├── BUILDING.md ├── CMakeLists.txt ├── ChangeLog.md ├── LICENSE.md ├── README.ijg ├── README.md ├── cderror.h ├── cdjpeg.c ├── cdjpeg.h ├── change.log ├── cjpeg.1 ├── cjpeg.c ├── cmakescripts ├── BuildPackages.cmake ├── GNUInstallDirs.cmake ├── PackageInfo.cmake ├── cmake_uninstall.cmake.in ├── testclean.cmake └── tjbenchtest.cmake ├── cmyk.h ├── coderules.txt ├── croptest.in ├── djpeg.1 ├── djpeg.c ├── doc └── html │ ├── annotated.html │ ├── bc_s.png │ ├── bc_sd.png │ ├── classes.html │ ├── closed.png │ ├── doc.svg │ ├── docd.svg │ ├── doxygen-extra.css │ ├── doxygen.css │ ├── doxygen.svg │ ├── dynsections.js │ ├── folderclosed.svg │ ├── folderclosedd.svg │ ├── folderopen.svg │ ├── folderopend.svg │ ├── functions.html │ ├── functions_vars.html │ ├── group___turbo_j_p_e_g.html │ ├── index.html │ ├── jquery.js │ ├── menu.js │ ├── menudata.js │ ├── minus.svg │ ├── minusd.svg │ ├── nav_f.png │ ├── nav_fd.png │ ├── nav_g.png │ ├── nav_h.png │ ├── nav_hd.png │ ├── open.png │ ├── plus.svg │ ├── plusd.svg │ ├── search │ ├── all_0.js │ ├── all_1.js │ ├── all_2.js │ ├── all_3.js │ ├── all_4.js │ ├── all_5.js │ ├── all_6.js │ ├── all_7.js │ ├── all_8.js │ ├── all_9.js │ ├── all_a.js │ ├── all_b.js │ ├── classes_0.js │ ├── close.svg │ ├── enums_0.js │ ├── enumvalues_0.js │ ├── functions_0.js │ ├── groups_0.js │ ├── mag.svg │ ├── mag_d.svg │ ├── mag_sel.svg │ ├── mag_seld.svg │ ├── search.css │ ├── search.js │ ├── searchdata.js │ ├── typedefs_0.js │ ├── variables_0.js │ ├── variables_1.js │ ├── variables_2.js │ ├── variables_3.js │ ├── variables_4.js │ ├── variables_5.js │ ├── variables_6.js │ ├── variables_7.js │ ├── variables_8.js │ └── variables_9.js │ ├── splitbar.png │ ├── splitbard.png │ ├── structtjregion.html │ ├── structtjscalingfactor.html │ ├── structtjtransform.html │ ├── sync_off.png │ ├── sync_on.png │ ├── tab_a.png │ ├── tab_ad.png │ ├── tab_b.png │ ├── tab_bd.png │ ├── tab_h.png │ ├── tab_hd.png │ ├── tab_s.png │ ├── tab_sd.png │ ├── tabs.css │ └── topics.html ├── doxygen-extra.css ├── doxygen.config ├── example.c ├── fuzz ├── CMakeLists.txt ├── build.sh ├── cjpeg.cc ├── compress.cc ├── compress12.cc ├── compress12_lossless.cc ├── compress16_lossless.cc ├── compress_lossless.cc ├── compress_yuv.cc ├── decompress.cc ├── decompress_yuv.cc └── transform.cc ├── jaricom.c ├── java ├── CMakeLists.txt ├── MANIFEST.MF ├── README ├── TJBench.java ├── TJExample.java ├── TJUnitTest.java ├── doc │ ├── allclasses-index.html │ ├── allclasses.html │ ├── allpackages-index.html │ ├── constant-values.html │ ├── deprecated-list.html │ ├── element-list │ ├── help-doc.html │ ├── index-all.html │ ├── index.html │ ├── jquery-ui.overrides.css │ ├── jquery │ │ ├── external │ │ │ └── jquery │ │ │ │ └── jquery.js │ │ ├── jquery-3.6.1.min.js │ │ ├── jquery-ui.min.css │ │ ├── jquery-ui.min.js │ │ ├── jszip-utils │ │ │ └── dist │ │ │ │ ├── jszip-utils-ie.js │ │ │ │ ├── jszip-utils-ie.min.js │ │ │ │ ├── jszip-utils.js │ │ │ │ └── jszip-utils.min.js │ │ └── jszip │ │ │ └── dist │ │ │ ├── jszip.js │ │ │ └── jszip.min.js │ ├── legal │ │ ├── ADDITIONAL_LICENSE_INFO │ │ ├── ASSEMBLY_EXCEPTION │ │ ├── LICENSE │ │ ├── jquery.md │ │ ├── jqueryUI.md │ │ ├── jszip.md │ │ └── pako.md │ ├── member-search-index.js │ ├── member-search-index.zip │ ├── org │ │ └── libjpegturbo │ │ │ └── turbojpeg │ │ │ ├── TJ.html │ │ │ ├── TJCompressor.html │ │ │ ├── TJCustomFilter.html │ │ │ ├── TJDecompressor.html │ │ │ ├── TJException.html │ │ │ ├── TJScalingFactor.html │ │ │ ├── TJTransform.html │ │ │ ├── TJTransformer.html │ │ │ ├── YUVImage.html │ │ │ ├── package-summary.html │ │ │ └── package-tree.html │ ├── overview-tree.html │ ├── package-search-index.js │ ├── package-search-index.zip │ ├── resources │ │ ├── glass.png │ │ └── x.png │ ├── script.js │ ├── search.js │ ├── serialized-form.html │ ├── stylesheet.css │ ├── type-search-index.js │ └── type-search-index.zip ├── org │ └── libjpegturbo │ │ └── turbojpeg │ │ ├── TJ.java │ │ ├── TJCompressor.java │ │ ├── TJCustomFilter.java │ │ ├── TJDecompressor.java │ │ ├── TJException.java │ │ ├── TJLoader-unix.java.in │ │ ├── TJLoader-win.java.in │ │ ├── TJScalingFactor.java │ │ ├── TJTransform.java │ │ ├── TJTransformer.java │ │ └── YUVImage.java ├── org_libjpegturbo_turbojpeg_TJ.h ├── org_libjpegturbo_turbojpeg_TJCompressor.h ├── org_libjpegturbo_turbojpeg_TJDecompressor.h └── org_libjpegturbo_turbojpeg_TJTransformer.h ├── jcapimin.c ├── jcapistd.c ├── jcarith.c ├── jccoefct.c ├── jccolext.c ├── jccolor.c ├── jcdctmgr.c ├── jcdiffct.c ├── jchuff.c ├── jchuff.h ├── jcicc.c ├── jcinit.c ├── jclhuff.c ├── jclossls.c ├── jcmainct.c ├── jcmarker.c ├── jcmaster.c ├── jcmaster.h ├── jcomapi.c ├── jconfig.h.in ├── jconfig.txt ├── jconfigint.h.in ├── jcparam.c ├── jcphuff.c ├── jcprepct.c ├── jcsample.c ├── jcstest.c ├── jctrans.c ├── jdapimin.c ├── jdapistd.c ├── jdarith.c ├── jdatadst-tj.c ├── jdatadst.c ├── jdatasrc-tj.c ├── jdatasrc.c ├── jdcoefct.c ├── jdcoefct.h ├── jdcol565.c ├── jdcolext.c ├── jdcolor.c ├── jdct.h ├── jddctmgr.c ├── jddiffct.c ├── jdhuff.c ├── jdhuff.h ├── jdicc.c ├── jdinput.c ├── jdlhuff.c ├── jdlossls.c ├── jdmainct.c ├── jdmainct.h ├── jdmarker.c ├── jdmaster.c ├── jdmaster.h ├── jdmerge.c ├── jdmerge.h ├── jdmrg565.c ├── jdmrgext.c ├── jdphuff.c ├── jdpostct.c ├── jdsample.c ├── jdsample.h ├── jdtrans.c ├── jerror.c ├── jerror.h ├── jfdctflt.c ├── jfdctfst.c ├── jfdctint.c ├── jidctflt.c ├── jidctfst.c ├── jidctint.c ├── jidctred.c ├── jinclude.h ├── jlossls.h ├── jmemmgr.c ├── jmemnobs.c ├── jmemsys.h ├── jmorecfg.h ├── jpeg_nbits.c ├── jpeg_nbits.h ├── jpegapicomp.h ├── jpegint.h ├── jpeglib.h ├── jpegtran.1 ├── jpegtran.c ├── jquant1.c ├── jquant2.c ├── jsamplecomp.h ├── jsimd.h ├── jsimddct.h ├── jstdhuff.c ├── jutils.c ├── jversion.h.in ├── libjpeg.map.in ├── libjpeg.txt ├── md5 ├── CMakeLists.txt ├── md5.c ├── md5.h ├── md5cmp.c └── md5hl.c ├── rdbmp.c ├── rdcolmap.c ├── rdgif.c ├── rdjpgcom.1 ├── rdjpgcom.c ├── rdppm.c ├── rdswitch.c ├── rdtarga.c ├── release ├── Config.cmake.in ├── Distribution.xml.in ├── License.rtf ├── ReadMe.txt ├── Welcome.rtf.in ├── deb-control.in ├── installer.nsi.in ├── libjpeg.pc.in ├── libturbojpeg.pc.in ├── makedpkg.in ├── makemacpkg.in ├── makerpm.in ├── makesrpm.in ├── maketarball.in ├── rpm.spec.in └── uninstall.in ├── sharedlib └── CMakeLists.txt ├── simd ├── CMakeLists.txt ├── arm │ ├── aarch32 │ │ ├── jccolext-neon.c │ │ ├── jchuff-neon.c │ │ ├── jsimd.c │ │ └── jsimd_neon.S │ ├── aarch64 │ │ ├── jccolext-neon.c │ │ ├── jchuff-neon.c │ │ ├── jsimd.c │ │ └── jsimd_neon.S │ ├── align.h │ ├── jccolor-neon.c │ ├── jcgray-neon.c │ ├── jcgryext-neon.c │ ├── jchuff.h │ ├── jcphuff-neon.c │ ├── jcsample-neon.c │ ├── jdcolext-neon.c │ ├── jdcolor-neon.c │ ├── jdmerge-neon.c │ ├── jdmrgext-neon.c │ ├── jdsample-neon.c │ ├── jfdctfst-neon.c │ ├── jfdctint-neon.c │ ├── jidctfst-neon.c │ ├── jidctint-neon.c │ ├── jidctred-neon.c │ ├── jquanti-neon.c │ └── neon-compat.h.in ├── i386 │ ├── jccolext-avx2.asm │ ├── jccolext-mmx.asm │ ├── jccolext-sse2.asm │ ├── jccolor-avx2.asm │ ├── jccolor-mmx.asm │ ├── jccolor-sse2.asm │ ├── jcgray-avx2.asm │ ├── jcgray-mmx.asm │ ├── jcgray-sse2.asm │ ├── jcgryext-avx2.asm │ ├── jcgryext-mmx.asm │ ├── jcgryext-sse2.asm │ ├── jchuff-sse2.asm │ ├── jcphuff-sse2.asm │ ├── jcsample-avx2.asm │ ├── jcsample-mmx.asm │ ├── jcsample-sse2.asm │ ├── jdcolext-avx2.asm │ ├── jdcolext-mmx.asm │ ├── jdcolext-sse2.asm │ ├── jdcolor-avx2.asm │ ├── jdcolor-mmx.asm │ ├── jdcolor-sse2.asm │ ├── jdmerge-avx2.asm │ ├── jdmerge-mmx.asm │ ├── jdmerge-sse2.asm │ ├── jdmrgext-avx2.asm │ ├── jdmrgext-mmx.asm │ ├── jdmrgext-sse2.asm │ ├── jdsample-avx2.asm │ ├── jdsample-mmx.asm │ ├── jdsample-sse2.asm │ ├── jfdctflt-3dn.asm │ ├── jfdctflt-sse.asm │ ├── jfdctfst-mmx.asm │ ├── jfdctfst-sse2.asm │ ├── jfdctint-avx2.asm │ ├── jfdctint-mmx.asm │ ├── jfdctint-sse2.asm │ ├── jidctflt-3dn.asm │ ├── jidctflt-sse.asm │ ├── jidctflt-sse2.asm │ ├── jidctfst-mmx.asm │ ├── jidctfst-sse2.asm │ ├── jidctint-avx2.asm │ ├── jidctint-mmx.asm │ ├── jidctint-sse2.asm │ ├── jidctred-mmx.asm │ ├── jidctred-sse2.asm │ ├── jquant-3dn.asm │ ├── jquant-mmx.asm │ ├── jquant-sse.asm │ ├── jquantf-sse2.asm │ ├── jquanti-avx2.asm │ ├── jquanti-sse2.asm │ ├── jsimd.c │ └── jsimdcpu.asm ├── jsimd.h ├── mips │ ├── jsimd.c │ ├── jsimd_dspr2.S │ └── jsimd_dspr2_asm.h ├── mips64 │ ├── jccolext-mmi.c │ ├── jccolor-mmi.c │ ├── jcgray-mmi.c │ ├── jcgryext-mmi.c │ ├── jcsample-mmi.c │ ├── jcsample.h │ ├── jdcolext-mmi.c │ ├── jdcolor-mmi.c │ ├── jdmerge-mmi.c │ ├── jdmrgext-mmi.c │ ├── jdsample-mmi.c │ ├── jfdctfst-mmi.c │ ├── jfdctint-mmi.c │ ├── jidctfst-mmi.c │ ├── jidctint-mmi.c │ ├── jquanti-mmi.c │ ├── jsimd.c │ ├── jsimd_mmi.h │ └── loongson-mmintrin.h ├── nasm │ ├── jcolsamp.inc │ ├── jdct.inc │ ├── jsimdcfg.inc │ ├── jsimdcfg.inc.h │ └── jsimdext.inc ├── powerpc │ ├── jccolext-altivec.c │ ├── jccolor-altivec.c │ ├── jcgray-altivec.c │ ├── jcgryext-altivec.c │ ├── jcsample-altivec.c │ ├── jcsample.h │ ├── jdcolext-altivec.c │ ├── jdcolor-altivec.c │ ├── jdmerge-altivec.c │ ├── jdmrgext-altivec.c │ ├── jdsample-altivec.c │ ├── jfdctfst-altivec.c │ ├── jfdctint-altivec.c │ ├── jidctfst-altivec.c │ ├── jidctint-altivec.c │ ├── jquanti-altivec.c │ ├── jsimd.c │ └── jsimd_altivec.h └── x86_64 │ ├── jccolext-avx2.asm │ ├── jccolext-sse2.asm │ ├── jccolor-avx2.asm │ ├── jccolor-sse2.asm │ ├── jcgray-avx2.asm │ ├── jcgray-sse2.asm │ ├── jcgryext-avx2.asm │ ├── jcgryext-sse2.asm │ ├── jchuff-sse2.asm │ ├── jcphuff-sse2.asm │ ├── jcsample-avx2.asm │ ├── jcsample-sse2.asm │ ├── jdcolext-avx2.asm │ ├── jdcolext-sse2.asm │ ├── jdcolor-avx2.asm │ ├── jdcolor-sse2.asm │ ├── jdmerge-avx2.asm │ ├── jdmerge-sse2.asm │ ├── jdmrgext-avx2.asm │ ├── jdmrgext-sse2.asm │ ├── jdsample-avx2.asm │ ├── jdsample-sse2.asm │ ├── jfdctflt-sse.asm │ ├── jfdctfst-sse2.asm │ ├── jfdctint-avx2.asm │ ├── jfdctint-sse2.asm │ ├── jidctflt-sse2.asm │ ├── jidctfst-sse2.asm │ ├── jidctint-avx2.asm │ ├── jidctint-sse2.asm │ ├── jidctred-sse2.asm │ ├── jquantf-sse2.asm │ ├── jquanti-avx2.asm │ ├── jquanti-sse2.asm │ ├── jsimd.c │ └── jsimdcpu.asm ├── strtest.c ├── structure.txt ├── testimages ├── big_building16.ppm ├── big_tree8.bmp ├── big_tree8.txt ├── test.scan ├── test1.icc ├── test1.icc.txt ├── test2.icc ├── test2.icc.txt ├── testimgari.jpg ├── testimgint.jpg ├── testorig.jpg ├── testorig.ppm ├── testorig12.jpg ├── vgl_5674_0098.bmp ├── vgl_6434_0018a.bmp └── vgl_6548_0026a.bmp ├── tjbench.c ├── tjbenchtest.in ├── tjexample.c ├── tjexampletest.in ├── tjunittest.c ├── tjutil.c ├── tjutil.h ├── transupp.c ├── transupp.h ├── turbojpeg-jni.c ├── turbojpeg-mapfile ├── turbojpeg-mapfile.jni ├── turbojpeg-mp.c ├── turbojpeg.c ├── turbojpeg.h ├── usage.txt ├── win ├── gcc │ └── projectTargets-release.cmake.in ├── jpeg.rc.in ├── jpeg62.def ├── jpeg7.def ├── jpeg8.def ├── projectTargets.cmake.in ├── turbojpeg.rc.in └── vc │ └── projectTargets-release.cmake.in ├── wizard.txt ├── wrbmp.c ├── wrgif.c ├── wrjpgcom.1 ├── wrjpgcom.c ├── wrppm.c └── wrtarga.c /cmakescripts/PackageInfo.cmake: -------------------------------------------------------------------------------- 1 | # This file is included from the top-level CMakeLists.txt. We just store it 2 | # here to avoid cluttering up that file. 3 | 4 | set(PKGNAME ${CMAKE_PROJECT_NAME} CACHE STRING 5 | "Distribution package name (default: ${CMAKE_PROJECT_NAME})") 6 | set(PKGVENDOR "The ${CMAKE_PROJECT_NAME} Project" CACHE STRING 7 | "Vendor name to be included in distribution package descriptions (default: The ${CMAKE_PROJECT_NAME} Project)") 8 | set(PKGURL "http://www.${CMAKE_PROJECT_NAME}.org" CACHE STRING 9 | "URL of project web site to be included in distribution package descriptions (default: http://www.${CMAKE_PROJECT_NAME}.org)") 10 | set(PKGEMAIL "information@${CMAKE_PROJECT_NAME}.org" CACHE STRING 11 | "E-mail of project maintainer to be included in distribution package descriptions (default: information@${CMAKE_PROJECT_NAME}.org") 12 | set(PKGID "com.${CMAKE_PROJECT_NAME}.${PKGNAME}" CACHE STRING 13 | "Globally unique package identifier (reverse DNS notation) (default: com.${CMAKE_PROJECT_NAME}.${PKGNAME})") 14 | -------------------------------------------------------------------------------- /cmakescripts/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | # This code is from the CMake FAQ 2 | 3 | if (NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") 4 | message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_BINARY_DIR@/install_manifest.txt\"") 5 | endif(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") 6 | 7 | file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) 8 | string(REGEX REPLACE "\n" ";" files "${files}") 9 | list(REVERSE files) 10 | foreach (file ${files}) 11 | message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"") 12 | if (EXISTS "$ENV{DESTDIR}${file}") 13 | execute_process( 14 | COMMAND "@CMAKE_COMMAND@" -E remove "$ENV{DESTDIR}${file}" 15 | OUTPUT_VARIABLE rm_out 16 | RESULT_VARIABLE rm_retval 17 | ) 18 | if(NOT ${rm_retval} EQUAL 0) 19 | message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"") 20 | endif (NOT ${rm_retval} EQUAL 0) 21 | else (EXISTS "$ENV{DESTDIR}${file}") 22 | message(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") 23 | endif (EXISTS "$ENV{DESTDIR}${file}") 24 | endforeach(file) 25 | -------------------------------------------------------------------------------- /cmakescripts/testclean.cmake: -------------------------------------------------------------------------------- 1 | file(GLOB FILES 2 | testout* 3 | *_GRAY_*.bmp 4 | *_GRAY_*.png 5 | *_GRAY_*.ppm 6 | *_GRAY_*.jpg 7 | *_GRAY.yuv 8 | *_420_*.bmp 9 | *_420_*.png 10 | *_420_*.ppm 11 | *_420_*.jpg 12 | *_420.yuv 13 | *_422_*.bmp 14 | *_422_*.png 15 | *_422_*.ppm 16 | *_422_*.jpg 17 | *_422.yuv 18 | *_444_*.bmp 19 | *_444_*.png 20 | *_444_*.ppm 21 | *_444_*.jpg 22 | *_444.yuv 23 | *_440_*.bmp 24 | *_440_*.png 25 | *_440_*.ppm 26 | *_440_*.jpg 27 | *_440.yuv 28 | *_411_*.bmp 29 | *_411_*.png 30 | *_411_*.ppm 31 | *_411_*.jpg 32 | *_411.yuv 33 | *_441_*.bmp 34 | *_441_*.png 35 | *_441_*.ppm 36 | *_441_*.jpg 37 | *_441.yuv 38 | *_LOSSL*S_*.bmp 39 | *_LOSSL*S_*.ppm 40 | *_LOSSL*S_*.jpg 41 | tjbenchtest*.log 42 | tjexampletest*.log) 43 | 44 | if(NOT FILES STREQUAL "") 45 | message(STATUS "Removing test files") 46 | file(REMOVE ${FILES}) 47 | else() 48 | message(STATUS "No files to remove") 49 | endif() 50 | -------------------------------------------------------------------------------- /cmakescripts/tjbenchtest.cmake: -------------------------------------------------------------------------------- 1 | if(NOT DEFINED PRECISION) 2 | message(FATAL_ERROR "PRECISION must be specified") 3 | endif() 4 | 5 | if(NOT DEFINED WITH_JAVA) 6 | message(FATAL_ERROR "WITH_JAVA must be specified") 7 | endif() 8 | 9 | macro(check_error program) 10 | if(NOT RESULT EQUAL 0) 11 | message(FATAL_ERROR "${program} failed.") 12 | endif() 13 | endmacro() 14 | 15 | macro(run_test PROG ARGS) 16 | string(REPLACE ";" " " SPACED_ARGS "${ARGS}") 17 | message(STATUS "${PROG} ${SPACED_ARGS}") 18 | execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/${PROG} ${ARGS} 19 | RESULT_VARIABLE RESULT) 20 | check_error("${PROG} ${SPACED_ARGS}") 21 | endmacro() 22 | 23 | if(NOT PRECISION EQUAL 16) 24 | run_test(tjbenchtest "-precision;${PRECISION}") 25 | run_test(tjbenchtest "-precision;${PRECISION};-alloc") 26 | endif() 27 | if(PRECISION EQUAL 8) 28 | run_test(tjbenchtest "-precision;${PRECISION};-yuv") 29 | run_test(tjbenchtest "-precision;${PRECISION};-yuv;-alloc") 30 | run_test(tjbenchtest "-precision;${PRECISION};-optimize") 31 | run_test(tjbenchtest "-precision;${PRECISION};-optimize;-yuv") 32 | endif() 33 | if(NOT PRECISION EQUAL 16) 34 | run_test(tjbenchtest "-precision;${PRECISION};-progressive") 35 | endif() 36 | if(PRECISION EQUAL 8) 37 | run_test(tjbenchtest "-precision;${PRECISION};-progressive;-yuv") 38 | endif() 39 | if(NOT PRECISION EQUAL 16) 40 | run_test(tjbenchtest "-precision;${PRECISION};-arithmetic") 41 | run_test(tjbenchtest "-precision;${PRECISION};-progressive;-arithmetic") 42 | endif() 43 | if(PRECISION EQUAL 8) 44 | run_test(tjbenchtest "-precision;${PRECISION};-arithmetic;-yuv") 45 | endif() 46 | run_test(tjbenchtest "-precision;${PRECISION};-lossless") 47 | run_test(tjbenchtest "-precision;${PRECISION};-lossless;-alloc") 48 | if(PRECISION EQUAL 8) 49 | run_test(tjexampletest "") 50 | endif() 51 | if(WITH_JAVA) 52 | if(NOT PRECISION EQUAL 16) 53 | run_test(tjbenchtest "-java;-precision;${PRECISION}") 54 | endif() 55 | if(PRECISION EQUAL 8) 56 | run_test(tjbenchtest "-java;-precision;${PRECISION};-yuv") 57 | run_test(tjbenchtest "-java;-precision;${PRECISION};-optimize") 58 | run_test(tjbenchtest "-java;-precision;${PRECISION};-optimize;-yuv") 59 | endif() 60 | if(NOT PRECISION EQUAL 16) 61 | run_test(tjbenchtest "-java;-precision;${PRECISION};-progressive") 62 | endif() 63 | if(PRECISION EQUAL 8) 64 | run_test(tjbenchtest "-java;-precision;${PRECISION};-progressive;-yuv") 65 | endif() 66 | if(NOT PRECISION EQUAL 16) 67 | run_test(tjbenchtest "-java;-precision;${PRECISION};-arithmetic") 68 | run_test(tjbenchtest "-java;-precision;${PRECISION};-progressive;-arithmetic") 69 | endif() 70 | if(PRECISION EQUAL 8) 71 | run_test(tjbenchtest "-java;-precision;${PRECISION};-arithmetic;-yuv") 72 | endif() 73 | run_test(tjbenchtest "-java;-precision;${PRECISION};-lossless") 74 | if(PRECISION EQUAL 8) 75 | run_test(tjexampletest "-java") 76 | endif() 77 | endif() 78 | -------------------------------------------------------------------------------- /cmyk.h: -------------------------------------------------------------------------------- 1 | /* 2 | * cmyk.h 3 | * 4 | * Copyright (C) 2017-2018, 2022, D. R. Commander. 5 | * For conditions of distribution and use, see the accompanying README.ijg 6 | * file. 7 | * 8 | * This file contains convenience functions for performing quick & dirty 9 | * CMYK<->RGB conversion. This algorithm is suitable for testing purposes 10 | * only. Properly converting between CMYK and RGB requires a color management 11 | * system. 12 | */ 13 | 14 | #ifndef CMYK_H 15 | #define CMYK_H 16 | 17 | #include 18 | #define JPEG_INTERNALS 19 | #include 20 | #include "jsamplecomp.h" 21 | 22 | 23 | /* Fully reversible */ 24 | 25 | INLINE 26 | LOCAL(void) 27 | rgb_to_cmyk(_JSAMPLE r, _JSAMPLE g, _JSAMPLE b, 28 | _JSAMPLE *c, _JSAMPLE *m, _JSAMPLE *y, _JSAMPLE *k) 29 | { 30 | double ctmp = 1.0 - ((double)r / (double)_MAXJSAMPLE); 31 | double mtmp = 1.0 - ((double)g / (double)_MAXJSAMPLE); 32 | double ytmp = 1.0 - ((double)b / (double)_MAXJSAMPLE); 33 | double ktmp = MIN(MIN(ctmp, mtmp), ytmp); 34 | 35 | if (ktmp == 1.0) ctmp = mtmp = ytmp = 0.0; 36 | else { 37 | ctmp = (ctmp - ktmp) / (1.0 - ktmp); 38 | mtmp = (mtmp - ktmp) / (1.0 - ktmp); 39 | ytmp = (ytmp - ktmp) / (1.0 - ktmp); 40 | } 41 | *c = (_JSAMPLE)((double)_MAXJSAMPLE - ctmp * (double)_MAXJSAMPLE + 0.5); 42 | *m = (_JSAMPLE)((double)_MAXJSAMPLE - mtmp * (double)_MAXJSAMPLE + 0.5); 43 | *y = (_JSAMPLE)((double)_MAXJSAMPLE - ytmp * (double)_MAXJSAMPLE + 0.5); 44 | *k = (_JSAMPLE)((double)_MAXJSAMPLE - ktmp * (double)_MAXJSAMPLE + 0.5); 45 | } 46 | 47 | 48 | /* Fully reversible only for C/M/Y/K values generated with rgb_to_cmyk() */ 49 | 50 | INLINE 51 | LOCAL(void) 52 | cmyk_to_rgb(_JSAMPLE c, _JSAMPLE m, _JSAMPLE y, _JSAMPLE k, 53 | _JSAMPLE *r, _JSAMPLE *g, _JSAMPLE *b) 54 | { 55 | *r = (_JSAMPLE)((double)c * (double)k / (double)_MAXJSAMPLE + 0.5); 56 | *g = (_JSAMPLE)((double)m * (double)k / (double)_MAXJSAMPLE + 0.5); 57 | *b = (_JSAMPLE)((double)y * (double)k / (double)_MAXJSAMPLE + 0.5); 58 | } 59 | 60 | 61 | #endif /* CMYK_H */ 62 | -------------------------------------------------------------------------------- /coderules.txt: -------------------------------------------------------------------------------- 1 | IJG JPEG LIBRARY: CODING RULES 2 | 3 | This file was part of the Independent JPEG Group's software: 4 | Copyright (C) 1991-1996, Thomas G. Lane. 5 | It was modified by The libjpeg-turbo Project to include only information 6 | relevant to libjpeg-turbo. 7 | For conditions of distribution and use, see the accompanying README.ijg file. 8 | 9 | 10 | Since numerous people will be contributing code and bug fixes, it's important 11 | to establish a common coding style. The goal of using similar coding styles 12 | is much more important than the details of just what that style is. 13 | 14 | In general we follow the recommendations of "Recommended C Style and Coding 15 | Standards" revision 6.1 (Cannon et al. as modified by Spencer, Keppel and 16 | Brader). This document is available in the IJG FTP archive (see 17 | jpeg/doc/cstyle.ms.tbl.Z, or cstyle.txt.Z for those without nroff/tbl). 18 | 19 | Block comments should be laid out thusly: 20 | 21 | /* 22 | * Block comments in this style. 23 | */ 24 | 25 | We indent statements in K&R style, e.g., 26 | if (test) { 27 | then-part; 28 | } else { 29 | else-part; 30 | } 31 | with two spaces per indentation level. (This indentation convention is 32 | handled automatically by GNU Emacs and many other text editors.) 33 | 34 | Multi-word names should be written in lower case with underscores, e.g., 35 | multi_word_name (not multiWordName). Preprocessor symbols and enum constants 36 | are similar but upper case (MULTI_WORD_NAME). Names should be unique within 37 | the first fifteen characters. 38 | 39 | Note that each function definition must begin with GLOBAL(type), LOCAL(type), 40 | or METHODDEF(type). These macros expand to "static type" or just "type" as 41 | appropriate. They provide a readable indication of the routine's usage and 42 | can readily be changed for special needs. (For instance, special linkage 43 | keywords can be inserted for use in Windows DLLs.) 44 | 45 | A similar solution is used for external function declarations (see the EXTERN 46 | macro.) 47 | 48 | 49 | The JPEG library is intended to be used within larger programs. Furthermore, 50 | we want it to be reentrant so that it can be used by applications that process 51 | multiple images concurrently. The following rules support these requirements: 52 | 53 | 1. Avoid direct use of file I/O, "malloc", error report printouts, etc; 54 | pass these through the common routines provided. 55 | 56 | 2. Minimize global namespace pollution. Functions should be declared static 57 | wherever possible. (Note that our method-based calling conventions help this 58 | a lot: in many modules only the initialization function will ever need to be 59 | called directly, so only that function need be externally visible.) All 60 | global function names should begin with "jpeg_". 61 | 62 | 3. Don't use global variables; anything that must be used in another module 63 | should be in the common data structures. 64 | 65 | 4. Don't use static variables except for read-only constant tables. Variables 66 | that should be private to a module can be placed into private structures (see 67 | the system architecture document, structure.txt). 68 | 69 | 5. Source file names should begin with "j" for files that are part of the 70 | library proper; source files that are not part of the library, such as cjpeg.c 71 | and djpeg.c, do not begin with "j". Keep compression and decompression code in 72 | separate source files --- some applications may want only one half of the 73 | library. 74 | 75 | Note: these rules (particularly #4) are not followed religiously in the 76 | modules that are used in cjpeg/djpeg but are not part of the JPEG library 77 | proper. Those modules are not really intended to be used in other 78 | applications. 79 | -------------------------------------------------------------------------------- /croptest.in: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -u 4 | set -e 5 | trap onexit INT 6 | trap onexit TERM 7 | trap onexit EXIT 8 | 9 | onexit() 10 | { 11 | if [ -d $OUTDIR ]; then 12 | rm -rf $OUTDIR 13 | fi 14 | } 15 | 16 | runme() 17 | { 18 | echo \*\*\* $* 19 | $* 20 | } 21 | 22 | IMAGE=vgl_6548_0026a.bmp 23 | WIDTH=128 24 | HEIGHT=95 25 | IMGDIR=@CMAKE_CURRENT_SOURCE_DIR@/testimages 26 | OUTDIR=`mktemp -d /tmp/__croptest_output.XXXXXX` 27 | EXEDIR=@CMAKE_CURRENT_BINARY_DIR@ 28 | 29 | if [ -d $OUTDIR ]; then 30 | rm -rf $OUTDIR 31 | fi 32 | mkdir -p $OUTDIR 33 | 34 | exec >$EXEDIR/croptest.log 35 | 36 | echo "============================================================" 37 | echo "$IMAGE ($WIDTH x $HEIGHT)" 38 | echo "============================================================" 39 | echo 40 | 41 | for PROGARG in "" -progressive; do 42 | 43 | cp $IMGDIR/$IMAGE $OUTDIR 44 | basename=`basename $IMAGE .bmp` 45 | echo "------------------------------------------------------------" 46 | echo "Generating test images" 47 | echo "------------------------------------------------------------" 48 | echo 49 | runme $EXEDIR/cjpeg $PROGARG -grayscale -outfile $OUTDIR/${basename}_GRAY.jpg $IMGDIR/${basename}.bmp 50 | runme $EXEDIR/cjpeg $PROGARG -sample 2x2 -outfile $OUTDIR/${basename}_420.jpg $IMGDIR/${basename}.bmp 51 | runme $EXEDIR/cjpeg $PROGARG -sample 2x1 -outfile $OUTDIR/${basename}_422.jpg $IMGDIR/${basename}.bmp 52 | runme $EXEDIR/cjpeg $PROGARG -sample 1x2 -outfile $OUTDIR/${basename}_440.jpg $IMGDIR/${basename}.bmp 53 | runme $EXEDIR/cjpeg $PROGARG -sample 1x1 -outfile $OUTDIR/${basename}_444.jpg $IMGDIR/${basename}.bmp 54 | echo 55 | 56 | for NSARG in "" -nosmooth; do 57 | 58 | for COLORSARG in "" "-colors 256 -dither none -onepass"; do 59 | 60 | for Y in {0..16}; do 61 | 62 | for H in {1..16}; do 63 | 64 | X=$(( (Y*16)%128 )) 65 | W=$(( WIDTH-X-7 )) 66 | if [ $Y -le 15 ]; then 67 | CROPSPEC="${W}x${H}+${X}+${Y}" 68 | else 69 | Y2=$(( HEIGHT-H )); 70 | CROPSPEC="${W}x${H}+${X}+${Y2}" 71 | fi 72 | 73 | echo "------------------------------------------------------------" 74 | echo $PROGARG $NSARG $COLORSARG -crop $CROPSPEC 75 | echo "------------------------------------------------------------" 76 | echo 77 | for samp in GRAY 420 422 440 444; do 78 | $EXEDIR/djpeg $NSARG $COLORSARG -rgb -outfile $OUTDIR/${basename}_${samp}_full.ppm $OUTDIR/${basename}_${samp}.jpg 79 | convert -crop $CROPSPEC $OUTDIR/${basename}_${samp}_full.ppm $OUTDIR/${basename}_${samp}_ref.ppm 80 | runme $EXEDIR/djpeg $NSARG $COLORSARG -crop $CROPSPEC -rgb -outfile $OUTDIR/${basename}_${samp}.ppm $OUTDIR/${basename}_${samp}.jpg 81 | runme cmp $OUTDIR/${basename}_${samp}.ppm $OUTDIR/${basename}_${samp}_ref.ppm 82 | done 83 | echo 84 | 85 | done 86 | 87 | done 88 | 89 | done 90 | 91 | done 92 | 93 | done 94 | 95 | echo SUCCESS! 96 | -------------------------------------------------------------------------------- /doc/html/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/doc/html/bc_s.png -------------------------------------------------------------------------------- /doc/html/bc_sd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/doc/html/bc_sd.png -------------------------------------------------------------------------------- /doc/html/classes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | TurboJPEG: Data Structure Index 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | 28 | 29 | 30 |
25 |
TurboJPEG 3.0.1 26 |
27 |
31 |
32 | 33 | 34 | 39 | 40 | 41 | 49 | 50 |
51 | 52 |
56 |
57 | 58 | 59 |
60 |
61 |
62 |
63 |
64 |
Loading...
65 |
Searching...
66 |
No Matches
67 |
68 |
69 |
70 |
71 | 72 |
73 |
Data Structure Index
74 |
75 |
76 | 77 | 82 |
83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /doc/html/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/doc/html/closed.png -------------------------------------------------------------------------------- /doc/html/doc.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /doc/html/docd.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /doc/html/doxygen-extra.css: -------------------------------------------------------------------------------- 1 | code { 2 | color: #4665A2; 3 | } 4 | 5 | th.markdownTableHeadNone { 6 | color: black; 7 | } 8 | -------------------------------------------------------------------------------- /doc/html/folderclosed.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /doc/html/folderclosedd.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /doc/html/folderopen.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | 11 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /doc/html/folderopend.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /doc/html/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | TurboJPEG: Main Page 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | 28 | 29 | 30 |
25 |
TurboJPEG 3.0.1 26 |
27 |
31 |
32 | 33 | 34 | 39 | 40 | 41 | 49 | 50 |
51 | 52 |
56 |
57 | 58 | 59 |
60 |
61 |
62 |
63 |
64 |
Loading...
65 |
Searching...
66 |
No Matches
67 |
68 |
69 |
70 |
71 | 72 |
73 |
TurboJPEG Documentation
74 |
75 |
76 |
77 | 78 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /doc/html/menudata.js: -------------------------------------------------------------------------------- 1 | /* 2 | @licstart The following is the entire license notice for the JavaScript code in this file. 3 | 4 | The MIT License (MIT) 5 | 6 | Copyright (C) 1997-2020 by Dimitri van Heesch 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 9 | and associated documentation files (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 11 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all copies or 15 | substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 18 | BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 20 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | @licend The above is the entire license notice for the JavaScript code in this file 24 | */ 25 | var menudata={children:[ 26 | {text:"Main Page",url:"index.html"}, 27 | {text:"Topics",url:"topics.html"}, 28 | {text:"Data Structures",url:"annotated.html",children:[ 29 | {text:"Data Structures",url:"annotated.html"}, 30 | {text:"Data Structure Index",url:"classes.html"}, 31 | {text:"Data Fields",url:"functions.html",children:[ 32 | {text:"All",url:"functions.html"}, 33 | {text:"Variables",url:"functions_vars.html"}]}]}]} 34 | -------------------------------------------------------------------------------- /doc/html/minus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /doc/html/minusd.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /doc/html/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/doc/html/nav_f.png -------------------------------------------------------------------------------- /doc/html/nav_fd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/doc/html/nav_fd.png -------------------------------------------------------------------------------- /doc/html/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/doc/html/nav_g.png -------------------------------------------------------------------------------- /doc/html/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/doc/html/nav_h.png -------------------------------------------------------------------------------- /doc/html/nav_hd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/doc/html/nav_hd.png -------------------------------------------------------------------------------- /doc/html/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/doc/html/open.png -------------------------------------------------------------------------------- /doc/html/plus.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /doc/html/plusd.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /doc/html/search/all_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['customfilter_0',['customFilter',['../structtjtransform.html#a0dc7697d59a7abe48afc629e96cbc1d2',1,'tjtransform']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/all_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['data_0',['data',['../structtjtransform.html#a688fe8f1a8ecc12a538d9e561cf338e3',1,'tjtransform']]], 4 | ['denom_1',['denom',['../structtjscalingfactor.html#aefbcdf3e9e62274b2d312c695f133ce3',1,'tjscalingfactor']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/all_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['format_20notes_0',['YUV Image Format Notes',['../group___turbo_j_p_e_g.html#autotoc_md0',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/all_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['h_0',['h',['../structtjregion.html#aecefc45a26f4d8b60dd4d825c1710115',1,'tjregion']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/all_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['image_20format_20notes_0',['YUV Image Format Notes',['../group___turbo_j_p_e_g.html#autotoc_md0',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/all_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['notes_0',['YUV Image Format Notes',['../group___turbo_j_p_e_g.html#autotoc_md0',1,'']]], 4 | ['num_1',['num',['../structtjscalingfactor.html#a9b011e57f981ee23083e2c1aa5e640ec',1,'tjscalingfactor']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/all_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['op_0',['op',['../structtjtransform.html#a2525aab4ba6978a1c273f74fef50e498',1,'tjtransform']]], 4 | ['options_1',['options',['../structtjtransform.html#ac0e74655baa4402209a21e1ae481c8f6',1,'tjtransform']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/all_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['r_0',['r',['../structtjtransform.html#ac324e5e442abec8a961e5bf219db12cf',1,'tjtransform']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/all_9.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['w_0',['w',['../structtjregion.html#ab6eb73ceef584fc23c8c8097926dce42',1,'tjregion']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/all_a.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['x_0',['x',['../structtjregion.html#a4b6a37a93997091b26a75831fa291ad9',1,'tjregion']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/all_b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['y_0',['y',['../structtjregion.html#a7b3e0c24cfe87acc80e334cafdcf22c2',1,'tjregion']]], 4 | ['yuv_20image_20format_20notes_1',['YUV Image Format Notes',['../group___turbo_j_p_e_g.html#autotoc_md0',1,'']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/classes_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['tjregion_0',['tjregion',['../structtjregion.html',1,'']]], 4 | ['tjscalingfactor_1',['tjscalingfactor',['../structtjscalingfactor.html',1,'']]], 5 | ['tjtransform_2',['tjtransform',['../structtjtransform.html',1,'']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /doc/html/search/close.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 12 | 14 | 18 | 19 | -------------------------------------------------------------------------------- /doc/html/search/enums_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['tjcs_0',['TJCS',['../group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720',1,'turbojpeg.h']]], 4 | ['tjerr_1',['TJERR',['../group___turbo_j_p_e_g.html#gafbc17cfa57d0d5d11fea35ac025950fe',1,'turbojpeg.h']]], 5 | ['tjinit_2',['TJINIT',['../group___turbo_j_p_e_g.html#ga3850bbee1313e752e667b4eb08b1e086',1,'turbojpeg.h']]], 6 | ['tjparam_3',['TJPARAM',['../group___turbo_j_p_e_g.html#gaa0f6be63ba78278299c9f5c12031fe82',1,'turbojpeg.h']]], 7 | ['tjpf_4',['TJPF',['../group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a',1,'turbojpeg.h']]], 8 | ['tjsamp_5',['TJSAMP',['../group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074',1,'turbojpeg.h']]], 9 | ['tjxop_6',['TJXOP',['../group___turbo_j_p_e_g.html#ga2de531af4e7e6c4f124908376b354866',1,'turbojpeg.h']]] 10 | ]; 11 | -------------------------------------------------------------------------------- /doc/html/search/groups_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['turbojpeg_0',['TurboJPEG',['../group___turbo_j_p_e_g.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/mag.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 12 | 14 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /doc/html/search/mag_d.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 12 | 14 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /doc/html/search/mag_sel.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 13 | 15 | 21 | 26 | 31 | 32 | -------------------------------------------------------------------------------- /doc/html/search/mag_seld.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 13 | 15 | 21 | 26 | 31 | 32 | -------------------------------------------------------------------------------- /doc/html/search/searchdata.js: -------------------------------------------------------------------------------- 1 | var indexSectionsWithContent = 2 | { 3 | 0: "cdfhinortwxy", 4 | 1: "t", 5 | 2: "t", 6 | 3: "cdhnortwxy", 7 | 4: "t", 8 | 5: "t", 9 | 6: "t", 10 | 7: "t" 11 | }; 12 | 13 | var indexSectionNames = 14 | { 15 | 0: "all", 16 | 1: "classes", 17 | 2: "functions", 18 | 3: "variables", 19 | 4: "typedefs", 20 | 5: "enums", 21 | 6: "enumvalues", 22 | 7: "groups" 23 | }; 24 | 25 | var indexSectionLabels = 26 | { 27 | 0: "All", 28 | 1: "Data Structures", 29 | 2: "Functions", 30 | 3: "Variables", 31 | 4: "Typedefs", 32 | 5: "Enumerations", 33 | 6: "Enumerator", 34 | 7: "Modules" 35 | }; 36 | 37 | -------------------------------------------------------------------------------- /doc/html/search/typedefs_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['tjhandle_0',['tjhandle',['../group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763',1,'turbojpeg.h']]], 4 | ['tjtransform_1',['tjtransform',['../group___turbo_j_p_e_g.html#ga504805ec0161f1b505397ca0118bf8fd',1,'turbojpeg.h']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/variables_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['customfilter_0',['customFilter',['../structtjtransform.html#a0dc7697d59a7abe48afc629e96cbc1d2',1,'tjtransform']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/variables_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['data_0',['data',['../structtjtransform.html#a688fe8f1a8ecc12a538d9e561cf338e3',1,'tjtransform']]], 4 | ['denom_1',['denom',['../structtjscalingfactor.html#aefbcdf3e9e62274b2d312c695f133ce3',1,'tjscalingfactor']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/variables_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['h_0',['h',['../structtjregion.html#aecefc45a26f4d8b60dd4d825c1710115',1,'tjregion']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/variables_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['num_0',['num',['../structtjscalingfactor.html#a9b011e57f981ee23083e2c1aa5e640ec',1,'tjscalingfactor']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/variables_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['op_0',['op',['../structtjtransform.html#a2525aab4ba6978a1c273f74fef50e498',1,'tjtransform']]], 4 | ['options_1',['options',['../structtjtransform.html#ac0e74655baa4402209a21e1ae481c8f6',1,'tjtransform']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /doc/html/search/variables_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['r_0',['r',['../structtjtransform.html#ac324e5e442abec8a961e5bf219db12cf',1,'tjtransform']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/variables_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['tjalphaoffset_0',['tjAlphaOffset',['../group___turbo_j_p_e_g.html#ga5af0ab065feefd526debf1e20c43e837',1,'turbojpeg.h']]], 4 | ['tjblueoffset_1',['tjBlueOffset',['../group___turbo_j_p_e_g.html#ga84e2e35d3f08025f976ec1ec53693dea',1,'turbojpeg.h']]], 5 | ['tjgreenoffset_2',['tjGreenOffset',['../group___turbo_j_p_e_g.html#ga82d6e35da441112a411da41923c0ba2f',1,'turbojpeg.h']]], 6 | ['tjmcuheight_3',['tjMCUHeight',['../group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf',1,'turbojpeg.h']]], 7 | ['tjmcuwidth_4',['tjMCUWidth',['../group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c',1,'turbojpeg.h']]], 8 | ['tjpixelsize_5',['tjPixelSize',['../group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c',1,'turbojpeg.h']]], 9 | ['tjredoffset_6',['tjRedOffset',['../group___turbo_j_p_e_g.html#gadd9b446742ac8a3923f7992c7988fea8',1,'turbojpeg.h']]], 10 | ['tjuncropped_7',['TJUNCROPPED',['../group___turbo_j_p_e_g.html#ga6f192ad58a5a5802e145149d83c643bf',1,'turbojpeg.h']]], 11 | ['tjunscaled_8',['TJUNSCALED',['../group___turbo_j_p_e_g.html#ga7880644a0849161ad20933536169ee19',1,'turbojpeg.h']]] 12 | ]; 13 | -------------------------------------------------------------------------------- /doc/html/search/variables_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['w_0',['w',['../structtjregion.html#ab6eb73ceef584fc23c8c8097926dce42',1,'tjregion']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/variables_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['x_0',['x',['../structtjregion.html#a4b6a37a93997091b26a75831fa291ad9',1,'tjregion']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/search/variables_9.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['y_0',['y',['../structtjregion.html#a7b3e0c24cfe87acc80e334cafdcf22c2',1,'tjregion']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /doc/html/splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/doc/html/splitbar.png -------------------------------------------------------------------------------- /doc/html/splitbard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/doc/html/splitbard.png -------------------------------------------------------------------------------- /doc/html/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/doc/html/sync_off.png -------------------------------------------------------------------------------- /doc/html/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/doc/html/sync_on.png -------------------------------------------------------------------------------- /doc/html/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/doc/html/tab_a.png -------------------------------------------------------------------------------- /doc/html/tab_ad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/doc/html/tab_ad.png -------------------------------------------------------------------------------- /doc/html/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/doc/html/tab_b.png -------------------------------------------------------------------------------- /doc/html/tab_bd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/doc/html/tab_bd.png -------------------------------------------------------------------------------- /doc/html/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/doc/html/tab_h.png -------------------------------------------------------------------------------- /doc/html/tab_hd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/doc/html/tab_hd.png -------------------------------------------------------------------------------- /doc/html/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/doc/html/tab_s.png -------------------------------------------------------------------------------- /doc/html/tab_sd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/doc/html/tab_sd.png -------------------------------------------------------------------------------- /doc/html/topics.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | TurboJPEG: Topics 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 | 28 | 29 | 30 |
25 |
TurboJPEG 3.0.1 26 |
27 |
31 |
32 | 33 | 34 | 39 | 40 | 41 | 49 | 50 |
51 | 52 |
56 |
57 | 58 | 59 |
60 |
61 |
62 |
63 |
64 |
Loading...
65 |
Searching...
66 |
No Matches
67 |
68 |
69 |
70 |
71 | 72 |
73 |
Topics
74 |
75 |
76 |
Here is a list of all topics with brief descriptions:
77 | 78 | 79 |
 TurboJPEGTurboJPEG API
80 |
81 |
82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /doxygen-extra.css: -------------------------------------------------------------------------------- 1 | code { 2 | color: #4665A2; 3 | } 4 | 5 | th.markdownTableHeadNone { 6 | color: black; 7 | } 8 | -------------------------------------------------------------------------------- /doxygen.config: -------------------------------------------------------------------------------- 1 | PROJECT_NAME = TurboJPEG 2 | PROJECT_NUMBER = 3.0.1 3 | OUTPUT_DIRECTORY = doc/ 4 | USE_WINDOWS_ENCODING = NO 5 | OPTIMIZE_OUTPUT_FOR_C = YES 6 | WARN_NO_PARAMDOC = YES 7 | GENERATE_LATEX = NO 8 | FILE_PATTERNS = turbojpeg.h 9 | HIDE_UNDOC_MEMBERS = YES 10 | VERBATIM_HEADERS = NO 11 | EXTRACT_STATIC = YES 12 | JAVADOC_AUTOBRIEF = YES 13 | MAX_INITIALIZER_LINES = 0 14 | ALWAYS_DETAILED_SEC = YES 15 | HTML_TIMESTAMP = NO 16 | HTML_EXTRA_STYLESHEET = doxygen-extra.css 17 | -------------------------------------------------------------------------------- /fuzz/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(NOT ENABLE_STATIC) 2 | message(FATAL_ERROR "Fuzz targets require static libraries.") 3 | endif() 4 | if(NOT WITH_TURBOJPEG) 5 | message(FATAL_ERROR "Fuzz targets require the TurboJPEG API library.") 6 | endif() 7 | 8 | set(FUZZ_BINDIR "" CACHE PATH 9 | "Directory into which fuzz targets should be installed") 10 | if(NOT FUZZ_BINDIR) 11 | message(FATAL_ERROR "FUZZ_BINDIR must be specified.") 12 | endif() 13 | message(STATUS "FUZZ_BINDIR = ${FUZZ_BINDIR}") 14 | 15 | set(FUZZ_LIBRARY "" CACHE STRING 16 | "Path to fuzzer library or flags necessary to link with it") 17 | if(NOT FUZZ_LIBRARY) 18 | message(FATAL_ERROR "FUZZ_LIBRARY must be specified.") 19 | endif() 20 | message(STATUS "FUZZ_LIBRARY = ${FUZZ_LIBRARY}") 21 | 22 | enable_language(CXX) 23 | 24 | set(EFFECTIVE_CXX_FLAGS 25 | "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_UC}}") 26 | message(STATUS "C++ Compiler flags = ${EFFECTIVE_CXX_FLAGS}") 27 | 28 | add_executable(cjpeg_fuzzer${FUZZER_SUFFIX} cjpeg.cc ../cdjpeg.c ../rdbmp.c 29 | ../rdgif.c ../rdppm.c ../rdswitch.c ../rdtarga.c) 30 | set_property(TARGET cjpeg_fuzzer${FUZZER_SUFFIX} PROPERTY COMPILE_FLAGS 31 | ${COMPILE_FLAGS}) 32 | target_link_libraries(cjpeg_fuzzer${FUZZER_SUFFIX} ${FUZZ_LIBRARY} jpeg-static) 33 | install(TARGETS cjpeg_fuzzer${FUZZER_SUFFIX} 34 | RUNTIME DESTINATION ${FUZZ_BINDIR} COMPONENT bin) 35 | 36 | macro(add_fuzz_target target source_file) 37 | add_executable(${target}_fuzzer${FUZZER_SUFFIX} ${source_file}) 38 | target_link_libraries(${target}_fuzzer${FUZZER_SUFFIX} ${FUZZ_LIBRARY} 39 | turbojpeg-static) 40 | install(TARGETS ${target}_fuzzer${FUZZER_SUFFIX} 41 | RUNTIME DESTINATION ${FUZZ_BINDIR} COMPONENT bin) 42 | endmacro() 43 | 44 | add_fuzz_target(compress compress.cc) 45 | 46 | add_fuzz_target(compress_yuv compress_yuv.cc) 47 | 48 | add_fuzz_target(compress_lossless compress_lossless.cc) 49 | 50 | add_fuzz_target(compress12 compress12.cc) 51 | 52 | add_fuzz_target(compress12_lossless compress12.cc) 53 | 54 | add_fuzz_target(compress16_lossless compress16_lossless.cc) 55 | 56 | # NOTE: This target is named libjpeg_turbo_fuzzer instead of decompress_fuzzer 57 | # in order to preserve the corpora from Google's OSS-Fuzz target for 58 | # libjpeg-turbo, which this target replaces. 59 | add_fuzz_target(libjpeg_turbo decompress.cc) 60 | 61 | add_fuzz_target(decompress_yuv decompress_yuv.cc) 62 | 63 | add_fuzz_target(transform transform.cc) 64 | -------------------------------------------------------------------------------- /fuzz/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -u 4 | set -e 5 | 6 | FUZZER_SUFFIX= 7 | if [ $# -ge 1 ]; then 8 | FUZZER_SUFFIX="$1" 9 | FUZZER_SUFFIX="`echo $1 | sed 's/\./_/g'`" 10 | fi 11 | 12 | cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DENABLE_STATIC=1 -DENABLE_SHARED=0 \ 13 | -DCMAKE_C_FLAGS_RELWITHDEBINFO="-g -DNDEBUG" \ 14 | -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-g -DNDEBUG" -DCMAKE_INSTALL_PREFIX=$WORK \ 15 | -DWITH_FUZZ=1 -DFUZZ_BINDIR=$OUT -DFUZZ_LIBRARY=$LIB_FUZZING_ENGINE \ 16 | -DFUZZER_SUFFIX="$FUZZER_SUFFIX" 17 | make "-j$(nproc)" "--load-average=$(nproc)" 18 | make install 19 | 20 | cp $SRC/compress_fuzzer_seed_corpus.zip $OUT/cjpeg_fuzzer${FUZZER_SUFFIX}_seed_corpus.zip 21 | cp $SRC/compress_fuzzer_seed_corpus.zip $OUT/compress_fuzzer${FUZZER_SUFFIX}_seed_corpus.zip 22 | cp $SRC/compress_fuzzer_seed_corpus.zip $OUT/compress_yuv_fuzzer${FUZZER_SUFFIX}_seed_corpus.zip 23 | cp $SRC/compress_fuzzer_seed_corpus.zip $OUT/compress_lossless_fuzzer${FUZZER_SUFFIX}_seed_corpus.zip 24 | cp $SRC/compress_fuzzer_seed_corpus.zip $OUT/compress12_fuzzer${FUZZER_SUFFIX}_seed_corpus.zip 25 | cp $SRC/compress_fuzzer_seed_corpus.zip $OUT/compress12_lossless_fuzzer${FUZZER_SUFFIX}_seed_corpus.zip 26 | cp $SRC/compress_fuzzer_seed_corpus.zip $OUT/compress16_lossless_fuzzer${FUZZER_SUFFIX}_seed_corpus.zip 27 | cp $SRC/decompress_fuzzer_seed_corpus.zip $OUT/libjpeg_turbo_fuzzer${FUZZER_SUFFIX}_seed_corpus.zip 28 | cp $SRC/decompress_fuzzer_seed_corpus.zip $OUT/decompress_yuv_fuzzer${FUZZER_SUFFIX}_seed_corpus.zip 29 | cp $SRC/decompress_fuzzer_seed_corpus.zip $OUT/transform_fuzzer${FUZZER_SUFFIX}_seed_corpus.zip 30 | -------------------------------------------------------------------------------- /fuzz/cjpeg.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C)2021 D. R. Commander. All Rights Reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * - Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * - Redistributions in binary form must reproduce the above copyright notice, 10 | * this list of conditions and the following disclaimer in the documentation 11 | * and/or other materials provided with the distribution. 12 | * - Neither the name of the libjpeg-turbo Project nor the names of its 13 | * contributors may be used to endorse or promote products derived from this 14 | * software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | * POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | /* This fuzz target wraps cjpeg in order to test esoteric compression options 30 | as well as the GIF and Targa readers. */ 31 | 32 | #define main cjpeg_main 33 | #define CJPEG_FUZZER 34 | extern "C" { 35 | #include "../cjpeg.c" 36 | } 37 | #undef main 38 | #undef CJPEG_FUZZER 39 | 40 | #include 41 | #include 42 | 43 | 44 | extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) 45 | { 46 | char filename[FILENAME_MAX] = { 0 }; 47 | char *argv1[] = { 48 | (char *)"cjpeg", (char *)"-dct", (char *)"float", (char *)"-memdst", 49 | (char *)"-optimize", (char *)"-quality", (char *)"100,99,98", 50 | (char *)"-restart", (char *)"2", (char *)"-sample", (char *)"4x1,2x2,1x2", 51 | (char *)"-targa", NULL 52 | }; 53 | char *argv2[] = { 54 | (char *)"cjpeg", (char *)"-arithmetic", (char *)"-dct", (char *)"float", 55 | (char *)"-memdst", (char *)"-quality", (char *)"90,80,70", (char *)"-rgb", 56 | (char *)"-sample", (char *)"2x2", (char *)"-smooth", (char *)"50", 57 | (char *)"-targa", NULL 58 | }; 59 | int fd = -1; 60 | #if defined(__has_feature) && __has_feature(memory_sanitizer) 61 | char env[18] = "JSIMD_FORCENONE=1"; 62 | 63 | /* The libjpeg-turbo SIMD extensions produce false positives with 64 | MemorySanitizer. */ 65 | putenv(env); 66 | #endif 67 | 68 | snprintf(filename, FILENAME_MAX, "/tmp/libjpeg-turbo_cjpeg_fuzz.XXXXXX"); 69 | if ((fd = mkstemp(filename)) < 0 || write(fd, data, size) < 0) 70 | goto bailout; 71 | 72 | argv1[12] = argv2[13] = filename; 73 | 74 | cjpeg_main(13, argv1); 75 | cjpeg_main(14, argv2); 76 | 77 | argv1[12] = argv2[13] = NULL; 78 | argv1[11] = argv2[12] = filename; 79 | 80 | cjpeg_main(12, argv1); 81 | cjpeg_main(13, argv2); 82 | 83 | bailout: 84 | if (fd >= 0) { 85 | close(fd); 86 | if (strlen(filename) > 0) unlink(filename); 87 | } 88 | return 0; 89 | } 90 | -------------------------------------------------------------------------------- /java/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Main-Class: TJExample 3 | -------------------------------------------------------------------------------- /java/README: -------------------------------------------------------------------------------- 1 | TurboJPEG Java Wrapper 2 | ====================== 3 | 4 | The TurboJPEG shared library can optionally be built with a Java Native 5 | Interface wrapper, which allows the library to be loaded and used directly from 6 | Java applications. The Java front end for this is defined in several classes 7 | located under org/libjpegturbo/turbojpeg. The source code for these Java 8 | classes is licensed under a BSD-style license, so the files can be incorporated 9 | directly into both open source and proprietary projects without restriction. A 10 | Java archive (JAR) file containing these classes is also shipped with the 11 | "official" distribution packages of libjpeg-turbo. 12 | 13 | TJExample.java, which should also be located in the same directory as this 14 | README file, demonstrates how to use the TurboJPEG Java API to compress and 15 | decompress JPEG images in memory. 16 | 17 | 18 | Performance Pitfalls 19 | -------------------- 20 | 21 | The TurboJPEG Java API defines several convenience methods that can allocate 22 | image buffers or instantiate classes to hold the result of compress, 23 | decompress, or transform operations. However, if you use these methods, then 24 | be mindful of the amount of new data you are creating on the heap. It may be 25 | necessary to manually invoke the garbage collector to prevent heap exhaustion 26 | or to prevent performance degradation. Background garbage collection can kill 27 | performance, particularly in a multi-threaded environment (Java pauses all 28 | threads when the GC runs.) 29 | 30 | The TurboJPEG Java API always gives you the option of pre-allocating your own 31 | source and destination buffers, which allows you to re-use those buffers for 32 | compressing/decompressing multiple images. If the image sequence you are 33 | compressing or decompressing consists of images of the same size, then 34 | pre-allocating the buffers is recommended. 35 | 36 | 37 | Installation Directory 38 | ---------------------- 39 | 40 | The TurboJPEG Java Wrapper will look for the TurboJPEG JNI library 41 | (libturbojpeg.so, libturbojpeg.dylib, or turbojpeg.dll) in the system library 42 | paths or in any paths specified in LD_LIBRARY_PATH (Un*x), DYLD_LIBRARY_PATH 43 | (Mac), or PATH (Windows.) Failing this, on Un*x and Mac systems, the wrapper 44 | will look for the JNI library under the library directory configured when 45 | libjpeg-turbo was built. If that library directory is 46 | /opt/libjpeg-turbo/lib32, then /opt/libjpeg-turbo/lib64 is also searched, and 47 | vice versa. 48 | 49 | If you installed the JNI library into another directory, then you will need 50 | to pass an argument of -Djava.library.path={path_to_JNI_library} to java, or 51 | manipulate LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, or PATH to include the directory 52 | containing the JNI library. 53 | -------------------------------------------------------------------------------- /java/doc/allclasses.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | All Classes 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 |
22 |

All Classes

23 |
24 | 35 |
36 |
37 | 38 | 39 | -------------------------------------------------------------------------------- /java/doc/element-list: -------------------------------------------------------------------------------- 1 | org.libjpegturbo.turbojpeg 2 | -------------------------------------------------------------------------------- /java/doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Generated Documentation (Untitled) 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 |
17 | 20 |

org/libjpegturbo/turbojpeg/package-summary.html

21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /java/doc/jquery-ui.overrides.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 | * 5 | * This code is free software; you can redistribute it and/or modify it 6 | * under the terms of the GNU General Public License version 2 only, as 7 | * published by the Free Software Foundation. Oracle designates this 8 | * particular file as subject to the "Classpath" exception as provided 9 | * by Oracle in the LICENSE file that accompanied this code. 10 | * 11 | * This code is distributed in the hope that it will be useful, but WITHOUT 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 | * version 2 for more details (a copy is included in the LICENSE file that 15 | * accompanied this code). 16 | * 17 | * You should have received a copy of the GNU General Public License version 18 | * 2 along with this work; if not, write to the Free Software Foundation, 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 | * 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 | * or visit www.oracle.com if you need additional information or have any 23 | * questions. 24 | */ 25 | 26 | .ui-state-active, 27 | .ui-widget-content .ui-state-active, 28 | .ui-widget-header .ui-state-active, 29 | a.ui-button:active, 30 | .ui-button:active, 31 | .ui-button.ui-state-active:hover { 32 | /* Overrides the color of selection used in jQuery UI */ 33 | background: #F8981D; 34 | border: 1px solid #F8981D; 35 | } 36 | -------------------------------------------------------------------------------- /java/doc/jquery/jquery-ui.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.13.2 - 2023-02-27 2 | * http://jqueryui.com 3 | * Includes: core.css, autocomplete.css, menu.css 4 | * Copyright jQuery Foundation and other contributors; Licensed MIT */ 5 | 6 | .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;-ms-filter:"alpha(opacity=0)"}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0} -------------------------------------------------------------------------------- /java/doc/jquery/jszip-utils/dist/jszip-utils-ie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | JSZipUtils - A collection of cross-browser utilities to go along with JSZip. 4 | 5 | 6 | (c) 2014 Stuart Knightley, David Duponchel 7 | Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. 8 | 9 | */ 10 | ;(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o\r\n"+ 18 | "\r\n"; 32 | 33 | // inject VBScript 34 | document.write(IEBinaryToArray_ByteStr_Script); 35 | 36 | global.JSZipUtils._getBinaryFromXHR = function (xhr) { 37 | var binary = xhr.responseBody; 38 | var byteMapping = {}; 39 | for ( var i = 0; i < 256; i++ ) { 40 | for ( var j = 0; j < 256; j++ ) { 41 | byteMapping[ String.fromCharCode( i + (j << 8) ) ] = 42 | String.fromCharCode(i) + String.fromCharCode(j); 43 | } 44 | } 45 | var rawBytes = IEBinaryToArray_ByteStr(binary); 46 | var lastChr = IEBinaryToArray_ByteStr_Last(binary); 47 | return rawBytes.replace(/[\s\S]/g, function( match ) { 48 | return byteMapping[match]; 49 | }) + lastChr; 50 | }; 51 | 52 | // enforcing Stuk's coding style 53 | // vim: set shiftwidth=4 softtabstop=4: 54 | 55 | },{}]},{},[1]) 56 | ; 57 | -------------------------------------------------------------------------------- /java/doc/jquery/jszip-utils/dist/jszip-utils-ie.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | JSZipUtils - A collection of cross-browser utilities to go along with JSZip. 4 | 5 | 6 | (c) 2014 Stuart Knightley, David Duponchel 7 | Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. 8 | 9 | */ 10 | !function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g\r\n";document.write(b),a.JSZipUtils._getBinaryFromXHR=function(a){for(var b=a.responseBody,c={},d=0;256>d;d++)for(var e=0;256>e;e++)c[String.fromCharCode(d+(e<<8))]=String.fromCharCode(d)+String.fromCharCode(e);var f=IEBinaryToArray_ByteStr(b),g=IEBinaryToArray_ByteStr_Last(b);return f.replace(/[\s\S]/g,function(a){return c[a]})+g}},{}]},{},[1]); 11 | -------------------------------------------------------------------------------- /java/doc/jquery/jszip-utils/dist/jszip-utils.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | JSZipUtils - A collection of cross-browser utilities to go along with JSZip. 4 | 5 | 6 | (c) 2014 Stuart Knightley, David Duponchel 7 | Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. 8 | 9 | */ 10 | !function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define(a):"undefined"!=typeof window?window.JSZipUtils=a():"undefined"!=typeof global?global.JSZipUtils=a():"undefined"!=typeof self&&(self.JSZipUtils=a())}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g version 2 7 | only ("GPL2"), with the following clarification and special exception. 8 | 9 | Linking this OpenJDK Code statically or dynamically with other code 10 | is making a combined work based on this library. Thus, the terms 11 | and conditions of GPL2 cover the whole combination. 12 | 13 | As a special exception, Oracle gives you permission to link this 14 | OpenJDK Code with certain code licensed by Oracle as indicated at 15 | http://openjdk.java.net/legal/exception-modules-2007-05-08.html 16 | ("Designated Exception Modules") to produce an executable, 17 | regardless of the license terms of the Designated Exception Modules, 18 | and to copy and distribute the resulting executable under GPL2, 19 | provided that the Designated Exception Modules continue to be 20 | governed by the licenses under which they were offered by Oracle. 21 | 22 | As such, it allows licensees and sublicensees of Oracle's GPL2 OpenJDK Code 23 | to build an executable that includes those portions of necessary code that 24 | Oracle could not provide under GPL2 (or that Oracle has provided under GPL2 25 | with the Classpath exception). If you modify or add to the OpenJDK code, 26 | that new GPL2 code may still be combined with Designated Exception Modules 27 | if the new code is made subject to this exception by its copyright holder. 28 | -------------------------------------------------------------------------------- /java/doc/legal/jquery.md: -------------------------------------------------------------------------------- 1 | ## jQuery v3.6.1 2 | 3 | ### jQuery License 4 | ``` 5 | jQuery v 3.6.1 6 | Copyright OpenJS Foundation and other contributors, https://openjsf.org/ 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining 9 | a copy of this software and associated documentation files (the 10 | "Software"), to deal in the Software without restriction, including 11 | without limitation the rights to use, copy, modify, merge, publish, 12 | distribute, sublicense, and/or sell copies of the Software, and to 13 | permit persons to whom the Software is furnished to do so, subject to 14 | the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be 17 | included in all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 23 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 24 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 25 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | 27 | ****************************************** 28 | 29 | The jQuery JavaScript Library v3.6.1 also includes Sizzle.js 30 | 31 | Sizzle.js includes the following license: 32 | 33 | Copyright JS Foundation and other contributors, https://js.foundation/ 34 | 35 | This software consists of voluntary contributions made by many 36 | individuals. For exact contribution history, see the revision history 37 | available at https://github.com/jquery/sizzle 38 | 39 | The following license applies to all parts of this software except as 40 | documented below: 41 | 42 | ==== 43 | 44 | Permission is hereby granted, free of charge, to any person obtaining 45 | a copy of this software and associated documentation files (the 46 | "Software"), to deal in the Software without restriction, including 47 | without limitation the rights to use, copy, modify, merge, publish, 48 | distribute, sublicense, and/or sell copies of the Software, and to 49 | permit persons to whom the Software is furnished to do so, subject to 50 | the following conditions: 51 | 52 | The above copyright notice and this permission notice shall be 53 | included in all copies or substantial portions of the Software. 54 | 55 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 56 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 57 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 58 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 59 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 60 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 61 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 62 | 63 | ==== 64 | 65 | All files located in the node_modules and external directories are 66 | externally maintained libraries used by this software which have their 67 | own licenses; we recommend you read them, as their terms may differ from 68 | the terms above. 69 | 70 | ********************* 71 | 72 | ``` 73 | -------------------------------------------------------------------------------- /java/doc/legal/jqueryUI.md: -------------------------------------------------------------------------------- 1 | ## jQuery UI v1.13.2 2 | 3 | ### jQuery UI License 4 | ``` 5 | Copyright jQuery Foundation and other contributors, https://jquery.org/ 6 | 7 | This software consists of voluntary contributions made by many 8 | individuals. For exact contribution history, see the revision history 9 | available at https://github.com/jquery/jquery-ui 10 | 11 | The following license applies to all parts of this software except as 12 | documented below: 13 | 14 | ==== 15 | 16 | Permission is hereby granted, free of charge, to any person obtaining 17 | a copy of this software and associated documentation files (the 18 | "Software"), to deal in the Software without restriction, including 19 | without limitation the rights to use, copy, modify, merge, publish, 20 | distribute, sublicense, and/or sell copies of the Software, and to 21 | permit persons to whom the Software is furnished to do so, subject to 22 | the following conditions: 23 | 24 | The above copyright notice and this permission notice shall be 25 | included in all copies or substantial portions of the Software. 26 | 27 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 28 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 29 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 30 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 31 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 32 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 33 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 34 | 35 | ==== 36 | 37 | Copyright and related rights for sample code are waived via CC0. Sample 38 | code is defined as all source code contained within the demos directory. 39 | 40 | CC0: http://creativecommons.org/publicdomain/zero/1.0/ 41 | 42 | ==== 43 | 44 | All files located in the node_modules and external directories are 45 | externally maintained libraries used by this software which have their 46 | own licenses; we recommend you read them, as their terms may differ from 47 | the terms above. 48 | 49 | ``` 50 | -------------------------------------------------------------------------------- /java/doc/legal/pako.md: -------------------------------------------------------------------------------- 1 | ## Pako v1.0 2 | 3 | ### Pako License 4 |
 5 | Copyright (C) 2014-2017 by Vitaly Puzrin and Andrei Tuputcyn
 6 | 
 7 | Permission is hereby granted, free of charge, to any person obtaining a copy
 8 | of this software and associated documentation files (the "Software"), to deal
 9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 | 
14 | The above copyright notice and this permission notice shall be included in
15 | all copies or substantial portions of the Software.
16 | 
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23 | THE SOFTWARE.
24 | (C) 1995-2013 Jean-loup Gailly and Mark Adler
25 | (C) 2014-2017 Vitaly Puzrin and Andrey Tupitsin
26 | 
27 | This software is provided 'as-is', without any express or implied
28 | warranty. In no event will the authors be held liable for any damages
29 | arising from the use of this software.
30 | 
31 | Permission is granted to anyone to use this software for any purpose,
32 | including commercial applications, and to alter it and redistribute it
33 | freely, subject to the following restrictions:
34 | 
35 | 1. The origin of this software must not be misrepresented; you must not
36 | claim that you wrote the original software. If you use this software
37 | in a product, an acknowledgment in the product documentation would be
38 | appreciated but is not required.
39 | 2. Altered source versions must be plainly marked as such, and must not be
40 |  misrepresented as being the original software.
41 | 3. This notice may not be removed or altered from any source distribution.
42 | 
43 | 
44 | 45 | 46 | -------------------------------------------------------------------------------- /java/doc/member-search-index.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/java/doc/member-search-index.zip -------------------------------------------------------------------------------- /java/doc/package-search-index.js: -------------------------------------------------------------------------------- 1 | packageSearchIndex = [{"l":"All Packages","url":"allpackages-index.html"},{"l":"org.libjpegturbo.turbojpeg"}] -------------------------------------------------------------------------------- /java/doc/package-search-index.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/java/doc/package-search-index.zip -------------------------------------------------------------------------------- /java/doc/resources/glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/java/doc/resources/glass.png -------------------------------------------------------------------------------- /java/doc/resources/x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/java/doc/resources/x.png -------------------------------------------------------------------------------- /java/doc/type-search-index.js: -------------------------------------------------------------------------------- 1 | typeSearchIndex = [{"l":"All Classes","url":"allclasses-index.html"},{"p":"org.libjpegturbo.turbojpeg","l":"TJ"},{"p":"org.libjpegturbo.turbojpeg","l":"TJCompressor"},{"p":"org.libjpegturbo.turbojpeg","l":"TJCustomFilter"},{"p":"org.libjpegturbo.turbojpeg","l":"TJDecompressor"},{"p":"org.libjpegturbo.turbojpeg","l":"TJException"},{"p":"org.libjpegturbo.turbojpeg","l":"TJScalingFactor"},{"p":"org.libjpegturbo.turbojpeg","l":"TJTransform"},{"p":"org.libjpegturbo.turbojpeg","l":"TJTransformer"},{"p":"org.libjpegturbo.turbojpeg","l":"YUVImage"}] -------------------------------------------------------------------------------- /java/doc/type-search-index.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/java/doc/type-search-index.zip -------------------------------------------------------------------------------- /java/org/libjpegturbo/turbojpeg/TJException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C)2015 Viktor Szathmáry. All Rights Reserved. 3 | * Copyright (C)2017-2018 D. R. Commander. All Rights Reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * - Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * - Neither the name of the libjpeg-turbo Project nor the names of its 14 | * contributors may be used to endorse or promote products derived from this 15 | * software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | package org.libjpegturbo.turbojpeg; 31 | 32 | import java.io.IOException; 33 | 34 | @SuppressWarnings("checkstyle:JavadocType") 35 | public class TJException extends IOException { 36 | 37 | private static final long serialVersionUID = 1L; 38 | 39 | @SuppressWarnings("checkstyle:JavadocMethod") 40 | public TJException() { 41 | super(); 42 | } 43 | 44 | @SuppressWarnings("checkstyle:JavadocMethod") 45 | public TJException(String message, Throwable cause) { 46 | super(message, cause); 47 | } 48 | 49 | @SuppressWarnings("checkstyle:JavadocMethod") 50 | public TJException(String message) { 51 | super(message); 52 | } 53 | 54 | @SuppressWarnings("checkstyle:JavadocMethod") 55 | public TJException(String message, int code) { 56 | super(message); 57 | if (errorCode >= 0 && errorCode < TJ.NUMERR) 58 | errorCode = code; 59 | } 60 | 61 | @SuppressWarnings("checkstyle:JavadocMethod") 62 | public TJException(Throwable cause) { 63 | super(cause); 64 | } 65 | 66 | /** 67 | * Returns a code (one of {@link TJ TJ.ERR_*}) indicating the severity of the 68 | * last error. 69 | * 70 | * @return a code (one of {@link TJ TJ.ERR_*}) indicating the severity of the 71 | * last error. 72 | */ 73 | public int getErrorCode() { 74 | return errorCode; 75 | } 76 | 77 | private int errorCode = TJ.ERR_FATAL; 78 | } 79 | -------------------------------------------------------------------------------- /java/org/libjpegturbo/turbojpeg/TJLoader-unix.java.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C)2011-2013, 2016, 2020 D. R. Commander. All Rights Reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * - Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * - Redistributions in binary form must reproduce the above copyright notice, 10 | * this list of conditions and the following disclaimer in the documentation 11 | * and/or other materials provided with the distribution. 12 | * - Neither the name of the libjpeg-turbo Project nor the names of its 13 | * contributors may be used to endorse or promote products derived from this 14 | * software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | * POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | package org.libjpegturbo.turbojpeg; 30 | 31 | final class TJLoader { 32 | static void load() { 33 | try { 34 | System.loadLibrary("turbojpeg"); 35 | } catch (java.lang.UnsatisfiedLinkError e) { 36 | String os = System.getProperty("os.name").toLowerCase(); 37 | if (os.indexOf("mac") >= 0) { 38 | try { 39 | System.load("@CMAKE_INSTALL_FULL_LIBDIR@/libturbojpeg.dylib"); 40 | } catch (java.lang.UnsatisfiedLinkError e2) { 41 | System.load("/usr/lib/libturbojpeg.dylib"); 42 | } 43 | } else { 44 | try { 45 | System.load("@CMAKE_INSTALL_FULL_LIBDIR@/libturbojpeg.so"); 46 | } catch (java.lang.UnsatisfiedLinkError e3) { 47 | String libdir = "@CMAKE_INSTALL_FULL_LIBDIR@"; 48 | if (libdir.equals("@CMAKE_INSTALL_DEFAULT_PREFIX@/lib64")) { 49 | System.load("@CMAKE_INSTALL_DEFAULT_PREFIX@/lib32/libturbojpeg.so"); 50 | } else if (libdir.equals("@CMAKE_INSTALL_DEFAULT_PREFIX@/lib32")) { 51 | System.load("@CMAKE_INSTALL_DEFAULT_PREFIX@/lib64/libturbojpeg.so"); 52 | } else { 53 | throw e3; 54 | } 55 | } 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /java/org/libjpegturbo/turbojpeg/TJLoader-win.java.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C)2011 D. R. Commander. All Rights Reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * - Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * - Redistributions in binary form must reproduce the above copyright notice, 10 | * this list of conditions and the following disclaimer in the documentation 11 | * and/or other materials provided with the distribution. 12 | * - Neither the name of the libjpeg-turbo Project nor the names of its 13 | * contributors may be used to endorse or promote products derived from this 14 | * software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | * POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | package org.libjpegturbo.turbojpeg; 30 | 31 | final class TJLoader { 32 | static void load() { 33 | System.loadLibrary("@TURBOJPEG_DLL_NAME@"); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /java/org_libjpegturbo_turbojpeg_TJTransformer.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class org_libjpegturbo_turbojpeg_TJTransformer */ 4 | 5 | #ifndef _Included_org_libjpegturbo_turbojpeg_TJTransformer 6 | #define _Included_org_libjpegturbo_turbojpeg_TJTransformer 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: org_libjpegturbo_turbojpeg_TJTransformer 12 | * Method: init 13 | * Signature: ()V 14 | */ 15 | JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJTransformer_init 16 | (JNIEnv *, jobject); 17 | 18 | /* 19 | * Class: org_libjpegturbo_turbojpeg_TJTransformer 20 | * Method: transform 21 | * Signature: ([BI[[B[Lorg/libjpegturbo/turbojpeg/TJTransform;)[I 22 | */ 23 | JNIEXPORT jintArray JNICALL Java_org_libjpegturbo_turbojpeg_TJTransformer_transform 24 | (JNIEnv *, jobject, jbyteArray, jint, jobjectArray, jobjectArray); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | #endif 30 | -------------------------------------------------------------------------------- /jchuff.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jchuff.h 3 | * 4 | * This file was part of the Independent JPEG Group's software: 5 | * Copyright (C) 1991-1997, Thomas G. Lane. 6 | * libjpeg-turbo Modifications: 7 | * Copyright (C) 2022, D. R. Commander. 8 | * For conditions of distribution and use, see the accompanying README.ijg 9 | * file. 10 | * 11 | * This file contains declarations for Huffman entropy encoding routines 12 | * that are shared between the sequential encoder (jchuff.c) and the 13 | * progressive encoder (jcphuff.c). No other modules need to see these. 14 | */ 15 | 16 | /* The legal range of a DCT coefficient is 17 | * -1024 .. +1023 for 8-bit data; 18 | * -16384 .. +16383 for 12-bit data. 19 | * Hence the magnitude should always fit in 10 or 14 bits respectively. 20 | */ 21 | 22 | /* The progressive Huffman encoder uses an unsigned 16-bit data type to store 23 | * absolute values of coefficients, because it is possible to inject a 24 | * coefficient value of -32768 into the encoder by attempting to transform a 25 | * malformed 12-bit JPEG image, and the absolute value of -32768 would overflow 26 | * a signed 16-bit integer. 27 | */ 28 | typedef unsigned short UJCOEF; 29 | 30 | /* Derived data constructed for each Huffman table */ 31 | 32 | typedef struct { 33 | unsigned int ehufco[256]; /* code for each symbol */ 34 | char ehufsi[256]; /* length of code for each symbol */ 35 | /* If no code has been allocated for a symbol S, ehufsi[S] contains 0 */ 36 | } c_derived_tbl; 37 | 38 | /* Expand a Huffman table definition into the derived format */ 39 | EXTERN(void) jpeg_make_c_derived_tbl(j_compress_ptr cinfo, boolean isDC, 40 | int tblno, c_derived_tbl **pdtbl); 41 | 42 | /* Generate an optimal table definition given the specified counts */ 43 | EXTERN(void) jpeg_gen_optimal_table(j_compress_ptr cinfo, JHUFF_TBL *htbl, 44 | long freq[]); 45 | -------------------------------------------------------------------------------- /jcmaster.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jcmaster.h 3 | * 4 | * This file was part of the Independent JPEG Group's software: 5 | * Copyright (C) 1991-1995, Thomas G. Lane. 6 | * libjpeg-turbo Modifications: 7 | * Copyright (C) 2016, D. R. Commander. 8 | * For conditions of distribution and use, see the accompanying README.ijg 9 | * file. 10 | * 11 | * This file contains master control structure for the JPEG compressor. 12 | */ 13 | 14 | /* Private state */ 15 | 16 | typedef enum { 17 | main_pass, /* input data, also do first output step */ 18 | huff_opt_pass, /* Huffman code optimization pass */ 19 | output_pass /* data output pass */ 20 | } c_pass_type; 21 | 22 | typedef struct { 23 | struct jpeg_comp_master pub; /* public fields */ 24 | 25 | c_pass_type pass_type; /* the type of the current pass */ 26 | 27 | int pass_number; /* # of passes completed */ 28 | int total_passes; /* total # of passes needed */ 29 | 30 | int scan_number; /* current index in scan_info[] */ 31 | 32 | /* 33 | * This is here so we can add libjpeg-turbo version/build information to the 34 | * global string table without introducing a new global symbol. Adding this 35 | * information to the global string table allows one to examine a binary 36 | * object and determine which version of libjpeg-turbo it was built from or 37 | * linked against. 38 | */ 39 | const char *jpeg_version; 40 | 41 | } my_comp_master; 42 | 43 | typedef my_comp_master *my_master_ptr; 44 | -------------------------------------------------------------------------------- /jcomapi.c: -------------------------------------------------------------------------------- 1 | /* 2 | * jcomapi.c 3 | * 4 | * This file was part of the Independent JPEG Group's software: 5 | * Copyright (C) 1994-1997, Thomas G. Lane. 6 | * It was modified by The libjpeg-turbo Project to include only code relevant 7 | * to libjpeg-turbo. 8 | * For conditions of distribution and use, see the accompanying README.ijg 9 | * file. 10 | * 11 | * This file contains application interface routines that are used for both 12 | * compression and decompression. 13 | */ 14 | 15 | #define JPEG_INTERNALS 16 | #include "jinclude.h" 17 | #include "jpeglib.h" 18 | 19 | 20 | /* 21 | * Abort processing of a JPEG compression or decompression operation, 22 | * but don't destroy the object itself. 23 | * 24 | * For this, we merely clean up all the nonpermanent memory pools. 25 | * Note that temp files (virtual arrays) are not allowed to belong to 26 | * the permanent pool, so we will be able to close all temp files here. 27 | * Closing a data source or destination, if necessary, is the application's 28 | * responsibility. 29 | */ 30 | 31 | GLOBAL(void) 32 | jpeg_abort(j_common_ptr cinfo) 33 | { 34 | int pool; 35 | 36 | /* Do nothing if called on a not-initialized or destroyed JPEG object. */ 37 | if (cinfo->mem == NULL) 38 | return; 39 | 40 | /* Releasing pools in reverse order might help avoid fragmentation 41 | * with some (brain-damaged) malloc libraries. 42 | */ 43 | for (pool = JPOOL_NUMPOOLS - 1; pool > JPOOL_PERMANENT; pool--) { 44 | (*cinfo->mem->free_pool) (cinfo, pool); 45 | } 46 | 47 | /* Reset overall state for possible reuse of object */ 48 | if (cinfo->is_decompressor) { 49 | cinfo->global_state = DSTATE_START; 50 | /* Try to keep application from accessing now-deleted marker list. 51 | * A bit kludgy to do it here, but this is the most central place. 52 | */ 53 | ((j_decompress_ptr)cinfo)->marker_list = NULL; 54 | } else { 55 | cinfo->global_state = CSTATE_START; 56 | } 57 | } 58 | 59 | 60 | /* 61 | * Destruction of a JPEG object. 62 | * 63 | * Everything gets deallocated except the master jpeg_compress_struct itself 64 | * and the error manager struct. Both of these are supplied by the application 65 | * and must be freed, if necessary, by the application. (Often they are on 66 | * the stack and so don't need to be freed anyway.) 67 | * Closing a data source or destination, if necessary, is the application's 68 | * responsibility. 69 | */ 70 | 71 | GLOBAL(void) 72 | jpeg_destroy(j_common_ptr cinfo) 73 | { 74 | /* We need only tell the memory manager to release everything. */ 75 | /* NB: mem pointer is NULL if memory mgr failed to initialize. */ 76 | if (cinfo->mem != NULL) 77 | (*cinfo->mem->self_destruct) (cinfo); 78 | cinfo->mem = NULL; /* be safe if jpeg_destroy is called twice */ 79 | cinfo->global_state = 0; /* mark it destroyed */ 80 | } 81 | 82 | 83 | /* 84 | * Convenience routines for allocating quantization and Huffman tables. 85 | * (Would jutils.c be a more reasonable place to put these?) 86 | */ 87 | 88 | GLOBAL(JQUANT_TBL *) 89 | jpeg_alloc_quant_table(j_common_ptr cinfo) 90 | { 91 | JQUANT_TBL *tbl; 92 | 93 | tbl = (JQUANT_TBL *) 94 | (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, sizeof(JQUANT_TBL)); 95 | tbl->sent_table = FALSE; /* make sure this is false in any new table */ 96 | return tbl; 97 | } 98 | 99 | 100 | GLOBAL(JHUFF_TBL *) 101 | jpeg_alloc_huff_table(j_common_ptr cinfo) 102 | { 103 | JHUFF_TBL *tbl; 104 | 105 | tbl = (JHUFF_TBL *) 106 | (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, sizeof(JHUFF_TBL)); 107 | tbl->sent_table = FALSE; /* make sure this is false in any new table */ 108 | return tbl; 109 | } 110 | -------------------------------------------------------------------------------- /jconfig.h.in: -------------------------------------------------------------------------------- 1 | /* Version ID for the JPEG library. 2 | * Might be useful for tests like "#if JPEG_LIB_VERSION >= 60". 3 | */ 4 | #define JPEG_LIB_VERSION @JPEG_LIB_VERSION@ 5 | 6 | /* libjpeg-turbo version */ 7 | #define LIBJPEG_TURBO_VERSION @VERSION@ 8 | 9 | /* libjpeg-turbo version in integer form */ 10 | #define LIBJPEG_TURBO_VERSION_NUMBER @LIBJPEG_TURBO_VERSION_NUMBER@ 11 | 12 | /* Support arithmetic encoding when using 8-bit samples */ 13 | #cmakedefine C_ARITH_CODING_SUPPORTED 1 14 | 15 | /* Support arithmetic decoding when using 8-bit samples */ 16 | #cmakedefine D_ARITH_CODING_SUPPORTED 1 17 | 18 | /* Support in-memory source/destination managers */ 19 | #define MEM_SRCDST_SUPPORTED 1 20 | 21 | /* Use accelerated SIMD routines when using 8-bit samples */ 22 | #cmakedefine WITH_SIMD 1 23 | 24 | /* This version of libjpeg-turbo supports run-time selection of data precision, 25 | * so BITS_IN_JSAMPLE is no longer used to specify the data precision at build 26 | * time. However, some downstream software expects the macro to be defined. 27 | * Since 12-bit data precision is an opt-in feature that requires explicitly 28 | * calling 12-bit-specific libjpeg API functions and using 12-bit-specific data 29 | * types, the unmodified portion of the libjpeg API still behaves as if it were 30 | * built for 8-bit precision, and JSAMPLE is still literally an 8-bit data 31 | * type. Thus, it is correct to define BITS_IN_JSAMPLE to 8 here. 32 | */ 33 | #ifndef BITS_IN_JSAMPLE 34 | #define BITS_IN_JSAMPLE 8 35 | #endif 36 | 37 | #ifdef _WIN32 38 | 39 | #undef RIGHT_SHIFT_IS_UNSIGNED 40 | 41 | /* Define "boolean" as unsigned char, not int, per Windows custom */ 42 | #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ 43 | typedef unsigned char boolean; 44 | #endif 45 | #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ 46 | 47 | /* Define "INT32" as int, not long, per Windows custom */ 48 | #if !(defined(_BASETSD_H_) || defined(_BASETSD_H)) /* don't conflict if basetsd.h already read */ 49 | typedef short INT16; 50 | typedef signed int INT32; 51 | #endif 52 | #define XMD_H /* prevent jmorecfg.h from redefining it */ 53 | 54 | #else 55 | 56 | /* Define if your (broken) compiler shifts signed values as if they were 57 | unsigned. */ 58 | #cmakedefine RIGHT_SHIFT_IS_UNSIGNED 1 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /jconfig.txt: -------------------------------------------------------------------------------- 1 | /* 2 | * jconfig.txt 3 | * 4 | * This file was part of the Independent JPEG Group's software: 5 | * Copyright (C) 1991-1994, Thomas G. Lane. 6 | * It was modified by The libjpeg-turbo Project to include only code relevant 7 | * to libjpeg-turbo. 8 | * For conditions of distribution and use, see the accompanying README.ijg 9 | * file. 10 | * 11 | * This file documents the configuration options that are required to 12 | * customize the JPEG software for a particular system. 13 | * 14 | * The actual configuration options for a particular installation are stored 15 | * in jconfig.h. On many machines, jconfig.h can be generated automatically 16 | * or copied from one of the "canned" jconfig files that we supply. But if 17 | * you need to generate a jconfig.h file by hand, this file tells you how. 18 | * 19 | * DO NOT EDIT THIS FILE --- IT WON'T ACCOMPLISH ANYTHING. 20 | * EDIT A COPY NAMED JCONFIG.H. 21 | */ 22 | 23 | 24 | /* 25 | * These symbols indicate the properties of your machine or compiler. 26 | * #define the symbol if yes, #undef it if no. 27 | */ 28 | 29 | /* Define "boolean" as unsigned char, not int, on Windows systems. 30 | */ 31 | #ifdef _WIN32 32 | #ifndef __RPCNDR_H__ /* don't conflict if rpcndr.h already read */ 33 | typedef unsigned char boolean; 34 | #endif 35 | #define HAVE_BOOLEAN /* prevent jmorecfg.h from redefining it */ 36 | #endif 37 | 38 | 39 | /* 40 | * The following options affect code selection within the JPEG library, 41 | * but they don't need to be visible to applications using the library. 42 | * To minimize application namespace pollution, the symbols won't be 43 | * defined unless JPEG_INTERNALS has been defined. 44 | */ 45 | 46 | #ifdef JPEG_INTERNALS 47 | 48 | /* Define this if your compiler implements ">>" on signed values as a logical 49 | * (unsigned) shift; leave it undefined if ">>" is a signed (arithmetic) shift, 50 | * which is the normal and rational definition. 51 | */ 52 | #undef RIGHT_SHIFT_IS_UNSIGNED 53 | 54 | 55 | #endif /* JPEG_INTERNALS */ 56 | 57 | 58 | /* 59 | * The remaining options do not affect the JPEG library proper, 60 | * but only the sample applications cjpeg/djpeg (see cjpeg.c, djpeg.c). 61 | * Other applications can ignore these. 62 | */ 63 | 64 | #ifdef JPEG_CJPEG_DJPEG 65 | 66 | /* These defines indicate which image (non-JPEG) file formats are allowed. */ 67 | 68 | #define BMP_SUPPORTED /* BMP image file format */ 69 | #define GIF_SUPPORTED /* GIF image file format */ 70 | #define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */ 71 | #define TARGA_SUPPORTED /* Targa image file format */ 72 | 73 | /* Define this if you want to name both input and output files on the command 74 | * line, rather than using stdout and optionally stdin. You MUST do this if 75 | * your system can't cope with binary I/O to stdin/stdout. See comments at 76 | * head of cjpeg.c or djpeg.c. 77 | */ 78 | #undef TWO_FILE_COMMANDLINE 79 | 80 | /* By default, we open image files with fopen(..., "rb") or fopen(..., "wb"). 81 | * This is necessary on systems that distinguish text files from binary files, 82 | * and is harmless on most systems that don't. If you have one of the rare 83 | * systems that complains about the "b" spec, define this symbol. 84 | */ 85 | #undef DONT_USE_B_MODE 86 | 87 | /* Define this if you want percent-done progress reports from cjpeg/djpeg. 88 | */ 89 | #undef PROGRESS_REPORT 90 | 91 | 92 | #endif /* JPEG_CJPEG_DJPEG */ 93 | -------------------------------------------------------------------------------- /jconfigint.h.in: -------------------------------------------------------------------------------- 1 | /* libjpeg-turbo build number */ 2 | #define BUILD "@BUILD@" 3 | 4 | /* How to hide global symbols. */ 5 | #define HIDDEN @HIDDEN@ 6 | 7 | /* Compiler's inline keyword */ 8 | #undef inline 9 | 10 | /* How to obtain function inlining. */ 11 | #define INLINE @INLINE@ 12 | 13 | /* How to obtain thread-local storage */ 14 | #define THREAD_LOCAL @THREAD_LOCAL@ 15 | 16 | /* Define to the full name of this package. */ 17 | #define PACKAGE_NAME "@CMAKE_PROJECT_NAME@" 18 | 19 | /* Version number of package */ 20 | #define VERSION "@VERSION@" 21 | 22 | /* The size of `size_t', as computed by sizeof. */ 23 | #define SIZEOF_SIZE_T @SIZE_T@ 24 | 25 | /* Define if your compiler has __builtin_ctzl() and sizeof(unsigned long) == sizeof(size_t). */ 26 | #cmakedefine HAVE_BUILTIN_CTZL 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #cmakedefine HAVE_INTRIN_H 30 | 31 | #if defined(_MSC_VER) && defined(HAVE_INTRIN_H) 32 | #if (SIZEOF_SIZE_T == 8) 33 | #define HAVE_BITSCANFORWARD64 34 | #elif (SIZEOF_SIZE_T == 4) 35 | #define HAVE_BITSCANFORWARD 36 | #endif 37 | #endif 38 | 39 | #if defined(__has_attribute) 40 | #if __has_attribute(fallthrough) 41 | #define FALLTHROUGH __attribute__((fallthrough)); 42 | #else 43 | #define FALLTHROUGH 44 | #endif 45 | #else 46 | #define FALLTHROUGH 47 | #endif 48 | 49 | /* 50 | * Define BITS_IN_JSAMPLE as either 51 | * 8 for 8-bit sample values (the usual setting) 52 | * 12 for 12-bit sample values 53 | * Only 8 and 12 are legal data precisions for lossy JPEG according to the 54 | * JPEG standard, and the IJG code does not support anything else! 55 | */ 56 | 57 | #ifndef BITS_IN_JSAMPLE 58 | #define BITS_IN_JSAMPLE 8 /* use 8 or 12 */ 59 | #endif 60 | 61 | #undef C_ARITH_CODING_SUPPORTED 62 | #undef D_ARITH_CODING_SUPPORTED 63 | #undef WITH_SIMD 64 | 65 | #if BITS_IN_JSAMPLE == 8 66 | 67 | /* Support arithmetic encoding */ 68 | #cmakedefine C_ARITH_CODING_SUPPORTED 1 69 | 70 | /* Support arithmetic decoding */ 71 | #cmakedefine D_ARITH_CODING_SUPPORTED 1 72 | 73 | /* Use accelerated SIMD routines. */ 74 | #cmakedefine WITH_SIMD 1 75 | 76 | #endif 77 | -------------------------------------------------------------------------------- /jdcoefct.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jdcoefct.h 3 | * 4 | * This file was part of the Independent JPEG Group's software: 5 | * Copyright (C) 1994-1997, Thomas G. Lane. 6 | * libjpeg-turbo Modifications: 7 | * Copyright 2009 Pierre Ossman for Cendio AB 8 | * Copyright (C) 2020, Google, Inc. 9 | * Copyright (C) 2022, D. R. Commander. 10 | * For conditions of distribution and use, see the accompanying README.ijg 11 | * file. 12 | */ 13 | 14 | #define JPEG_INTERNALS 15 | #include "jpeglib.h" 16 | 17 | 18 | #if BITS_IN_JSAMPLE != 16 || defined(D_LOSSLESS_SUPPORTED) 19 | 20 | /* Block smoothing is only applicable for progressive JPEG, so: */ 21 | #ifndef D_PROGRESSIVE_SUPPORTED 22 | #undef BLOCK_SMOOTHING_SUPPORTED 23 | #endif 24 | 25 | 26 | /* Private buffer controller object */ 27 | 28 | typedef struct { 29 | struct jpeg_d_coef_controller pub; /* public fields */ 30 | 31 | /* These variables keep track of the current location of the input side. */ 32 | /* cinfo->input_iMCU_row is also used for this. */ 33 | JDIMENSION MCU_ctr; /* counts MCUs processed in current row */ 34 | int MCU_vert_offset; /* counts MCU rows within iMCU row */ 35 | int MCU_rows_per_iMCU_row; /* number of such rows needed */ 36 | 37 | /* The output side's location is represented by cinfo->output_iMCU_row. */ 38 | 39 | /* In single-pass modes, it's sufficient to buffer just one MCU. 40 | * We allocate a workspace of D_MAX_BLOCKS_IN_MCU coefficient blocks, 41 | * and let the entropy decoder write into that workspace each time. 42 | * In multi-pass modes, this array points to the current MCU's blocks 43 | * within the virtual arrays; it is used only by the input side. 44 | */ 45 | JBLOCKROW MCU_buffer[D_MAX_BLOCKS_IN_MCU]; 46 | 47 | /* Temporary workspace for one MCU */ 48 | JCOEF *workspace; 49 | 50 | #ifdef D_MULTISCAN_FILES_SUPPORTED 51 | /* In multi-pass modes, we need a virtual block array for each component. */ 52 | jvirt_barray_ptr whole_image[MAX_COMPONENTS]; 53 | #endif 54 | 55 | #ifdef BLOCK_SMOOTHING_SUPPORTED 56 | /* When doing block smoothing, we latch coefficient Al values here */ 57 | int *coef_bits_latch; 58 | #define SAVED_COEFS 10 /* we save coef_bits[0..9] */ 59 | #endif 60 | } my_coef_controller; 61 | 62 | typedef my_coef_controller *my_coef_ptr; 63 | 64 | 65 | LOCAL(void) 66 | start_iMCU_row(j_decompress_ptr cinfo) 67 | /* Reset within-iMCU-row counters for a new row (input side) */ 68 | { 69 | my_coef_ptr coef = (my_coef_ptr)cinfo->coef; 70 | 71 | /* In an interleaved scan, an MCU row is the same as an iMCU row. 72 | * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows. 73 | * But at the bottom of the image, process only what's left. 74 | */ 75 | if (cinfo->comps_in_scan > 1) { 76 | coef->MCU_rows_per_iMCU_row = 1; 77 | } else { 78 | if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows - 1)) 79 | coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor; 80 | else 81 | coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height; 82 | } 83 | 84 | coef->MCU_ctr = 0; 85 | coef->MCU_vert_offset = 0; 86 | } 87 | 88 | #endif /* BITS_IN_JSAMPLE != 16 || defined(D_LOSSLESS_SUPPORTED) */ 89 | -------------------------------------------------------------------------------- /jdmainct.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jdmainct.h 3 | * 4 | * This file was part of the Independent JPEG Group's software: 5 | * Copyright (C) 1994-1996, Thomas G. Lane. 6 | * libjpeg-turbo Modifications: 7 | * Copyright (C) 2022, D. R. Commander. 8 | * For conditions of distribution and use, see the accompanying README.ijg 9 | * file. 10 | */ 11 | 12 | #define JPEG_INTERNALS 13 | #include "jpeglib.h" 14 | #include "jpegapicomp.h" 15 | #include "jsamplecomp.h" 16 | 17 | 18 | #if BITS_IN_JSAMPLE != 16 || defined(D_LOSSLESS_SUPPORTED) 19 | 20 | /* Private buffer controller object */ 21 | 22 | typedef struct { 23 | struct jpeg_d_main_controller pub; /* public fields */ 24 | 25 | /* Pointer to allocated workspace (M or M+2 row groups). */ 26 | _JSAMPARRAY buffer[MAX_COMPONENTS]; 27 | 28 | boolean buffer_full; /* Have we gotten an iMCU row from decoder? */ 29 | JDIMENSION rowgroup_ctr; /* counts row groups output to postprocessor */ 30 | 31 | /* Remaining fields are only used in the context case. */ 32 | 33 | /* These are the master pointers to the funny-order pointer lists. */ 34 | _JSAMPIMAGE xbuffer[2]; /* pointers to weird pointer lists */ 35 | 36 | int whichptr; /* indicates which pointer set is now in use */ 37 | int context_state; /* process_data state machine status */ 38 | JDIMENSION rowgroups_avail; /* row groups available to postprocessor */ 39 | JDIMENSION iMCU_row_ctr; /* counts iMCU rows to detect image top/bot */ 40 | } my_main_controller; 41 | 42 | typedef my_main_controller *my_main_ptr; 43 | 44 | 45 | /* context_state values: */ 46 | #define CTX_PREPARE_FOR_IMCU 0 /* need to prepare for MCU row */ 47 | #define CTX_PROCESS_IMCU 1 /* feeding iMCU to postprocessor */ 48 | #define CTX_POSTPONED_ROW 2 /* feeding postponed row group */ 49 | 50 | 51 | LOCAL(void) 52 | set_wraparound_pointers(j_decompress_ptr cinfo) 53 | /* Set up the "wraparound" pointers at top and bottom of the pointer lists. 54 | * This changes the pointer list state from top-of-image to the normal state. 55 | */ 56 | { 57 | my_main_ptr main_ptr = (my_main_ptr)cinfo->main; 58 | int ci, i, rgroup; 59 | int M = cinfo->_min_DCT_scaled_size; 60 | jpeg_component_info *compptr; 61 | _JSAMPARRAY xbuf0, xbuf1; 62 | 63 | for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; 64 | ci++, compptr++) { 65 | rgroup = (compptr->v_samp_factor * compptr->_DCT_scaled_size) / 66 | cinfo->_min_DCT_scaled_size; /* height of a row group of component */ 67 | xbuf0 = main_ptr->xbuffer[0][ci]; 68 | xbuf1 = main_ptr->xbuffer[1][ci]; 69 | for (i = 0; i < rgroup; i++) { 70 | xbuf0[i - rgroup] = xbuf0[rgroup * (M + 1) + i]; 71 | xbuf1[i - rgroup] = xbuf1[rgroup * (M + 1) + i]; 72 | xbuf0[rgroup * (M + 2) + i] = xbuf0[i]; 73 | xbuf1[rgroup * (M + 2) + i] = xbuf1[i]; 74 | } 75 | } 76 | } 77 | 78 | #endif /* BITS_IN_JSAMPLE != 16 || defined(D_LOSSLESS_SUPPORTED) */ 79 | -------------------------------------------------------------------------------- /jdmaster.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jdmaster.h 3 | * 4 | * This file was part of the Independent JPEG Group's software: 5 | * Copyright (C) 1991-1995, Thomas G. Lane. 6 | * For conditions of distribution and use, see the accompanying README.ijg 7 | * file. 8 | * 9 | * This file contains the master control structure for the JPEG decompressor. 10 | */ 11 | 12 | /* Private state */ 13 | 14 | typedef struct { 15 | struct jpeg_decomp_master pub; /* public fields */ 16 | 17 | int pass_number; /* # of passes completed */ 18 | 19 | boolean using_merged_upsample; /* TRUE if using merged upsample/cconvert */ 20 | 21 | /* Saved references to initialized quantizer modules, 22 | * in case we need to switch modes. 23 | */ 24 | struct jpeg_color_quantizer *quantizer_1pass; 25 | struct jpeg_color_quantizer *quantizer_2pass; 26 | } my_decomp_master; 27 | 28 | typedef my_decomp_master *my_master_ptr; 29 | -------------------------------------------------------------------------------- /jdmerge.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jdmerge.h 3 | * 4 | * This file was part of the Independent JPEG Group's software: 5 | * Copyright (C) 1994-1996, Thomas G. Lane. 6 | * libjpeg-turbo Modifications: 7 | * Copyright (C) 2020, 2022, D. R. Commander. 8 | * For conditions of distribution and use, see the accompanying README.ijg 9 | * file. 10 | */ 11 | 12 | #define JPEG_INTERNALS 13 | #include "jpeglib.h" 14 | #include "jsamplecomp.h" 15 | 16 | #ifdef UPSAMPLE_MERGING_SUPPORTED 17 | 18 | 19 | /* Private subobject */ 20 | 21 | typedef struct { 22 | struct jpeg_upsampler pub; /* public fields */ 23 | 24 | /* Pointer to routine to do actual upsampling/conversion of one row group */ 25 | void (*upmethod) (j_decompress_ptr cinfo, _JSAMPIMAGE input_buf, 26 | JDIMENSION in_row_group_ctr, _JSAMPARRAY output_buf); 27 | 28 | /* Private state for YCC->RGB conversion */ 29 | int *Cr_r_tab; /* => table for Cr to R conversion */ 30 | int *Cb_b_tab; /* => table for Cb to B conversion */ 31 | JLONG *Cr_g_tab; /* => table for Cr to G conversion */ 32 | JLONG *Cb_g_tab; /* => table for Cb to G conversion */ 33 | 34 | /* For 2:1 vertical sampling, we produce two output rows at a time. 35 | * We need a "spare" row buffer to hold the second output row if the 36 | * application provides just a one-row buffer; we also use the spare 37 | * to discard the dummy last row if the image height is odd. 38 | */ 39 | _JSAMPROW spare_row; 40 | boolean spare_full; /* T if spare buffer is occupied */ 41 | 42 | JDIMENSION out_row_width; /* samples per output row */ 43 | JDIMENSION rows_to_go; /* counts rows remaining in image */ 44 | } my_merged_upsampler; 45 | 46 | typedef my_merged_upsampler *my_merged_upsample_ptr; 47 | 48 | #endif /* UPSAMPLE_MERGING_SUPPORTED */ 49 | -------------------------------------------------------------------------------- /jdsample.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jdsample.h 3 | * 4 | * This file was part of the Independent JPEG Group's software: 5 | * Copyright (C) 1991-1996, Thomas G. Lane. 6 | * libjpeg-turbo Modifications: 7 | * Copyright (C) 2022, D. R. Commander. 8 | * For conditions of distribution and use, see the accompanying README.ijg 9 | * file. 10 | */ 11 | 12 | #define JPEG_INTERNALS 13 | #include "jpeglib.h" 14 | #include "jsamplecomp.h" 15 | 16 | 17 | /* Pointer to routine to upsample a single component */ 18 | typedef void (*upsample1_ptr) (j_decompress_ptr cinfo, 19 | jpeg_component_info *compptr, 20 | _JSAMPARRAY input_data, 21 | _JSAMPARRAY *output_data_ptr); 22 | 23 | /* Private subobject */ 24 | 25 | typedef struct { 26 | struct jpeg_upsampler pub; /* public fields */ 27 | 28 | /* Color conversion buffer. When using separate upsampling and color 29 | * conversion steps, this buffer holds one upsampled row group until it 30 | * has been color converted and output. 31 | * Note: we do not allocate any storage for component(s) which are full-size, 32 | * ie do not need rescaling. The corresponding entry of color_buf[] is 33 | * simply set to point to the input data array, thereby avoiding copying. 34 | */ 35 | _JSAMPARRAY color_buf[MAX_COMPONENTS]; 36 | 37 | /* Per-component upsampling method pointers */ 38 | upsample1_ptr methods[MAX_COMPONENTS]; 39 | 40 | int next_row_out; /* counts rows emitted from color_buf */ 41 | JDIMENSION rows_to_go; /* counts rows remaining in image */ 42 | 43 | /* Height of an input row group for each component. */ 44 | int rowgroup_height[MAX_COMPONENTS]; 45 | 46 | /* These arrays save pixel expansion factors so that int_expand need not 47 | * recompute them each time. They are unused for other upsampling methods. 48 | */ 49 | UINT8 h_expand[MAX_COMPONENTS]; 50 | UINT8 v_expand[MAX_COMPONENTS]; 51 | } my_upsampler; 52 | 53 | typedef my_upsampler *my_upsample_ptr; 54 | -------------------------------------------------------------------------------- /jlossls.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jlossls.h 3 | * 4 | * This file was part of the Independent JPEG Group's software: 5 | * Copyright (C) 1998, Thomas G. Lane. 6 | * Lossless JPEG Modifications: 7 | * Copyright (C) 1999, Ken Murchison. 8 | * libjpeg-turbo Modifications: 9 | * Copyright (C) 2022, D. R. Commander. 10 | * For conditions of distribution and use, see the accompanying README.ijg 11 | * file. 12 | * 13 | * This include file contains common declarations for the lossless JPEG 14 | * codec modules. 15 | */ 16 | 17 | #ifndef JLOSSLS_H 18 | #define JLOSSLS_H 19 | 20 | #if defined(C_LOSSLESS_SUPPORTED) || defined(D_LOSSLESS_SUPPORTED) 21 | 22 | #define JPEG_INTERNALS 23 | #include "jpeglib.h" 24 | #include "jsamplecomp.h" 25 | 26 | 27 | #define ALLOC_DARRAY(pool_id, diffsperrow, numrows) \ 28 | (JDIFFARRAY)(*cinfo->mem->alloc_sarray) \ 29 | ((j_common_ptr)cinfo, pool_id, \ 30 | (diffsperrow) * sizeof(JDIFF) / sizeof(_JSAMPLE), numrows) 31 | 32 | 33 | /* 34 | * Table H.1: Predictors for lossless coding. 35 | */ 36 | 37 | #define PREDICTOR1 Ra 38 | #define PREDICTOR2 Rb 39 | #define PREDICTOR3 Rc 40 | #define PREDICTOR4 (int)((JLONG)Ra + (JLONG)Rb - (JLONG)Rc) 41 | #define PREDICTOR5 (int)((JLONG)Ra + RIGHT_SHIFT((JLONG)Rb - (JLONG)Rc, 1)) 42 | #define PREDICTOR6 (int)((JLONG)Rb + RIGHT_SHIFT((JLONG)Ra - (JLONG)Rc, 1)) 43 | #define PREDICTOR7 (int)RIGHT_SHIFT((JLONG)Ra + (JLONG)Rb, 1) 44 | 45 | #endif 46 | 47 | 48 | #ifdef C_LOSSLESS_SUPPORTED 49 | 50 | typedef void (*predict_difference_method_ptr) (j_compress_ptr cinfo, int ci, 51 | _JSAMPROW input_buf, 52 | _JSAMPROW prev_row, 53 | JDIFFROW diff_buf, 54 | JDIMENSION width); 55 | 56 | /* Lossless compressor */ 57 | typedef struct { 58 | struct jpeg_forward_dct pub; /* public fields */ 59 | 60 | /* It is useful to allow each component to have a separate diff method. */ 61 | predict_difference_method_ptr predict_difference[MAX_COMPONENTS]; 62 | 63 | /* MCU rows left in the restart interval for each component */ 64 | unsigned int restart_rows_to_go[MAX_COMPONENTS]; 65 | 66 | /* Sample scaling */ 67 | void (*scaler_scale) (j_compress_ptr cinfo, _JSAMPROW input_buf, 68 | _JSAMPROW output_buf, JDIMENSION width); 69 | } jpeg_lossless_compressor; 70 | 71 | typedef jpeg_lossless_compressor *lossless_comp_ptr; 72 | 73 | #endif /* C_LOSSLESS_SUPPORTED */ 74 | 75 | 76 | #ifdef D_LOSSLESS_SUPPORTED 77 | 78 | typedef void (*predict_undifference_method_ptr) (j_decompress_ptr cinfo, 79 | int comp_index, 80 | JDIFFROW diff_buf, 81 | JDIFFROW prev_row, 82 | JDIFFROW undiff_buf, 83 | JDIMENSION width); 84 | 85 | /* Lossless decompressor */ 86 | typedef struct { 87 | struct jpeg_inverse_dct pub; /* public fields */ 88 | 89 | /* It is useful to allow each component to have a separate undiff method. */ 90 | predict_undifference_method_ptr predict_undifference[MAX_COMPONENTS]; 91 | 92 | /* Sample scaling */ 93 | void (*scaler_scale) (j_decompress_ptr cinfo, JDIFFROW diff_buf, 94 | _JSAMPROW output_buf, JDIMENSION width); 95 | } jpeg_lossless_decompressor; 96 | 97 | typedef jpeg_lossless_decompressor *lossless_decomp_ptr; 98 | 99 | #endif /* D_LOSSLESS_SUPPORTED */ 100 | 101 | #endif /* JLOSSLS_H */ 102 | -------------------------------------------------------------------------------- /jmemnobs.c: -------------------------------------------------------------------------------- 1 | /* 2 | * jmemnobs.c 3 | * 4 | * This file was part of the Independent JPEG Group's software: 5 | * Copyright (C) 1992-1996, Thomas G. Lane. 6 | * libjpeg-turbo Modifications: 7 | * Copyright (C) 2017-2018, D. R. Commander. 8 | * For conditions of distribution and use, see the accompanying README.ijg 9 | * file. 10 | * 11 | * This file provides a really simple implementation of the system- 12 | * dependent portion of the JPEG memory manager. This implementation 13 | * assumes that no backing-store files are needed: all required space 14 | * can be obtained from malloc(). 15 | * This is very portable in the sense that it'll compile on almost anything, 16 | * but you'd better have lots of main memory (or virtual memory) if you want 17 | * to process big images. 18 | */ 19 | 20 | #define JPEG_INTERNALS 21 | #include "jinclude.h" 22 | #include "jpeglib.h" 23 | #include "jmemsys.h" /* import the system-dependent declarations */ 24 | 25 | 26 | /* 27 | * Memory allocation and freeing are controlled by the regular library 28 | * routines malloc() and free(). 29 | */ 30 | 31 | GLOBAL(void *) 32 | jpeg_get_small(j_common_ptr cinfo, size_t sizeofobject) 33 | { 34 | return (void *)malloc(sizeofobject); 35 | } 36 | 37 | GLOBAL(void) 38 | jpeg_free_small(j_common_ptr cinfo, void *object, size_t sizeofobject) 39 | { 40 | free(object); 41 | } 42 | 43 | 44 | /* 45 | * "Large" objects are treated the same as "small" ones. 46 | */ 47 | 48 | GLOBAL(void *) 49 | jpeg_get_large(j_common_ptr cinfo, size_t sizeofobject) 50 | { 51 | return (void *)malloc(sizeofobject); 52 | } 53 | 54 | GLOBAL(void) 55 | jpeg_free_large(j_common_ptr cinfo, void *object, size_t sizeofobject) 56 | { 57 | free(object); 58 | } 59 | 60 | 61 | /* 62 | * This routine computes the total memory space available for allocation. 63 | */ 64 | 65 | GLOBAL(size_t) 66 | jpeg_mem_available(j_common_ptr cinfo, size_t min_bytes_needed, 67 | size_t max_bytes_needed, size_t already_allocated) 68 | { 69 | if (cinfo->mem->max_memory_to_use) { 70 | if ((size_t)cinfo->mem->max_memory_to_use > already_allocated) 71 | return cinfo->mem->max_memory_to_use - already_allocated; 72 | else 73 | return 0; 74 | } else { 75 | /* Here we always say, "we got all you want bud!" */ 76 | return max_bytes_needed; 77 | } 78 | } 79 | 80 | 81 | /* 82 | * Backing store (temporary file) management. 83 | * Since jpeg_mem_available always promised the moon, 84 | * this should never be called and we can just error out. 85 | */ 86 | 87 | GLOBAL(void) 88 | jpeg_open_backing_store(j_common_ptr cinfo, backing_store_ptr info, 89 | long total_bytes_needed) 90 | { 91 | ERREXIT(cinfo, JERR_NO_BACKING_STORE); 92 | } 93 | 94 | 95 | /* 96 | * These routines take care of any system-dependent initialization and 97 | * cleanup required. Here, there isn't any. 98 | */ 99 | 100 | GLOBAL(long) 101 | jpeg_mem_init(j_common_ptr cinfo) 102 | { 103 | return 0; /* just set max_memory_to_use to 0 */ 104 | } 105 | 106 | GLOBAL(void) 107 | jpeg_mem_term(j_common_ptr cinfo) 108 | { 109 | /* no work */ 110 | } 111 | -------------------------------------------------------------------------------- /jpeg_nbits.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014, 2021, 2024, D. R. Commander. 3 | * Copyright (C) 2014, Olle Liljenzin. 4 | * Copyright (C) 2020, Arm Limited. 5 | * 6 | * For conditions of distribution and use, see the accompanying README.ijg 7 | * file. 8 | */ 9 | 10 | /* 11 | * NOTE: If USE_CLZ_INTRINSIC is defined, then clz/bsr instructions will be 12 | * used for bit counting rather than the lookup table. This will reduce the 13 | * memory footprint by 64k, which is important for some mobile applications 14 | * that create many isolated instances of libjpeg-turbo (web browsers, for 15 | * instance.) This may improve performance on some mobile platforms as well. 16 | * This feature is enabled by default only on Arm processors, because some x86 17 | * chips have a slow implementation of bsr, and the use of clz/bsr cannot be 18 | * shown to have a significant performance impact even on the x86 chips that 19 | * have a fast implementation of it. When building for Armv6, you can 20 | * explicitly disable the use of clz/bsr by adding -mthumb to the compiler 21 | * flags (this defines __thumb__). 22 | */ 23 | 24 | /* NOTE: Both GCC and Clang define __GNUC__ */ 25 | #if (defined(__GNUC__) && (defined(__arm__) || defined(__aarch64__))) || \ 26 | defined(_M_ARM) || defined(_M_ARM64) 27 | #if !defined(__thumb__) || defined(__thumb2__) 28 | #define USE_CLZ_INTRINSIC 29 | #endif 30 | #endif 31 | 32 | #ifdef USE_CLZ_INTRINSIC 33 | #if defined(_MSC_VER) && !defined(__clang__) 34 | #define JPEG_NBITS_NONZERO(x) (32 - _CountLeadingZeros(x)) 35 | #else 36 | #define JPEG_NBITS_NONZERO(x) (32 - __builtin_clz(x)) 37 | #endif 38 | #define JPEG_NBITS(x) (x ? JPEG_NBITS_NONZERO(x) : 0) 39 | #else 40 | extern const unsigned char jpeg_nbits_table[65536]; 41 | #define JPEG_NBITS(x) (jpeg_nbits_table[x]) 42 | #define JPEG_NBITS_NONZERO(x) JPEG_NBITS(x) 43 | #endif 44 | -------------------------------------------------------------------------------- /jpegapicomp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jpegapicomp.h 3 | * 4 | * Copyright (C) 2010, 2020, D. R. Commander. 5 | * For conditions of distribution and use, see the accompanying README.ijg 6 | * file. 7 | * 8 | * JPEG compatibility macros 9 | * These declarations are considered internal to the JPEG library; most 10 | * applications using the library shouldn't need to include this file. 11 | */ 12 | 13 | #if JPEG_LIB_VERSION >= 70 14 | #define _DCT_scaled_size DCT_h_scaled_size 15 | #define _DCT_h_scaled_size DCT_h_scaled_size 16 | #define _DCT_v_scaled_size DCT_v_scaled_size 17 | #define _min_DCT_scaled_size min_DCT_h_scaled_size 18 | #define _min_DCT_h_scaled_size min_DCT_h_scaled_size 19 | #define _min_DCT_v_scaled_size min_DCT_v_scaled_size 20 | #define _jpeg_width jpeg_width 21 | #define _jpeg_height jpeg_height 22 | #define JERR_ARITH_NOTIMPL JERR_NOT_COMPILED 23 | #else 24 | #define _DCT_scaled_size DCT_scaled_size 25 | #define _DCT_h_scaled_size DCT_scaled_size 26 | #define _DCT_v_scaled_size DCT_scaled_size 27 | #define _min_DCT_scaled_size min_DCT_scaled_size 28 | #define _min_DCT_h_scaled_size min_DCT_scaled_size 29 | #define _min_DCT_v_scaled_size min_DCT_scaled_size 30 | #define _jpeg_width image_width 31 | #define _jpeg_height image_height 32 | #endif 33 | -------------------------------------------------------------------------------- /jsimddct.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jsimddct.h 3 | * 4 | * Copyright 2009 Pierre Ossman for Cendio AB 5 | * 6 | * Based on the x86 SIMD extension for IJG JPEG library, 7 | * Copyright (C) 1999-2006, MIYASAKA Masaru. 8 | * For conditions of distribution and use, see copyright notice in jsimdext.inc 9 | * 10 | */ 11 | 12 | EXTERN(int) jsimd_can_convsamp(void); 13 | EXTERN(int) jsimd_can_convsamp_float(void); 14 | 15 | EXTERN(void) jsimd_convsamp(JSAMPARRAY sample_data, JDIMENSION start_col, 16 | DCTELEM *workspace); 17 | EXTERN(void) jsimd_convsamp_float(JSAMPARRAY sample_data, JDIMENSION start_col, 18 | FAST_FLOAT *workspace); 19 | 20 | EXTERN(int) jsimd_can_fdct_islow(void); 21 | EXTERN(int) jsimd_can_fdct_ifast(void); 22 | EXTERN(int) jsimd_can_fdct_float(void); 23 | 24 | EXTERN(void) jsimd_fdct_islow(DCTELEM *data); 25 | EXTERN(void) jsimd_fdct_ifast(DCTELEM *data); 26 | EXTERN(void) jsimd_fdct_float(FAST_FLOAT *data); 27 | 28 | EXTERN(int) jsimd_can_quantize(void); 29 | EXTERN(int) jsimd_can_quantize_float(void); 30 | 31 | EXTERN(void) jsimd_quantize(JCOEFPTR coef_block, DCTELEM *divisors, 32 | DCTELEM *workspace); 33 | EXTERN(void) jsimd_quantize_float(JCOEFPTR coef_block, FAST_FLOAT *divisors, 34 | FAST_FLOAT *workspace); 35 | 36 | EXTERN(int) jsimd_can_idct_2x2(void); 37 | EXTERN(int) jsimd_can_idct_4x4(void); 38 | EXTERN(int) jsimd_can_idct_6x6(void); 39 | EXTERN(int) jsimd_can_idct_12x12(void); 40 | 41 | EXTERN(void) jsimd_idct_2x2(j_decompress_ptr cinfo, 42 | jpeg_component_info *compptr, JCOEFPTR coef_block, 43 | JSAMPARRAY output_buf, JDIMENSION output_col); 44 | EXTERN(void) jsimd_idct_4x4(j_decompress_ptr cinfo, 45 | jpeg_component_info *compptr, JCOEFPTR coef_block, 46 | JSAMPARRAY output_buf, JDIMENSION output_col); 47 | EXTERN(void) jsimd_idct_6x6(j_decompress_ptr cinfo, 48 | jpeg_component_info *compptr, JCOEFPTR coef_block, 49 | JSAMPARRAY output_buf, JDIMENSION output_col); 50 | EXTERN(void) jsimd_idct_12x12(j_decompress_ptr cinfo, 51 | jpeg_component_info *compptr, 52 | JCOEFPTR coef_block, JSAMPARRAY output_buf, 53 | JDIMENSION output_col); 54 | 55 | EXTERN(int) jsimd_can_idct_islow(void); 56 | EXTERN(int) jsimd_can_idct_ifast(void); 57 | EXTERN(int) jsimd_can_idct_float(void); 58 | 59 | EXTERN(void) jsimd_idct_islow(j_decompress_ptr cinfo, 60 | jpeg_component_info *compptr, 61 | JCOEFPTR coef_block, JSAMPARRAY output_buf, 62 | JDIMENSION output_col); 63 | EXTERN(void) jsimd_idct_ifast(j_decompress_ptr cinfo, 64 | jpeg_component_info *compptr, 65 | JCOEFPTR coef_block, JSAMPARRAY output_buf, 66 | JDIMENSION output_col); 67 | EXTERN(void) jsimd_idct_float(j_decompress_ptr cinfo, 68 | jpeg_component_info *compptr, 69 | JCOEFPTR coef_block, JSAMPARRAY output_buf, 70 | JDIMENSION output_col); 71 | -------------------------------------------------------------------------------- /jversion.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * jversion.h 3 | * 4 | * This file was part of the Independent JPEG Group's software: 5 | * Copyright (C) 1991-2020, Thomas G. Lane, Guido Vollbeding. 6 | * libjpeg-turbo Modifications: 7 | * Copyright (C) 2010, 2012-2024, D. R. Commander. 8 | * For conditions of distribution and use, see the accompanying README.ijg 9 | * file. 10 | * 11 | * This file contains software version identification. 12 | */ 13 | 14 | 15 | #if JPEG_LIB_VERSION >= 80 16 | 17 | #define JVERSION "8d 15-Jan-2012" 18 | 19 | #elif JPEG_LIB_VERSION >= 70 20 | 21 | #define JVERSION "7 27-Jun-2009" 22 | 23 | #else 24 | 25 | #define JVERSION "6b 27-Mar-1998" 26 | 27 | #endif 28 | 29 | /* 30 | * NOTE: It is our convention to place the authors in the following order: 31 | * - libjpeg-turbo authors (2009-) in descending order of the date of their 32 | * most recent contribution to the project, then in ascending order of the 33 | * date of their first contribution to the project, then in alphabetical 34 | * order 35 | * - Upstream authors in descending order of the date of the first inclusion of 36 | * their code 37 | */ 38 | 39 | #define JCOPYRIGHT1 \ 40 | "Copyright (C) 2009-2024 D. R. Commander\n" \ 41 | "Copyright (C) 2015, 2020 Google, Inc.\n" \ 42 | "Copyright (C) 2019-2020 Arm Limited\n" \ 43 | "Copyright (C) 2015-2016, 2018 Matthieu Darbois\n" \ 44 | "Copyright (C) 2011-2016 Siarhei Siamashka\n" \ 45 | "Copyright (C) 2015 Intel Corporation\n" 46 | #define JCOPYRIGHT2 \ 47 | "Copyright (C) 2013-2014 Linaro Limited\n" \ 48 | "Copyright (C) 2013-2014 MIPS Technologies, Inc.\n" \ 49 | "Copyright (C) 2009, 2012 Pierre Ossman for Cendio AB\n" \ 50 | "Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies)\n" \ 51 | "Copyright (C) 1999-2006 MIYASAKA Masaru\n" \ 52 | "Copyright (C) 1999 Ken Murchison\n" \ 53 | "Copyright (C) 1991-2020 Thomas G. Lane, Guido Vollbeding\n" 54 | 55 | #define JCOPYRIGHT_SHORT \ 56 | "Copyright (C) @COPYRIGHT_YEAR@ The libjpeg-turbo Project and many others" 57 | -------------------------------------------------------------------------------- /libjpeg.map.in: -------------------------------------------------------------------------------- 1 | LIBJPEGTURBO_@JPEG_LIB_VERSION_DECIMAL@ { 2 | @MEM_SRCDST_FUNCTIONS@ 3 | local: 4 | jsimd_*; 5 | jconst_*; 6 | }; 7 | 8 | LIBJPEG_@JPEG_LIB_VERSION_DECIMAL@ { 9 | global: 10 | *; 11 | }; 12 | -------------------------------------------------------------------------------- /md5/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(md5cmp md5cmp.c md5.c md5hl.c) 2 | -------------------------------------------------------------------------------- /md5/md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libjpeg-turbo Modifications: 3 | * Copyright (C)2018 D. R. Commander. All Rights Reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * 8 | * - Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * - Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * - Neither the name of the libjpeg-turbo Project nor the names of its 14 | * contributors may be used to endorse or promote products derived from this 15 | * software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", 18 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 21 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27 | * POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef MD5_H 31 | #define MD5_H 32 | 33 | #include 34 | #ifdef __amigaos4__ 35 | #include 36 | #endif 37 | 38 | /* On machines where "long" is 64 bits, we need to declare 39 | uint32 as something guaranteed to be 32 bits. */ 40 | 41 | typedef unsigned int uint32; 42 | 43 | typedef struct MD5Context { 44 | uint32 buf[4]; 45 | uint32 bits[2]; 46 | unsigned char in[64]; 47 | } MD5_CTX; 48 | 49 | extern void MD5Init(struct MD5Context *ctx); 50 | extern void MD5Update(struct MD5Context *ctx, unsigned char *buf, 51 | unsigned int len); 52 | extern void MD5Final(unsigned char digest[16], struct MD5Context *ctx); 53 | extern void MD5Transform(uint32 buf[4], uint32 in[16]); 54 | extern char *MD5File(const char *, char *); 55 | extern char *MD5FileChunk(const char *, char *, off_t, off_t); 56 | 57 | #endif /* !MD5_H */ 58 | -------------------------------------------------------------------------------- /md5/md5cmp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C)2013, 2016 D. R. Commander. All Rights Reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * - Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * - Redistributions in binary form must reproduce the above copyright notice, 10 | * this list of conditions and the following disclaimer in the documentation 11 | * and/or other materials provided with the distribution. 12 | * - Neither the name of the libjpeg-turbo Project nor the names of its 13 | * contributors may be used to endorse or promote products derived from this 14 | * software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | * POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #include 30 | #include 31 | #include "./md5.h" 32 | #include "../tjutil.h" 33 | 34 | int main(int argc, char *argv[]) 35 | { 36 | char *md5sum = NULL, buf[65]; 37 | 38 | if (argc < 3) { 39 | fprintf(stderr, "USAGE: %s \n", argv[0]); 40 | return -1; 41 | } 42 | 43 | if (strlen(argv[1]) != 32) 44 | fprintf(stderr, "WARNING: MD5 hash size is wrong.\n"); 45 | 46 | md5sum = MD5File(argv[2], buf); 47 | if (!md5sum) { 48 | perror("Could not obtain MD5 sum"); 49 | return -1; 50 | } 51 | 52 | if (!strcasecmp(md5sum, argv[1])) { 53 | fprintf(stderr, "%s: OK\n", argv[2]); 54 | return 0; 55 | } else { 56 | fprintf(stderr, "%s: FAILED. Checksum is %s\n", argv[2], md5sum); 57 | return -1; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /rdjpgcom.1: -------------------------------------------------------------------------------- 1 | .TH RDJPGCOM 1 "02 April 2009" 2 | .SH NAME 3 | rdjpgcom \- display text comments from a JPEG file 4 | .SH SYNOPSIS 5 | .B rdjpgcom 6 | [ 7 | .B \-raw 8 | ] 9 | [ 10 | .B \-verbose 11 | ] 12 | [ 13 | .I filename 14 | ] 15 | .LP 16 | .SH DESCRIPTION 17 | .LP 18 | .B rdjpgcom 19 | reads the named JPEG/JFIF file, or the standard input if no file is named, 20 | and prints any text comments found in the file on the standard output. 21 | .PP 22 | The JPEG standard allows "comment" (COM) blocks to occur within a JPEG file. 23 | Although the standard doesn't actually define what COM blocks are for, they 24 | are widely used to hold user-supplied text strings. This lets you add 25 | annotations, titles, index terms, etc to your JPEG files, and later retrieve 26 | them as text. COM blocks do not interfere with the image stored in the JPEG 27 | file. The maximum size of a COM block is 64K, but you can have as many of 28 | them as you like in one JPEG file. 29 | .SH OPTIONS 30 | .TP 31 | .B \-raw 32 | Normally 33 | .B rdjpgcom 34 | escapes non-printable characters in comments, for security reasons. 35 | This option avoids that. 36 | .PP 37 | .B \-verbose 38 | Causes 39 | .B rdjpgcom 40 | to also display the JPEG image dimensions. 41 | .PP 42 | Switch names may be abbreviated, and are not case sensitive. 43 | .SH HINTS 44 | .B rdjpgcom 45 | does not depend on the IJG JPEG library. Its source code is intended as an 46 | illustration of the minimum amount of code required to parse a JPEG file 47 | header correctly. 48 | .PP 49 | In 50 | .B \-verbose 51 | mode, 52 | .B rdjpgcom 53 | will also attempt to print the contents of any "APP12" markers as text. 54 | Some digital cameras produce APP12 markers containing useful textual 55 | information. If you like, you can modify the source code to print 56 | other APPn marker types as well. 57 | .SH SEE ALSO 58 | .BR cjpeg (1), 59 | .BR djpeg (1), 60 | .BR jpegtran (1), 61 | .BR wrjpgcom (1) 62 | .SH AUTHOR 63 | Independent JPEG Group 64 | -------------------------------------------------------------------------------- /release/Config.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | include("${CMAKE_CURRENT_LIST_DIR}/@CMAKE_PROJECT_NAME@Targets.cmake") 4 | check_required_components("@CMAKE_PROJECT_NAME@") 5 | -------------------------------------------------------------------------------- /release/Distribution.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | @CMAKE_PROJECT_NAME@ 4 | 5 | 6 | 7 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | @PKGNAME@.pkg 24 | 25 | -------------------------------------------------------------------------------- /release/License.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf350 2 | {\fonttbl\f0\fswiss\fcharset0 Helvetica;} 3 | {\colortbl;\red255\green255\blue255;} 4 | {\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}} 5 | {\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}} 6 | \margl1440\margr1440\vieww9820\viewh8480\viewkind0 7 | \deftab720 8 | \pard\pardeftab720 9 | 10 | \f0\fs24 \cf0 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\ 11 | \ 12 | \pard\tx220\tx720\pardeftab720\li720\fi-720 13 | \ls1\ilvl0\cf0 {\listtext \'95 }Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\ 14 | {\listtext \'95 }Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\ 15 | {\listtext \'95 }Neither the name of the libjpeg-turbo Project nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\ 16 | \pard\pardeftab720\qc 17 | \cf0 \ 18 | \pard\pardeftab720 19 | \cf0 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\ 20 | } -------------------------------------------------------------------------------- /release/ReadMe.txt: -------------------------------------------------------------------------------- 1 | libjpeg-turbo is a JPEG image codec that uses SIMD instructions to accelerate baseline JPEG compression and decompression on x86, x86-64, Arm, PowerPC, and MIPS systems, as well as progressive JPEG compression on x86, x86-64, and Arm systems. On such systems, libjpeg-turbo is generally 2-6x as fast as libjpeg, all else being equal. On other types of systems, libjpeg-turbo can still outperform libjpeg by a significant amount, by virtue of its highly-optimized Huffman coding routines. In many cases, the performance of libjpeg-turbo rivals that of proprietary high-speed JPEG codecs. 2 | 3 | libjpeg-turbo implements both the traditional libjpeg API as well as the less powerful but more straightforward TurboJPEG API. libjpeg-turbo also features colorspace extensions that allow it to compress from/decompress to 32-bit and big-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java interface. 4 | 5 | libjpeg-turbo was originally based on libjpeg/SIMD, an MMX-accelerated derivative of libjpeg v6b developed by Miyasaka Masaru. The TigerVNC and VirtualGL projects made numerous enhancements to the codec in 2009, and in early 2010, libjpeg-turbo spun off into an independent project, with the goal of making high-speed JPEG compression/decompression technology available to a broader range of users and developers. libjpeg-turbo is an ISO/IEC and ITU-T reference implementation of the JPEG standard. 6 | -------------------------------------------------------------------------------- /release/Welcome.rtf.in: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 2 | {\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fmodern\fcharset0 CourierNewPSMT;} 3 | {\colortbl;\red255\green255\blue255;} 4 | \margl1440\margr1440\vieww9000\viewh8400\viewkind0 5 | \deftab720 6 | \pard\pardeftab720\ql\qnatural 7 | 8 | \f0\fs24 \cf0 This installer will install the libjpeg-turbo SDK and run-time libraries onto your computer so that you can use libjpeg-turbo to build new applications or accelerate existing ones. To remove the libjpeg-turbo package, run\ 9 | \ 10 | \pard\pardeftab720\ql\qnatural 11 | 12 | \f1 \cf0 @CMAKE_INSTALL_FULL_BINDIR@/uninstall\ 13 | \pard\pardeftab720\ql\qnatural 14 | 15 | \f0 \cf0 \ 16 | from the command line.\ 17 | } 18 | -------------------------------------------------------------------------------- /release/deb-control.in: -------------------------------------------------------------------------------- 1 | Package: {__PKGNAME} 2 | Version: @VERSION@-@BUILD@ 3 | Section: misc 4 | Priority: optional 5 | Architecture: {__ARCH} 6 | Essential: no 7 | Maintainer: @PKGVENDOR@ <@PKGEMAIL@> 8 | Homepage: @PKGURL@ 9 | Installed-Size: {__SIZE} 10 | Description: A SIMD-accelerated JPEG codec that provides both the libjpeg and TurboJPEG APIs 11 | libjpeg-turbo is a JPEG image codec that uses SIMD instructions to accelerate 12 | baseline JPEG compression and decompression on x86, x86-64, Arm, PowerPC, and 13 | MIPS systems, as well as progressive JPEG compression on x86, x86-64, and 14 | Arm systems. On such systems, libjpeg-turbo is generally 2-6x as fast as 15 | libjpeg, all else being equal. On other types of systems, libjpeg-turbo can 16 | still outperform libjpeg by a significant amount, by virtue of its 17 | highly-optimized Huffman coding routines. In many cases, the performance of 18 | libjpeg-turbo rivals that of proprietary high-speed JPEG codecs. 19 | . 20 | libjpeg-turbo implements both the traditional libjpeg API as well as the less 21 | powerful but more straightforward TurboJPEG API. libjpeg-turbo also features 22 | colorspace extensions that allow it to compress from/decompress to 32-bit and 23 | big-endian pixel buffers (RGBX, XBGR, etc.), as well as a full-featured Java 24 | interface. 25 | . 26 | libjpeg-turbo was originally based on libjpeg/SIMD, an MMX-accelerated 27 | derivative of libjpeg v6b developed by Miyasaka Masaru. The TigerVNC and 28 | VirtualGL projects made numerous enhancements to the codec in 2009, and in 29 | early 2010, libjpeg-turbo spun off into an independent project, with the goal 30 | of making high-speed JPEG compression/decompression technology available to a 31 | broader range of users and developers. libjpeg-turbo is an ISO/IEC and ITU-T 32 | reference implementation of the JPEG standard. 33 | -------------------------------------------------------------------------------- /release/libjpeg.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=@CMAKE_INSTALL_PREFIX@ 3 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 4 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 5 | 6 | Name: libjpeg 7 | Description: A SIMD-accelerated JPEG codec that provides the libjpeg API 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -ljpeg 10 | Cflags: -I${includedir} 11 | -------------------------------------------------------------------------------- /release/libturbojpeg.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=@CMAKE_INSTALL_PREFIX@ 3 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 4 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 5 | 6 | Name: libturbojpeg 7 | Description: A SIMD-accelerated JPEG codec that provides the TurboJPEG API 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -lturbojpeg 10 | Cflags: -I${includedir} 11 | -------------------------------------------------------------------------------- /release/makedpkg.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -u 4 | set -e 5 | trap onexit INT 6 | trap onexit TERM 7 | trap onexit EXIT 8 | 9 | TMPDIR= 10 | SUDO= 11 | 12 | onexit() 13 | { 14 | if [ ! "$TMPDIR" = "" ]; then 15 | $SUDO rm -rf $TMPDIR 16 | fi 17 | } 18 | 19 | uid() 20 | { 21 | id | cut -f2 -d = | cut -f1 -d \(; 22 | } 23 | 24 | safedirmove () 25 | { 26 | if [ "$1" = "$2" ]; then 27 | return 0 28 | fi 29 | if [ "$1" = "" -o ! -d "$1" ]; then 30 | echo safedirmove: source dir $1 is not valid 31 | return 1 32 | fi 33 | if [ "$2" = "" -o -e "$2" ]; then 34 | echo safedirmove: dest dir $2 is not valid 35 | return 1 36 | fi 37 | if [ "$3" = "" -o -e "$3" ]; then 38 | echo safedirmove: tmp dir $3 is not valid 39 | return 1 40 | fi 41 | mkdir -p $3 42 | mv $1/* $3/ 43 | rmdir $1 44 | mkdir -p $2 45 | mv $3/* $2/ 46 | rmdir $3 47 | return 0 48 | } 49 | 50 | makedeb() 51 | { 52 | SUPPLEMENT=$1 53 | DIRNAME=$PKGNAME 54 | 55 | if [ $SUPPLEMENT = 1 ]; then 56 | PKGNAME=$PKGNAME\32 57 | if [ "$DEBARCH" = "i386" ]; then 58 | DEBARCH=amd64 59 | else 60 | DEBARCH=arm64 61 | fi 62 | fi 63 | 64 | umask 022 65 | rm -f $PKGNAME\_$VERSION\_$DEBARCH.deb 66 | TMPDIR=`mktemp -d /tmp/$PKGNAME-build.XXXXXX` 67 | mkdir $TMPDIR/DEBIAN 68 | 69 | if [ $SUPPLEMENT = 1 ]; then 70 | DESTDIR=$TMPDIR @CMAKE_MAKE_PROGRAM@ install 71 | rm -rf $TMPDIR$BINDIR 72 | if [ "$DATAROOTDIR" != "$PREFIX" ]; then 73 | rm -rf $TMPDIR$DATAROOTDIR 74 | fi 75 | if [ "$JAVADIR" != "" ]; then 76 | rm -rf $TMPDIR$JAVADIR 77 | fi 78 | rm -rf $TMPDIR$DOCDIR 79 | rm -rf $TMPDIR$INCLUDEDIR 80 | rm -rf $TMPDIR$MANDIR 81 | else 82 | DESTDIR=$TMPDIR @CMAKE_MAKE_PROGRAM@ install 83 | if [ "$PREFIX" = "@CMAKE_INSTALL_DEFAULT_PREFIX@" -a "$DOCDIR" = "@CMAKE_INSTALL_DEFAULT_PREFIX@/doc" ]; then 84 | safedirmove $TMPDIR/$DOCDIR $TMPDIR/usr/share/doc/$PKGNAME-$VERSION $TMPDIR/__tmpdoc 85 | ln -fs /usr/share/doc/$DIRNAME-$VERSION $TMPDIR$DOCDIR 86 | fi 87 | fi 88 | 89 | SIZE=`du -s $TMPDIR | cut -f1` 90 | (cat pkgscripts/deb-control | sed s/{__PKGNAME}/$PKGNAME/g \ 91 | | sed s/{__ARCH}/$DEBARCH/g | sed s/{__SIZE}/$SIZE/g \ 92 | > $TMPDIR/DEBIAN/control) 93 | 94 | /sbin/ldconfig -n $TMPDIR$LIBDIR 95 | 96 | $SUDO chown -Rh root:root $TMPDIR/* 97 | dpkg -b $TMPDIR $PKGNAME\_$VERSION\_$DEBARCH.deb 98 | } 99 | 100 | PKGNAME=@PKGNAME@ 101 | VERSION=@VERSION@ 102 | DEBARCH=@DEBARCH@ 103 | PREFIX=@CMAKE_INSTALL_PREFIX@ 104 | BINDIR=@CMAKE_INSTALL_FULL_BINDIR@ 105 | DATAROOTDIR=@CMAKE_INSTALL_FULL_DATAROOTDIR@ 106 | DOCDIR=@CMAKE_INSTALL_FULL_DOCDIR@ 107 | INCLUDEDIR=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 108 | JAVADIR=@CMAKE_INSTALL_FULL_JAVADIR@ 109 | LIBDIR=@CMAKE_INSTALL_FULL_LIBDIR@ 110 | MANDIR=@CMAKE_INSTALL_FULL_MANDIR@ 111 | 112 | if [ ! `uid` -eq 0 ]; then 113 | SUDO=sudo 114 | fi 115 | 116 | makedeb 0 117 | if [ "$DEBARCH" = "i386" -o "$DEBARCH" = "armel" -o "$DEBARCH" = "armhf" ]; then 118 | makedeb 1 119 | fi 120 | 121 | exit 122 | -------------------------------------------------------------------------------- /release/makerpm.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -u 4 | set -e 5 | trap onexit INT 6 | trap onexit TERM 7 | trap onexit EXIT 8 | 9 | TMPDIR= 10 | 11 | onexit() 12 | { 13 | if [ ! "$TMPDIR" = "" ]; then 14 | rm -rf $TMPDIR 15 | fi 16 | } 17 | 18 | if [ -f @PKGNAME@-@VERSION@.@RPMARCH@.rpm ]; then 19 | rm -f @PKGNAME@-@VERSION@.@RPMARCH@.rpm 20 | fi 21 | 22 | umask 022 23 | TMPDIR=`mktemp -d /tmp/@CMAKE_PROJECT_NAME@-build.XXXXXX` 24 | 25 | mkdir -p $TMPDIR/RPMS 26 | ln -fs `pwd` $TMPDIR/BUILD 27 | rpmbuild -bb --define "_blddir $TMPDIR/buildroot" --define "_topdir $TMPDIR" \ 28 | --target @RPMARCH@ pkgscripts/rpm.spec; \ 29 | cp $TMPDIR/RPMS/@RPMARCH@/@PKGNAME@-@VERSION@-@BUILD@.@RPMARCH@.rpm \ 30 | @PKGNAME@-@VERSION@.@RPMARCH@.rpm 31 | -------------------------------------------------------------------------------- /release/makesrpm.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -u 4 | set -e 5 | trap onexit INT 6 | trap onexit TERM 7 | trap onexit EXIT 8 | 9 | TMPDIR= 10 | 11 | onexit() 12 | { 13 | if [ ! "$TMPDIR" = "" ]; then 14 | rm -rf $TMPDIR 15 | fi 16 | } 17 | 18 | PKGNAME=@PKGNAME@ 19 | PROJECT=@CMAKE_PROJECT_NAME@ 20 | VERSION=@VERSION@ 21 | BUILD=@BUILD@ 22 | 23 | if [ -f $PKGNAME-$VERSION.src.rpm ]; then 24 | rm -f $PKGNAME-$VERSION.src.rpm 25 | fi 26 | 27 | umask 022 28 | TMPDIR=`mktemp -d /tmp/$PKGNAME-build.XXXXXX` 29 | 30 | mkdir -p $TMPDIR/RPMS 31 | mkdir -p $TMPDIR/SRPMS 32 | mkdir -p $TMPDIR/BUILD 33 | mkdir -p $TMPDIR/SOURCES 34 | mkdir -p $TMPDIR/SPECS 35 | 36 | if [ ! -f $PROJECT-$VERSION.tar.gz ]; then 37 | echo "ERROR: $PROJECT-$VERSION.tar.gz does not exist." 38 | fi 39 | 40 | cp $PROJECT-$VERSION.tar.gz $TMPDIR/SOURCES/$PROJECT-$VERSION.tar.gz 41 | 42 | cat pkgscripts/rpm.spec | sed s/%{_blddir}/%{_tmppath}/g \ 43 | | sed s/#--\>//g > $TMPDIR/SPECS/$PKGNAME.spec 44 | 45 | rpmbuild -bs --define "_topdir $TMPDIR" $TMPDIR/SPECS/$PKGNAME.spec 46 | mv $TMPDIR/SRPMS/$PKGNAME-$VERSION-$BUILD.src.rpm $PKGNAME-$VERSION.src.rpm 47 | 48 | exit 49 | -------------------------------------------------------------------------------- /release/maketarball.in: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -u 4 | set -e 5 | trap onexit INT 6 | trap onexit TERM 7 | trap onexit EXIT 8 | 9 | TMPDIR= 10 | SUDO= 11 | 12 | onexit() 13 | { 14 | if [ ! "$TMPDIR" = "" ]; then 15 | rm -rf $TMPDIR 16 | fi 17 | } 18 | 19 | uid() 20 | { 21 | id | cut -f2 -d = | cut -f1 -d \(; 22 | } 23 | 24 | PKGNAME=@PKGNAME@ 25 | VERSION=@VERSION@ 26 | ARCH=@CPU_TYPE@ 27 | OS=@CMAKE_SYSTEM_NAME@ 28 | PREFIX=@CMAKE_INSTALL_PREFIX@ 29 | 30 | umask 022 31 | rm -f $PKGNAME-$VERSION-$OS-$ARCH.tar.bz2 32 | TMPDIR=`mktemp -d /tmp/$PKGNAME-build.XXXXXX` 33 | mkdir -p $TMPDIR/install 34 | 35 | DESTDIR=$TMPDIR/install @CMAKE_MAKE_PROGRAM@ install 36 | echo tartest >$TMPDIR/tartest 37 | GNUTAR=0 38 | BSDTAR=0 39 | tar cf $TMPDIR/tartest.tar --owner=root --group=root -C $TMPDIR tartest >/dev/null 2>&1 && GNUTAR=1 40 | if [ "$GNUTAR" = "1" ]; then 41 | tar cf - --owner=root --group=root -C $TMPDIR/install .$PREFIX | bzip2 -c >$PKGNAME-$VERSION-$OS-$ARCH.tar.bz2 42 | else 43 | tar cf $TMPDIR/tartest.tar --uid 0 --gid 0 -C $TMPDIR tartest >/dev/null 2>&1 && BSDTAR=1 44 | if [ "$BSDTAR" = "1" ]; then 45 | tar cf - --uid=0 --gid=0 -C $TMPDIR/install .$PREFIX | bzip2 -c >$PKGNAME-$VERSION-$OS-$ARCH.tar.bz2 46 | else 47 | tar cf - -C $TMPDIR/install .$PREFIX | bzip2 -c >$PKGNAME-$VERSION-$OS-$ARCH.tar.bz2 48 | fi 49 | fi 50 | 51 | exit 52 | -------------------------------------------------------------------------------- /simd/arm/align.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, Arm Limited. All Rights Reserved. 3 | * 4 | * This software is provided 'as-is', without any express or implied 5 | * warranty. In no event will the authors be held liable for any damages 6 | * arising from the use of this software. 7 | * 8 | * Permission is granted to anyone to use this software for any purpose, 9 | * including commercial applications, and to alter it and redistribute it 10 | * freely, subject to the following restrictions: 11 | * 12 | * 1. The origin of this software must not be misrepresented; you must not 13 | * claim that you wrote the original software. If you use this software 14 | * in a product, an acknowledgment in the product documentation would be 15 | * appreciated but is not required. 16 | * 2. Altered source versions must be plainly marked as such, and must not be 17 | * misrepresented as being the original software. 18 | * 3. This notice may not be removed or altered from any source distribution. 19 | */ 20 | 21 | /* How to obtain memory alignment for structures and variables */ 22 | #if defined(_MSC_VER) 23 | #define ALIGN(alignment) __declspec(align(alignment)) 24 | #elif defined(__clang__) || defined(__GNUC__) 25 | #define ALIGN(alignment) __attribute__((aligned(alignment))) 26 | #else 27 | #error "Unknown compiler" 28 | #endif 29 | -------------------------------------------------------------------------------- /simd/arm/neon-compat.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2020, D. R. Commander. All Rights Reserved. 3 | * Copyright (C) 2020-2021, Arm Limited. All Rights Reserved. 4 | * 5 | * This software is provided 'as-is', without any express or implied 6 | * warranty. In no event will the authors be held liable for any damages 7 | * arising from the use of this software. 8 | * 9 | * Permission is granted to anyone to use this software for any purpose, 10 | * including commercial applications, and to alter it and redistribute it 11 | * freely, subject to the following restrictions: 12 | * 13 | * 1. The origin of this software must not be misrepresented; you must not 14 | * claim that you wrote the original software. If you use this software 15 | * in a product, an acknowledgment in the product documentation would be 16 | * appreciated but is not required. 17 | * 2. Altered source versions must be plainly marked as such, and must not be 18 | * misrepresented as being the original software. 19 | * 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #cmakedefine HAVE_VLD1_S16_X3 23 | #cmakedefine HAVE_VLD1_U16_X2 24 | #cmakedefine HAVE_VLD1Q_U8_X4 25 | 26 | /* Define compiler-independent count-leading-zeros and byte-swap macros */ 27 | #if defined(_MSC_VER) && !defined(__clang__) 28 | #define BUILTIN_CLZ(x) _CountLeadingZeros(x) 29 | #define BUILTIN_CLZLL(x) _CountLeadingZeros64(x) 30 | #define BUILTIN_BSWAP64(x) _byteswap_uint64(x) 31 | #elif defined(__clang__) || defined(__GNUC__) 32 | #define BUILTIN_CLZ(x) __builtin_clz(x) 33 | #define BUILTIN_CLZLL(x) __builtin_clzll(x) 34 | #define BUILTIN_BSWAP64(x) __builtin_bswap64(x) 35 | #else 36 | #error "Unknown compiler" 37 | #endif 38 | -------------------------------------------------------------------------------- /simd/mips64/jcsample.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jcsample.h 3 | * 4 | * This file was part of the Independent JPEG Group's software: 5 | * Copyright (C) 1991-1996, Thomas G. Lane. 6 | * For conditions of distribution and use, see the accompanying README.ijg 7 | * file. 8 | */ 9 | 10 | LOCAL(void) 11 | expand_right_edge(JSAMPARRAY image_data, int num_rows, JDIMENSION input_cols, 12 | JDIMENSION output_cols) 13 | { 14 | register JSAMPROW ptr; 15 | register JSAMPLE pixval; 16 | register int count; 17 | int row; 18 | int numcols = (int)(output_cols - input_cols); 19 | 20 | if (numcols > 0) { 21 | for (row = 0; row < num_rows; row++) { 22 | ptr = image_data[row] + input_cols; 23 | pixval = ptr[-1]; 24 | for (count = numcols; count > 0; count--) 25 | *ptr++ = pixval; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /simd/mips64/jsimd_mmi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Loongson MMI optimizations for libjpeg-turbo 3 | * 4 | * Copyright (C) 2016-2018, Loongson Technology Corporation Limited, BeiJing. 5 | * All Rights Reserved. 6 | * Authors: ZhuChen 7 | * CaiWanwei 8 | * SunZhangzhi 9 | * QingfaLiu 10 | * 11 | * This software is provided 'as-is', without any express or implied 12 | * warranty. In no event will the authors be held liable for any damages 13 | * arising from the use of this software. 14 | * 15 | * Permission is granted to anyone to use this software for any purpose, 16 | * including commercial applications, and to alter it and redistribute it 17 | * freely, subject to the following restrictions: 18 | * 19 | * 1. The origin of this software must not be misrepresented; you must not 20 | * claim that you wrote the original software. If you use this software 21 | * in a product, an acknowledgment in the product documentation would be 22 | * appreciated but is not required. 23 | * 2. Altered source versions must be plainly marked as such, and must not be 24 | * misrepresented as being the original software. 25 | * 3. This notice may not be removed or altered from any source distribution. 26 | */ 27 | 28 | #define JPEG_INTERNALS 29 | #include "../../jinclude.h" 30 | #include "../../jpeglib.h" 31 | #include "../../jdct.h" 32 | #include "loongson-mmintrin.h" 33 | 34 | 35 | /* Common code */ 36 | #if defined(_ABI64) && _MIPS_SIM == _ABI64 37 | # define PTR_ADDU "daddu " 38 | # define PTR_SLL "dsll " 39 | #else 40 | # define PTR_ADDU "addu " 41 | # define PTR_SLL "sll " 42 | #endif 43 | 44 | #define SIZEOF_MMWORD 8 45 | #define BYTE_BIT 8 46 | #define WORD_BIT 16 47 | #define SCALEBITS 16 48 | 49 | #define _uint64_set_pi8(a, b, c, d, e, f, g, h) \ 50 | (((uint64_t)(uint8_t)a << 56) | \ 51 | ((uint64_t)(uint8_t)b << 48) | \ 52 | ((uint64_t)(uint8_t)c << 40) | \ 53 | ((uint64_t)(uint8_t)d << 32) | \ 54 | ((uint64_t)(uint8_t)e << 24) | \ 55 | ((uint64_t)(uint8_t)f << 16) | \ 56 | ((uint64_t)(uint8_t)g << 8) | \ 57 | ((uint64_t)(uint8_t)h)) 58 | #define _uint64_set1_pi8(a) _uint64_set_pi8(a, a, a, a, a, a, a, a) 59 | #define _uint64_set_pi16(a, b, c, d) \ 60 | (((uint64_t)(uint16_t)a << 48) | \ 61 | ((uint64_t)(uint16_t)b << 32) | \ 62 | ((uint64_t)(uint16_t)c << 16) | \ 63 | ((uint64_t)(uint16_t)d)) 64 | #define _uint64_set1_pi16(a) _uint64_set_pi16(a, a, a, a) 65 | #define _uint64_set_pi32(a, b) \ 66 | (((uint64_t)(uint32_t)a << 32) | \ 67 | ((uint64_t)(uint32_t)b)) 68 | 69 | #define get_const_value(index) (*(__m64 *)&const_value[index]) 70 | -------------------------------------------------------------------------------- /simd/nasm/jcolsamp.inc: -------------------------------------------------------------------------------- 1 | ; 2 | ; jcolsamp.inc - private declarations for color conversion & up/downsampling 3 | ; 4 | ; Copyright 2009 Pierre Ossman for Cendio AB 5 | ; Copyright (C) 2015, Intel Corporation. 6 | ; 7 | ; Based on the x86 SIMD extension for IJG JPEG library 8 | ; Copyright (C) 1999-2006, MIYASAKA Masaru. 9 | ; For conditions of distribution and use, see copyright notice in jsimdext.inc 10 | 11 | ; -------------------------------------------------------------------------- 12 | 13 | ; pseudo-resisters to make ordering of RGB configurable 14 | ; 15 | %if RGB_RED == 0 16 | %define mmA mm0 17 | %define mmB mm1 18 | %define xmmA xmm0 19 | %define xmmB xmm1 20 | %define ymmA ymm0 21 | %define ymmB ymm1 22 | %elif RGB_GREEN == 0 23 | %define mmA mm2 24 | %define mmB mm3 25 | %define xmmA xmm2 26 | %define xmmB xmm3 27 | %define ymmA ymm2 28 | %define ymmB ymm3 29 | %elif RGB_BLUE == 0 30 | %define mmA mm4 31 | %define mmB mm5 32 | %define xmmA xmm4 33 | %define xmmB xmm5 34 | %define ymmA ymm4 35 | %define ymmB ymm5 36 | %else 37 | %define mmA mm6 38 | %define mmB mm7 39 | %define xmmA xmm6 40 | %define xmmB xmm7 41 | %define ymmA ymm6 42 | %define ymmB ymm7 43 | %endif 44 | 45 | %if RGB_RED == 1 46 | %define mmC mm0 47 | %define mmD mm1 48 | %define xmmC xmm0 49 | %define xmmD xmm1 50 | %define ymmC ymm0 51 | %define ymmD ymm1 52 | %elif RGB_GREEN == 1 53 | %define mmC mm2 54 | %define mmD mm3 55 | %define xmmC xmm2 56 | %define xmmD xmm3 57 | %define ymmC ymm2 58 | %define ymmD ymm3 59 | %elif RGB_BLUE == 1 60 | %define mmC mm4 61 | %define mmD mm5 62 | %define xmmC xmm4 63 | %define xmmD xmm5 64 | %define ymmC ymm4 65 | %define ymmD ymm5 66 | %else 67 | %define mmC mm6 68 | %define mmD mm7 69 | %define xmmC xmm6 70 | %define xmmD xmm7 71 | %define ymmC ymm6 72 | %define ymmD ymm7 73 | %endif 74 | 75 | %if RGB_RED == 2 76 | %define mmE mm0 77 | %define mmF mm1 78 | %define xmmE xmm0 79 | %define xmmF xmm1 80 | %define ymmE ymm0 81 | %define ymmF ymm1 82 | %elif RGB_GREEN == 2 83 | %define mmE mm2 84 | %define mmF mm3 85 | %define xmmE xmm2 86 | %define xmmF xmm3 87 | %define ymmE ymm2 88 | %define ymmF ymm3 89 | %elif RGB_BLUE == 2 90 | %define mmE mm4 91 | %define mmF mm5 92 | %define xmmE xmm4 93 | %define xmmF xmm5 94 | %define ymmE ymm4 95 | %define ymmF ymm5 96 | %else 97 | %define mmE mm6 98 | %define mmF mm7 99 | %define xmmE xmm6 100 | %define xmmF xmm7 101 | %define ymmE ymm6 102 | %define ymmF ymm7 103 | %endif 104 | 105 | %if RGB_RED == 3 106 | %define mmG mm0 107 | %define mmH mm1 108 | %define xmmG xmm0 109 | %define xmmH xmm1 110 | %define ymmG ymm0 111 | %define ymmH ymm1 112 | %elif RGB_GREEN == 3 113 | %define mmG mm2 114 | %define mmH mm3 115 | %define xmmG xmm2 116 | %define xmmH xmm3 117 | %define ymmG ymm2 118 | %define ymmH ymm3 119 | %elif RGB_BLUE == 3 120 | %define mmG mm4 121 | %define mmH mm5 122 | %define xmmG xmm4 123 | %define xmmH xmm5 124 | %define ymmG ymm4 125 | %define ymmH ymm5 126 | %else 127 | %define mmG mm6 128 | %define mmH mm7 129 | %define xmmG xmm6 130 | %define xmmH xmm7 131 | %define ymmG ymm6 132 | %define ymmH ymm7 133 | %endif 134 | 135 | ; -------------------------------------------------------------------------- 136 | -------------------------------------------------------------------------------- /simd/nasm/jdct.inc: -------------------------------------------------------------------------------- 1 | ; 2 | ; jdct.inc - private declarations for forward & reverse DCT subsystems 3 | ; 4 | ; Copyright 2009 Pierre Ossman for Cendio AB 5 | ; Copyright (C) 2018, D. R. Commander. 6 | ; 7 | ; Based on the x86 SIMD extension for IJG JPEG library 8 | ; Copyright (C) 1999-2006, MIYASAKA Masaru. 9 | ; For conditions of distribution and use, see copyright notice in jsimdext.inc 10 | 11 | ; Each IDCT routine is responsible for range-limiting its results and 12 | ; converting them to unsigned form (0..MAXJSAMPLE). The raw outputs could 13 | ; be quite far out of range if the input data is corrupt, so a bulletproof 14 | ; range-limiting step is required. We use a mask-and-table-lookup method 15 | ; to do the combined operations quickly. 16 | ; 17 | %define RANGE_MASK (MAXJSAMPLE * 4 + 3) ; 2 bits wider than legal samples 18 | 19 | %define ROW(n, b, s) ((b) + (n) * (s)) 20 | %define COL(n, b, s) ((b) + (n) * (s) * DCTSIZE) 21 | 22 | %define DWBLOCK(m, n, b, s) \ 23 | ((b) + (m) * DCTSIZE * (s) + (n) * SIZEOF_DWORD) 24 | %define MMBLOCK(m, n, b, s) \ 25 | ((b) + (m) * DCTSIZE * (s) + (n) * SIZEOF_MMWORD) 26 | %define XMMBLOCK(m, n, b, s) \ 27 | ((b) + (m) * DCTSIZE * (s) + (n) * SIZEOF_XMMWORD) 28 | %define YMMBLOCK(m, n, b, s) \ 29 | ((b) + (m) * DCTSIZE * (s) + (n) * SIZEOF_YMMWORD) 30 | 31 | ; -------------------------------------------------------------------------- 32 | -------------------------------------------------------------------------------- /simd/nasm/jsimdcfg.inc: -------------------------------------------------------------------------------- 1 | ; 2 | ; Automatically generated include file from jsimdcfg.inc.h 3 | ; 4 | ; 5 | ; -- jpeglib.h 6 | ; 7 | %define DCTSIZE 8 8 | %define DCTSIZE2 64 9 | ; 10 | ; -- jmorecfg.h 11 | ; 12 | %define RGB_RED 0 13 | %define RGB_GREEN 1 14 | %define RGB_BLUE 2 15 | %define RGB_PIXELSIZE 3 16 | %define EXT_RGB_RED 0 17 | %define EXT_RGB_GREEN 1 18 | %define EXT_RGB_BLUE 2 19 | %define EXT_RGB_PIXELSIZE 3 20 | %define EXT_RGBX_RED 0 21 | %define EXT_RGBX_GREEN 1 22 | %define EXT_RGBX_BLUE 2 23 | %define EXT_RGBX_PIXELSIZE 4 24 | %define EXT_BGR_RED 2 25 | %define EXT_BGR_GREEN 1 26 | %define EXT_BGR_BLUE 0 27 | %define EXT_BGR_PIXELSIZE 3 28 | %define EXT_BGRX_RED 2 29 | %define EXT_BGRX_GREEN 1 30 | %define EXT_BGRX_BLUE 0 31 | %define EXT_BGRX_PIXELSIZE 4 32 | %define EXT_XBGR_RED 3 33 | %define EXT_XBGR_GREEN 2 34 | %define EXT_XBGR_BLUE 1 35 | %define EXT_XBGR_PIXELSIZE 4 36 | %define EXT_XRGB_RED 1 37 | %define EXT_XRGB_GREEN 2 38 | %define EXT_XRGB_BLUE 3 39 | %define EXT_XRGB_PIXELSIZE 4 40 | %define RGBX_FILLER_0XFF 1 41 | ; Representation of a single sample (pixel element value). 42 | ; On this SIMD implementation, this must be 'unsigned char'. 43 | ; 44 | %define JSAMPLE byte ; unsigned char 45 | %define SIZEOF_JSAMPLE SIZEOF_BYTE ; sizeof(JSAMPLE) 46 | %define CENTERJSAMPLE 128 47 | ; Representation of a DCT frequency coefficient. 48 | ; On this SIMD implementation, this must be 'short'. 49 | ; 50 | %define JCOEF word ; short 51 | %define SIZEOF_JCOEF SIZEOF_WORD ; sizeof(JCOEF) 52 | ; Datatype used for image dimensions. 53 | ; On this SIMD implementation, this must be 'unsigned int'. 54 | ; 55 | %define JDIMENSION dword ; unsigned int 56 | %define SIZEOF_JDIMENSION SIZEOF_DWORD ; sizeof(JDIMENSION) 57 | %define JSAMPROW POINTER ; JSAMPLE * (jpeglib.h) 58 | %define JSAMPARRAY POINTER ; JSAMPROW * (jpeglib.h) 59 | %define JSAMPIMAGE POINTER ; JSAMPARRAY * (jpeglib.h) 60 | %define JCOEFPTR POINTER ; JCOEF * (jpeglib.h) 61 | %define SIZEOF_JSAMPROW SIZEOF_POINTER ; sizeof(JSAMPROW) 62 | %define SIZEOF_JSAMPARRAY SIZEOF_POINTER ; sizeof(JSAMPARRAY) 63 | %define SIZEOF_JSAMPIMAGE SIZEOF_POINTER ; sizeof(JSAMPIMAGE) 64 | %define SIZEOF_JCOEFPTR SIZEOF_POINTER ; sizeof(JCOEFPTR) 65 | ; 66 | ; -- jdct.h 67 | ; 68 | ; A forward DCT routine is given a pointer to a work area of type DCTELEM[]; 69 | ; the DCT is to be performed in-place in that buffer. 70 | ; To maximize parallelism, Type DCTELEM is changed to short (originally, int). 71 | ; 72 | %define DCTELEM word ; short 73 | %define SIZEOF_DCTELEM SIZEOF_WORD ; sizeof(DCTELEM) 74 | %define float FP32 ; float 75 | %define SIZEOF_FAST_FLOAT SIZEOF_FP32 ; sizeof(float) 76 | ; To maximize parallelism, Type short is changed to short. 77 | ; 78 | %define ISLOW_MULT_TYPE word ; must be short 79 | %define SIZEOF_ISLOW_MULT_TYPE SIZEOF_WORD ; sizeof(ISLOW_MULT_TYPE) 80 | %define IFAST_MULT_TYPE word ; must be short 81 | %define SIZEOF_IFAST_MULT_TYPE SIZEOF_WORD ; sizeof(IFAST_MULT_TYPE) 82 | %define IFAST_SCALE_BITS 2 ; fractional bits in scale factors 83 | %define FLOAT_MULT_TYPE FP32 ; must be float 84 | %define SIZEOF_FLOAT_MULT_TYPE SIZEOF_FP32 ; sizeof(FLOAT_MULT_TYPE) 85 | ; 86 | ; -- jsimd.h 87 | ; 88 | %define JSIMD_NONE 0x00 89 | %define JSIMD_MMX 0x01 90 | %define JSIMD_3DNOW 0x02 91 | %define JSIMD_SSE 0x04 92 | %define JSIMD_SSE2 0x08 93 | %define JSIMD_AVX2 0x80 94 | -------------------------------------------------------------------------------- /simd/powerpc/jcsample.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jcsample.h 3 | * 4 | * This file was part of the Independent JPEG Group's software: 5 | * Copyright (C) 1991-1996, Thomas G. Lane. 6 | * For conditions of distribution and use, see the accompanying README.ijg 7 | * file. 8 | */ 9 | 10 | LOCAL(void) 11 | expand_right_edge(JSAMPARRAY image_data, int num_rows, JDIMENSION input_cols, 12 | JDIMENSION output_cols) 13 | { 14 | register JSAMPROW ptr; 15 | register JSAMPLE pixval; 16 | register int count; 17 | int row; 18 | int numcols = (int)(output_cols - input_cols); 19 | 20 | if (numcols > 0) { 21 | for (row = 0; row < num_rows; row++) { 22 | ptr = image_data[row] + input_cols; 23 | pixval = ptr[-1]; 24 | for (count = numcols; count > 0; count--) 25 | *ptr++ = pixval; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /simd/x86_64/jsimdcpu.asm: -------------------------------------------------------------------------------- 1 | ; 2 | ; jsimdcpu.asm - SIMD instruction support check 3 | ; 4 | ; Copyright 2009 Pierre Ossman for Cendio AB 5 | ; Copyright (C) 2016, D. R. Commander. 6 | ; Copyright (C) 2023, Aliaksiej Kandracienka. 7 | ; 8 | ; Based on 9 | ; x86 SIMD extension for IJG JPEG library 10 | ; Copyright (C) 1999-2006, MIYASAKA Masaru. 11 | ; For conditions of distribution and use, see copyright notice in jsimdext.inc 12 | ; 13 | ; This file should be assembled with NASM (Netwide Assembler), 14 | ; can *not* be assembled with Microsoft's MASM or any compatible 15 | ; assembler (including Borland's Turbo Assembler). 16 | ; NASM is available from http://nasm.sourceforge.net/ or 17 | ; http://sourceforge.net/project/showfiles.php?group_id=6208 18 | 19 | %include "jsimdext.inc" 20 | 21 | ; -------------------------------------------------------------------------- 22 | SECTION SEG_TEXT 23 | BITS 64 24 | ; 25 | ; Check if the CPU supports SIMD instructions 26 | ; 27 | ; GLOBAL(unsigned int) 28 | ; jpeg_simd_cpu_support(void) 29 | ; 30 | 31 | align 32 32 | GLOBAL_FUNCTION(jpeg_simd_cpu_support) 33 | 34 | EXTN(jpeg_simd_cpu_support): 35 | push rbp 36 | mov rbp, rsp 37 | push rbx 38 | push rdi 39 | 40 | xor rdi, rdi ; simd support flag 41 | 42 | ; Assume that all x86-64 processors support SSE & SSE2 instructions 43 | or rdi, JSIMD_SSE2 44 | or rdi, JSIMD_SSE 45 | 46 | ; Check whether CPUID leaf 07H is supported 47 | ; (leaf 07H is used to check for AVX2 instruction support) 48 | mov rax, 0 49 | cpuid 50 | cmp rax, 7 51 | jl short .return ; Maximum leaf < 07H 52 | 53 | ; Check for AVX2 instruction support 54 | mov rax, 7 55 | xor rcx, rcx 56 | cpuid 57 | mov rax, rbx ; rax = Extended feature flags 58 | 59 | test rax, 1<<5 ; bit5:AVX2 60 | jz short .return 61 | 62 | ; Check for AVX2 O/S support 63 | mov rax, 1 64 | xor rcx, rcx 65 | cpuid 66 | test rcx, 1<<27 67 | jz short .return ; O/S does not support XSAVE 68 | test rcx, 1<<28 69 | jz short .return ; CPU does not support AVX2 70 | 71 | xor rcx, rcx 72 | xgetbv 73 | and rax, 6 74 | cmp rax, 6 ; O/S does not manage XMM/YMM state 75 | ; using XSAVE 76 | jnz short .return 77 | 78 | or rdi, JSIMD_AVX2 79 | 80 | .return: 81 | mov rax, rdi 82 | 83 | pop rdi 84 | pop rbx 85 | pop rbp 86 | ret 87 | 88 | ; For some reason, the OS X linker does not honor the request to align the 89 | ; segment unless we do this. 90 | align 32 91 | -------------------------------------------------------------------------------- /testimages/big_building16.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/testimages/big_building16.ppm -------------------------------------------------------------------------------- /testimages/big_tree8.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/testimages/big_tree8.bmp -------------------------------------------------------------------------------- /testimages/big_tree8.txt: -------------------------------------------------------------------------------- 1 | libjpeg-turbo note: This image was extracted from the 8-bit big_tree image. 2 | The original can be downloaded at the link below. 3 | 4 | The New Image Compression Test Set - Jan 2008 5 | http://www.imagecompression.info/test_images 6 | 7 | The images historically used for compression research (lena, barbra, pepper etc...) have outlived their useful life and its about time they become a part of history only. They are too small, come from data sources too old and are available in only 8-bit precision. 8 | 9 | These images have been carefully selected to aid in image compression algorithm research and evaluation. These are photographic images chosen to come from a wide variety of sources and each one picked to stress different aspects of algorithms. Images are available in 8-bit, 16-bit and 16-bit linear variations, RGB and gray. 10 | 11 | Images are available without any prohibitive copyright restrictions. 12 | 13 | These images are (c) there respective owners. You are granted full redistribution and publication rights on these images provided: 14 | 15 | 1. The origin of the pictures must not be misrepresented; you must not claim that you took the original pictures. If you use, publish or redistribute them, an acknowledgment would be appreciated but is not required. 16 | 2. Altered versions must be plainly marked as such, and must not be misinterpreted as being the originals. 17 | 3. No payment is required for distribution this material, it must be available freely under the conditions stated here. That is, it is prohibited to sell the material. 18 | 4. This notice may not be removed or altered from any distribution. 19 | 20 | Acknowledgments: A lot of people contributed a lot of time and effort in making this test set possible. Thanks to everyone who voiced their opinion in any of the discussions online. Thanks to Axel Becker, Thomas Richter and Niels Fröhling for their extensive help in picking images, running all the various tests etc... Thanks to Pete Fraser, Tony Story, Wayne J. Cosshall, David Coffin, Bruce Lindbloom and raw.fotosite.pl for the images which make up this set. 21 | 22 | Sachin Garg [India] 23 | sachingarg@c10n.info 24 | 25 | www.sachingarg.com | www.c10n.info | www.imagecompression.info 26 | -------------------------------------------------------------------------------- /testimages/test.scan: -------------------------------------------------------------------------------- 1 | 0 1 2: 0 0 0 0; 2 | 0: 1 9 0 0; 3 | 0: 10 41 0 2; 4 | 0: 10 41 2 1; 5 | 0: 10 41 1 0; 6 | 0: 42 63 0 0; 7 | 1: 1 63 0 0; 8 | 2: 1 63 0 0; 9 | -------------------------------------------------------------------------------- /testimages/test1.icc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/testimages/test1.icc -------------------------------------------------------------------------------- /testimages/test1.icc.txt: -------------------------------------------------------------------------------- 1 | Little CMS 2 | Copyright (c) 1998-2011 Marti Maria Saguer 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the "Software"), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | of the Software, and to permit persons to whom the Software is furnished to do 9 | so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. 21 | -------------------------------------------------------------------------------- /testimages/test2.icc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/testimages/test2.icc -------------------------------------------------------------------------------- /testimages/test2.icc.txt: -------------------------------------------------------------------------------- 1 | Little CMS 2 | Copyright (c) 1998-2011 Marti Maria Saguer 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the "Software"), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | of the Software, and to permit persons to whom the Software is furnished to do 9 | so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. 21 | -------------------------------------------------------------------------------- /testimages/testimgari.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/testimages/testimgari.jpg -------------------------------------------------------------------------------- /testimages/testimgint.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/testimages/testimgint.jpg -------------------------------------------------------------------------------- /testimages/testorig.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/testimages/testorig.jpg -------------------------------------------------------------------------------- /testimages/testorig.ppm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/testimages/testorig.ppm -------------------------------------------------------------------------------- /testimages/testorig12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/testimages/testorig12.jpg -------------------------------------------------------------------------------- /testimages/vgl_5674_0098.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/testimages/vgl_5674_0098.bmp -------------------------------------------------------------------------------- /testimages/vgl_6434_0018a.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/testimages/vgl_6434_0018a.bmp -------------------------------------------------------------------------------- /testimages/vgl_6548_0026a.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/winlibs/libjpeg/1177955a8eecc6cdc61a39e59081e410d9054f66/testimages/vgl_6548_0026a.bmp -------------------------------------------------------------------------------- /tjutil.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C)2011, 2019 D. R. Commander. All Rights Reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * - Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * - Redistributions in binary form must reproduce the above copyright notice, 10 | * this list of conditions and the following disclaimer in the documentation 11 | * and/or other materials provided with the distribution. 12 | * - Neither the name of the libjpeg-turbo Project nor the names of its 13 | * contributors may be used to endorse or promote products derived from this 14 | * software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | * POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifdef _WIN32 30 | 31 | #include 32 | #include "tjutil.h" 33 | 34 | static double getFreq(void) 35 | { 36 | LARGE_INTEGER freq; 37 | 38 | if (!QueryPerformanceFrequency(&freq)) return 0.0; 39 | return (double)freq.QuadPart; 40 | } 41 | 42 | static double f = -1.0; 43 | 44 | double getTime(void) 45 | { 46 | LARGE_INTEGER t; 47 | 48 | if (f < 0.0) f = getFreq(); 49 | if (f == 0.0) return (double)GetTickCount() / 1000.; 50 | else { 51 | QueryPerformanceCounter(&t); 52 | return (double)t.QuadPart / f; 53 | } 54 | } 55 | 56 | #else 57 | 58 | #include 59 | #include 60 | #include "tjutil.h" 61 | 62 | double getTime(void) 63 | { 64 | struct timeval tv; 65 | 66 | if (gettimeofday(&tv, NULL) < 0) return 0.0; 67 | else return (double)tv.tv_sec + ((double)tv.tv_usec / 1000000.); 68 | } 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /tjutil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C)2011, 2022 D. R. Commander. All Rights Reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * - Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * - Redistributions in binary form must reproduce the above copyright notice, 10 | * this list of conditions and the following disclaimer in the documentation 11 | * and/or other materials provided with the distribution. 12 | * - Neither the name of the libjpeg-turbo Project nor the names of its 13 | * contributors may be used to endorse or promote products derived from this 14 | * software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 | * POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifdef _WIN32 30 | #ifndef strcasecmp 31 | #define strcasecmp stricmp 32 | #endif 33 | #ifndef strncasecmp 34 | #define strncasecmp strnicmp 35 | #endif 36 | #endif 37 | 38 | #ifdef _MSC_VER 39 | #define SNPRINTF(str, n, format, ...) \ 40 | _snprintf_s(str, n, _TRUNCATE, format, ##__VA_ARGS__) 41 | #else 42 | #define SNPRINTF snprintf 43 | #endif 44 | 45 | #ifndef min 46 | #define min(a, b) ((a) < (b) ? (a) : (b)) 47 | #endif 48 | 49 | #ifndef max 50 | #define max(a, b) ((a) > (b) ? (a) : (b)) 51 | #endif 52 | 53 | extern double getTime(void); 54 | -------------------------------------------------------------------------------- /turbojpeg-mapfile: -------------------------------------------------------------------------------- 1 | TURBOJPEG_1.0 2 | { 3 | global: 4 | TJBUFSIZE; 5 | tjCompress; 6 | tjDecompress; 7 | tjDecompressHeader; 8 | tjDestroy; 9 | tjGetErrorStr; 10 | tjInitCompress; 11 | tjInitDecompress; 12 | local: 13 | *; 14 | }; 15 | 16 | TURBOJPEG_1.1 17 | { 18 | global: 19 | TJBUFSIZEYUV; 20 | tjDecompressHeader2; 21 | tjDecompressToYUV; 22 | tjEncodeYUV; 23 | } TURBOJPEG_1.0; 24 | 25 | TURBOJPEG_1.2 26 | { 27 | global: 28 | tjAlloc; 29 | tjBufSize; 30 | tjBufSizeYUV; 31 | tjCompress2; 32 | tjDecompress2; 33 | tjEncodeYUV2; 34 | tjFree; 35 | tjGetScalingFactors; 36 | tjInitTransform; 37 | tjTransform; 38 | } TURBOJPEG_1.1; 39 | 40 | TURBOJPEG_1.4 41 | { 42 | global: 43 | tjBufSizeYUV2; 44 | tjCompressFromYUV; 45 | tjCompressFromYUVPlanes; 46 | tjDecodeYUV; 47 | tjDecodeYUVPlanes; 48 | tjDecompressHeader3; 49 | tjDecompressToYUV2; 50 | tjDecompressToYUVPlanes; 51 | tjEncodeYUV3; 52 | tjEncodeYUVPlanes; 53 | tjPlaneHeight; 54 | tjPlaneSizeYUV; 55 | tjPlaneWidth; 56 | } TURBOJPEG_1.2; 57 | 58 | TURBOJPEG_2.0 59 | { 60 | global: 61 | tjGetErrorCode; 62 | tjGetErrorStr2; 63 | tjLoadImage; 64 | tjSaveImage; 65 | } TURBOJPEG_1.4; 66 | 67 | TURBOJPEG_3 68 | { 69 | global: 70 | tj3Alloc; 71 | tj3Compress8; 72 | tj3Compress12; 73 | tj3Compress16; 74 | tj3CompressFromYUV8; 75 | tj3CompressFromYUVPlanes8; 76 | tj3DecodeYUV8; 77 | tj3DecodeYUVPlanes8; 78 | tj3Decompress8; 79 | tj3Decompress12; 80 | tj3Decompress16; 81 | tj3DecompressHeader; 82 | tj3DecompressToYUV8; 83 | tj3DecompressToYUVPlanes8; 84 | tj3Destroy; 85 | tj3EncodeYUV8; 86 | tj3EncodeYUVPlanes8; 87 | tj3Free; 88 | tj3Get; 89 | tj3GetErrorCode; 90 | tj3GetErrorStr; 91 | tj3GetScalingFactors; 92 | tj3Init; 93 | tj3JPEGBufSize; 94 | tj3LoadImage8; 95 | tj3LoadImage12; 96 | tj3LoadImage16; 97 | tj3SaveImage8; 98 | tj3SaveImage12; 99 | tj3SaveImage16; 100 | tj3Set; 101 | tj3SetCroppingRegion; 102 | tj3SetScalingFactor; 103 | tj3Transform; 104 | tj3YUVBufSize; 105 | tj3YUVPlaneHeight; 106 | tj3YUVPlaneSize; 107 | tj3YUVPlaneWidth; 108 | } TURBOJPEG_2.0; 109 | -------------------------------------------------------------------------------- /win/gcc/projectTargets-release.cmake.in: -------------------------------------------------------------------------------- 1 | #---------------------------------------------------------------- 2 | # Generated CMake target import file for configuration "Release". 3 | #---------------------------------------------------------------- 4 | 5 | # Commands may need to know the format version. 6 | set(CMAKE_IMPORT_FILE_VERSION 1) 7 | 8 | # Import target "@CMAKE_PROJECT_NAME@::jpeg" for configuration "Release" 9 | set_property(TARGET @CMAKE_PROJECT_NAME@::jpeg APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) 10 | set_target_properties(@CMAKE_PROJECT_NAME@::jpeg PROPERTIES 11 | IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/libjpeg.dll.a" 12 | IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/libjpeg-62.dll" 13 | ) 14 | 15 | list(APPEND _IMPORT_CHECK_TARGETS @CMAKE_PROJECT_NAME@::jpeg ) 16 | list(APPEND _IMPORT_CHECK_FILES_FOR_@CMAKE_PROJECT_NAME@::jpeg "${_IMPORT_PREFIX}/lib/libjpeg.dll.a" "${_IMPORT_PREFIX}/bin/libjpeg-62.dll" ) 17 | 18 | # Import target "@CMAKE_PROJECT_NAME@::turbojpeg" for configuration "Release" 19 | set_property(TARGET @CMAKE_PROJECT_NAME@::turbojpeg APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) 20 | set_target_properties(@CMAKE_PROJECT_NAME@::turbojpeg PROPERTIES 21 | IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/libturbojpeg.dll.a" 22 | IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/libturbojpeg.dll" 23 | ) 24 | 25 | list(APPEND _IMPORT_CHECK_TARGETS @CMAKE_PROJECT_NAME@::turbojpeg ) 26 | list(APPEND _IMPORT_CHECK_FILES_FOR_@CMAKE_PROJECT_NAME@::turbojpeg "${_IMPORT_PREFIX}/lib/libturbojpeg.dll.a" "${_IMPORT_PREFIX}/bin/libturbojpeg.dll" ) 27 | 28 | # Import target "@CMAKE_PROJECT_NAME@::turbojpeg-static" for configuration "Release" 29 | set_property(TARGET @CMAKE_PROJECT_NAME@::turbojpeg-static APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) 30 | set_target_properties(@CMAKE_PROJECT_NAME@::turbojpeg-static PROPERTIES 31 | IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "ASM_NASM;C" 32 | IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libturbojpeg.a" 33 | ) 34 | 35 | list(APPEND _IMPORT_CHECK_TARGETS @CMAKE_PROJECT_NAME@::turbojpeg-static ) 36 | list(APPEND _IMPORT_CHECK_FILES_FOR_@CMAKE_PROJECT_NAME@::turbojpeg-static "${_IMPORT_PREFIX}/lib/libturbojpeg.a" ) 37 | 38 | # Import target "@CMAKE_PROJECT_NAME@::jpeg-static" for configuration "Release" 39 | set_property(TARGET @CMAKE_PROJECT_NAME@::jpeg-static APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) 40 | set_target_properties(@CMAKE_PROJECT_NAME@::jpeg-static PROPERTIES 41 | IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "ASM_NASM;C" 42 | IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/libjpeg.a" 43 | ) 44 | 45 | list(APPEND _IMPORT_CHECK_TARGETS @CMAKE_PROJECT_NAME@::jpeg-static ) 46 | list(APPEND _IMPORT_CHECK_FILES_FOR_@CMAKE_PROJECT_NAME@::jpeg-static "${_IMPORT_PREFIX}/lib/libjpeg.a" ) 47 | 48 | # Commands beyond this point should not need to know the version. 49 | set(CMAKE_IMPORT_FILE_VERSION) 50 | -------------------------------------------------------------------------------- /win/jpeg.rc.in: -------------------------------------------------------------------------------- 1 | #include "Winver.h" 2 | #include "winres.h" 3 | 4 | VS_VERSION_INFO VERSIONINFO 5 | FILEVERSION @SO_MAJOR_VERSION@,@SO_AGE@,@SO_MINOR_VERSION@,0 6 | PRODUCTVERSION @VERSION_MAJOR@,@VERSION_MINOR@,@VERSION_REVISION@,0 7 | FILEFLAGSMASK 0x17L 8 | #ifndef NDEBUG 9 | FILEFLAGS VS_FF_DEBUG 10 | #else 11 | FILEFLAGS 0x0L 12 | #endif 13 | FILEOS VOS_NT_WINDOWS32 14 | FILETYPE VFT_DLL 15 | FILESUBTYPE VFT2_UNKNOWN 16 | BEGIN 17 | BLOCK "StringFileInfo" 18 | BEGIN 19 | BLOCK "040904b0" 20 | BEGIN 21 | VALUE "CompanyName", "@PKGVENDOR@" 22 | VALUE "FileDescription", "libjpeg API DLL" 23 | VALUE "FileVersion", "@SO_MAJOR_VERSION@,@SO_AGE@,@SO_MINOR_VERSION@,0" 24 | VALUE "ProductVersion", "@VERSION@" 25 | VALUE "ProductName", "@CMAKE_PROJECT_NAME@" 26 | VALUE "InternalName", "jpeg@SO_MAJOR_VERSION@" 27 | VALUE "LegalCopyright", L"Copyright \xA9 @COPYRIGHT_YEAR@ The libjpeg-turbo Project and many others" 28 | VALUE "OriginalFilename", "jpeg@SO_MAJOR_VERSION@.dll" 29 | END 30 | END 31 | BLOCK "VarFileInfo" 32 | BEGIN 33 | VALUE "Translation", 0x409, 1200 34 | END 35 | END 36 | -------------------------------------------------------------------------------- /win/turbojpeg.rc.in: -------------------------------------------------------------------------------- 1 | #include "Winver.h" 2 | #include "winres.h" 3 | 4 | VS_VERSION_INFO VERSIONINFO 5 | FILEVERSION 0,@TURBOJPEG_SO_AGE@,0,0 6 | PRODUCTVERSION @VERSION_MAJOR@,@VERSION_MINOR@,@VERSION_REVISION@,0 7 | FILEFLAGSMASK 0x17L 8 | #ifndef NDEBUG 9 | FILEFLAGS VS_FF_DEBUG 10 | #else 11 | FILEFLAGS 0x0L 12 | #endif 13 | FILEOS VOS_NT_WINDOWS32 14 | FILETYPE VFT_DLL 15 | FILESUBTYPE VFT2_UNKNOWN 16 | BEGIN 17 | BLOCK "StringFileInfo" 18 | BEGIN 19 | BLOCK "040904b0" 20 | BEGIN 21 | VALUE "CompanyName", "@PKGVENDOR@" 22 | VALUE "FileDescription", "TurboJPEG API DLL" 23 | VALUE "FileVersion", "0,@TURBOJPEG_SO_AGE@,0,0" 24 | VALUE "ProductVersion", "@VERSION@" 25 | VALUE "ProductName", "@CMAKE_PROJECT_NAME@" 26 | VALUE "InternalName", "turbojpeg" 27 | VALUE "LegalCopyright", L"Copyright \xA9 @COPYRIGHT_YEAR@ The libjpeg-turbo Project and many others" 28 | VALUE "OriginalFilename", "turbojpeg.dll" 29 | END 30 | END 31 | BLOCK "VarFileInfo" 32 | BEGIN 33 | VALUE "Translation", 0x409, 1200 34 | END 35 | END 36 | -------------------------------------------------------------------------------- /win/vc/projectTargets-release.cmake.in: -------------------------------------------------------------------------------- 1 | #---------------------------------------------------------------- 2 | # Generated CMake target import file for configuration "Release". 3 | #---------------------------------------------------------------- 4 | 5 | # Commands may need to know the format version. 6 | set(CMAKE_IMPORT_FILE_VERSION 1) 7 | 8 | # Import target "@CMAKE_PROJECT_NAME@::jpeg" for configuration "Release" 9 | set_property(TARGET @CMAKE_PROJECT_NAME@::jpeg APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) 10 | set_target_properties(@CMAKE_PROJECT_NAME@::jpeg PROPERTIES 11 | IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/jpeg.lib" 12 | IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/jpeg62.dll" 13 | ) 14 | 15 | list(APPEND _IMPORT_CHECK_TARGETS @CMAKE_PROJECT_NAME@::jpeg ) 16 | list(APPEND _IMPORT_CHECK_FILES_FOR_@CMAKE_PROJECT_NAME@::jpeg "${_IMPORT_PREFIX}/lib/jpeg.lib" "${_IMPORT_PREFIX}/bin/jpeg62.dll" ) 17 | 18 | # Import target "@CMAKE_PROJECT_NAME@::turbojpeg" for configuration "Release" 19 | set_property(TARGET @CMAKE_PROJECT_NAME@::turbojpeg APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) 20 | set_target_properties(@CMAKE_PROJECT_NAME@::turbojpeg PROPERTIES 21 | IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/turbojpeg.lib" 22 | IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/turbojpeg.dll" 23 | ) 24 | 25 | list(APPEND _IMPORT_CHECK_TARGETS @CMAKE_PROJECT_NAME@::turbojpeg ) 26 | list(APPEND _IMPORT_CHECK_FILES_FOR_@CMAKE_PROJECT_NAME@::turbojpeg "${_IMPORT_PREFIX}/lib/turbojpeg.lib" "${_IMPORT_PREFIX}/bin/turbojpeg.dll" ) 27 | 28 | # Import target "@CMAKE_PROJECT_NAME@::turbojpeg-static" for configuration "Release" 29 | set_property(TARGET @CMAKE_PROJECT_NAME@::turbojpeg-static APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) 30 | set_target_properties(@CMAKE_PROJECT_NAME@::turbojpeg-static PROPERTIES 31 | IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "ASM_NASM;C" 32 | IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/turbojpeg-static.lib" 33 | ) 34 | 35 | list(APPEND _IMPORT_CHECK_TARGETS @CMAKE_PROJECT_NAME@::turbojpeg-static ) 36 | list(APPEND _IMPORT_CHECK_FILES_FOR_@CMAKE_PROJECT_NAME@::turbojpeg-static "${_IMPORT_PREFIX}/lib/turbojpeg-static.lib" ) 37 | 38 | # Import target "@CMAKE_PROJECT_NAME@::jpeg-static" for configuration "Release" 39 | set_property(TARGET @CMAKE_PROJECT_NAME@::jpeg-static APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) 40 | set_target_properties(@CMAKE_PROJECT_NAME@::jpeg-static PROPERTIES 41 | IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "ASM_NASM;C" 42 | IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/jpeg-static.lib" 43 | ) 44 | 45 | list(APPEND _IMPORT_CHECK_TARGETS @CMAKE_PROJECT_NAME@::jpeg-static ) 46 | list(APPEND _IMPORT_CHECK_FILES_FOR_@CMAKE_PROJECT_NAME@::jpeg-static "${_IMPORT_PREFIX}/lib/jpeg-static.lib" ) 47 | 48 | # Commands beyond this point should not need to know the version. 49 | set(CMAKE_IMPORT_FILE_VERSION) 50 | -------------------------------------------------------------------------------- /wrjpgcom.1: -------------------------------------------------------------------------------- 1 | .TH WRJPGCOM 1 "15 June 1995" 2 | .SH NAME 3 | wrjpgcom \- insert text comments into a JPEG file 4 | .SH SYNOPSIS 5 | .B wrjpgcom 6 | [ 7 | .B \-replace 8 | ] 9 | [ 10 | .BI \-comment " text" 11 | ] 12 | [ 13 | .BI \-cfile " name" 14 | ] 15 | [ 16 | .I filename 17 | ] 18 | .LP 19 | .SH DESCRIPTION 20 | .LP 21 | .B wrjpgcom 22 | reads the named JPEG/JFIF file, or the standard input if no file is named, 23 | and generates a new JPEG/JFIF file on standard output. A comment block is 24 | added to the file. 25 | .PP 26 | The JPEG standard allows "comment" (COM) blocks to occur within a JPEG file. 27 | Although the standard doesn't actually define what COM blocks are for, they 28 | are widely used to hold user-supplied text strings. This lets you add 29 | annotations, titles, index terms, etc to your JPEG files, and later retrieve 30 | them as text. COM blocks do not interfere with the image stored in the JPEG 31 | file. The maximum size of a COM block is 64K, but you can have as many of 32 | them as you like in one JPEG file. 33 | .PP 34 | .B wrjpgcom 35 | adds a COM block, containing text you provide, to a JPEG file. 36 | Ordinarily, the COM block is added after any existing COM blocks; but you 37 | can delete the old COM blocks if you wish. 38 | .SH OPTIONS 39 | Switch names may be abbreviated, and are not case sensitive. 40 | .TP 41 | .B \-replace 42 | Delete any existing COM blocks from the file. 43 | .TP 44 | .BI \-comment " text" 45 | Supply text for new COM block on command line. 46 | .TP 47 | .BI \-cfile " name" 48 | Read text for new COM block from named file. 49 | .PP 50 | If you have only one line of comment text to add, you can provide it on the 51 | command line with 52 | .BR \-comment . 53 | The comment text must be surrounded with quotes so that it is treated as a 54 | single argument. Longer comments can be read from a text file. 55 | .PP 56 | If you give neither 57 | .B \-comment 58 | nor 59 | .BR \-cfile, 60 | then 61 | .B wrjpgcom 62 | will read the comment text from standard input. (In this case an input image 63 | file name MUST be supplied, so that the source JPEG file comes from somewhere 64 | else.) You can enter multiple lines, up to 64KB worth. Type an end-of-file 65 | indicator (usually control-D) to terminate the comment text entry. 66 | .PP 67 | .B wrjpgcom 68 | will not add a COM block if the provided comment string is empty. Therefore 69 | \fB\-replace \-comment ""\fR can be used to delete all COM blocks from a file. 70 | .SH EXAMPLES 71 | .LP 72 | Add a short comment to in.jpg, producing out.jpg: 73 | .IP 74 | .B wrjpgcom \-c 75 | \fI"View of my back yard" in.jpg 76 | .B > 77 | .I out.jpg 78 | .PP 79 | Attach a long comment previously stored in comment.txt: 80 | .IP 81 | .B wrjpgcom 82 | .I in.jpg 83 | .B < 84 | .I comment.txt 85 | .B > 86 | .I out.jpg 87 | .PP 88 | or equivalently 89 | .IP 90 | .B wrjpgcom 91 | .B -cfile 92 | .I comment.txt 93 | .B < 94 | .I in.jpg 95 | .B > 96 | .I out.jpg 97 | .SH SEE ALSO 98 | .BR cjpeg (1), 99 | .BR djpeg (1), 100 | .BR jpegtran (1), 101 | .BR rdjpgcom (1) 102 | .SH AUTHOR 103 | Independent JPEG Group 104 | --------------------------------------------------------------------------------