Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ea3e246f5b | ||
|
|
51f79d71ad | ||
|
|
d430a6ddec | ||
|
|
feb8788065 | ||
|
|
35095326cd | ||
|
|
c88d7a526e | ||
|
|
f6b64bc01c | ||
|
|
2bac87cc9f | ||
|
|
d34056eefb | ||
|
|
72e0b2e9e9 | ||
|
|
6d7e638613 | ||
|
|
cec2b5c490 | ||
|
|
4eaea80281 | ||
|
|
41a5a423b4 | ||
|
|
a721b3d6a8 | ||
|
|
dccdd2b095 | ||
|
|
cd393530cb | ||
|
|
7684dbeee7 | ||
|
|
e20100ff74 | ||
|
|
935ec55745 | ||
|
|
c88848d829 | ||
|
|
8df82dc573 | ||
|
|
688e1f0ed2 | ||
|
|
3a7bc14c01 | ||
|
|
d23623ac16 | ||
|
|
432ab6b045 | ||
|
|
c578cefeea | ||
|
|
ffdd42851c | ||
|
|
5c66172bb9 | ||
|
|
415a973a97 | ||
|
|
8149257c27 | ||
|
|
3bd56377c9 | ||
|
|
9d070fbdf9 | ||
|
|
52b62cefee | ||
|
|
61992ed2a2 | ||
|
|
71f1077241 | ||
|
|
ffe4eb0fa1 | ||
|
|
018b176541 | ||
|
|
c406f71578 | ||
|
|
133a6dc400 | ||
|
|
0d7e39168e | ||
|
|
f82cfb0540 | ||
|
|
4b4aaa982f | ||
|
|
ba21d1dc7c | ||
|
|
b405c92a6f | ||
|
|
1760d16c43 | ||
|
|
329246e155 | ||
|
|
d54ffee6d2 | ||
|
|
4ca72e498b | ||
|
|
0564b5c657 | ||
|
|
b33817bcc9 | ||
|
|
4998dd2e86 | ||
|
|
2f30c23e30 | ||
|
|
42ae15e3f7 | ||
|
|
aa04c8cfe7 | ||
|
|
16c847b669 | ||
|
|
a75bb29315 | ||
|
|
788631b6ee |
No files matched your search
@@ -1,58 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="com.android.toolchain.gcc.1322280913">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.android.toolchain.gcc.1322280913" moduleId="org.eclipse.cdt.core.settings" name="Default">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.android.toolchain.gcc.1322280913" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
|
||||
<folderInfo id="com.android.toolchain.gcc.1322280913.1369823253" name="/" resourcePath="">
|
||||
<toolChain id="com.android.toolchain.gcc.803500692" name="Android GCC" superClass="com.android.toolchain.gcc">
|
||||
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.android.targetPlatform.1260474165" isAbstract="false" superClass="com.android.targetPlatform"/>
|
||||
<builder arguments="NDK_DEBUG=0" command="ndk-build" enableCleanBuild="false" id="com.android.builder.2127875218" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Android Builder" superClass="com.android.builder">
|
||||
<outputEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="obj"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="libs"/>
|
||||
</outputEntries>
|
||||
</builder>
|
||||
<tool id="com.android.gcc.compiler.877935514" name="Android GCC Compiler" superClass="com.android.gcc.compiler">
|
||||
<inputType id="com.android.gcc.inputType.68370901" superClass="com.android.gcc.inputType"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="jni"/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="EhViewer.null.1834465747" name="EhViewer"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="scannerConfiguration">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
<scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.1322280913;com.android.toolchain.gcc.1322280913.1369823253;com.android.gcc.compiler.877935514;com.android.gcc.inputType.68370901">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.android.AndroidPerProjectProfile"/>
|
||||
</scannerConfigBuildInfo>
|
||||
</storageModule>
|
||||
<storageModule moduleId="refreshScope" versionNumber="2">
|
||||
<configuration configurationName="Default">
|
||||
<resource resourceType="PROJECT" workspacePath="/EhViewer"/>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
|
||||
</cproject>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||
<cconfiguration id="com.android.toolchain.gcc.1322280913">
|
||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.android.toolchain.gcc.1322280913" moduleId="org.eclipse.cdt.core.settings" name="Default">
|
||||
<externalSettings/>
|
||||
<extensions>
|
||||
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||
<extension id="org.eclipse.cdt.core.VCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||
</extensions>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<configuration artifactName="${ProjName}" buildProperties="" description="" id="com.android.toolchain.gcc.1322280913" name="Default" parent="org.eclipse.cdt.build.core.emptycfg">
|
||||
<folderInfo id="com.android.toolchain.gcc.1322280913.1369823253" name="/" resourcePath="">
|
||||
<toolChain id="com.android.toolchain.gcc.803500692" name="Android GCC" superClass="com.android.toolchain.gcc">
|
||||
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="com.android.targetPlatform.1260474165" isAbstract="false" superClass="com.android.targetPlatform"/>
|
||||
<builder arguments="NDK_DEBUG=0" autoBuildTarget="" cleanBuildTarget="clean" command="ndk-build" enableAutoBuild="false" enableCleanBuild="false" enabledIncrementalBuild="true" id="com.android.builder.2127875218" incrementalBuildTarget="" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Android Builder" superClass="com.android.builder">
|
||||
<outputEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="obj"/>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="outputPath" name="libs"/>
|
||||
</outputEntries>
|
||||
</builder>
|
||||
<tool id="com.android.gcc.compiler.877935514" name="Android GCC Compiler" superClass="com.android.gcc.compiler">
|
||||
<inputType id="com.android.gcc.inputType.68370901" superClass="com.android.gcc.inputType"/>
|
||||
</tool>
|
||||
</toolChain>
|
||||
</folderInfo>
|
||||
<sourceEntries>
|
||||
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="jni"/>
|
||||
</sourceEntries>
|
||||
</configuration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
|
||||
</cconfiguration>
|
||||
</storageModule>
|
||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||
<project id="EhViewer.null.1834465747" name="EhViewer"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||
<storageModule moduleId="scannerConfiguration">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
|
||||
<scannerConfigBuildInfo instanceId="com.android.toolchain.gcc.1322280913;com.android.toolchain.gcc.1322280913.1369823253;com.android.gcc.compiler.877935514;com.android.gcc.inputType.68370901">
|
||||
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.android.AndroidPerProjectProfile"/>
|
||||
</scannerConfigBuildInfo>
|
||||
</storageModule>
|
||||
<storageModule moduleId="refreshScope" versionNumber="1">
|
||||
<resource resourceType="PROJECT" workspacePath="/EhViewer"/>
|
||||
</storageModule>
|
||||
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
|
||||
</cproject>
|
||||
@@ -0,0 +1,12 @@
|
||||
.settings
|
||||
bin
|
||||
gen
|
||||
obj
|
||||
doc
|
||||
proguard
|
||||
lint.xml
|
||||
libs/armeabi
|
||||
libs/armeabi-v7a
|
||||
libs/arm64-v8a
|
||||
libs/mips
|
||||
libs/x86
|
||||
@@ -21,6 +21,10 @@
|
||||
<key>org.eclipse.cdt.make.core.append_environment</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.autoBuildTarget</key>
|
||||
<value></value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.buildArguments</key>
|
||||
<value>NDK_DEBUG=0</value>
|
||||
@@ -49,6 +53,10 @@
|
||||
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
|
||||
<value>true</value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.fullBuildTarget</key>
|
||||
<value></value>
|
||||
</dictionary>
|
||||
<dictionary>
|
||||
<key>org.eclipse.cdt.make.core.stopOnError</key>
|
||||
<value>true</value>
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.hippo.ehviewer"
|
||||
android:versionCode="28"
|
||||
android:versionName="0.6.7" >
|
||||
android:versionCode="29"
|
||||
android:versionName="0.6.8" >
|
||||
|
||||
<uses-sdk
|
||||
android:minSdkVersion="14"
|
||||
android:targetSdkVersion="19" />
|
||||
android:targetSdkVersion="21" />
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
@@ -84,7 +84,7 @@
|
||||
android:name=".ui.GalleryActivity"
|
||||
android:configChanges="orientation|screenSize|uiMode"
|
||||
android:screenOrientation="behind"
|
||||
android:theme="@style/AppTheme.NoActionBar" >
|
||||
android:theme="@style/AppTheme.Gallery" >
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
@@ -104,6 +104,15 @@
|
||||
android:theme="@style/AppTheme.ListActivity" >
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".ui.HistoryActivity"
|
||||
android:configChanges="orientation|screenSize|uiMode"
|
||||
android:icon="@drawable/ic_action_history"
|
||||
android:label="@string/history"
|
||||
android:screenOrientation="behind"
|
||||
android:theme="@style/AppTheme.ListActivity" >
|
||||
</activity>
|
||||
|
||||
<activity
|
||||
android:name=".ui.DownloadActivity"
|
||||
android:configChanges="orientation|screenSize|uiMode"
|
||||
|
||||
@@ -44,61 +44,66 @@ libjpeg-turbo/jquant2.c \
|
||||
libjpeg-turbo/jutils.c \
|
||||
libjpeg-turbo/transupp.c \
|
||||
libjpeg-turbo/turbojpeg.c
|
||||
LOCAL_CFLAGS := -O3
|
||||
LOCAL_CFLAGS := -O3 -DANDROID
|
||||
|
||||
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
|
||||
ifeq ($(TARGET_ARCH_ABI),$(filter $(TARGET_ARCH_ABI), armeabi armeabi-v7a))
|
||||
# Don't add -mfpu=neon
|
||||
# Some arm v7 cpu do not support neon,
|
||||
# libjpeg-turbo can check neon in init_simd()
|
||||
# through parse_proc_cpuinfo()
|
||||
#LOCAL_CFLAGS += -mfpu=neon
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ARCH),arm)
|
||||
LOCAL_SRC_FILES += \
|
||||
libjpeg-turbo/simd/jsimd_arm.c \
|
||||
libjpeg-turbo/simd/jsimd_arm_neon.S
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ARCH),x86)
|
||||
ifeq ($(TARGET_ARCH_ABI),arm64-v8a)
|
||||
LOCAL_SRC_FILES += \
|
||||
libjpeg-turbo/simd/jsimd_i386.c \
|
||||
libjpeg-turbo/simd/jccolor-mmx.asm \
|
||||
libjpeg-turbo/simd/jccolor-sse2.asm \
|
||||
libjpeg-turbo/simd/jcgray-mmx.asm \
|
||||
libjpeg-turbo/simd/jcgray-sse2.asm \
|
||||
libjpeg-turbo/simd/jcsample-mmx.asm \
|
||||
libjpeg-turbo/simd/jcsample-sse2.asm \
|
||||
libjpeg-turbo/simd/jdcolor-mmx.asm \
|
||||
libjpeg-turbo/simd/jdcolor-sse2.asm \
|
||||
libjpeg-turbo/simd/jdmerge-mmx.asm \
|
||||
libjpeg-turbo/simd/jdmerge-sse2.asm \
|
||||
libjpeg-turbo/simd/jdsample-mmx.asm \
|
||||
libjpeg-turbo/simd/jdsample-sse2.asm \
|
||||
libjpeg-turbo/simd/jfdctflt-3dn.asm \
|
||||
libjpeg-turbo/simd/jfdctflt-sse.asm \
|
||||
libjpeg-turbo/simd/jfdctfst-mmx.asm \
|
||||
libjpeg-turbo/simd/jfdctfst-sse2.asm \
|
||||
libjpeg-turbo/simd/jfdctint-mmx.asm \
|
||||
libjpeg-turbo/simd/jfdctint-sse2.asm \
|
||||
libjpeg-turbo/simd/jidctflt-3dn.asm \
|
||||
libjpeg-turbo/simd/jidctflt-sse.asm \
|
||||
libjpeg-turbo/simd/jidctflt-sse2.asm \
|
||||
libjpeg-turbo/simd/jidctfst-mmx.asm \
|
||||
libjpeg-turbo/simd/jidctfst-sse2.asm \
|
||||
libjpeg-turbo/simd/jidctint-mmx.asm \
|
||||
libjpeg-turbo/simd/jidctint-sse2.asm \
|
||||
libjpeg-turbo/simd/jidctred-mmx.asm \
|
||||
libjpeg-turbo/simd/jidctred-sse2.asm \
|
||||
libjpeg-turbo/simd/jquant-3dn.asm \
|
||||
libjpeg-turbo/simd/jquantf-sse2.asm \
|
||||
libjpeg-turbo/simd/jquanti-sse2.asm \
|
||||
libjpeg-turbo/simd/jquant-mmx.asm \
|
||||
libjpeg-turbo/simd/jquant-sse.asm \
|
||||
libjpeg-turbo/simd/jsimdcpu.asm
|
||||
libjpeg-turbo/simd/jsimd_arm64.c \
|
||||
libjpeg-turbo/simd/jsimd_arm64_neon.S
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ARCH),mips)
|
||||
ifeq ($(TARGET_ARCH_ABI),x86)
|
||||
LOCAL_SRC_FILES += \
|
||||
libjpeg-turbo/simd/jsimd_i386.c \
|
||||
libjpeg-turbo/simd/jsimdcpu.asm \
|
||||
libjpeg-turbo/simd/jfdctflt-3dn.asm \
|
||||
libjpeg-turbo/simd/jidctflt-3dn.asm \
|
||||
libjpeg-turbo/simd/jquant-3dn.asm \
|
||||
libjpeg-turbo/simd/jccolor-mmx.asm \
|
||||
libjpeg-turbo/simd/jcgray-mmx.asm \
|
||||
libjpeg-turbo/simd/jcsample-mmx.asm \
|
||||
libjpeg-turbo/simd/jdcolor-mmx.asm \
|
||||
libjpeg-turbo/simd/jdmerge-mmx.asm \
|
||||
libjpeg-turbo/simd/jdsample-mmx.asm \
|
||||
libjpeg-turbo/simd/jfdctfst-mmx.asm \
|
||||
libjpeg-turbo/simd/jfdctint-mmx.asm \
|
||||
libjpeg-turbo/simd/jidctfst-mmx.asm \
|
||||
libjpeg-turbo/simd/jidctint-mmx.asm \
|
||||
libjpeg-turbo/simd/jidctred-mmx.asm \
|
||||
libjpeg-turbo/simd/jquant-mmx.asm \
|
||||
libjpeg-turbo/simd/jfdctflt-sse.asm \
|
||||
libjpeg-turbo/simd/jidctflt-sse.asm \
|
||||
libjpeg-turbo/simd/jquant-sse.asm \
|
||||
libjpeg-turbo/simd/jccolor-sse2.asm \
|
||||
libjpeg-turbo/simd/jcgray-sse2.asm \
|
||||
libjpeg-turbo/simd/jcsample-sse2.asm \
|
||||
libjpeg-turbo/simd/jdcolor-sse2.asm \
|
||||
libjpeg-turbo/simd/jdmerge-sse2.asm \
|
||||
libjpeg-turbo/simd/jdsample-sse2.asm \
|
||||
libjpeg-turbo/simd/jfdctfst-sse2.asm \
|
||||
libjpeg-turbo/simd/jfdctint-sse2.asm \
|
||||
libjpeg-turbo/simd/jidctflt-sse2.asm \
|
||||
libjpeg-turbo/simd/jidctfst-sse2.asm \
|
||||
libjpeg-turbo/simd/jidctint-sse2.asm \
|
||||
libjpeg-turbo/simd/jidctred-sse2.asm \
|
||||
libjpeg-turbo/simd/jquantf-sse2.asm \
|
||||
libjpeg-turbo/simd/jquanti-sse2.asm
|
||||
|
||||
LOCAL_ASMFLAGS:= -Plibjpeg-turbo/simd/jsimdcfg.inc
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ARCH_ABI),mips)
|
||||
LOCAL_SRC_FILES += \
|
||||
libjpeg-turbo/simd/jsimd_mips.c \
|
||||
libjpeg-turbo/simd/jsimd_mips_dspr2.S
|
||||
@@ -121,7 +126,7 @@ zlib/inflate.c \
|
||||
zlib/inftrees.c \
|
||||
zlib/trees.c \
|
||||
zlib/zutil.c
|
||||
LOCAL_CFLAGS := -O3
|
||||
LOCAL_CFLAGS := -O3 -DANDROID
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
@@ -144,12 +149,15 @@ libpng/pngrtran.c \
|
||||
libpng/pngrutil.c \
|
||||
libpng/pngset.c \
|
||||
libpng/pngtrans.c
|
||||
LOCAL_CFLAGS := -O3
|
||||
LOCAL_CFLAGS := -O3 -DANDROID
|
||||
|
||||
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
|
||||
# Add -mfpu=neon
|
||||
# libpng only check neon when add -mfpu=neon
|
||||
LOCAL_CFLAGS += -mfpu=neon
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET_ARCH_ABI),$(filter $(TARGET_ARCH_ABI), armeabi armeabi-v7a arm64-v8a))
|
||||
LOCAL_SRC_FILES += \
|
||||
libpng/arm/arm_init.c \
|
||||
libpng/arm/filter_neon_intrinsics.c \
|
||||
@@ -171,7 +179,7 @@ LOCAL_SRC_FILES := \
|
||||
giflib/dgif_lib.c \
|
||||
giflib/gif_hash.c \
|
||||
giflib/gifalloc.c
|
||||
LOCAL_CFLAGS := -O3
|
||||
LOCAL_CFLAGS := -O3 -DANDROID
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
||||
@@ -190,7 +198,7 @@ jpeg.c \
|
||||
png.c \
|
||||
gif.c \
|
||||
utils.c
|
||||
LOCAL_CFLAGS := -O3
|
||||
LOCAL_CFLAGS := -O3 -DANDROID
|
||||
LOCAL_STATIC_LIBRARIES := libjpeg-turbo libpng libgif
|
||||
LOCAL_LDLIBS := -lGLESv2
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# x86 libjpeg-turbo 汇编链接会出错
|
||||
APP_ABI := armeabi armeabi-v7a# mips# x86
|
||||
APP_ABI := armeabi armeabi-v7a# arm64-v8a# mips# x86
|
||||
APP_PLATFORM := android-14
|
||||
APP_OPTIM := release
|
||||
@@ -491,12 +491,12 @@ jobject getObjFromGifFileType(JNIEnv* env, GifFileType* gifFile, int format) {
|
||||
gifClazz = (*env)->FindClass(env,
|
||||
"com/hippo/ehviewer/gallery/image/GifImage");
|
||||
constructor = (*env)->GetMethodID(env, gifClazz, "<init>",
|
||||
"(IIIIII[I)V");
|
||||
"(JIIIII[I)V");
|
||||
if (constructor == 0) {
|
||||
GIF_Free((JNIEnv*)NULL, (int)gif);
|
||||
GIF_Free((JNIEnv*)NULL, gif);
|
||||
return NULL;
|
||||
} else {
|
||||
return (*env)->NewObject(env, gifClazz, constructor, (jint) gif,
|
||||
return (*env)->NewObject(env, gifClazz, constructor, (jlong) (intptr_t) gif,
|
||||
FILE_FORMAT_GIF, realWidth, gifFile->SHeight, format,
|
||||
DEFAULT_TYPE, delayArray);
|
||||
}
|
||||
@@ -511,7 +511,7 @@ jobject GIF_DecodeStream(JNIEnv* env, jobject is, jint format) {
|
||||
if (format == FORMAT_AUTO)
|
||||
format = FORMAT_RGB;
|
||||
|
||||
sc = (StreamContainer*)getStreamContainer(env, is);
|
||||
sc = getStreamContainer(env, is);
|
||||
if (sc == NULL)
|
||||
return NULL;
|
||||
|
||||
@@ -554,18 +554,16 @@ jobject GIF_DecodeFileHandler(JNIEnv* env, FILE* fp, jint format) {
|
||||
return gifImage;
|
||||
}
|
||||
|
||||
void GIF_Render(JNIEnv* env, int nativeImage, int format, int index) {
|
||||
void GIF_Render(JNIEnv* env, GIF* gif, int format, int index) {
|
||||
|
||||
GIF* gif = (GIF*) nativeImage;
|
||||
if (format != gif->format)
|
||||
return;
|
||||
|
||||
render(gif, index);
|
||||
}
|
||||
|
||||
void GIF_Free(JNIEnv* env, int nativeImage) {
|
||||
void GIF_Free(JNIEnv* env, GIF* gif) {
|
||||
|
||||
GIF* gif = (GIF*) nativeImage;
|
||||
DGifCloseFile(gif->gifFile, &errorCode);
|
||||
free(gif->trans);
|
||||
free(gif->disposals);
|
||||
|
||||
@@ -21,7 +21,7 @@ typedef struct {
|
||||
|
||||
jobject GIF_DecodeStream(JNIEnv* env, jobject is, jint format);
|
||||
jobject GIF_DecodeFileHandler(JNIEnv* env, FILE* fp, jint format);
|
||||
void GIF_Render(JNIEnv* env, int nativeImage, int format, int index);
|
||||
void GIF_Free(JNIEnv* env, int nativeImage);
|
||||
void GIF_Render(JNIEnv* env, GIF* gif, int format, int index);
|
||||
void GIF_Free(JNIEnv* env, GIF* gif);
|
||||
|
||||
#endif /* GIF_H_ */
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "image.h"
|
||||
#include "jpeg.h"
|
||||
#include "gif.h"
|
||||
#include "png.h"
|
||||
#include "giflib/gif_lib.h"
|
||||
@@ -119,33 +120,33 @@ Java_com_hippo_ehviewer_gallery_image_Image_nativeDecodeFile(JNIEnv* env,
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_hippo_ehviewer_gallery_image_Image_nativeFree(JNIEnv* env,
|
||||
jclass clazz, jint nativeImage, jint fileFormat) {
|
||||
jclass clazz, jlong nativeImage, jint fileFormat) {
|
||||
|
||||
switch (fileFormat) {
|
||||
case FILE_FORMAT_JPEG:
|
||||
JPEG_Free(env, nativeImage);
|
||||
JPEG_Free(env, (JPEG*) (intptr_t) nativeImage);
|
||||
break;
|
||||
case FILE_FORMAT_PNG:
|
||||
PNG_Free(env, nativeImage);
|
||||
PNG_Free(env, (PNG*) (intptr_t) nativeImage);
|
||||
break;
|
||||
case FILE_FORMAT_BMP:
|
||||
break;
|
||||
case FILE_FORMAT_GIF:
|
||||
GIF_Free(env, nativeImage);
|
||||
GIF_Free(env, (GIF*) (intptr_t) nativeImage);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_hippo_ehviewer_gallery_image_Image_nativeRender(JNIEnv* env,
|
||||
jclass clazz, jint format, jint type, jint nativeImage, jint fileFormat) {
|
||||
jclass clazz, jint format, jint type, jlong nativeImage, jint fileFormat) {
|
||||
|
||||
switch (fileFormat) {
|
||||
case FILE_FORMAT_JPEG:
|
||||
JPEG_Render(env, nativeImage, format);
|
||||
JPEG_Render(env, (JPEG*) (intptr_t) nativeImage, format);
|
||||
break;
|
||||
case FILE_FORMAT_PNG:
|
||||
PNG_Render(env, nativeImage, format);
|
||||
PNG_Render(env, (PNG*) (intptr_t) nativeImage, format);
|
||||
break;
|
||||
case FILE_FORMAT_BMP:
|
||||
break;
|
||||
@@ -154,13 +155,13 @@ Java_com_hippo_ehviewer_gallery_image_Image_nativeRender(JNIEnv* env,
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_hippo_ehviewer_gallery_image_GifImage_nativeRender(JNIEnv* env,
|
||||
jclass clazz, jint format, jint type, jint nativeImage, jint fileFormat,
|
||||
jclass clazz, jint format, jint type, jlong nativeImage, jint fileFormat,
|
||||
jint index) {
|
||||
|
||||
if (type != DEFAULT_TYPE || fileFormat != FILE_FORMAT_GIF)
|
||||
return;
|
||||
|
||||
GIF_Render(env, nativeImage, format, index);
|
||||
GIF_Render(env, (GIF*) (intptr_t) nativeImage, format, index);
|
||||
}
|
||||
|
||||
jint JNI_OnLoad(JavaVM *vm, void *reserved) {
|
||||
|
||||
@@ -121,19 +121,18 @@ jobject JPEG_DecodeFileHandler(JNIEnv* env, FILE* fp, jint format) {
|
||||
imageClazz = (*env)->FindClass(env,
|
||||
"com/hippo/ehviewer/gallery/image/Image");
|
||||
constructor = (*env)->GetMethodID(env, imageClazz, "<init>",
|
||||
"(IIIIII)V");
|
||||
"(JIIIII)V");
|
||||
if (constructor == 0) {
|
||||
JPEG_Free((JNIEnv*)NULL, (int) jpeg);
|
||||
JPEG_Free((JNIEnv*)NULL, jpeg);
|
||||
return NULL;
|
||||
} else {
|
||||
return (*env)->NewObject(env, imageClazz, constructor, (jint) jpeg,
|
||||
return (*env)->NewObject(env, imageClazz, constructor, (jlong) (intptr_t) jpeg,
|
||||
FILE_FORMAT_JPEG, cinfo.output_width, cinfo.output_height, format,
|
||||
DEFAULT_TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
void JPEG_Render(JNIEnv* env, int nativeImage, int format) {
|
||||
JPEG* jpeg = (JPEG*) nativeImage;
|
||||
void JPEG_Render(JNIEnv* env, JPEG* jpeg, int format) {
|
||||
if (format != jpeg->format)
|
||||
return;
|
||||
|
||||
@@ -141,9 +140,8 @@ void JPEG_Render(JNIEnv* env, int nativeImage, int format) {
|
||||
jpeg->height, format, DEFAULT_TYPE, jpeg->data);
|
||||
}
|
||||
|
||||
void JPEG_Free(JNIEnv* env, int nativeImage) {
|
||||
void JPEG_Free(JNIEnv* env, JPEG* jpeg) {
|
||||
|
||||
JPEG* jpeg = (JPEG*) nativeImage;
|
||||
free(jpeg->data);
|
||||
free(jpeg);
|
||||
}
|
||||
@@ -14,7 +14,7 @@ typedef struct {
|
||||
|
||||
jobject JPEG_DecodeStream(JNIEnv* env, jobject is, jint format);
|
||||
jobject JPEG_DecodeFileHandler(JNIEnv* env, FILE* fp, jint format);
|
||||
void JPEG_Render(JNIEnv* env, int nativeImage, int format);
|
||||
void JPEG_Free(JNIEnv* env, int nativeImage);
|
||||
void JPEG_Render(JNIEnv* env, JPEG* jpeg, int format);
|
||||
void JPEG_Free(JNIEnv* env, JPEG* jpeg);
|
||||
|
||||
#endif /* JPEG_H_ */
|
||||
@@ -5,6 +5,7 @@
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* Modifications:
|
||||
* Copyright (C) 2013, Linaro Limited.
|
||||
* Copyright (C) 2014, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file contains output colorspace conversion routines.
|
||||
@@ -13,42 +14,11 @@
|
||||
/* This file is included by jdcolor.c */
|
||||
|
||||
|
||||
#define PACK_SHORT_565(r, g, b) ((((r) << 8) & 0xf800) | \
|
||||
(((g) << 3) & 0x7E0) | ((b) >> 3))
|
||||
#define PACK_TWO_PIXELS(l, r) ((r << 16) | l)
|
||||
#define PACK_NEED_ALIGNMENT(ptr) (((size_t)(ptr)) & 3)
|
||||
|
||||
#define WRITE_TWO_PIXELS(addr, pixels) { \
|
||||
((INT16*)(addr))[0] = (pixels); \
|
||||
((INT16*)(addr))[1] = (pixels) >> 16; \
|
||||
}
|
||||
#define WRITE_TWO_ALIGNED_PIXELS(addr, pixels) ((*(INT32 *)(addr)) = pixels)
|
||||
|
||||
#define DITHER_565_R(r, dither) ((r) + ((dither) & 0xFF))
|
||||
#define DITHER_565_G(g, dither) ((g) + (((dither) & 0xFF) >> 1))
|
||||
#define DITHER_565_B(b, dither) ((b) + ((dither) & 0xFF))
|
||||
|
||||
|
||||
/* Declarations for ordered dithering
|
||||
*
|
||||
* We use a 4x4 ordered dither array packed into 32 bits. This array is
|
||||
* sufficent for dithering RGB888 to RGB565.
|
||||
*/
|
||||
|
||||
#define DITHER_MASK 0x3
|
||||
#define DITHER_ROTATE(x) (((x) << 24) | (((x) >> 8) & 0x00FFFFFF))
|
||||
static const INT32 dither_matrix[4] = {
|
||||
0x0008020A,
|
||||
0x0C040E06,
|
||||
0x030B0109,
|
||||
0x0F070D05
|
||||
};
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
ycc_rgb565_convert (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
ycc_rgb565_convert_internal (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
|
||||
register int y, cb, cr;
|
||||
@@ -123,10 +93,11 @@ ycc_rgb565_convert (j_decompress_ptr cinfo,
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
ycc_rgb565D_convert (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
ycc_rgb565D_convert_internal (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert;
|
||||
register int y, cb, cr;
|
||||
@@ -208,10 +179,11 @@ ycc_rgb565D_convert (j_decompress_ptr cinfo,
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
rgb_rgb565_convert (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
rgb_rgb565_convert_internal (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
register JSAMPROW outptr;
|
||||
register JSAMPROW inptr0, inptr1, inptr2;
|
||||
@@ -262,10 +234,11 @@ rgb_rgb565_convert (j_decompress_ptr cinfo,
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
rgb_rgb565D_convert (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
rgb_rgb565D_convert_internal (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
register JSAMPROW outptr;
|
||||
register JSAMPROW inptr0, inptr1, inptr2;
|
||||
@@ -320,10 +293,11 @@ rgb_rgb565D_convert (j_decompress_ptr cinfo,
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
gray_rgb565_convert (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
gray_rgb565_convert_internal (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
register JSAMPROW inptr, outptr;
|
||||
register JDIMENSION col;
|
||||
@@ -359,10 +333,11 @@ gray_rgb565_convert (j_decompress_ptr cinfo,
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
gray_rgb565D_convert (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
gray_rgb565D_convert_internal (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
register JSAMPROW inptr, outptr;
|
||||
register JDIMENSION col;
|
||||
|
||||
@@ -141,8 +141,9 @@ rgb_rgb_convert_internal (j_decompress_ptr cinfo,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Convert RGB to extended RGB: just swap the order of source pixels
|
||||
* Convert cmyk to extended RGB
|
||||
*/
|
||||
|
||||
INLINE
|
||||
|
||||
@@ -213,6 +213,7 @@ typedef my_color_deconverter * my_cconvert_ptr;
|
||||
#undef rgb_rgb_convert_internal
|
||||
#undef cmyk_rgb_convert_internal
|
||||
|
||||
|
||||
/*
|
||||
* Initialize tables for YCC->RGB colorspace conversion.
|
||||
*/
|
||||
@@ -638,7 +639,162 @@ ycck_cmyk_convert (j_decompress_ptr cinfo,
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* RGB565 conversion
|
||||
*/
|
||||
|
||||
#define PACK_SHORT_565_LE(r, g, b) ((((r) << 8) & 0xF800) | \
|
||||
(((g) << 3) & 0x7E0) | ((b) >> 3))
|
||||
#define PACK_SHORT_565_BE(r, g, b) (((r) & 0xF8) | ((g) >> 5) | \
|
||||
(((g) << 11) & 0xE000) | \
|
||||
(((b) << 5) & 0x1F00))
|
||||
|
||||
#define PACK_TWO_PIXELS_LE(l, r) ((r << 16) | l)
|
||||
#define PACK_TWO_PIXELS_BE(l, r) ((l << 16) | r)
|
||||
|
||||
#define PACK_NEED_ALIGNMENT(ptr) (((size_t)(ptr)) & 3)
|
||||
|
||||
#define WRITE_TWO_ALIGNED_PIXELS(addr, pixels) ((*(int *)(addr)) = pixels)
|
||||
|
||||
#define DITHER_565_R(r, dither) ((r) + ((dither) & 0xFF))
|
||||
#define DITHER_565_G(g, dither) ((g) + (((dither) & 0xFF) >> 1))
|
||||
#define DITHER_565_B(b, dither) ((b) + ((dither) & 0xFF))
|
||||
|
||||
|
||||
/* Declarations for ordered dithering
|
||||
*
|
||||
* We use a 4x4 ordered dither array packed into 32 bits. This array is
|
||||
* sufficent for dithering RGB888 to RGB565.
|
||||
*/
|
||||
|
||||
#define DITHER_MASK 0x3
|
||||
#define DITHER_ROTATE(x) (((x) << 24) | (((x) >> 8) & 0x00FFFFFF))
|
||||
static const INT32 dither_matrix[4] = {
|
||||
0x0008020A,
|
||||
0x0C040E06,
|
||||
0x030B0109,
|
||||
0x0F070D05
|
||||
};
|
||||
|
||||
|
||||
static INLINE boolean is_big_endian(void)
|
||||
{
|
||||
int test_value = 1;
|
||||
if(*(char *)&test_value != 1)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
/* Include inline routines for RGB565 conversion */
|
||||
|
||||
#define PACK_SHORT_565 PACK_SHORT_565_LE
|
||||
#define PACK_TWO_PIXELS PACK_TWO_PIXELS_LE
|
||||
#define ycc_rgb565_convert_internal ycc_rgb565_convert_le
|
||||
#define ycc_rgb565D_convert_internal ycc_rgb565D_convert_le
|
||||
#define rgb_rgb565_convert_internal rgb_rgb565_convert_le
|
||||
#define rgb_rgb565D_convert_internal rgb_rgb565D_convert_le
|
||||
#define gray_rgb565_convert_internal gray_rgb565_convert_le
|
||||
#define gray_rgb565D_convert_internal gray_rgb565D_convert_le
|
||||
#include "jdcol565.c"
|
||||
#undef PACK_SHORT_565
|
||||
#undef PACK_TWO_PIXELS
|
||||
#undef ycc_rgb565_convert_internal
|
||||
#undef ycc_rgb565D_convert_internal
|
||||
#undef rgb_rgb565_convert_internal
|
||||
#undef rgb_rgb565D_convert_internal
|
||||
#undef gray_rgb565_convert_internal
|
||||
#undef gray_rgb565D_convert_internal
|
||||
|
||||
#define PACK_SHORT_565 PACK_SHORT_565_BE
|
||||
#define PACK_TWO_PIXELS PACK_TWO_PIXELS_BE
|
||||
#define ycc_rgb565_convert_internal ycc_rgb565_convert_be
|
||||
#define ycc_rgb565D_convert_internal ycc_rgb565D_convert_be
|
||||
#define rgb_rgb565_convert_internal rgb_rgb565_convert_be
|
||||
#define rgb_rgb565D_convert_internal rgb_rgb565D_convert_be
|
||||
#define gray_rgb565_convert_internal gray_rgb565_convert_be
|
||||
#define gray_rgb565D_convert_internal gray_rgb565D_convert_be
|
||||
#include "jdcol565.c"
|
||||
#undef PACK_SHORT_565
|
||||
#undef PACK_TWO_PIXELS
|
||||
#undef ycc_rgb565_convert_internal
|
||||
#undef ycc_rgb565D_convert_internal
|
||||
#undef rgb_rgb565_convert_internal
|
||||
#undef rgb_rgb565D_convert_internal
|
||||
#undef gray_rgb565_convert_internal
|
||||
#undef gray_rgb565D_convert_internal
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
ycc_rgb565_convert (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
if (is_big_endian())
|
||||
ycc_rgb565_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
else
|
||||
ycc_rgb565_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
ycc_rgb565D_convert (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
if (is_big_endian())
|
||||
ycc_rgb565D_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
else
|
||||
ycc_rgb565D_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
rgb_rgb565_convert (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
if (is_big_endian())
|
||||
rgb_rgb565_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
else
|
||||
rgb_rgb565_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
rgb_rgb565D_convert (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
if (is_big_endian())
|
||||
rgb_rgb565D_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
else
|
||||
rgb_rgb565D_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
gray_rgb565_convert (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
if (is_big_endian())
|
||||
gray_rgb565_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
else
|
||||
gray_rgb565_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
gray_rgb565D_convert (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
if (is_big_endian())
|
||||
gray_rgb565D_convert_be(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
else
|
||||
gray_rgb565D_convert_le(cinfo, input_buf, input_row, output_buf, num_rows);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009, 2011, D. R. Commander.
|
||||
* Copyright (C) 2009, 2011, 2014 D. R. Commander.
|
||||
* Copyright (C) 2013, Linaro Limited.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -45,38 +45,6 @@
|
||||
#ifdef UPSAMPLE_MERGING_SUPPORTED
|
||||
|
||||
|
||||
#define PACK_SHORT_565(r, g, b) ((((r) << 8) & 0xf800) | \
|
||||
(((g) << 3) & 0x7E0) | ((b) >> 3))
|
||||
#define PACK_TWO_PIXELS(l, r) ((r << 16) | l)
|
||||
#define PACK_NEED_ALIGNMENT(ptr) (((size_t)(ptr)) & 3)
|
||||
|
||||
#define WRITE_TWO_PIXELS(addr, pixels) { \
|
||||
((INT16*)(addr))[0] = (pixels); \
|
||||
((INT16*)(addr))[1] = (pixels) >> 16; \
|
||||
}
|
||||
#define WRITE_TWO_ALIGNED_PIXELS(addr, pixels) ((*(INT32 *)(addr)) = pixels)
|
||||
|
||||
#define DITHER_565_R(r, dither) ((r) + ((dither) & 0xFF))
|
||||
#define DITHER_565_G(g, dither) ((g) + (((dither) & 0xFF) >> 1))
|
||||
#define DITHER_565_B(b, dither) ((b) + ((dither) & 0xFF))
|
||||
|
||||
|
||||
/* Declarations for ordered dithering
|
||||
*
|
||||
* We use a 4x4 ordered dither array packed into 32 bits. This array is
|
||||
* sufficent for dithering RGB888 to RGB565.
|
||||
*/
|
||||
|
||||
#define DITHER_MASK 0x3
|
||||
#define DITHER_ROTATE(x) (((x) << 24) | (((x) >> 8) & 0x00FFFFFF))
|
||||
static const INT32 dither_matrix[4] = {
|
||||
0x0008020A,
|
||||
0x0C040E06,
|
||||
0x030B0109,
|
||||
0x0F070D05
|
||||
};
|
||||
|
||||
|
||||
/* Private subobject */
|
||||
|
||||
typedef struct {
|
||||
@@ -451,72 +419,106 @@ h2v2_merged_upsample (j_decompress_ptr cinfo,
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* RGB565 conversion
|
||||
*/
|
||||
|
||||
#define PACK_SHORT_565_LE(r, g, b) ((((r) << 8) & 0xF800) | \
|
||||
(((g) << 3) & 0x7E0) | ((b) >> 3))
|
||||
#define PACK_SHORT_565_BE(r, g, b) (((r) & 0xF8) | ((g) >> 5) | \
|
||||
(((g) << 11) & 0xE000) | \
|
||||
(((b) << 5) & 0x1F00))
|
||||
|
||||
#define PACK_TWO_PIXELS_LE(l, r) ((r << 16) | l)
|
||||
#define PACK_TWO_PIXELS_BE(l, r) ((l << 16) | r)
|
||||
|
||||
#define PACK_NEED_ALIGNMENT(ptr) (((size_t)(ptr)) & 3)
|
||||
|
||||
#define WRITE_TWO_PIXELS_LE(addr, pixels) { \
|
||||
((INT16*)(addr))[0] = (pixels); \
|
||||
((INT16*)(addr))[1] = (pixels) >> 16; \
|
||||
}
|
||||
#define WRITE_TWO_PIXELS_BE(addr, pixels) { \
|
||||
((INT16*)(addr))[1] = (pixels); \
|
||||
((INT16*)(addr))[0] = (pixels) >> 16; \
|
||||
}
|
||||
|
||||
#define DITHER_565_R(r, dither) ((r) + ((dither) & 0xFF))
|
||||
#define DITHER_565_G(g, dither) ((g) + (((dither) & 0xFF) >> 1))
|
||||
#define DITHER_565_B(b, dither) ((b) + ((dither) & 0xFF))
|
||||
|
||||
|
||||
/* Declarations for ordered dithering
|
||||
*
|
||||
* We use a 4x4 ordered dither array packed into 32 bits. This array is
|
||||
* sufficent for dithering RGB888 to RGB565.
|
||||
*/
|
||||
|
||||
#define DITHER_MASK 0x3
|
||||
#define DITHER_ROTATE(x) (((x) << 24) | (((x) >> 8) & 0x00FFFFFF))
|
||||
static const INT32 dither_matrix[4] = {
|
||||
0x0008020A,
|
||||
0x0C040E06,
|
||||
0x030B0109,
|
||||
0x0F070D05
|
||||
};
|
||||
|
||||
|
||||
/* Include inline routines for RGB565 conversion */
|
||||
|
||||
#define PACK_SHORT_565 PACK_SHORT_565_LE
|
||||
#define PACK_TWO_PIXELS PACK_TWO_PIXELS_LE
|
||||
#define WRITE_TWO_PIXELS WRITE_TWO_PIXELS_LE
|
||||
#define h2v1_merged_upsample_565_internal h2v1_merged_upsample_565_le
|
||||
#define h2v1_merged_upsample_565D_internal h2v1_merged_upsample_565D_le
|
||||
#define h2v2_merged_upsample_565_internal h2v2_merged_upsample_565_le
|
||||
#define h2v2_merged_upsample_565D_internal h2v2_merged_upsample_565D_le
|
||||
#include "jdmrg565.c"
|
||||
#undef PACK_SHORT_565
|
||||
#undef PACK_TWO_PIXELS
|
||||
#undef WRITE_TWO_PIXELS
|
||||
#undef h2v1_merged_upsample_565_internal
|
||||
#undef h2v1_merged_upsample_565D_internal
|
||||
#undef h2v2_merged_upsample_565_internal
|
||||
#undef h2v2_merged_upsample_565D_internal
|
||||
|
||||
#define PACK_SHORT_565 PACK_SHORT_565_BE
|
||||
#define PACK_TWO_PIXELS PACK_TWO_PIXELS_BE
|
||||
#define WRITE_TWO_PIXELS WRITE_TWO_PIXELS_BE
|
||||
#define h2v1_merged_upsample_565_internal h2v1_merged_upsample_565_be
|
||||
#define h2v1_merged_upsample_565D_internal h2v1_merged_upsample_565D_be
|
||||
#define h2v2_merged_upsample_565_internal h2v2_merged_upsample_565_be
|
||||
#define h2v2_merged_upsample_565D_internal h2v2_merged_upsample_565D_be
|
||||
#include "jdmrg565.c"
|
||||
#undef PACK_SHORT_565
|
||||
#undef PACK_TWO_PIXELS
|
||||
#undef WRITE_TWO_PIXELS
|
||||
#undef h2v1_merged_upsample_565_internal
|
||||
#undef h2v1_merged_upsample_565D_internal
|
||||
#undef h2v2_merged_upsample_565_internal
|
||||
#undef h2v2_merged_upsample_565D_internal
|
||||
|
||||
|
||||
static INLINE boolean is_big_endian(void)
|
||||
{
|
||||
int test_value = 1;
|
||||
if(*(char *)&test_value != 1)
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
h2v1_merged_upsample_565 (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr;
|
||||
JSAMPROW inptr0, inptr1, inptr2;
|
||||
JDIMENSION col;
|
||||
/* copy these pointers into registers if possible */
|
||||
register JSAMPLE * range_limit = cinfo->sample_range_limit;
|
||||
int * Crrtab = upsample->Cr_r_tab;
|
||||
int * Cbbtab = upsample->Cb_b_tab;
|
||||
INT32 * Crgtab = upsample->Cr_g_tab;
|
||||
INT32 * Cbgtab = upsample->Cb_g_tab;
|
||||
unsigned int r, g, b;
|
||||
INT32 rgb;
|
||||
SHIFT_TEMPS
|
||||
|
||||
inptr0 = input_buf[0][in_row_group_ctr];
|
||||
inptr1 = input_buf[1][in_row_group_ctr];
|
||||
inptr2 = input_buf[2][in_row_group_ctr];
|
||||
outptr = output_buf[0];
|
||||
|
||||
/* Loop for each pair of output pixels */
|
||||
for (col = cinfo->output_width >> 1; col > 0; col--) {
|
||||
/* Do the chroma part of the calculation */
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
|
||||
/* Fetch 2 Y values and emit 2 pixels */
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
|
||||
|
||||
WRITE_TWO_PIXELS(outptr, rgb);
|
||||
outptr += 4;
|
||||
}
|
||||
|
||||
/* If image width is odd, do the last output column separately */
|
||||
if (cinfo->output_width & 1) {
|
||||
cb = GETJSAMPLE(*inptr1);
|
||||
cr = GETJSAMPLE(*inptr2);
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
y = GETJSAMPLE(*inptr0);
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16*)outptr = rgb;
|
||||
}
|
||||
if (is_big_endian())
|
||||
h2v1_merged_upsample_565_be(cinfo, input_buf, in_row_group_ctr,
|
||||
output_buf);
|
||||
else
|
||||
h2v1_merged_upsample_565_le(cinfo, input_buf, in_row_group_ctr,
|
||||
output_buf);
|
||||
}
|
||||
|
||||
|
||||
@@ -525,70 +527,12 @@ h2v1_merged_upsample_565D (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr;
|
||||
JSAMPROW inptr0, inptr1, inptr2;
|
||||
JDIMENSION col;
|
||||
/* copy these pointers into registers if possible */
|
||||
register JSAMPLE * range_limit = cinfo->sample_range_limit;
|
||||
int * Crrtab = upsample->Cr_r_tab;
|
||||
int * Cbbtab = upsample->Cb_b_tab;
|
||||
INT32 * Crgtab = upsample->Cr_g_tab;
|
||||
INT32 * Cbgtab = upsample->Cb_g_tab;
|
||||
INT32 d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK];
|
||||
unsigned int r, g, b;
|
||||
INT32 rgb;
|
||||
SHIFT_TEMPS
|
||||
|
||||
inptr0 = input_buf[0][in_row_group_ctr];
|
||||
inptr1 = input_buf[1][in_row_group_ctr];
|
||||
inptr2 = input_buf[2][in_row_group_ctr];
|
||||
outptr = output_buf[0];
|
||||
|
||||
/* Loop for each pair of output pixels */
|
||||
for (col = cinfo->output_width >> 1; col > 0; col--) {
|
||||
/* Do the chroma part of the calculation */
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
|
||||
/* Fetch 2 Y values and emit 2 pixels */
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
r = range_limit[DITHER_565_R(y + cred, d0)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d0)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d0)];
|
||||
d0 = DITHER_ROTATE(d0);
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
r = range_limit[DITHER_565_R(y + cred, d0)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d0)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d0)];
|
||||
d0 = DITHER_ROTATE(d0);
|
||||
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
|
||||
|
||||
WRITE_TWO_PIXELS(outptr, rgb);
|
||||
outptr += 4;
|
||||
}
|
||||
|
||||
/* If image width is odd, do the last output column separately */
|
||||
if (cinfo->output_width & 1) {
|
||||
cb = GETJSAMPLE(*inptr1);
|
||||
cr = GETJSAMPLE(*inptr2);
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
y = GETJSAMPLE(*inptr0);
|
||||
r = range_limit[DITHER_565_R(y + cred, d0)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d0)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d0)];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16*)outptr = rgb;
|
||||
}
|
||||
if (is_big_endian())
|
||||
h2v1_merged_upsample_565D_be(cinfo, input_buf, in_row_group_ctr,
|
||||
output_buf);
|
||||
else
|
||||
h2v1_merged_upsample_565D_le(cinfo, input_buf, in_row_group_ctr,
|
||||
output_buf);
|
||||
}
|
||||
|
||||
|
||||
@@ -597,92 +541,12 @@ h2v2_merged_upsample_565 (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr0, outptr1;
|
||||
JSAMPROW inptr00, inptr01, inptr1, inptr2;
|
||||
JDIMENSION col;
|
||||
/* copy these pointers into registers if possible */
|
||||
register JSAMPLE * range_limit = cinfo->sample_range_limit;
|
||||
int * Crrtab = upsample->Cr_r_tab;
|
||||
int * Cbbtab = upsample->Cb_b_tab;
|
||||
INT32 * Crgtab = upsample->Cr_g_tab;
|
||||
INT32 * Cbgtab = upsample->Cb_g_tab;
|
||||
unsigned int r, g, b;
|
||||
INT32 rgb;
|
||||
SHIFT_TEMPS
|
||||
|
||||
inptr00 = input_buf[0][in_row_group_ctr * 2];
|
||||
inptr01 = input_buf[0][in_row_group_ctr * 2 + 1];
|
||||
inptr1 = input_buf[1][in_row_group_ctr];
|
||||
inptr2 = input_buf[2][in_row_group_ctr];
|
||||
outptr0 = output_buf[0];
|
||||
outptr1 = output_buf[1];
|
||||
|
||||
/* Loop for each group of output pixels */
|
||||
for (col = cinfo->output_width >> 1; col > 0; col--) {
|
||||
/* Do the chroma part of the calculation */
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
|
||||
/* Fetch 4 Y values and emit 4 pixels */
|
||||
y = GETJSAMPLE(*inptr00++);
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
y = GETJSAMPLE(*inptr00++);
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
|
||||
|
||||
WRITE_TWO_PIXELS(outptr0, rgb);
|
||||
outptr0 += 4;
|
||||
|
||||
y = GETJSAMPLE(*inptr01++);
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
y = GETJSAMPLE(*inptr01++);
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
|
||||
|
||||
WRITE_TWO_PIXELS(outptr1, rgb);
|
||||
outptr1 += 4;
|
||||
}
|
||||
|
||||
/* If image width is odd, do the last output column separately */
|
||||
if (cinfo->output_width & 1) {
|
||||
cb = GETJSAMPLE(*inptr1);
|
||||
cr = GETJSAMPLE(*inptr2);
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
|
||||
y = GETJSAMPLE(*inptr00);
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16*)outptr0 = rgb;
|
||||
|
||||
y = GETJSAMPLE(*inptr01);
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16*)outptr1 = rgb;
|
||||
}
|
||||
if (is_big_endian())
|
||||
h2v2_merged_upsample_565_be(cinfo, input_buf, in_row_group_ctr,
|
||||
output_buf);
|
||||
else
|
||||
h2v2_merged_upsample_565_le(cinfo, input_buf, in_row_group_ctr,
|
||||
output_buf);
|
||||
}
|
||||
|
||||
|
||||
@@ -691,98 +555,12 @@ h2v2_merged_upsample_565D (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr0, outptr1;
|
||||
JSAMPROW inptr00, inptr01, inptr1, inptr2;
|
||||
JDIMENSION col;
|
||||
/* copy these pointers into registers if possible */
|
||||
register JSAMPLE * range_limit = cinfo->sample_range_limit;
|
||||
int * Crrtab = upsample->Cr_r_tab;
|
||||
int * Cbbtab = upsample->Cb_b_tab;
|
||||
INT32 * Crgtab = upsample->Cr_g_tab;
|
||||
INT32 * Cbgtab = upsample->Cb_g_tab;
|
||||
INT32 d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK];
|
||||
INT32 d1 = dither_matrix[(cinfo->output_scanline+1) & DITHER_MASK];
|
||||
unsigned int r, g, b;
|
||||
INT32 rgb;
|
||||
SHIFT_TEMPS
|
||||
|
||||
inptr00 = input_buf[0][in_row_group_ctr*2];
|
||||
inptr01 = input_buf[0][in_row_group_ctr*2 + 1];
|
||||
inptr1 = input_buf[1][in_row_group_ctr];
|
||||
inptr2 = input_buf[2][in_row_group_ctr];
|
||||
outptr0 = output_buf[0];
|
||||
outptr1 = output_buf[1];
|
||||
|
||||
/* Loop for each group of output pixels */
|
||||
for (col = cinfo->output_width >> 1; col > 0; col--) {
|
||||
/* Do the chroma part of the calculation */
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
|
||||
/* Fetch 4 Y values and emit 4 pixels */
|
||||
y = GETJSAMPLE(*inptr00++);
|
||||
r = range_limit[DITHER_565_R(y + cred, d0)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d0)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d0)];
|
||||
d0 = DITHER_ROTATE(d0);
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
y = GETJSAMPLE(*inptr00++);
|
||||
r = range_limit[DITHER_565_R(y + cred, d1)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d1)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d1)];
|
||||
d1 = DITHER_ROTATE(d1);
|
||||
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
|
||||
|
||||
WRITE_TWO_PIXELS(outptr0, rgb);
|
||||
outptr0 += 4;
|
||||
|
||||
y = GETJSAMPLE(*inptr01++);
|
||||
r = range_limit[DITHER_565_R(y + cred, d0)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d0)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d0)];
|
||||
d0 = DITHER_ROTATE(d0);
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
y = GETJSAMPLE(*inptr01++);
|
||||
r = range_limit[DITHER_565_R(y + cred, d1)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d1)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d1)];
|
||||
d1 = DITHER_ROTATE(d1);
|
||||
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
|
||||
|
||||
WRITE_TWO_PIXELS(outptr1, rgb);
|
||||
outptr1 += 4;
|
||||
}
|
||||
|
||||
/* If image width is odd, do the last output column separately */
|
||||
if (cinfo->output_width & 1) {
|
||||
cb = GETJSAMPLE(*inptr1);
|
||||
cr = GETJSAMPLE(*inptr2);
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
|
||||
y = GETJSAMPLE(*inptr00);
|
||||
r = range_limit[DITHER_565_R(y + cred, d0)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d0)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d0)];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16*)outptr0 = rgb;
|
||||
|
||||
y = GETJSAMPLE(*inptr01);
|
||||
r = range_limit[DITHER_565_R(y + cred, d1)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d1)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d1)];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16*)outptr1 = rgb;
|
||||
}
|
||||
if (is_big_endian())
|
||||
h2v2_merged_upsample_565D_be(cinfo, input_buf, in_row_group_ctr,
|
||||
output_buf);
|
||||
else
|
||||
h2v2_merged_upsample_565D_le(cinfo, input_buf, in_row_group_ctr,
|
||||
output_buf);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,355 @@
|
||||
/*
|
||||
* jdmrg565.c
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2013, Linaro Limited.
|
||||
* Copyright (C) 2014, D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file contains code for merged upsampling/color conversion.
|
||||
*/
|
||||
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
h2v1_merged_upsample_565_internal (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr;
|
||||
JSAMPROW inptr0, inptr1, inptr2;
|
||||
JDIMENSION col;
|
||||
/* copy these pointers into registers if possible */
|
||||
register JSAMPLE * range_limit = cinfo->sample_range_limit;
|
||||
int * Crrtab = upsample->Cr_r_tab;
|
||||
int * Cbbtab = upsample->Cb_b_tab;
|
||||
INT32 * Crgtab = upsample->Cr_g_tab;
|
||||
INT32 * Cbgtab = upsample->Cb_g_tab;
|
||||
unsigned int r, g, b;
|
||||
INT32 rgb;
|
||||
SHIFT_TEMPS
|
||||
|
||||
inptr0 = input_buf[0][in_row_group_ctr];
|
||||
inptr1 = input_buf[1][in_row_group_ctr];
|
||||
inptr2 = input_buf[2][in_row_group_ctr];
|
||||
outptr = output_buf[0];
|
||||
|
||||
/* Loop for each pair of output pixels */
|
||||
for (col = cinfo->output_width >> 1; col > 0; col--) {
|
||||
/* Do the chroma part of the calculation */
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
|
||||
/* Fetch 2 Y values and emit 2 pixels */
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
|
||||
|
||||
WRITE_TWO_PIXELS(outptr, rgb);
|
||||
outptr += 4;
|
||||
}
|
||||
|
||||
/* If image width is odd, do the last output column separately */
|
||||
if (cinfo->output_width & 1) {
|
||||
cb = GETJSAMPLE(*inptr1);
|
||||
cr = GETJSAMPLE(*inptr2);
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
y = GETJSAMPLE(*inptr0);
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16*)outptr = rgb;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
h2v1_merged_upsample_565D_internal (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr;
|
||||
JSAMPROW inptr0, inptr1, inptr2;
|
||||
JDIMENSION col;
|
||||
/* copy these pointers into registers if possible */
|
||||
register JSAMPLE * range_limit = cinfo->sample_range_limit;
|
||||
int * Crrtab = upsample->Cr_r_tab;
|
||||
int * Cbbtab = upsample->Cb_b_tab;
|
||||
INT32 * Crgtab = upsample->Cr_g_tab;
|
||||
INT32 * Cbgtab = upsample->Cb_g_tab;
|
||||
INT32 d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK];
|
||||
unsigned int r, g, b;
|
||||
INT32 rgb;
|
||||
SHIFT_TEMPS
|
||||
|
||||
inptr0 = input_buf[0][in_row_group_ctr];
|
||||
inptr1 = input_buf[1][in_row_group_ctr];
|
||||
inptr2 = input_buf[2][in_row_group_ctr];
|
||||
outptr = output_buf[0];
|
||||
|
||||
/* Loop for each pair of output pixels */
|
||||
for (col = cinfo->output_width >> 1; col > 0; col--) {
|
||||
/* Do the chroma part of the calculation */
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
|
||||
/* Fetch 2 Y values and emit 2 pixels */
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
r = range_limit[DITHER_565_R(y + cred, d0)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d0)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d0)];
|
||||
d0 = DITHER_ROTATE(d0);
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
y = GETJSAMPLE(*inptr0++);
|
||||
r = range_limit[DITHER_565_R(y + cred, d0)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d0)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d0)];
|
||||
d0 = DITHER_ROTATE(d0);
|
||||
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
|
||||
|
||||
WRITE_TWO_PIXELS(outptr, rgb);
|
||||
outptr += 4;
|
||||
}
|
||||
|
||||
/* If image width is odd, do the last output column separately */
|
||||
if (cinfo->output_width & 1) {
|
||||
cb = GETJSAMPLE(*inptr1);
|
||||
cr = GETJSAMPLE(*inptr2);
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
y = GETJSAMPLE(*inptr0);
|
||||
r = range_limit[DITHER_565_R(y + cred, d0)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d0)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d0)];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16*)outptr = rgb;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
h2v2_merged_upsample_565_internal (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr0, outptr1;
|
||||
JSAMPROW inptr00, inptr01, inptr1, inptr2;
|
||||
JDIMENSION col;
|
||||
/* copy these pointers into registers if possible */
|
||||
register JSAMPLE * range_limit = cinfo->sample_range_limit;
|
||||
int * Crrtab = upsample->Cr_r_tab;
|
||||
int * Cbbtab = upsample->Cb_b_tab;
|
||||
INT32 * Crgtab = upsample->Cr_g_tab;
|
||||
INT32 * Cbgtab = upsample->Cb_g_tab;
|
||||
unsigned int r, g, b;
|
||||
INT32 rgb;
|
||||
SHIFT_TEMPS
|
||||
|
||||
inptr00 = input_buf[0][in_row_group_ctr * 2];
|
||||
inptr01 = input_buf[0][in_row_group_ctr * 2 + 1];
|
||||
inptr1 = input_buf[1][in_row_group_ctr];
|
||||
inptr2 = input_buf[2][in_row_group_ctr];
|
||||
outptr0 = output_buf[0];
|
||||
outptr1 = output_buf[1];
|
||||
|
||||
/* Loop for each group of output pixels */
|
||||
for (col = cinfo->output_width >> 1; col > 0; col--) {
|
||||
/* Do the chroma part of the calculation */
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
|
||||
/* Fetch 4 Y values and emit 4 pixels */
|
||||
y = GETJSAMPLE(*inptr00++);
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
y = GETJSAMPLE(*inptr00++);
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
|
||||
|
||||
WRITE_TWO_PIXELS(outptr0, rgb);
|
||||
outptr0 += 4;
|
||||
|
||||
y = GETJSAMPLE(*inptr01++);
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
y = GETJSAMPLE(*inptr01++);
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
|
||||
|
||||
WRITE_TWO_PIXELS(outptr1, rgb);
|
||||
outptr1 += 4;
|
||||
}
|
||||
|
||||
/* If image width is odd, do the last output column separately */
|
||||
if (cinfo->output_width & 1) {
|
||||
cb = GETJSAMPLE(*inptr1);
|
||||
cr = GETJSAMPLE(*inptr2);
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
|
||||
y = GETJSAMPLE(*inptr00);
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16*)outptr0 = rgb;
|
||||
|
||||
y = GETJSAMPLE(*inptr01);
|
||||
r = range_limit[y + cred];
|
||||
g = range_limit[y + cgreen];
|
||||
b = range_limit[y + cblue];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16*)outptr1 = rgb;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
INLINE
|
||||
LOCAL(void)
|
||||
h2v2_merged_upsample_565D_internal (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample;
|
||||
register int y, cred, cgreen, cblue;
|
||||
int cb, cr;
|
||||
register JSAMPROW outptr0, outptr1;
|
||||
JSAMPROW inptr00, inptr01, inptr1, inptr2;
|
||||
JDIMENSION col;
|
||||
/* copy these pointers into registers if possible */
|
||||
register JSAMPLE * range_limit = cinfo->sample_range_limit;
|
||||
int * Crrtab = upsample->Cr_r_tab;
|
||||
int * Cbbtab = upsample->Cb_b_tab;
|
||||
INT32 * Crgtab = upsample->Cr_g_tab;
|
||||
INT32 * Cbgtab = upsample->Cb_g_tab;
|
||||
INT32 d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK];
|
||||
INT32 d1 = dither_matrix[(cinfo->output_scanline+1) & DITHER_MASK];
|
||||
unsigned int r, g, b;
|
||||
INT32 rgb;
|
||||
SHIFT_TEMPS
|
||||
|
||||
inptr00 = input_buf[0][in_row_group_ctr*2];
|
||||
inptr01 = input_buf[0][in_row_group_ctr*2 + 1];
|
||||
inptr1 = input_buf[1][in_row_group_ctr];
|
||||
inptr2 = input_buf[2][in_row_group_ctr];
|
||||
outptr0 = output_buf[0];
|
||||
outptr1 = output_buf[1];
|
||||
|
||||
/* Loop for each group of output pixels */
|
||||
for (col = cinfo->output_width >> 1; col > 0; col--) {
|
||||
/* Do the chroma part of the calculation */
|
||||
cb = GETJSAMPLE(*inptr1++);
|
||||
cr = GETJSAMPLE(*inptr2++);
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
|
||||
/* Fetch 4 Y values and emit 4 pixels */
|
||||
y = GETJSAMPLE(*inptr00++);
|
||||
r = range_limit[DITHER_565_R(y + cred, d0)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d0)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d0)];
|
||||
d0 = DITHER_ROTATE(d0);
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
y = GETJSAMPLE(*inptr00++);
|
||||
r = range_limit[DITHER_565_R(y + cred, d1)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d1)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d1)];
|
||||
d1 = DITHER_ROTATE(d1);
|
||||
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
|
||||
|
||||
WRITE_TWO_PIXELS(outptr0, rgb);
|
||||
outptr0 += 4;
|
||||
|
||||
y = GETJSAMPLE(*inptr01++);
|
||||
r = range_limit[DITHER_565_R(y + cred, d0)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d0)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d0)];
|
||||
d0 = DITHER_ROTATE(d0);
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
|
||||
y = GETJSAMPLE(*inptr01++);
|
||||
r = range_limit[DITHER_565_R(y + cred, d1)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d1)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d1)];
|
||||
d1 = DITHER_ROTATE(d1);
|
||||
rgb = PACK_TWO_PIXELS(rgb, PACK_SHORT_565(r, g, b));
|
||||
|
||||
WRITE_TWO_PIXELS(outptr1, rgb);
|
||||
outptr1 += 4;
|
||||
}
|
||||
|
||||
/* If image width is odd, do the last output column separately */
|
||||
if (cinfo->output_width & 1) {
|
||||
cb = GETJSAMPLE(*inptr1);
|
||||
cr = GETJSAMPLE(*inptr2);
|
||||
cred = Crrtab[cr];
|
||||
cgreen = (int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS);
|
||||
cblue = Cbbtab[cb];
|
||||
|
||||
y = GETJSAMPLE(*inptr00);
|
||||
r = range_limit[DITHER_565_R(y + cred, d0)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d0)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d0)];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16*)outptr0 = rgb;
|
||||
|
||||
y = GETJSAMPLE(*inptr01);
|
||||
r = range_limit[DITHER_565_R(y + cred, d1)];
|
||||
g = range_limit[DITHER_565_G(y + cgreen, d1)];
|
||||
b = range_limit[DITHER_565_B(y + cblue, d1)];
|
||||
rgb = PACK_SHORT_565(r, g, b);
|
||||
*(INT16*)outptr1 = rgb;
|
||||
}
|
||||
}
|
||||
@@ -1,83 +1,83 @@
|
||||
/*
|
||||
* jinclude.h
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1994, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file exists to provide a single place to fix any problems with
|
||||
* including the wrong system include files. (Common problems are taken
|
||||
* care of by the standard jconfig symbols, but on really weird systems
|
||||
* you may have to edit this file.)
|
||||
*
|
||||
* NOTE: this file is NOT intended to be included by applications using the
|
||||
* JPEG library. Most applications need only include jpeglib.h.
|
||||
*/
|
||||
|
||||
|
||||
/* Include auto-config file to find out which system include files we need. */
|
||||
|
||||
#include "jconfig.h" /* auto configuration options */
|
||||
#define JCONFIG_INCLUDED /* so that jpeglib.h doesn't do it again */
|
||||
|
||||
/*
|
||||
* We need the NULL macro and size_t typedef.
|
||||
* On an ANSI-conforming system it is sufficient to include <stddef.h>.
|
||||
* Otherwise, we get them from <stdlib.h> or <stdio.h>; we may have to
|
||||
* pull in <sys/types.h> as well.
|
||||
* Note that the core JPEG library does not require <stdio.h>;
|
||||
* only the default error handler and data source/destination modules do.
|
||||
* But we must pull it in because of the references to FILE in jpeglib.h.
|
||||
* You can remove those references if you want to compile without <stdio.h>.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_STDDEF_H
|
||||
#include <stddef.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef NEED_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
* We need memory copying and zeroing functions, plus strncpy().
|
||||
* ANSI and System V implementations declare these in <string.h>.
|
||||
* BSD doesn't have the mem() functions, but it does have bcopy()/bzero().
|
||||
* Some systems may declare memset and memcpy in <memory.h>.
|
||||
*
|
||||
* NOTE: we assume the size parameters to these functions are of type size_t.
|
||||
* Change the casts in these macros if not!
|
||||
*/
|
||||
|
||||
#ifdef NEED_BSD_STRINGS
|
||||
|
||||
#include <strings.h>
|
||||
#define MEMZERO(target,size) bzero((void *)(target), (size_t)(size))
|
||||
#define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size))
|
||||
|
||||
#else /* not BSD, assume ANSI/SysV string lib */
|
||||
|
||||
#include <string.h>
|
||||
#define MEMZERO(target,size) memset((void *)(target), 0, (size_t)(size))
|
||||
#define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size))
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The modules that use fread() and fwrite() always invoke them through
|
||||
* these macros. On some systems you may need to twiddle the argument casts.
|
||||
* CAUTION: argument order is different from underlying functions!
|
||||
*/
|
||||
|
||||
#define JFREAD(file,buf,sizeofbuf) \
|
||||
((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
|
||||
#define JFWRITE(file,buf,sizeofbuf) \
|
||||
((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
|
||||
/*
|
||||
* jinclude.h
|
||||
*
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1994, Thomas G. Lane.
|
||||
* It was modified by The libjpeg-turbo Project to include only code relevant
|
||||
* to libjpeg-turbo.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file exists to provide a single place to fix any problems with
|
||||
* including the wrong system include files. (Common problems are taken
|
||||
* care of by the standard jconfig symbols, but on really weird systems
|
||||
* you may have to edit this file.)
|
||||
*
|
||||
* NOTE: this file is NOT intended to be included by applications using the
|
||||
* JPEG library. Most applications need only include jpeglib.h.
|
||||
*/
|
||||
|
||||
|
||||
/* Include auto-config file to find out which system include files we need. */
|
||||
|
||||
#include "jconfig.h" /* auto configuration options */
|
||||
#define JCONFIG_INCLUDED /* so that jpeglib.h doesn't do it again */
|
||||
|
||||
/*
|
||||
* We need the NULL macro and size_t typedef.
|
||||
* On an ANSI-conforming system it is sufficient to include <stddef.h>.
|
||||
* Otherwise, we get them from <stdlib.h> or <stdio.h>; we may have to
|
||||
* pull in <sys/types.h> as well.
|
||||
* Note that the core JPEG library does not require <stdio.h>;
|
||||
* only the default error handler and data source/destination modules do.
|
||||
* But we must pull it in because of the references to FILE in jpeglib.h.
|
||||
* You can remove those references if you want to compile without <stdio.h>.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_STDDEF_H
|
||||
#include <stddef.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef NEED_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
* We need memory copying and zeroing functions, plus strncpy().
|
||||
* ANSI and System V implementations declare these in <string.h>.
|
||||
* BSD doesn't have the mem() functions, but it does have bcopy()/bzero().
|
||||
* Some systems may declare memset and memcpy in <memory.h>.
|
||||
*
|
||||
* NOTE: we assume the size parameters to these functions are of type size_t.
|
||||
* Change the casts in these macros if not!
|
||||
*/
|
||||
|
||||
#ifdef NEED_BSD_STRINGS
|
||||
|
||||
#include <strings.h>
|
||||
#define MEMZERO(target,size) bzero((void *)(target), (size_t)(size))
|
||||
#define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size))
|
||||
|
||||
#else /* not BSD, assume ANSI/SysV string lib */
|
||||
|
||||
#include <string.h>
|
||||
#define MEMZERO(target,size) memset((void *)(target), 0, (size_t)(size))
|
||||
#define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size))
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The modules that use fread() and fwrite() always invoke them through
|
||||
* these macros. On some systems you may need to twiddle the argument casts.
|
||||
* CAUTION: argument order is different from underlying functions!
|
||||
*/
|
||||
|
||||
#define JFREAD(file,buf,sizeofbuf) \
|
||||
((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
|
||||
#define JFWRITE(file,buf,sizeofbuf) \
|
||||
((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file)))
|
||||
@@ -28,13 +28,13 @@
|
||||
#endif
|
||||
#include "jmorecfg.h" /* seldom changed options */
|
||||
|
||||
/*
|
||||
|
||||
#ifdef __cplusplus
|
||||
#ifndef DONT_USE_EXTERN_C
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif
|
||||
*/
|
||||
|
||||
|
||||
/* Various constants determining the sizes of things.
|
||||
* All of these are specified by the JPEG standard, so don't change them
|
||||
@@ -1096,12 +1096,10 @@ struct jpeg_color_quantizer { long dummy; };
|
||||
#include "jerror.h" /* fetch error codes too */
|
||||
#endif
|
||||
|
||||
/*
|
||||
#ifdef __cplusplus
|
||||
#ifndef DONT_USE_EXTERN_C
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
*/
|
||||
|
||||
#endif /* JPEGLIB_H */
|
||||
@@ -1 +0,0 @@
|
||||
# dummy
|
||||
@@ -1 +0,0 @@
|
||||
# dummy
|
||||
@@ -1 +0,0 @@
|
||||
# dummy
|
||||
@@ -1 +0,0 @@
|
||||
# dummy
|
||||
@@ -1 +0,0 @@
|
||||
# dummy
|
||||
@@ -1 +0,0 @@
|
||||
# dummy
|
||||
@@ -1 +0,0 @@
|
||||
# dummy
|
||||
@@ -1,109 +0,0 @@
|
||||
jsimd_x86_64.lo: jsimd_x86_64.c ../jinclude.h ../jconfig.h \
|
||||
/usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/stddef.h \
|
||||
/usr/include/stdlib.h /usr/include/machine/ieeefp.h /usr/include/_ansi.h \
|
||||
/usr/include/newlib.h /usr/include/sys/config.h \
|
||||
/usr/include/sys/features.h /usr/include/cygwin/config.h \
|
||||
/usr/include/sys/reent.h /usr/include/_ansi.h /usr/include/sys/_types.h \
|
||||
/usr/include/machine/_types.h /usr/include/machine/_default_types.h \
|
||||
/usr/include/sys/lock.h /usr/include/machine/stdlib.h \
|
||||
/usr/include/alloca.h /usr/include/cygwin/stdlib.h \
|
||||
/usr/include/cygwin/wait.h /usr/include/sys/types.h \
|
||||
/usr/include/machine/types.h /usr/include/cygwin/types.h \
|
||||
/usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/stdint.h \
|
||||
/usr/include/stdint.h /usr/include/bits/wordsize.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/byteswap.h \
|
||||
/usr/include/sys/sysmacros.h /usr/include/stdio.h \
|
||||
/usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/stdarg.h \
|
||||
/usr/include/sys/stdio.h \
|
||||
/usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include-fixed/sys/cdefs.h \
|
||||
/usr/include/string.h /usr/include/sys/string.h ../jpeglib.h \
|
||||
../jmorecfg.h ../jpegint.h ../jerror.h ../jsimd.h ../jdct.h \
|
||||
../jsimddct.h jsimd.h
|
||||
|
||||
../jinclude.h:
|
||||
|
||||
../jconfig.h:
|
||||
|
||||
/usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/stddef.h:
|
||||
|
||||
/usr/include/stdlib.h:
|
||||
|
||||
/usr/include/machine/ieeefp.h:
|
||||
|
||||
/usr/include/_ansi.h:
|
||||
|
||||
/usr/include/newlib.h:
|
||||
|
||||
/usr/include/sys/config.h:
|
||||
|
||||
/usr/include/sys/features.h:
|
||||
|
||||
/usr/include/cygwin/config.h:
|
||||
|
||||
/usr/include/sys/reent.h:
|
||||
|
||||
/usr/include/_ansi.h:
|
||||
|
||||
/usr/include/sys/_types.h:
|
||||
|
||||
/usr/include/machine/_types.h:
|
||||
|
||||
/usr/include/machine/_default_types.h:
|
||||
|
||||
/usr/include/sys/lock.h:
|
||||
|
||||
/usr/include/machine/stdlib.h:
|
||||
|
||||
/usr/include/alloca.h:
|
||||
|
||||
/usr/include/cygwin/stdlib.h:
|
||||
|
||||
/usr/include/cygwin/wait.h:
|
||||
|
||||
/usr/include/sys/types.h:
|
||||
|
||||
/usr/include/machine/types.h:
|
||||
|
||||
/usr/include/cygwin/types.h:
|
||||
|
||||
/usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/stdint.h:
|
||||
|
||||
/usr/include/stdint.h:
|
||||
|
||||
/usr/include/bits/wordsize.h:
|
||||
|
||||
/usr/include/endian.h:
|
||||
|
||||
/usr/include/bits/endian.h:
|
||||
|
||||
/usr/include/byteswap.h:
|
||||
|
||||
/usr/include/sys/sysmacros.h:
|
||||
|
||||
/usr/include/stdio.h:
|
||||
|
||||
/usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include/stdarg.h:
|
||||
|
||||
/usr/include/sys/stdio.h:
|
||||
|
||||
/usr/lib/gcc/x86_64-pc-cygwin/4.8.1/include-fixed/sys/cdefs.h:
|
||||
|
||||
/usr/include/string.h:
|
||||
|
||||
/usr/include/sys/string.h:
|
||||
|
||||
../jpeglib.h:
|
||||
|
||||
../jmorecfg.h:
|
||||
|
||||
../jpegint.h:
|
||||
|
||||
../jerror.h:
|
||||
|
||||
../jsimd.h:
|
||||
|
||||
../jdct.h:
|
||||
|
||||
../jsimddct.h:
|
||||
|
||||
jsimd.h:
|
||||
@@ -0,0 +1,544 @@
|
||||
/*
|
||||
* jsimd_arm64.c
|
||||
*
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright 2009-2011, 2013-2014 D. R. Commander
|
||||
*
|
||||
* Based on the x86 SIMD extension for IJG JPEG library,
|
||||
* Copyright (C) 1999-2006, MIYASAKA Masaru.
|
||||
* For conditions of distribution and use, see copyright notice in jsimdext.inc
|
||||
*
|
||||
* This file contains the interface between the "normal" portions
|
||||
* of the library and the SIMD implementations when running on a
|
||||
* 64-bit ARM architecture.
|
||||
*/
|
||||
|
||||
#define JPEG_INTERNALS
|
||||
#include "../jinclude.h"
|
||||
#include "../jpeglib.h"
|
||||
#include "../jsimd.h"
|
||||
#include "../jdct.h"
|
||||
#include "../jsimddct.h"
|
||||
#include "jsimd.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
|
||||
static unsigned int simd_support = ~0;
|
||||
|
||||
/*
|
||||
* Check what SIMD accelerations are supported.
|
||||
*
|
||||
* FIXME: This code is racy under a multi-threaded environment.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ARMv8 architectures support NEON extensions by default.
|
||||
* It is no longer optional as it was with ARMv7.
|
||||
*/
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
init_simd (void)
|
||||
{
|
||||
char *env = NULL;
|
||||
|
||||
if (simd_support != ~0U)
|
||||
return;
|
||||
|
||||
simd_support = 0;
|
||||
|
||||
simd_support |= JSIMD_ARM_NEON;
|
||||
|
||||
/* Force different settings through environment variables */
|
||||
env = getenv("JSIMD_FORCENEON");
|
||||
if ((env != NULL) && (strcmp(env, "1") == 0))
|
||||
simd_support &= JSIMD_ARM_NEON;
|
||||
env = getenv("JSIMD_FORCENONE");
|
||||
if ((env != NULL) && (strcmp(env, "1") == 0))
|
||||
simd_support = 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_rgb_ycc (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_rgb_gray (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_ycc_rgb (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_ARM_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_ycc_rgb565 (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_ARM_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
|
||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
JDIMENSION output_row, int num_rows)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_rgb_gray_convert (j_compress_ptr cinfo,
|
||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
JDIMENSION output_row, int num_rows)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
void (*neonfct)(JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);
|
||||
|
||||
switch(cinfo->out_color_space) {
|
||||
case JCS_EXT_RGB:
|
||||
neonfct=jsimd_ycc_extrgb_convert_neon;
|
||||
break;
|
||||
case JCS_EXT_RGBX:
|
||||
case JCS_EXT_RGBA:
|
||||
neonfct=jsimd_ycc_extrgbx_convert_neon;
|
||||
break;
|
||||
case JCS_EXT_BGR:
|
||||
neonfct=jsimd_ycc_extbgr_convert_neon;
|
||||
break;
|
||||
case JCS_EXT_BGRX:
|
||||
case JCS_EXT_BGRA:
|
||||
neonfct=jsimd_ycc_extbgrx_convert_neon;
|
||||
break;
|
||||
case JCS_EXT_XBGR:
|
||||
case JCS_EXT_ABGR:
|
||||
neonfct=jsimd_ycc_extxbgr_convert_neon;
|
||||
break;
|
||||
case JCS_EXT_XRGB:
|
||||
case JCS_EXT_ARGB:
|
||||
neonfct=jsimd_ycc_extxrgb_convert_neon;
|
||||
break;
|
||||
default:
|
||||
neonfct=jsimd_ycc_extrgb_convert_neon;
|
||||
break;
|
||||
}
|
||||
|
||||
if (simd_support & JSIMD_ARM_NEON)
|
||||
neonfct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_ycc_rgb565_convert (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
if (simd_support & JSIMD_ARM_NEON)
|
||||
jsimd_ycc_rgb565_convert_neon(cinfo->output_width, input_buf, input_row,
|
||||
output_buf, num_rows);
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v2_downsample (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v1_downsample (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v2_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v1_downsample (j_compress_ptr cinfo, jpeg_component_info * compptr,
|
||||
JSAMPARRAY input_data, JSAMPARRAY output_data)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v2_upsample (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v1_upsample (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v2_upsample (j_decompress_ptr cinfo,
|
||||
jpeg_component_info * compptr,
|
||||
JSAMPARRAY input_data,
|
||||
JSAMPARRAY * output_data_ptr)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v1_upsample (j_decompress_ptr cinfo,
|
||||
jpeg_component_info * compptr,
|
||||
JSAMPARRAY input_data,
|
||||
JSAMPARRAY * output_data_ptr)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v2_fancy_upsample (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v1_fancy_upsample (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v2_fancy_upsample (j_decompress_ptr cinfo,
|
||||
jpeg_component_info * compptr,
|
||||
JSAMPARRAY input_data,
|
||||
JSAMPARRAY * output_data_ptr)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v1_fancy_upsample (j_decompress_ptr cinfo,
|
||||
jpeg_component_info * compptr,
|
||||
JSAMPARRAY input_data,
|
||||
JSAMPARRAY * output_data_ptr)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v2_merged_upsample (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v1_merged_upsample (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v2_merged_upsample (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_h2v1_merged_upsample (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf,
|
||||
JDIMENSION in_row_group_ctr,
|
||||
JSAMPARRAY output_buf)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_convsamp (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_convsamp_float (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_convsamp (JSAMPARRAY sample_data, JDIMENSION start_col,
|
||||
DCTELEM * workspace)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_convsamp_float (JSAMPARRAY sample_data, JDIMENSION start_col,
|
||||
FAST_FLOAT * workspace)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_fdct_islow (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_fdct_ifast (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_fdct_float (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_fdct_islow (DCTELEM * data)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_fdct_ifast (DCTELEM * data)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_fdct_float (FAST_FLOAT * data)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_quantize (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_quantize_float (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_quantize (JCOEFPTR coef_block, DCTELEM * divisors,
|
||||
DCTELEM * workspace)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_quantize_float (JCOEFPTR coef_block, FAST_FLOAT * divisors,
|
||||
FAST_FLOAT * workspace)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_idct_2x2 (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (DCTSIZE != 8)
|
||||
return 0;
|
||||
if (sizeof(JCOEF) != 2)
|
||||
return 0;
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
if (sizeof(ISLOW_MULT_TYPE) != 2)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_ARM_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_idct_4x4 (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (DCTSIZE != 8)
|
||||
return 0;
|
||||
if (sizeof(JCOEF) != 2)
|
||||
return 0;
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
if (sizeof(ISLOW_MULT_TYPE) != 2)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_ARM_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_idct_2x2 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
||||
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col)
|
||||
{
|
||||
if (simd_support & JSIMD_ARM_NEON)
|
||||
jsimd_idct_2x2_neon(compptr->dct_table, coef_block, output_buf,
|
||||
output_col);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_idct_4x4 (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
||||
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col)
|
||||
{
|
||||
if (simd_support & JSIMD_ARM_NEON)
|
||||
jsimd_idct_4x4_neon(compptr->dct_table, coef_block, output_buf,
|
||||
output_col);
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_idct_islow (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (DCTSIZE != 8)
|
||||
return 0;
|
||||
if (sizeof(JCOEF) != 2)
|
||||
return 0;
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
if (sizeof(ISLOW_MULT_TYPE) != 2)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_ARM_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_idct_ifast (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (DCTSIZE != 8)
|
||||
return 0;
|
||||
if (sizeof(JCOEF) != 2)
|
||||
return 0;
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
if (sizeof(IFAST_MULT_TYPE) != 2)
|
||||
return 0;
|
||||
if (IFAST_SCALE_BITS != 2)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_ARM_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_idct_float (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_idct_islow (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
||||
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col)
|
||||
{
|
||||
if (simd_support & JSIMD_ARM_NEON)
|
||||
jsimd_idct_islow_neon(compptr->dct_table, coef_block, output_buf,
|
||||
output_col);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_idct_ifast (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
||||
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col)
|
||||
{
|
||||
if (simd_support & JSIMD_ARM_NEON)
|
||||
jsimd_idct_ifast_neon(compptr->dct_table, coef_block, output_buf,
|
||||
output_col);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_idct_float (j_decompress_ptr cinfo, jpeg_component_info * compptr,
|
||||
JCOEFPTR coef_block, JSAMPARRAY output_buf,
|
||||
JDIMENSION output_col)
|
||||
{
|
||||
}
|
||||
@@ -4,6 +4,7 @@
|
||||
* Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
* All rights reserved.
|
||||
* Author: Siarhei Siamashka <siarhei.siamashka@nokia.com>
|
||||
* Copyright (C) 2014 Siarhei Siamashka. All Rights Reserved.
|
||||
* Copyright (C) 2014 Linaro Limited. All Rights Reserved.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
@@ -1408,52 +1409,52 @@ asm_function jsimd_idct_2x2_neon
|
||||
.endm
|
||||
|
||||
.macro do_yuv_to_rgb_stage2_store_load_stage1
|
||||
/* "do_yuv_to_rgb_stage2" and "store" */
|
||||
vrshrn.s32 d20, q10, #15
|
||||
/* "do_yuv_to_rgb_stage2" and "store" */
|
||||
vrshrn.s32 d20, q10, #15
|
||||
/* "load" and "do_yuv_to_rgb_stage1" */
|
||||
pld [U, #64]
|
||||
vrshrn.s32 d21, q11, #15
|
||||
vrshrn.s32 d21, q11, #15
|
||||
pld [V, #64]
|
||||
vrshrn.s32 d24, q12, #14
|
||||
vrshrn.s32 d25, q13, #14
|
||||
vrshrn.s32 d24, q12, #14
|
||||
vrshrn.s32 d25, q13, #14
|
||||
vld1.8 {d4}, [U, :64]!
|
||||
vrshrn.s32 d28, q14, #14
|
||||
vrshrn.s32 d28, q14, #14
|
||||
vld1.8 {d5}, [V, :64]!
|
||||
vrshrn.s32 d29, q15, #14
|
||||
vrshrn.s32 d29, q15, #14
|
||||
vaddw.u8 q3, q1, d4 /* q3 = u - 128 */
|
||||
vaddw.u8 q4, q1, d5 /* q2 = v - 128 */
|
||||
vaddw.u8 q11, q10, d0
|
||||
vaddw.u8 q11, q10, d0
|
||||
vmull.s16 q10, d6, d1[1] /* multiply by -11277 */
|
||||
vmlal.s16 q10, d8, d1[2] /* multiply by -23401 */
|
||||
vaddw.u8 q12, q12, d0
|
||||
vaddw.u8 q14, q14, d0
|
||||
vaddw.u8 q12, q12, d0
|
||||
vaddw.u8 q14, q14, d0
|
||||
.if \bpp != 16 /**************** rgb24/rgb32 *********************************/
|
||||
vqmovun.s16 d1\g_offs, q11
|
||||
vqmovun.s16 d1\g_offs, q11
|
||||
pld [Y, #64]
|
||||
vqmovun.s16 d1\r_offs, q12
|
||||
vqmovun.s16 d1\r_offs, q12
|
||||
vld1.8 {d0}, [Y, :64]!
|
||||
vqmovun.s16 d1\b_offs, q14
|
||||
vqmovun.s16 d1\b_offs, q14
|
||||
vmull.s16 q11, d7, d1[1] /* multiply by -11277 */
|
||||
vmlal.s16 q11, d9, d1[2] /* multiply by -23401 */
|
||||
do_store \bpp, 8
|
||||
do_store \bpp, 8
|
||||
vmull.s16 q12, d8, d1[0] /* multiply by 22971 */
|
||||
vmull.s16 q13, d9, d1[0] /* multiply by 22971 */
|
||||
vmull.s16 q14, d6, d1[3] /* multiply by 29033 */
|
||||
vmull.s16 q15, d7, d1[3] /* multiply by 29033 */
|
||||
.else /**************************** rgb565 ***********************************/
|
||||
vqshlu.s16 q13, q11, #8
|
||||
vqshlu.s16 q13, q11, #8
|
||||
pld [Y, #64]
|
||||
vqshlu.s16 q15, q12, #8
|
||||
vqshlu.s16 q14, q14, #8
|
||||
vqshlu.s16 q15, q12, #8
|
||||
vqshlu.s16 q14, q14, #8
|
||||
vld1.8 {d0}, [Y, :64]!
|
||||
vmull.s16 q11, d7, d1[1]
|
||||
vmlal.s16 q11, d9, d1[2]
|
||||
vsri.u16 q15, q13, #5
|
||||
vsri.u16 q15, q13, #5
|
||||
vmull.s16 q12, d8, d1[0]
|
||||
vsri.u16 q15, q14, #11
|
||||
vsri.u16 q15, q14, #11
|
||||
vmull.s16 q13, d9, d1[0]
|
||||
vmull.s16 q14, d6, d1[3]
|
||||
do_store \bpp, 8
|
||||
do_store \bpp, 8
|
||||
vmull.s16 q15, d7, d1[3]
|
||||
.endif
|
||||
.endm
|
||||
|
||||
@@ -37,10 +37,10 @@
|
||||
#include "jpeglib.h"
|
||||
#include "jerror.h"
|
||||
#include <setjmp.h>
|
||||
#include "turbojpeg.h"
|
||||
#include "tjutil.h"
|
||||
#include "./turbojpeg.h"
|
||||
#include "./tjutil.h"
|
||||
#include "transupp.h"
|
||||
#include "jpegcomp.h"
|
||||
#include "./jpegcomp.h"
|
||||
|
||||
extern void jpeg_mem_dest_tj(j_compress_ptr, unsigned char **,
|
||||
unsigned long *, boolean);
|
||||
|
||||
@@ -82,20 +82,19 @@ jobject PNG_DecodeFileHandler(JNIEnv* env, FILE* fp, jint format) {
|
||||
imageClazz = (*env)->FindClass(env,
|
||||
"com/hippo/ehviewer/gallery/image/Image");
|
||||
constructor = (*env)->GetMethodID(env, imageClazz, "<init>",
|
||||
"(IIIIII)V");
|
||||
"(JIIIII)V");
|
||||
|
||||
if (constructor == 0) {
|
||||
PNG_Free((JNIEnv*)NULL, (int)png);
|
||||
PNG_Free((JNIEnv*)NULL, png);
|
||||
return NULL;
|
||||
} else {
|
||||
return (*env)->NewObject(env, imageClazz, constructor, (jint) png,
|
||||
return (*env)->NewObject(env, imageClazz, constructor, (jlong) (intptr_t) png,
|
||||
FILE_FORMAT_PNG, png->width, png->height, format,
|
||||
DEFAULT_TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
void PNG_Render(JNIEnv* env, int nativeImage, int format) {
|
||||
PNG* png = (PNG*) nativeImage;
|
||||
void PNG_Render(JNIEnv* env, PNG* png, int format) {
|
||||
if (format != png->format)
|
||||
return;
|
||||
|
||||
@@ -103,9 +102,8 @@ void PNG_Render(JNIEnv* env, int nativeImage, int format) {
|
||||
png->height, format, DEFAULT_TYPE, png->data);
|
||||
}
|
||||
|
||||
void PNG_Free(JNIEnv* env, int nativeImage) {
|
||||
void PNG_Free(JNIEnv* env, PNG* png) {
|
||||
|
||||
PNG* png = (PNG*) nativeImage;
|
||||
free(png->data);
|
||||
free(png);
|
||||
}
|
||||
@@ -14,7 +14,7 @@ typedef struct {
|
||||
|
||||
jobject PNG_DecodeStream(JNIEnv* env, jobject is, jint format);
|
||||
jobject PNG_DecodeFileHandler(JNIEnv* env, FILE* fp, jint format);
|
||||
void PNG_Render(JNIEnv* env, int nativeImage, int format);
|
||||
void PNG_Free(JNIEnv* env, int nativeImage);
|
||||
void PNG_Render(JNIEnv* env, PNG* png, int format);
|
||||
void PNG_Free(JNIEnv* env, PNG* png);
|
||||
|
||||
#endif /* PNG_H_ */
|
||||
@@ -18,3 +18,25 @@
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
-keep class com.hippo.**
|
||||
|
||||
-keep class com.hippo.ehviewer.gallery.image.Image {*;}
|
||||
|
||||
-keep class com.hippo.ehviewer.gallery.image.GifImage {*;}
|
||||
|
||||
-keepclassmembers public class * extends android.graphics.drawable.Drawable {
|
||||
void set*(***);
|
||||
*** get*();
|
||||
}
|
||||
|
||||
-keepclassmembers class com.hippo.ehviewer.drawable.MaterialProgressDrawable$Ring {
|
||||
void set*(***);
|
||||
*** get*();
|
||||
}
|
||||
|
||||
-keepclassmembers public class * extends com.hippo.ehviewer.windowsanimate.Sprite {
|
||||
void set*(***);
|
||||
*** get*();
|
||||
}
|
||||
@@ -8,9 +8,9 @@
|
||||
# project structure.
|
||||
#
|
||||
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
|
||||
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
|
||||
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
|
||||
|
||||
# Project target.
|
||||
target=android-19
|
||||
target=android-21
|
||||
android.library.reference.1=../../code/FloatingActionButton/FloatingActionButton
|
||||
android.library.reference.2=../../code/SlidingMenu/library
|
||||
android.library.reference.2=../../code/material-menu/library/src/main
|
||||
|
After Width: | Height: | Size: 270 B |
|
After Width: | Height: | Size: 249 B |
|
Before Width: | Height: | Size: 433 B After Width: | Height: | Size: 354 B |
|
After Width: | Height: | Size: 250 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 189 B |
|
After Width: | Height: | Size: 199 B |
|
Before Width: | Height: | Size: 277 B After Width: | Height: | Size: 280 B |
|
After Width: | Height: | Size: 221 B |
|
After Width: | Height: | Size: 740 B |
|
Before Width: | Height: | Size: 919 B |
|
Before Width: | Height: | Size: 664 B |
|
After Width: | Height: | Size: 691 B |
|
After Width: | Height: | Size: 327 B |
|
After Width: | Height: | Size: 331 B |
|
Before Width: | Height: | Size: 536 B After Width: | Height: | Size: 534 B |
|
After Width: | Height: | Size: 365 B |
|
After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 556 B |
|
After Width: | Height: | Size: 513 B |
|
Before Width: | Height: | Size: 927 B After Width: | Height: | Size: 769 B |
|
After Width: | Height: | Size: 548 B |
|
After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
After Width: | Height: | Size: 2.1 KiB |
@@ -21,14 +21,14 @@
|
||||
|
||||
<ListView
|
||||
android:id="@+id/list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" >
|
||||
</ListView>
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/set_default"
|
||||
style="@style/DialogMessage"
|
||||
style="@style/Dialog.CheckBox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8.0dp"
|
||||
|
||||
@@ -51,8 +51,9 @@
|
||||
<TextView
|
||||
android:id="@+id/message"
|
||||
style="@style/DialogMessage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<!-- custom view add here -->
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
android:id="@+id/progress_percent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_below="@id/progress"
|
||||
android:layout_marginEnd="16dip"
|
||||
android:layout_marginStart="16dip"
|
||||
@@ -44,7 +44,7 @@
|
||||
android:id="@+id/progress_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_below="@id/progress"
|
||||
android:layout_marginEnd="16dip"
|
||||
android:layout_marginStart="16dip"
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2014 Hippo Seven
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/white"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/title_layout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="64dp"
|
||||
android:background="@android:color/holo_blue_dark"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="24dp"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textColor="@android:color/white"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/button_root"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -15,7 +15,7 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
|
||||
@@ -1,134 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2014 Hippo Seven
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@android:color/white"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/title_layout"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="64.0dp"
|
||||
android:background="@android:color/holo_blue_dark"
|
||||
android:orientation="horizontal" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title"
|
||||
android:layout_width="0.0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginLeft="24.0dp"
|
||||
android:layout_marginRight="24.0dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="start"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||
android:textColor="@color/primary_text_light"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/action"
|
||||
android:layout_width="48.0dp"
|
||||
android:layout_height="48.0dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginRight="8.0dp"
|
||||
android:background="@drawable/clickable_bg_blue"
|
||||
android:src="@drawable/ic_action_touch"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
<ScrollView
|
||||
android:id="@+id/scroll_view"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:fillViewport="true"
|
||||
android:visibility="gone" >
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="36dp"
|
||||
android:layout_marginLeft="12dp"
|
||||
android:layout_marginRight="12dp"
|
||||
android:layout_marginTop="36dp"
|
||||
android:textSize="18sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/custom"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/custom_no_scroll"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ListView
|
||||
android:id="@+id/list"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone" >
|
||||
</ListView>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<com.hippo.ehviewer.widget.AlertButton
|
||||
android:id="@+id/negative_button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:textColor="@color/primary_text_light"
|
||||
android:visibility="gone" />
|
||||
|
||||
<com.hippo.ehviewer.widget.AlertButton
|
||||
android:id="@+id/neutral_button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:textColor="@color/primary_text_light"
|
||||
android:visibility="gone" />
|
||||
|
||||
<com.hippo.ehviewer.widget.AlertButton
|
||||
android:id="@+id/positive_button"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:textColor="@color/primary_text_light"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2014 Hippo Seven
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message"
|
||||
style="@style/DialogMessage"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/checkbox"
|
||||
style="@style/Dialog.CheckBox"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -16,8 +16,8 @@
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:auto="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<com.hippo.ehviewer.widget.FileExplorerView
|
||||
|
||||
@@ -14,18 +14,23 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical" >
|
||||
|
||||
<com.hippo.ehviewer.widget.FitWindowView
|
||||
android:id="@+id/standard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<com.hippo.ehviewer.widget.ExpandingListView
|
||||
android:id="@+id/download"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:clipToPadding="false"
|
||||
android:divider="@android:color/transparent"
|
||||
android:dividerHeight="0dp" >
|
||||
</com.hippo.ehviewer.widget.ExpandingListView>
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
@@ -74,11 +74,12 @@
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginTop="10dp" />
|
||||
|
||||
<TableLayout
|
||||
<TableLayout
|
||||
android:id="@+id/buttons"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:layout_below="@id/thumb" >
|
||||
|
||||
<TableRow
|
||||
@@ -104,32 +105,6 @@
|
||||
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
android:id="@+id/delete1"
|
||||
style="@style/EmbedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:textColor="@color/warning_red"
|
||||
android:text="@string/delete" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/delete2"
|
||||
style="@style/EmbedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:textColor="@color/warning_red"
|
||||
android:text="@string/delete2" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
@@ -143,6 +118,16 @@
|
||||
android:layout_weight="1"
|
||||
android:text="@string/detail" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/delete"
|
||||
style="@style/EmbedButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:textColor="@color/warning_red"
|
||||
android:text="@string/delete" />
|
||||
|
||||
</TableRow>
|
||||
|
||||
</TableLayout>
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
|
||||
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" >
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<View
|
||||
android:layout_width="0dp"
|
||||
@@ -55,7 +55,7 @@
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
@@ -86,7 +86,7 @@
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
@@ -119,7 +119,7 @@
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
@@ -152,7 +152,7 @@
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
@@ -185,7 +185,7 @@
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
@@ -218,7 +218,7 @@
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
@@ -251,7 +251,7 @@
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
@@ -284,7 +284,7 @@
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
@@ -317,7 +317,7 @@
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
@@ -350,7 +350,7 @@
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
@@ -383,7 +383,7 @@
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
@@ -416,7 +416,7 @@
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
@@ -449,7 +449,7 @@
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
@@ -482,7 +482,7 @@
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
@@ -515,7 +515,7 @@
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
@@ -548,7 +548,7 @@
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -17,106 +17,98 @@
|
||||
|
||||
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent" >
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/tag_group_reclass"
|
||||
style="@style/DialogMessage"
|
||||
style="@style/Dialog.CheckBox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="reclass"
|
||||
android:button="@drawable/btn_check_dialog_material"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/tag_group_language"
|
||||
style="@style/DialogMessage"
|
||||
style="@style/Dialog.CheckBox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="language"
|
||||
android:button="@drawable/btn_check_dialog_material"
|
||||
tools:ignore="HardcodedText" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/tag_group_parody"
|
||||
style="@style/DialogMessage"
|
||||
style="@style/Dialog.CheckBox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="parody"
|
||||
android:button="@drawable/btn_check_dialog_material"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/tag_group_character"
|
||||
style="@style/DialogMessage"
|
||||
style="@style/Dialog.CheckBox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="character"
|
||||
android:button="@drawable/btn_check_dialog_material"
|
||||
tools:ignore="HardcodedText" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/tag_group_group"
|
||||
style="@style/DialogMessage"
|
||||
style="@style/Dialog.CheckBox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="group"
|
||||
android:button="@drawable/btn_check_dialog_material"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/tag_group_artist"
|
||||
style="@style/DialogMessage"
|
||||
style="@style/Dialog.CheckBox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="artist"
|
||||
android:button="@drawable/btn_check_dialog_material"
|
||||
tools:ignore="HardcodedText" />
|
||||
</TableRow>
|
||||
|
||||
<TableRow
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/tag_group_male"
|
||||
style="@style/DialogMessage"
|
||||
style="@style/Dialog.CheckBox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="male"
|
||||
android:button="@drawable/btn_check_dialog_material"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/tag_group_female"
|
||||
style="@style/DialogMessage"
|
||||
style="@style/Dialog.CheckBox"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="female"
|
||||
android:button="@drawable/btn_check_dialog_material"
|
||||
tools:ignore="HardcodedText" />
|
||||
</TableRow>
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
Copyright (C) 2014 Hippo Seven
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
<com.hippo.ehviewer.widget.SlidingDrawerLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/drawerlayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" >
|
||||
|
||||
<com.hippo.ehviewer.widget.FitWindowView
|
||||
android:id="@+id/standard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
<com.hippo.ehviewer.widget.GalleryListView
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/gallery_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:glvContent="listview" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<include layout="@layout/favorite_menu"/>
|
||||
|
||||
</com.hippo.ehviewer.widget.SlidingDrawerLayout>
|
||||
@@ -15,12 +15,12 @@
|
||||
limitations under the License.
|
||||
-->
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" >
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/card_view"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_marginLeft="8dp"
|
||||
|
||||