Merge commit '662bf6ba7b70dfc727de7c186dec594e58f00ad1' into libjpeg-turbo
This commit is contained in:
14
.gitignore
vendored
Normal file
14
.gitignore
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
Makefile.in
|
||||
/autom4te.cache
|
||||
/aclocal.m4
|
||||
/compile
|
||||
/configure
|
||||
/depcomp
|
||||
/install-sh
|
||||
/missing
|
||||
/stamp-h1
|
||||
/config.guess
|
||||
/config.h.in
|
||||
/config.sub
|
||||
/ltmain.sh
|
||||
/ar-lib
|
||||
17
BUILDING.txt
17
BUILDING.txt
@@ -216,17 +216,6 @@ Add
|
||||
to the configure command line.
|
||||
|
||||
|
||||
64-bit Build on 64-bit OS X
|
||||
---------------------------
|
||||
|
||||
Add
|
||||
|
||||
--host x86_64-apple-darwin NASM=/opt/local/bin/nasm
|
||||
|
||||
to the configure command line. NASM 2.07 or later from MacPorts must be
|
||||
installed.
|
||||
|
||||
|
||||
32-bit Build on 64-bit OS X
|
||||
---------------------------
|
||||
|
||||
@@ -349,17 +338,17 @@ Set the following shell variables for simplicity:
|
||||
Xcode 5.0.x and later:
|
||||
IOS_GCC=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
|
||||
|
||||
ARM v6 only (up to and including iPhone 3G):
|
||||
ARM v6 (code will run on all iOS devices, not SIMD-accelerated):
|
||||
[NOTE: Requires Xcode 4.4.x or earlier]
|
||||
IOS_CFLAGS="-march=armv6 -mcpu=arm1176jzf-s -mfpu=vfp"
|
||||
|
||||
ARM v7 only (iPhone 3GS-4S, iPad 1st-3rd Generation):
|
||||
ARM v7 (code will run on iPhone 3GS-4S/iPad 1st-3rd Generation and newer):
|
||||
Xcode 4.6.x and earlier:
|
||||
IOS_CFLAGS="-march=armv7 -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon"
|
||||
Xcode 5.0.x and later:
|
||||
IOS_CFLAGS="-arch armv7"
|
||||
|
||||
ARM v7s only (iPhone 5, iPad 4th Generation):
|
||||
ARM v7s (code will run on iPhone 5/iPad 4th Generation and newer):
|
||||
[NOTE: Requires Xcode 4.5 or later]
|
||||
Xcode 4.6.x and earlier:
|
||||
IOS_CFLAGS="-march=armv7s -mcpu=swift -mtune=swift -mfpu=neon"
|
||||
|
||||
107
CMakeLists.txt
107
CMakeLists.txt
@@ -9,7 +9,7 @@ if(POLICY CMP0022)
|
||||
endif()
|
||||
|
||||
project(libmozjpeg C)
|
||||
set(VERSION 2.0.1)
|
||||
set(VERSION 2.1)
|
||||
|
||||
if(CYGWIN OR NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows")
|
||||
execute_process(COMMAND "date" "+%Y%m%d" OUTPUT_VARIABLE BUILD)
|
||||
@@ -50,7 +50,20 @@ option(WITH_ARITH_DEC "Include arithmetic decoding support" TRUE)
|
||||
option(WITH_JPEG7 "Emulate libjpeg v7 API/ABI (this makes libmozjpeg backward incompatible with libjpeg v6b)" FALSE)
|
||||
option(WITH_JPEG8 "Emulate libjpeg v8 API/ABI (this makes libmozjpeg backward incompatible with libjpeg v6b)" FALSE)
|
||||
option(WITH_MEM_SRCDST "Include in-memory source/destination manager functions when emulating the libjpeg v6b or v7 API/ABI" TRUE)
|
||||
option(WITH_TURBOJPEG "Include the TurboJPEG wrapper library and associated test programs" TRUE)
|
||||
option(WITH_JAVA "Build Java wrapper for the TurboJPEG library" FALSE)
|
||||
option(WITH_12BIT "Encode/decode JPEG images with 12-bit samples (implies WITH_SIMD=0 WITH_TURBOJPEG=0 WITH_ARITH_ENC=0 WITH_ARITH_DEC=0)" FALSE)
|
||||
|
||||
if(WITH_12BIT)
|
||||
set(WITH_SIMD FALSE)
|
||||
set(WITH_TURBOJPEG FALSE)
|
||||
set(WITH_ARITH_ENC FALSE)
|
||||
set(WITH_ARITH_DEC FALSE)
|
||||
set(BITS_IN_JSAMPLE 12)
|
||||
message(STATUS "12-bit JPEG support enabled")
|
||||
else()
|
||||
set(BITS_IN_JSAMPLE 8)
|
||||
endif()
|
||||
|
||||
if(WITH_ARITH_ENC)
|
||||
set(C_ARITH_CODING_SUPPORTED 1)
|
||||
@@ -66,6 +79,12 @@ else()
|
||||
message(STATUS "Arithmetic decoding support disabled")
|
||||
endif()
|
||||
|
||||
if(WITH_TURBOJPEG)
|
||||
message(STATUS "TurboJPEG C wrapper enabled")
|
||||
else()
|
||||
message(STATUS "TurboJPEG C wrapper disabled")
|
||||
endif()
|
||||
|
||||
if(WITH_JAVA)
|
||||
message(STATUS "TurboJPEG Java wrapper enabled")
|
||||
else()
|
||||
@@ -209,6 +228,7 @@ if(WITH_SIMD)
|
||||
add_dependencies(jpeg-static simd)
|
||||
endif()
|
||||
|
||||
if(WITH_TURBOJPEG)
|
||||
set(TURBOJPEG_SOURCES turbojpeg.c transupp.c jdatadst-tj.c jdatasrc-tj.c)
|
||||
if(WITH_JAVA)
|
||||
set(TURBOJPEG_SOURCES ${TURBOJPEG_SOURCES} turbojpeg-jni.c)
|
||||
@@ -249,17 +269,24 @@ add_executable(tjbench-static tjbench.c bmp.c tjutil.c rdbmp.c rdppm.c wrbmp.c
|
||||
target_link_libraries(tjbench-static turbojpeg-static jpeg-static)
|
||||
set_property(TARGET tjbench-static PROPERTY COMPILE_FLAGS
|
||||
"-DBMP_SUPPORTED -DPPM_SUPPORTED")
|
||||
endif()
|
||||
|
||||
add_executable(cjpeg-static cjpeg.c cdjpeg.c rdbmp.c rdgif.c rdppm.c rdswitch.c
|
||||
rdtarga.c rdjpeg.c)
|
||||
set_property(TARGET cjpeg-static PROPERTY COMPILE_FLAGS
|
||||
"-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED -DUSE_SETMODE")
|
||||
if(WITH_12BIT)
|
||||
set(COMPILE_FLAGS "-DGIF_SUPPORTED -DPPM_SUPPORTED -DUSE_SETMODE")
|
||||
else()
|
||||
set(COMPILE_FLAGS "-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED -DUSE_SETMODE")
|
||||
set(CJPEG_BMP_SOURCES rdbmp.c rdtarga.c)
|
||||
set(DJPEG_BMP_SOURCES wrbmp.c wrtarga.c)
|
||||
endif()
|
||||
|
||||
add_executable(cjpeg-static cjpeg.c cdjpeg.c rdgif.c rdppm.c rdswitch.c rdjpeg.c
|
||||
${CJPEG_BMP_SOURCES})
|
||||
set_property(TARGET cjpeg-static PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS})
|
||||
target_link_libraries(cjpeg-static jpeg-static)
|
||||
|
||||
add_executable(djpeg-static djpeg.c cdjpeg.c rdcolmap.c rdswitch.c wrbmp.c wrgif.c
|
||||
wrppm.c wrtarga.c)
|
||||
set_property(TARGET djpeg-static PROPERTY COMPILE_FLAGS
|
||||
"-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED -DUSE_SETMODE")
|
||||
add_executable(djpeg-static djpeg.c cdjpeg.c rdcolmap.c rdswitch.c wrgif.c
|
||||
wrppm.c ${DJPEG_BMP_SOURCES})
|
||||
set_property(TARGET djpeg-static PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS})
|
||||
target_link_libraries(djpeg-static jpeg-static)
|
||||
|
||||
add_executable(jpegtran-static jpegtran.c cdjpeg.c rdswitch.c transupp.c)
|
||||
@@ -283,6 +310,37 @@ endif()
|
||||
|
||||
enable_testing()
|
||||
|
||||
if(WITH_12BIT)
|
||||
set(TESTORIG testorig12.jpg)
|
||||
set(MD5_JPEG_RGB_ISLOW 9620f424569594bb9242b48498ad801f)
|
||||
set(MD5_PPM_RGB_ISLOW f3301d2219783b8b3d942b7239fa50c0)
|
||||
set(MD5_JPEG_422_IFAST_OPT 7322e3bd2f127f7de4b40d4480ce60e4)
|
||||
set(MD5_PPM_422_IFAST 79807fa552899e66a04708f533e16950)
|
||||
set(MD5_PPM_422M_IFAST 07737bfe8a7c1c87aaa393a0098d16b0)
|
||||
set(MD5_JPEG_420_IFAST_Q100_PROG a1da220b5604081863a504297ed59e55)
|
||||
set(MD5_PPM_420_Q100_IFAST 1b3730122709f53d007255e8dfd3305e)
|
||||
set(MD5_PPM_420M_Q100_IFAST 980a1a3c5bf9510022869d30b7d26566)
|
||||
set(MD5_JPEG_GRAY_ISLOW 235c90707b16e2e069f37c888b2636d9)
|
||||
set(MD5_PPM_GRAY_ISLOW 7213c10af507ad467da5578ca5ee1fca)
|
||||
set(MD5_PPM_GRAY_ISLOW_RGB e96ee81c30a6ed422d466338bd3de65d)
|
||||
set(MD5_JPEG_420S_IFAST_OPT 7af8e60be4d9c227ec63ac9b6630855e)
|
||||
set(MD5_JPEG_3x2_FLOAT_PROG a8c17daf77b457725ec929e215b603f8)
|
||||
set(MD5_PPM_3x2_FLOAT 42876ab9e5c2f76a87d08db5fbd57956)
|
||||
set(MD5_PPM_420M_ISLOW_2_1 4ca6be2a6f326ff9eaab63e70a8259c0)
|
||||
set(MD5_PPM_420M_ISLOW_15_8 12aa9f9534c1b3d7ba047322226365eb)
|
||||
set(MD5_PPM_420M_ISLOW_13_8 f7e22817c7b25e1393e4ec101e9d4e96)
|
||||
set(MD5_PPM_420M_ISLOW_11_8 800a16f9f4dc9b293197bfe11be10a82)
|
||||
set(MD5_PPM_420M_ISLOW_9_8 06b7a92a9bc69f4dc36ec40f1937d55c)
|
||||
set(MD5_PPM_420M_ISLOW_7_8 3ec444a14a4ab4eab88ffc49c48eca43)
|
||||
set(MD5_PPM_420M_ISLOW_3_4 3e726b7ea872445b19437d1c1d4f0d93)
|
||||
set(MD5_PPM_420M_ISLOW_5_8 a8a771abdc94301d20ffac119b2caccd)
|
||||
set(MD5_PPM_420M_ISLOW_1_2 b419124dd5568b085787234866102866)
|
||||
set(MD5_PPM_420M_ISLOW_3_8 343d19015531b7bbe746124127244fa8)
|
||||
set(MD5_PPM_420M_ISLOW_1_4 35fd59d866e44659edfa3c18db2a3edb)
|
||||
set(MD5_PPM_420M_ISLOW_1_8 ccaed48ac0aedefda5d4abe4013f4ad7)
|
||||
set(MD5_JPEG_CROP cdb35ff4b4519392690ea040c56ea99c)
|
||||
else()
|
||||
set(TESTORIG testorig.jpg)
|
||||
set(MD5_JPEG_RGB_ISLOW 768e970dd57b340ff1b83c9d3d47c77b)
|
||||
set(MD5_PPM_RGB_ISLOW 00a257f5393fef8821f2b88ac7421291)
|
||||
set(MD5_BMP_RGB_ISLOW_565 f07d2e75073e4bb10f6c6f4d36e2e3be)
|
||||
@@ -330,6 +388,7 @@ set(MD5_BMP_420_ISLOW_565D 6bde71526acc44bcff76f696df8638d2)
|
||||
set(MD5_BMP_420M_ISLOW_565 8dc0185245353cfa32ad97027342216f)
|
||||
set(MD5_BMP_420M_ISLOW_565D d1be3a3339166255e76fa50a0d70d73e)
|
||||
set(MD5_JPEG_CROP b4197f377e621c4e9b1d20471432610d)
|
||||
endif()
|
||||
|
||||
if(WITH_JAVA)
|
||||
add_test(TJUnitTest
|
||||
@@ -365,11 +424,13 @@ foreach(libtype shared static)
|
||||
set(dir "")
|
||||
set(suffix -static)
|
||||
endif()
|
||||
if(WITH_TURBOJPEG)
|
||||
add_test(tjunittest${suffix} tjunittest${suffix})
|
||||
add_test(tjunittest${suffix}-alloc tjunittest${suffix} -alloc)
|
||||
add_test(tjunittest${suffix}-yuv tjunittest${suffix} -yuv)
|
||||
add_test(tjunittest${suffix}-yuv-alloc tjunittest${suffix} -yuv -alloc)
|
||||
add_test(tjunittest${suffix}-yuv-nopad tjunittest${suffix} -yuv -noyuvpad)
|
||||
endif()
|
||||
|
||||
# These tests are carefully chosen to provide full coverage of as many of the
|
||||
# underlying algorithms as possible (including all of the SIMD-accelerated
|
||||
@@ -389,6 +450,7 @@ foreach(libtype shared static)
|
||||
add_test(djpeg${suffix}-rgb-islow-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_PPM_RGB_ISLOW} -DFILE=testout_rgb_islow.ppm
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
if(NOT WITH_12BIT)
|
||||
# CC: RGB->RGB565 SAMP: fullsize IDCT: islow ENT: huff
|
||||
add_test(djpeg${suffix}-rgb-islow-565
|
||||
${dir}djpeg${suffix} -dct int -rgb565 -dither none -bmp
|
||||
@@ -405,6 +467,7 @@ foreach(libtype shared static)
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_BMP_RGB_ISLOW_565D}
|
||||
-DFILE=testout_rgb_islow_565D.bmp
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
endif()
|
||||
|
||||
# CC: RGB->YCC SAMP: fullsize/h2v1 FDCT: ifast ENT: 2-pass huff
|
||||
add_test(cjpeg${suffix}-422-ifast-opt
|
||||
@@ -429,6 +492,7 @@ foreach(libtype shared static)
|
||||
add_test(djpeg${suffix}-422m-ifast-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_PPM_422M_IFAST} -DFILE=testout_422m_ifast.ppm
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
if(NOT WITH_12BIT)
|
||||
# CC: YCC->RGB565 SAMP: h2v1 merged IDCT: ifast ENT: huff
|
||||
add_test(djpeg${suffix}-422m-ifast-565
|
||||
${dir}djpeg${suffix} -dct int -nosmooth -rgb565 -dither none -bmp
|
||||
@@ -445,6 +509,7 @@ foreach(libtype shared static)
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_BMP_422M_IFAST_565D}
|
||||
-DFILE=testout_422m_ifast_565D.bmp
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
endif()
|
||||
|
||||
# CC: RGB->YCC SAMP: fullsize/h2v2 FDCT: ifast ENT: prog huff
|
||||
add_test(cjpeg${suffix}-420-q100-ifast-prog
|
||||
@@ -496,6 +561,7 @@ foreach(libtype shared static)
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_PPM_GRAY_ISLOW_RGB}
|
||||
-DFILE=testout_gray_islow_rgb.ppm
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
if(NOT WITH_12BIT)
|
||||
# CC: Gray->RGB565 SAMP: fullsize IDCT: islow ENT: huff
|
||||
add_test(djpeg${suffix}-gray-islow-565
|
||||
${dir}djpeg${suffix} -dct int -rgb565 -dither none -bmp
|
||||
@@ -512,6 +578,7 @@ foreach(libtype shared static)
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_BMP_GRAY_ISLOW_565D}
|
||||
-DFILE=testout_gray_islow_565D.bmp
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
endif()
|
||||
|
||||
# CC: RGB->YCC SAMP: fullsize smooth/h2v2 smooth FDCT: islow
|
||||
# ENT: 2-pass huff
|
||||
@@ -610,18 +677,19 @@ foreach(libtype shared static)
|
||||
add_test(djpeg${suffix}-420m-islow-${scale}
|
||||
${dir}djpeg${suffix} -dct int -scale ${scalearg} -nosmooth -ppm
|
||||
-outfile testout_420m_islow_${scale}.ppm
|
||||
${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
|
||||
${CMAKE_SOURCE_DIR}/testimages/${TESTORIG})
|
||||
add_test(djpeg${suffix}-420m-islow-${scale}-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_PPM_420M_ISLOW_${scale}}
|
||||
-DFILE=testout_420m_islow_${scale}.ppm
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
endforeach()
|
||||
|
||||
if(NOT WITH_12BIT)
|
||||
# CC: YCC->RGB (dithered) SAMP: h2v2 fancy IDCT: islow ENT: huff
|
||||
add_test(djpeg${suffix}-420-islow-256
|
||||
${dir}djpeg${suffix} -dct int -colors 256 -bmp
|
||||
-outfile testout_420_islow_256.bmp
|
||||
${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
|
||||
${CMAKE_SOURCE_DIR}/testimages/${TESTORIG})
|
||||
add_test(djpeg${suffix}-420-islow-256-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_BMP_420_ISLOW_256}
|
||||
-DFILE=testout_420_islow_256.bmp
|
||||
@@ -630,7 +698,7 @@ foreach(libtype shared static)
|
||||
add_test(djpeg${suffix}-420-islow-565
|
||||
${dir}djpeg${suffix} -dct int -rgb565 -dither none -bmp
|
||||
-outfile testout_420_islow_565.bmp
|
||||
${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
|
||||
${CMAKE_SOURCE_DIR}/testimages/${TESTORIG})
|
||||
add_test(djpeg${suffix}-420-islow-565-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_BMP_420_ISLOW_565}
|
||||
-DFILE=testout_420_islow_565.bmp
|
||||
@@ -639,7 +707,7 @@ foreach(libtype shared static)
|
||||
add_test(djpeg${suffix}-420-islow-565D
|
||||
${dir}djpeg${suffix} -dct int -rgb565 -bmp
|
||||
-outfile testout_420_islow_565D.bmp
|
||||
${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
|
||||
${CMAKE_SOURCE_DIR}/testimages/${TESTORIG})
|
||||
add_test(djpeg${suffix}-420-islow-565D-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_BMP_420_ISLOW_565D}
|
||||
-DFILE=testout_420_islow_565D.bmp
|
||||
@@ -648,7 +716,7 @@ foreach(libtype shared static)
|
||||
add_test(djpeg${suffix}-420m-islow-565
|
||||
${dir}djpeg${suffix} -dct int -nosmooth -rgb565 -dither none -bmp
|
||||
-outfile testout_420m_islow_565.bmp
|
||||
${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
|
||||
${CMAKE_SOURCE_DIR}/testimages/${TESTORIG})
|
||||
add_test(djpeg${suffix}-420m-islow-565-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_BMP_420M_ISLOW_565}
|
||||
-DFILE=testout_420m_islow_565.bmp
|
||||
@@ -657,15 +725,15 @@ foreach(libtype shared static)
|
||||
add_test(djpeg${suffix}-420m-islow-565D
|
||||
${dir}djpeg${suffix} -dct int -nosmooth -rgb565 -bmp
|
||||
-outfile testout_420m_islow_565D.bmp
|
||||
${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
|
||||
${CMAKE_SOURCE_DIR}/testimages/${TESTORIG})
|
||||
add_test(djpeg${suffix}-420m-islow-565D-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_BMP_420M_ISLOW_565D}
|
||||
-DFILE=testout_420m_islow_565D.bmp
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
|
||||
endif()
|
||||
add_test(jpegtran${suffix}-crop
|
||||
${dir}jpegtran${suffix} -crop 120x90+20+50 -transpose -perfect
|
||||
-outfile testout_crop.jpg ${CMAKE_SOURCE_DIR}/testimages/testorig.jpg)
|
||||
-outfile testout_crop.jpg ${CMAKE_SOURCE_DIR}/testimages/${TESTORIG})
|
||||
add_test(jpegtran${suffix}-crop-cmp
|
||||
${CMAKE_COMMAND} -DMD5=${MD5_JPEG_CROP} -DFILE=testout_crop.jpg
|
||||
-P ${CMAKE_SOURCE_DIR}/cmakescripts/md5cmp.cmake)
|
||||
@@ -721,7 +789,10 @@ add_custom_target(installer
|
||||
cjpeg djpeg jpegtran tjbench ${JAVA_DEPEND}
|
||||
SOURCES libmozjpeg.nsi)
|
||||
|
||||
install(TARGETS jpeg-static turbojpeg turbojpeg-static rdjpgcom wrjpgcom tjbench
|
||||
if(WITH_TURBOJPEG)
|
||||
set(TURBOJPEG_TARGETS turbojpeg turbojpeg-static tjbench)
|
||||
endif()
|
||||
install(TARGETS jpeg-static rdjpgcom wrjpgcom ${TURBOJPEG_TARGETS}
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
|
||||
@@ -13,13 +13,18 @@ compatibility, since 4:1:1 is not fully accelerated in libjpeg-turbo and has no
|
||||
significant advantages relative to 4:2:0.
|
||||
-- CMYK images are now supported. This feature allows CMYK source images to be
|
||||
compressed to YCCK JPEGs and YCCK or CMYK JPEGs to be decompressed to CMYK
|
||||
destination images. Conversion between CMYK and RGB or YUV images is not
|
||||
supported. Such conversion requires a color management system and is out of
|
||||
scope for a codec library.
|
||||
destination images. Conversion between CMYK/YCCK and RGB or YUV images is not
|
||||
supported. Such conversion requires a color management system and is thus out
|
||||
of scope for a codec library.
|
||||
-- The handling of YUV images in the Java API has been significantly refactored
|
||||
and should now be much more intuitive.
|
||||
-- The Java API now supports encoding a YUV image from an arbitrary position in
|
||||
a large image buffer.
|
||||
-- All of the YUV functions now have a corresponding function that operates on
|
||||
separate image planes instead of a unified image buffer. This allows for
|
||||
compressing/decoding from or decompressing/encoding to a subregion of a larger
|
||||
YUV image. It also allows for handling YUV formats that swap the order of the
|
||||
U and V planes.
|
||||
|
||||
[2] Added SIMD acceleration for DSPr2-capable MIPS platforms. This speeds up
|
||||
the compression of full-color JPEGs by 70-80% on such platforms and
|
||||
@@ -46,7 +51,7 @@ Android devices that were tested, two demonstrated a small overall performance
|
||||
loss (~3-4% on average) with ARMv6 code and a small gain (also ~3-4%) with
|
||||
ARMv7 code when enabling this new feature, but the other two devices
|
||||
demonstrated a significant overall performance gain with both ARMv6 and ARMv7
|
||||
code (~10-20%.) Actual mileage may vary.
|
||||
code (~10-20%) when enabling the feature. Actual mileage may vary.
|
||||
|
||||
[6] Worked around an issue with Visual C++ 2010 and later that caused incorrect
|
||||
pixels to be generated when decompressing a JPEG image to a 256-color bitmap,
|
||||
@@ -63,12 +68,12 @@ accuracy than the slow integer DCT/IDCT algorithms, and they are quite a bit
|
||||
slower.
|
||||
|
||||
[8] Added a new output colorspace (JCS_RGB565) to the libjpeg API that allows
|
||||
for decompressing JPEG images into RGB565 (16-bit) pixels.
|
||||
for decompressing JPEG images into RGB565 (16-bit) pixels. If dithering is not
|
||||
used, then this code path is SIMD-accelerated on ARM platforms.
|
||||
|
||||
[9] Numerous obsolete features, such as support for compilers that can't
|
||||
handle prototypes and support for the MS-DOS memory model, were removed from
|
||||
the libjpeg code, greatly improving its readability and making it easier to
|
||||
maintain and extend.
|
||||
[9] Numerous obsolete features, such as support for non-ANSI compilers and
|
||||
support for the MS-DOS memory model, were removed from the libjpeg code,
|
||||
greatly improving its readability and making it easier to maintain and extend.
|
||||
|
||||
[10] Fixed a segfault that occurred when calling output_message() with msg_code
|
||||
set to JMSG_COPYRIGHT.
|
||||
@@ -78,7 +83,38 @@ characters to be passed on the command line, which was causing it to generate
|
||||
incorrect JPEG files.
|
||||
|
||||
[12] Fixed a bug in the build system that was causing the Windows version of
|
||||
wrjpgcom to be built using the rdjpgcom code.
|
||||
wrjpgcom to be built using the rdjpgcom source code.
|
||||
|
||||
[13] Restored 12-bit-per-component JPEG support. A 12-bit version of
|
||||
libjpeg-turbo can now be built by passing an argument of --with-12bit to
|
||||
configure (Unix) or -DWITH_12BIT=1 to cmake (Windows.) 12-bit JPEG support is
|
||||
included only for convenience. Enabling this feature disables all of the
|
||||
performance features in libjpeg-turbo, as well as arithmetic coding and the
|
||||
TurboJPEG API. The resulting library still contains the other libjpeg-turbo
|
||||
features (such as the colorspace extensions), but in general, it performs no
|
||||
faster than libjpeg v6b.
|
||||
|
||||
[14] Added ARM 64-bit SIMD acceleration for the YCC-to-RGB color conversion
|
||||
and IDCT algorithms (both are used during JPEG decompression.) For unknown
|
||||
reasons (probably related to clang), this code cannot currently be compiled for
|
||||
iOS.
|
||||
|
||||
[15] Fixed an extremely rare bug that could cause the Huffman encoder's local
|
||||
buffer to overrun when a very high-frequency MCU is compressed using quality
|
||||
100 and no subsampling, and when the JPEG output buffer is being dynamically
|
||||
resized by the destination manager. This issue was so rare that, even with a
|
||||
test program specifically designed to make the bug occur (by injecting random
|
||||
high-frequency YUV data into the compressor), it was reproducible only once in
|
||||
about every 25 million iterations.
|
||||
|
||||
[16] Fixed an oversight in the TurboJPEG C wrapper: if any of the JPEG
|
||||
compression functions was called repeatedly with the same
|
||||
automatically-allocated destination buffer, then TurboJPEG would erroneously
|
||||
assume that the jpegSize parameter was equal to the size of the buffer, when in
|
||||
fact that parameter was probably equal to the size of the most recently
|
||||
compressed JPEG image. If the size of the previous JPEG image was not as large
|
||||
as the current JPEG image, then TurboJPEG would unnecessarily reallocate the
|
||||
destination buffer.
|
||||
|
||||
[7] Improved the accuracy and performance of the non-SIMD implementation of the
|
||||
floating point inverse DCT (using code borrowed from libjpeg v8a and later.)
|
||||
|
||||
124
Makefile.am
124
Makefile.am
@@ -108,21 +108,40 @@ tjunittest_LDADD = libturbojpeg.la
|
||||
endif
|
||||
|
||||
|
||||
cjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c cjpeg.c rdbmp.c rdgif.c \
|
||||
rdppm.c rdswitch.c rdtarga.c rdjpeg.c
|
||||
cjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c cjpeg.c rdgif.c rdppm.c rdswitch.c rdjpeg.c
|
||||
if WITH_12BIT
|
||||
else
|
||||
cjpeg_SOURCES += rdbmp.c rdtarga.c
|
||||
endif
|
||||
|
||||
cjpeg_LDADD = libjpeg.la
|
||||
|
||||
cjpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \
|
||||
-DTARGA_SUPPORTED
|
||||
cjpeg_CFLAGS = -DGIF_SUPPORTED -DPPM_SUPPORTED
|
||||
if WITH_12BIT
|
||||
else
|
||||
cjpeg_CFLAGS += -DBMP_SUPPORTED -DTARGA_SUPPORTED
|
||||
endif
|
||||
|
||||
if HAVE_LIBPNG
|
||||
cjpeg_CFLAGS += -DPNG_SUPPORTED $(libpng_CFLAGS)
|
||||
cjpeg_LDADD += $(libpng_LIBS)
|
||||
cjpeg_SOURCES += rdpng.c
|
||||
endif
|
||||
|
||||
djpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c djpeg.c rdcolmap.c rdswitch.c \
|
||||
wrbmp.c wrgif.c wrppm.c wrtarga.c
|
||||
wrgif.c wrppm.c
|
||||
if WITH_12BIT
|
||||
else
|
||||
djpeg_SOURCES += wrbmp.c wrtarga.c
|
||||
endif
|
||||
|
||||
djpeg_LDADD = libjpeg.la
|
||||
|
||||
djpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \
|
||||
-DTARGA_SUPPORTED
|
||||
djpeg_CFLAGS = -DGIF_SUPPORTED -DPPM_SUPPORTED
|
||||
if WITH_12BIT
|
||||
else
|
||||
djpeg_CFLAGS += -DBMP_SUPPORTED -DTARGA_SUPPORTED
|
||||
endif
|
||||
|
||||
jpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c transupp.h
|
||||
|
||||
@@ -163,7 +182,7 @@ dist_example_DATA = example.c
|
||||
|
||||
EXTRA_DIST = win release $(DOCS) testimages CMakeLists.txt \
|
||||
sharedlib/CMakeLists.txt cmakescripts libjpeg.map.in doc doxygen.config \
|
||||
jccolext.c jdcolext.c jdcol565.c jdmrgext.c jstdhuff.c
|
||||
doxygen-extra.css jccolext.c jdcolext.c jdcol565.c jdmrgext.c jstdhuff.c
|
||||
|
||||
dist-hook:
|
||||
rm -rf `find $(distdir) -name .svn`
|
||||
@@ -171,6 +190,40 @@ dist-hook:
|
||||
|
||||
SUBDIRS += md5
|
||||
|
||||
if WITH_12BIT
|
||||
|
||||
TESTORIG = testorig12.jpg
|
||||
MD5_JPEG_RGB_ISLOW = 9620f424569594bb9242b48498ad801f
|
||||
MD5_PPM_RGB_ISLOW = f3301d2219783b8b3d942b7239fa50c0
|
||||
MD5_JPEG_422_IFAST_OPT = 7322e3bd2f127f7de4b40d4480ce60e4
|
||||
MD5_PPM_422_IFAST = 79807fa552899e66a04708f533e16950
|
||||
MD5_PPM_422M_IFAST = 07737bfe8a7c1c87aaa393a0098d16b0
|
||||
MD5_JPEG_420_IFAST_Q100_PROG = a1da220b5604081863a504297ed59e55
|
||||
MD5_PPM_420_Q100_IFAST = 1b3730122709f53d007255e8dfd3305e
|
||||
MD5_PPM_420M_Q100_IFAST = 980a1a3c5bf9510022869d30b7d26566
|
||||
MD5_JPEG_GRAY_ISLOW = 235c90707b16e2e069f37c888b2636d9
|
||||
MD5_PPM_GRAY_ISLOW = 7213c10af507ad467da5578ca5ee1fca
|
||||
MD5_PPM_GRAY_ISLOW_RGB = e96ee81c30a6ed422d466338bd3de65d
|
||||
MD5_JPEG_420S_IFAST_OPT = 7af8e60be4d9c227ec63ac9b6630855e
|
||||
MD5_JPEG_3x2_FLOAT_PROG = a8c17daf77b457725ec929e215b603f8
|
||||
MD5_PPM_3x2_FLOAT = 42876ab9e5c2f76a87d08db5fbd57956
|
||||
MD5_PPM_420M_ISLOW_2_1 = 4ca6be2a6f326ff9eaab63e70a8259c0
|
||||
MD5_PPM_420M_ISLOW_15_8 = 12aa9f9534c1b3d7ba047322226365eb
|
||||
MD5_PPM_420M_ISLOW_13_8 = f7e22817c7b25e1393e4ec101e9d4e96
|
||||
MD5_PPM_420M_ISLOW_11_8 = 800a16f9f4dc9b293197bfe11be10a82
|
||||
MD5_PPM_420M_ISLOW_9_8 = 06b7a92a9bc69f4dc36ec40f1937d55c
|
||||
MD5_PPM_420M_ISLOW_7_8 = 3ec444a14a4ab4eab88ffc49c48eca43
|
||||
MD5_PPM_420M_ISLOW_3_4 = 3e726b7ea872445b19437d1c1d4f0d93
|
||||
MD5_PPM_420M_ISLOW_5_8 = a8a771abdc94301d20ffac119b2caccd
|
||||
MD5_PPM_420M_ISLOW_1_2 = b419124dd5568b085787234866102866
|
||||
MD5_PPM_420M_ISLOW_3_8 = 343d19015531b7bbe746124127244fa8
|
||||
MD5_PPM_420M_ISLOW_1_4 = 35fd59d866e44659edfa3c18db2a3edb
|
||||
MD5_PPM_420M_ISLOW_1_8 = ccaed48ac0aedefda5d4abe4013f4ad7
|
||||
MD5_JPEG_CROP = cdb35ff4b4519392690ea040c56ea99c
|
||||
|
||||
else
|
||||
|
||||
TESTORIG = testorig.jpg
|
||||
MD5_JPEG_RGB_ISLOW = 768e970dd57b340ff1b83c9d3d47c77b
|
||||
MD5_PPM_RGB_ISLOW = 00a257f5393fef8821f2b88ac7421291
|
||||
MD5_BMP_RGB_ISLOW_565 = f07d2e75073e4bb10f6c6f4d36e2e3be
|
||||
@@ -220,6 +273,8 @@ MD5_BMP_420M_ISLOW_565 = 8dc0185245353cfa32ad97027342216f
|
||||
MD5_BMP_420M_ISLOW_565D =d1be3a3339166255e76fa50a0d70d73e
|
||||
MD5_JPEG_CROP = b4197f377e621c4e9b1d20471432610d
|
||||
|
||||
endif
|
||||
|
||||
test: testclean all
|
||||
|
||||
if WITH_TURBOJPEG
|
||||
@@ -249,6 +304,9 @@ endif
|
||||
./djpeg -dct int -ppm -outfile testout_rgb_islow.ppm testout_rgb_islow.jpg
|
||||
md5/md5cmp $(MD5_PPM_RGB_ISLOW) testout_rgb_islow.ppm
|
||||
rm testout_rgb_islow.ppm
|
||||
if WITH_12BIT
|
||||
rm testout_rgb_islow.jpg
|
||||
else
|
||||
# CC: RGB->RGB565 SAMP: fullsize IDCT: islow ENT: huff
|
||||
./djpeg -dct int -rgb565 -dither none -bmp -outfile testout_rgb_islow_565.bmp testout_rgb_islow.jpg
|
||||
md5/md5cmp $(MD5_BMP_RGB_ISLOW_565) testout_rgb_islow_565.bmp
|
||||
@@ -257,6 +315,7 @@ endif
|
||||
./djpeg -dct int -rgb565 -bmp -outfile testout_rgb_islow_565D.bmp testout_rgb_islow.jpg
|
||||
md5/md5cmp $(MD5_BMP_RGB_ISLOW_565D) testout_rgb_islow_565D.bmp
|
||||
rm testout_rgb_islow_565D.bmp testout_rgb_islow.jpg
|
||||
endif
|
||||
|
||||
# CC: RGB->YCC SAMP: fullsize/h2v1 FDCT: ifast ENT: 2-pass huff
|
||||
./cjpeg -sample 2x1 -dct fast -opt -outfile testout_422_ifast_opt.jpg $(srcdir)/testimages/testorig.ppm
|
||||
@@ -269,6 +328,9 @@ endif
|
||||
./djpeg -dct fast -nosmooth -outfile testout_422m_ifast.ppm testout_422_ifast_opt.jpg
|
||||
md5/md5cmp $(MD5_PPM_422M_IFAST) testout_422m_ifast.ppm
|
||||
rm testout_422m_ifast.ppm
|
||||
if WITH_12BIT
|
||||
rm testout_422_ifast_opt.jpg
|
||||
else
|
||||
# CC: YCC->RGB565 SAMP: h2v1 merged IDCT: ifast ENT: huff
|
||||
./djpeg -dct int -nosmooth -rgb565 -dither none -bmp -outfile testout_422m_ifast_565.bmp testout_422_ifast_opt.jpg
|
||||
md5/md5cmp $(MD5_BMP_422M_IFAST_565) testout_422m_ifast_565.bmp
|
||||
@@ -277,6 +339,7 @@ endif
|
||||
./djpeg -dct int -nosmooth -rgb565 -bmp -outfile testout_422m_ifast_565D.bmp testout_422_ifast_opt.jpg
|
||||
md5/md5cmp $(MD5_BMP_422M_IFAST_565D) testout_422m_ifast_565D.bmp
|
||||
rm testout_422m_ifast_565D.bmp testout_422_ifast_opt.jpg
|
||||
endif
|
||||
|
||||
# CC: RGB->YCC SAMP: fullsize/h2v2 FDCT: ifast ENT: prog huff
|
||||
./cjpeg -sample 2x2 -quality 100 -dct fast -prog -outfile testout_420_q100_ifast_prog.jpg $(srcdir)/testimages/testorig.ppm
|
||||
@@ -301,6 +364,9 @@ endif
|
||||
./djpeg -dct int -rgb -outfile testout_gray_islow_rgb.ppm testout_gray_islow.jpg
|
||||
md5/md5cmp $(MD5_PPM_GRAY_ISLOW_RGB) testout_gray_islow_rgb.ppm
|
||||
rm testout_gray_islow_rgb.ppm
|
||||
if WITH_12BIT
|
||||
rm testout_gray_islow.jpg
|
||||
else
|
||||
# CC: Gray->RGB565 SAMP: fullsize IDCT: islow ENT: huff
|
||||
./djpeg -dct int -rgb565 -dither none -bmp -outfile testout_gray_islow_565.bmp testout_gray_islow.jpg
|
||||
md5/md5cmp $(MD5_BMP_GRAY_ISLOW_565) testout_gray_islow_565.bmp
|
||||
@@ -309,6 +375,7 @@ endif
|
||||
./djpeg -dct int -rgb565 -bmp -outfile testout_gray_islow_565D.bmp testout_gray_islow.jpg
|
||||
md5/md5cmp $(MD5_BMP_GRAY_ISLOW_565D) testout_gray_islow_565D.bmp
|
||||
rm testout_gray_islow_565D.bmp testout_gray_islow.jpg
|
||||
endif
|
||||
|
||||
# CC: RGB->YCC SAMP: fullsize smooth/h2v2 smooth FDCT: islow
|
||||
# ENT: 2-pass huff
|
||||
@@ -348,75 +415,78 @@ if WITH_ARITH_DEC
|
||||
endif
|
||||
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 16x16 islow ENT: huff
|
||||
./djpeg -dct int -scale 2/1 -nosmooth -ppm -outfile testout_420m_islow_2_1.ppm $(srcdir)/testimages/testorig.jpg
|
||||
./djpeg -dct int -scale 2/1 -nosmooth -ppm -outfile testout_420m_islow_2_1.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_2_1) testout_420m_islow_2_1.ppm
|
||||
rm testout_420m_islow_2_1.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 15x15 islow ENT: huff
|
||||
./djpeg -dct int -scale 15/8 -nosmooth -ppm -outfile testout_420m_islow_15_8.ppm $(srcdir)/testimages/testorig.jpg
|
||||
./djpeg -dct int -scale 15/8 -nosmooth -ppm -outfile testout_420m_islow_15_8.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_15_8) testout_420m_islow_15_8.ppm
|
||||
rm testout_420m_islow_15_8.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 13x13 islow ENT: huff
|
||||
./djpeg -dct int -scale 13/8 -nosmooth -ppm -outfile testout_420m_islow_13_8.ppm $(srcdir)/testimages/testorig.jpg
|
||||
./djpeg -dct int -scale 13/8 -nosmooth -ppm -outfile testout_420m_islow_13_8.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_13_8) testout_420m_islow_13_8.ppm
|
||||
rm testout_420m_islow_13_8.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 11x11 islow ENT: huff
|
||||
./djpeg -dct int -scale 11/8 -nosmooth -ppm -outfile testout_420m_islow_11_8.ppm $(srcdir)/testimages/testorig.jpg
|
||||
./djpeg -dct int -scale 11/8 -nosmooth -ppm -outfile testout_420m_islow_11_8.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_11_8) testout_420m_islow_11_8.ppm
|
||||
rm testout_420m_islow_11_8.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 9x9 islow ENT: huff
|
||||
./djpeg -dct int -scale 9/8 -nosmooth -ppm -outfile testout_420m_islow_9_8.ppm $(srcdir)/testimages/testorig.jpg
|
||||
./djpeg -dct int -scale 9/8 -nosmooth -ppm -outfile testout_420m_islow_9_8.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_9_8) testout_420m_islow_9_8.ppm
|
||||
rm testout_420m_islow_9_8.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 7x7 islow/14x14 islow ENT: huff
|
||||
./djpeg -dct int -scale 7/8 -nosmooth -ppm -outfile testout_420m_islow_7_8.ppm $(srcdir)/testimages/testorig.jpg
|
||||
./djpeg -dct int -scale 7/8 -nosmooth -ppm -outfile testout_420m_islow_7_8.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_7_8) testout_420m_islow_7_8.ppm
|
||||
rm testout_420m_islow_7_8.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 6x6 islow/12x12 islow ENT: huff
|
||||
./djpeg -dct int -scale 3/4 -nosmooth -ppm -outfile testout_420m_islow_3_4.ppm $(srcdir)/testimages/testorig.jpg
|
||||
./djpeg -dct int -scale 3/4 -nosmooth -ppm -outfile testout_420m_islow_3_4.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_3_4) testout_420m_islow_3_4.ppm
|
||||
rm testout_420m_islow_3_4.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 5x5 islow/10x10 islow ENT: huff
|
||||
./djpeg -dct int -scale 5/8 -nosmooth -ppm -outfile testout_420m_islow_5_8.ppm $(srcdir)/testimages/testorig.jpg
|
||||
./djpeg -dct int -scale 5/8 -nosmooth -ppm -outfile testout_420m_islow_5_8.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_5_8) testout_420m_islow_5_8.ppm
|
||||
rm testout_420m_islow_5_8.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 4x4 islow/8x8 islow ENT: huff
|
||||
./djpeg -dct int -scale 1/2 -nosmooth -ppm -outfile testout_420m_islow_1_2.ppm $(srcdir)/testimages/testorig.jpg
|
||||
./djpeg -dct int -scale 1/2 -nosmooth -ppm -outfile testout_420m_islow_1_2.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_1_2) testout_420m_islow_1_2.ppm
|
||||
rm testout_420m_islow_1_2.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 3x3 islow/6x6 islow ENT: huff
|
||||
./djpeg -dct int -scale 3/8 -nosmooth -ppm -outfile testout_420m_islow_3_8.ppm $(srcdir)/testimages/testorig.jpg
|
||||
./djpeg -dct int -scale 3/8 -nosmooth -ppm -outfile testout_420m_islow_3_8.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_3_8) testout_420m_islow_3_8.ppm
|
||||
rm testout_420m_islow_3_8.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 2x2 islow/4x4 islow ENT: huff
|
||||
./djpeg -dct int -scale 1/4 -nosmooth -ppm -outfile testout_420m_islow_1_4.ppm $(srcdir)/testimages/testorig.jpg
|
||||
./djpeg -dct int -scale 1/4 -nosmooth -ppm -outfile testout_420m_islow_1_4.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_1_4) testout_420m_islow_1_4.ppm
|
||||
rm testout_420m_islow_1_4.ppm
|
||||
# CC: YCC->RGB SAMP: h2v2 merged IDCT: 1x1 islow/2x2 islow ENT: huff
|
||||
./djpeg -dct int -scale 1/8 -nosmooth -ppm -outfile testout_420m_islow_1_8.ppm $(srcdir)/testimages/testorig.jpg
|
||||
./djpeg -dct int -scale 1/8 -nosmooth -ppm -outfile testout_420m_islow_1_8.ppm $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_PPM_420M_ISLOW_1_8) testout_420m_islow_1_8.ppm
|
||||
rm testout_420m_islow_1_8.ppm
|
||||
if WITH_12BIT
|
||||
else
|
||||
# CC: YCC->RGB (dithered) SAMP: h2v2 fancy IDCT: islow ENT: huff
|
||||
./djpeg -dct int -colors 256 -bmp -outfile testout_420_islow_256.bmp $(srcdir)/testimages/testorig.jpg
|
||||
./djpeg -dct int -colors 256 -bmp -outfile testout_420_islow_256.bmp $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_BMP_420_ISLOW_256) testout_420_islow_256.bmp
|
||||
rm testout_420_islow_256.bmp
|
||||
# CC: YCC->RGB565 SAMP: h2v2 fancy IDCT: islow ENT: huff
|
||||
./djpeg -dct int -rgb565 -dither none -bmp -outfile testout_420_islow_565.bmp $(srcdir)/testimages/testorig.jpg
|
||||
./djpeg -dct int -rgb565 -dither none -bmp -outfile testout_420_islow_565.bmp $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_BMP_420_ISLOW_565) testout_420_islow_565.bmp
|
||||
rm testout_420_islow_565.bmp
|
||||
# CC: YCC->RGB565 (dithered) SAMP: h2v2 fancy IDCT: islow ENT: huff
|
||||
./djpeg -dct int -rgb565 -bmp -outfile testout_420_islow_565D.bmp $(srcdir)/testimages/testorig.jpg
|
||||
./djpeg -dct int -rgb565 -bmp -outfile testout_420_islow_565D.bmp $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_BMP_420_ISLOW_565D) testout_420_islow_565D.bmp
|
||||
rm testout_420_islow_565D.bmp
|
||||
# CC: YCC->RGB565 SAMP: h2v2 merged IDCT: islow ENT: huff
|
||||
./djpeg -dct int -nosmooth -rgb565 -dither none -bmp -outfile testout_420m_islow_565.bmp $(srcdir)/testimages/testorig.jpg
|
||||
./djpeg -dct int -nosmooth -rgb565 -dither none -bmp -outfile testout_420m_islow_565.bmp $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_BMP_420M_ISLOW_565) testout_420m_islow_565.bmp
|
||||
rm testout_420m_islow_565.bmp
|
||||
# CC: YCC->RGB565 (dithered) SAMP: h2v2 merged IDCT: islow ENT: huff
|
||||
./djpeg -dct int -nosmooth -rgb565 -bmp -outfile testout_420m_islow_565D.bmp $(srcdir)/testimages/testorig.jpg
|
||||
./djpeg -dct int -nosmooth -rgb565 -bmp -outfile testout_420m_islow_565D.bmp $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_BMP_420M_ISLOW_565D) testout_420m_islow_565D.bmp
|
||||
rm testout_420m_islow_565D.bmp
|
||||
endif
|
||||
|
||||
./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testout_crop.jpg $(srcdir)/testimages/testorig.jpg
|
||||
./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testout_crop.jpg $(srcdir)/testimages/$(TESTORIG)
|
||||
md5/md5cmp $(MD5_JPEG_CROP) testout_crop.jpg
|
||||
rm testout_crop.jpg
|
||||
|
||||
@@ -457,7 +527,9 @@ testclean:
|
||||
|
||||
tjtest:
|
||||
sh ./tjbenchtest
|
||||
sh ./tjbenchtest -alloc
|
||||
sh ./tjbenchtest -yuv
|
||||
sh ./tjbenchtest -yuv -alloc
|
||||
if WITH_JAVA
|
||||
sh ./tjbenchtest.java
|
||||
sh ./tjbenchtest.java -yuv
|
||||
|
||||
@@ -7,6 +7,8 @@ The idea is to reduce transfer times for JPEGs on the Web, thus reducing page lo
|
||||
|
||||
'mozjpeg' is not intended to be a general JPEG library replacement. It makes tradeoffs that are intended to benefit Web use cases and focuses solely on improving encoding. It is best used as part of a Web encoding workflow. For a general JPEG library (e.g. your system libjpeg), especially if you care about decoding, we recommend libjpeg-turbo.
|
||||
|
||||
For more information, see the project announcement:
|
||||
More information:
|
||||
|
||||
https://blog.mozilla.org/research/2014/03/05/introducing-the-mozjpeg-project/
|
||||
* [Version 1.0 Announcement](https://blog.mozilla.org/research/2014/03/05/introducing-the-mozjpeg-project/)
|
||||
* [Version 2.0 Announcement](https://blog.mozilla.org/research/2014/07/15/mozilla-advances-jpeg-encoding-with-mozjpeg-2-0/)
|
||||
* [Mailing List](https://lists.mozilla.org/listinfo/dev-mozjpeg)</a>
|
||||
|
||||
@@ -219,6 +219,7 @@ AC_DEFUN([AC_CHECK_COMPATIBLE_ARM64_ASSEMBLER_IFELSE],[
|
||||
CC="$CCAS"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
.text
|
||||
.arch armv8-a+fp+simd
|
||||
movi v0.16b, #100]])], ac_good_gnu_arm_assembler=yes)
|
||||
|
||||
ac_use_gas_preprocessor=no
|
||||
@@ -226,6 +227,7 @@ AC_DEFUN([AC_CHECK_COMPATIBLE_ARM64_ASSEMBLER_IFELSE],[
|
||||
CC="gas-preprocessor.pl $CCAS"
|
||||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
.text
|
||||
.arch armv8-a+fp+simd
|
||||
movi v0.16b, #100]])], ac_use_gas_preprocessor=yes)
|
||||
fi
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
|
||||
@@ -122,6 +122,10 @@ JMESSAGE(JERR_UNKNOWN_FORMAT, "Unrecognized input file format")
|
||||
#endif
|
||||
JMESSAGE(JERR_UNSUPPORTED_FORMAT, "Unsupported output file format")
|
||||
|
||||
#ifdef PNG_SUPPORTED
|
||||
JMESSAGE(JERR_PNG_ERROR, "Unable to read PNG file: %s")
|
||||
#endif
|
||||
|
||||
#ifdef JMAKE_ENUM_LIST
|
||||
|
||||
JMSG_LASTADDONCODE
|
||||
|
||||
1
cdjpeg.h
1
cdjpeg.h
@@ -104,6 +104,7 @@ EXTERN(cjpeg_source_ptr) jinit_read_gif (j_compress_ptr cinfo);
|
||||
EXTERN(djpeg_dest_ptr) jinit_write_gif (j_decompress_ptr cinfo);
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_jpeg (j_compress_ptr cinfo);
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_ppm (j_compress_ptr cinfo);
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_png (j_compress_ptr cinfo);
|
||||
EXTERN(djpeg_dest_ptr) jinit_write_ppm (j_decompress_ptr cinfo);
|
||||
EXTERN(cjpeg_source_ptr) jinit_read_rle (j_compress_ptr cinfo);
|
||||
EXTERN(djpeg_dest_ptr) jinit_write_rle (j_decompress_ptr cinfo);
|
||||
|
||||
29
cjpeg.c
29
cjpeg.c
@@ -113,6 +113,10 @@ select_file_type (j_compress_ptr cinfo, FILE * infile)
|
||||
case 'P':
|
||||
return jinit_read_ppm(cinfo);
|
||||
#endif
|
||||
#ifdef PNG_SUPPORTED
|
||||
case 0x89:
|
||||
return jinit_read_png(cinfo);
|
||||
#endif
|
||||
#ifdef RLE_SUPPORTED
|
||||
case 'R':
|
||||
return jinit_read_rle(cinfo);
|
||||
@@ -168,13 +172,17 @@ usage (void)
|
||||
#ifdef C_PROGRESSIVE_SUPPORTED
|
||||
fprintf(stderr, " -progressive Create progressive JPEG file (enabled by default)\n");
|
||||
#endif
|
||||
fprintf(stderr, " -baseline Create baseline JPEG file (disable progressive coding)\n");
|
||||
#ifdef TARGA_SUPPORTED
|
||||
fprintf(stderr, " -targa Input file is Targa format (usually not needed)\n");
|
||||
#endif
|
||||
fprintf(stderr, " -revert Revert to standard defaults (instead of mozjpeg defaults)\n");
|
||||
fprintf(stderr, " -fastcrush Disable progressive scan optimization\n");
|
||||
fprintf(stderr, " -multidcscan Use multiple DC scans (may be incompatible with some JPEG decoders)\n");
|
||||
fprintf(stderr, " -opt-dc-scan Optimize DC scans (may be incompatible with some JPEG decoders)\n");
|
||||
fprintf(stderr, " -split-dc-scan Use one DC scan per component (may be incompatible with some JPEG decoders?)\n");
|
||||
fprintf(stderr, " -notrellis Disable trellis optimization\n");
|
||||
fprintf(stderr, " -trellis-dc Enable trellis optimization of DC coefficients (default)\n");
|
||||
fprintf(stderr, " -notrellis-dc Disable trellis optimization of DC coefficients\n");
|
||||
fprintf(stderr, " -tune-psnr Tune trellis optimization for PSNR\n");
|
||||
fprintf(stderr, " -tune-hvs-psnr Tune trellis optimization for PSNR-HVS (default)\n");
|
||||
fprintf(stderr, " -tune-ssim Tune trellis optimization for SSIM\n");
|
||||
@@ -206,7 +214,6 @@ usage (void)
|
||||
#endif
|
||||
fprintf(stderr, " -verbose or -debug Emit debug output\n");
|
||||
fprintf(stderr, "Switches for wizards:\n");
|
||||
fprintf(stderr, " -baseline Force baseline quantization tables\n");
|
||||
fprintf(stderr, " -qtables file Use quantization tables given in file\n");
|
||||
fprintf(stderr, " -qslots N[,...] Set component quantization tables\n");
|
||||
fprintf(stderr, " -sample HxV[,...] Set component sampling factors\n");
|
||||
@@ -279,6 +286,10 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
|
||||
} else if (keymatch(arg, "baseline", 1)) {
|
||||
/* Force baseline-compatible output (8-bit quantizer values). */
|
||||
force_baseline = TRUE;
|
||||
/* Disable multiple scans */
|
||||
simple_progressive = FALSE;
|
||||
cinfo->num_scans = 0;
|
||||
cinfo->scan_info = NULL;
|
||||
|
||||
} else if (keymatch(arg, "dct", 2)) {
|
||||
/* Select DCT algorithm. */
|
||||
@@ -349,7 +360,7 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
|
||||
lval *= 1000L;
|
||||
cinfo->mem->max_memory_to_use = lval * 1000L;
|
||||
|
||||
} else if (keymatch(arg, "multidcscan", 3)) {
|
||||
} else if (keymatch(arg, "opt-dc-scan", 6)) {
|
||||
cinfo->one_dc_scan = FALSE;
|
||||
|
||||
} else if (keymatch(arg, "optimize", 1) || keymatch(arg, "optimise", 1)) {
|
||||
@@ -475,14 +486,26 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
|
||||
usage();
|
||||
cinfo->smoothing_factor = val;
|
||||
|
||||
} else if (keymatch(arg, "split-dc-scans", 3)) {
|
||||
cinfo->one_dc_scan = FALSE;
|
||||
cinfo->sep_dc_scan = TRUE;
|
||||
|
||||
} else if (keymatch(arg, "targa", 1)) {
|
||||
/* Input file is Targa format. */
|
||||
is_targa = TRUE;
|
||||
|
||||
} else if (keymatch(arg, "notrellis-dc", 11)) {
|
||||
/* disable trellis quantization */
|
||||
cinfo->trellis_quant_dc = FALSE;
|
||||
|
||||
} else if (keymatch(arg, "notrellis", 1)) {
|
||||
/* disable trellis quantization */
|
||||
cinfo->trellis_quant = FALSE;
|
||||
|
||||
} else if (keymatch(arg, "trellis-dc", 9)) {
|
||||
/* enable DC trellis quantization */
|
||||
cinfo->trellis_quant_dc = TRUE;
|
||||
|
||||
} else if (keymatch(arg, "tune-psnr", 6)) {
|
||||
cinfo->use_flat_quant_tbl = TRUE;
|
||||
cinfo->lambda_log_scale1 = 9.0;
|
||||
|
||||
35
configure.ac
35
configure.ac
@@ -2,7 +2,7 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ([2.56])
|
||||
AC_INIT([libmozjpeg], [2.0.1])
|
||||
AC_INIT([libmozjpeg], [2.1])
|
||||
BUILD=`date +%Y%m%d`
|
||||
|
||||
AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2])
|
||||
@@ -93,6 +93,11 @@ fi
|
||||
# Checks for libraries.
|
||||
AC_CHECK_LIB([m],[pow])
|
||||
|
||||
PKG_CHECK_MODULES([libpng], [libpng], [HAVE_LIBPNG=1], [
|
||||
PKG_CHECK_MODULES([libpng], [libpng12], [HAVE_LIBPNG=1], [HAVE_LIBPNG=0])
|
||||
])
|
||||
AM_CONDITIONAL([HAVE_LIBPNG], [test "$HAVE_LIBPNG" -eq 1])
|
||||
|
||||
# Checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS([stddef.h stdlib.h locale.h string.h])
|
||||
@@ -263,13 +268,16 @@ int bar() { return foo();], ljt_cv_inline="__inline",
|
||||
AC_TRY_COMPILE(, [} inline int foo() { return 0; }
|
||||
int bar() { return foo();], ljt_cv_inline="inline"))))
|
||||
AC_MSG_RESULT($ljt_cv_inline)
|
||||
AC_DEFINE_UNQUOTED([INLINE],[inline $ljt_cv_inline],[How to obtain function inlining.])
|
||||
AC_DEFINE_UNQUOTED([INLINE],[$ljt_cv_inline],[How to obtain function inlining.])
|
||||
|
||||
# Arithmetic coding support
|
||||
AC_MSG_CHECKING([whether to include arithmetic encoding support])
|
||||
AC_ARG_WITH([arith-enc],
|
||||
AC_HELP_STRING([--without-arith-enc],
|
||||
[Do not include arithmetic encoding support]))
|
||||
if test "x$with_12bit" = "xyes"; then
|
||||
with_arith_enc=no
|
||||
fi
|
||||
if test "x$with_arith_enc" = "xno"; then
|
||||
AC_MSG_RESULT(no)
|
||||
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-arith-enc"
|
||||
@@ -283,6 +291,9 @@ AC_MSG_CHECKING([whether to include arithmetic decoding support])
|
||||
AC_ARG_WITH([arith-dec],
|
||||
AC_HELP_STRING([--without-arith-dec],
|
||||
[Do not include arithmetic decoding support]))
|
||||
if test "x$with_12bit" = "xyes"; then
|
||||
with_arith_dec=no
|
||||
fi
|
||||
if test "x$with_arith_dec" = "xno"; then
|
||||
AC_MSG_RESULT(no)
|
||||
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-arith-dec"
|
||||
@@ -295,11 +306,26 @@ AM_CONDITIONAL([WITH_ARITH_DEC], [test "x$with_arith_dec" != "xno"])
|
||||
AM_CONDITIONAL([WITH_ARITH],
|
||||
[test "x$with_arith_dec" != "xno" -o "x$with_arith_enc" != "xno"])
|
||||
|
||||
# 12-bit component support
|
||||
AC_MSG_CHECKING([whether to use 12-bit samples])
|
||||
AC_ARG_WITH([12bit],
|
||||
AC_HELP_STRING([--with-12bit], [Encode/decode JPEG images with 12-bit samples (implies --without-simd --without-turbojpeg --without-arith-dec --without-arith-enc)]))
|
||||
if test "x$with_12bit" = "xyes"; then
|
||||
AC_DEFINE([BITS_IN_JSAMPLE], [12], [use 8 or 12])
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
AM_CONDITIONAL([WITH_12BIT], [test "x$with_12bit" = "xyes"])
|
||||
|
||||
# TurboJPEG support
|
||||
AC_MSG_CHECKING([whether to build TurboJPEG C wrapper])
|
||||
AC_ARG_WITH([turbojpeg],
|
||||
AC_HELP_STRING([--without-turbojpeg],
|
||||
[Do not include the TurboJPEG wrapper library and associated test programs]))
|
||||
if test "x$with_12bit" = "xyes"; then
|
||||
with_turbojpeg=no
|
||||
fi
|
||||
if test "x$with_turbojpeg" = "xno"; then
|
||||
AC_MSG_RESULT(no)
|
||||
RPM_CONFIG_ARGS="$RPM_CONFIG_ARGS --without-turbojpeg"
|
||||
@@ -331,7 +357,7 @@ AC_ARG_VAR(JNI_CFLAGS,
|
||||
AC_MSG_CHECKING([whether to build TurboJPEG Java wrapper])
|
||||
AC_ARG_WITH([java],
|
||||
AC_HELP_STRING([--with-java], [Build Java wrapper for the TurboJPEG library]))
|
||||
if test "x$with_turbojpeg" = "xno"; then
|
||||
if test "x$with_12bit" = "xyes" -o "x$with_turbojpeg" = "xno"; then
|
||||
with_java=no
|
||||
fi
|
||||
|
||||
@@ -392,6 +418,9 @@ fi
|
||||
# SIMD is optional
|
||||
AC_ARG_WITH([simd],
|
||||
AC_HELP_STRING([--without-simd], [Do not include SIMD extensions]))
|
||||
if test "x$with_12bit" = "xyes"; then
|
||||
with_simd=no
|
||||
fi
|
||||
if test "x${with_simd}" != "xno"; then
|
||||
require_simd=no
|
||||
if test "x${with_simd}" = "xyes"; then
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
3
doc/html/doxygen-extra.css
Normal file
3
doc/html/doxygen-extra.css
Normal file
@@ -0,0 +1,3 @@
|
||||
code {
|
||||
color: #4665A2;
|
||||
}
|
||||
@@ -14,6 +14,7 @@
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
@@ -231,15 +232,30 @@ Functions</h2></td></tr>
|
||||
<tr class="memitem:ga0b931126c7a615ddc3bbd0cca6698d67"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga0b931126c7a615ddc3bbd0cca6698d67">tjCompressFromYUV</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char *srcBuf, int width, int pad, int height, int subsamp, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags)</td></tr>
|
||||
<tr class="memdesc:ga0b931126c7a615ddc3bbd0cca6698d67"><td class="mdescLeft"> </td><td class="mdescRight">Compress a YUV planar image into a JPEG image. <a href="#ga0b931126c7a615ddc3bbd0cca6698d67">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga0b931126c7a615ddc3bbd0cca6698d67"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gaa89a1982cb4556b12ae7af4439991af6"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaa89a1982cb4556b12ae7af4439991af6">tjCompressFromYUVPlanes</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char **srcPlanes, int width, int *strides, int height, int subsamp, unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags)</td></tr>
|
||||
<tr class="memdesc:gaa89a1982cb4556b12ae7af4439991af6"><td class="mdescLeft"> </td><td class="mdescRight">Compress a set of Y, U (Cb), and V (Cr) image planes into a JPEG image. <a href="#gaa89a1982cb4556b12ae7af4439991af6">More...</a><br/></td></tr>
|
||||
<tr class="separator:gaa89a1982cb4556b12ae7af4439991af6"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gaccc5bca7f12fcdcc302e6e1c6d4b311b"><td class="memItemLeft" align="right" valign="top">DLLEXPORT unsigned long DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaccc5bca7f12fcdcc302e6e1c6d4b311b">tjBufSize</a> (int width, int height, int jpegSubsamp)</td></tr>
|
||||
<tr class="memdesc:gaccc5bca7f12fcdcc302e6e1c6d4b311b"><td class="mdescLeft"> </td><td class="mdescRight">The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters. <a href="#gaccc5bca7f12fcdcc302e6e1c6d4b311b">More...</a><br/></td></tr>
|
||||
<tr class="separator:gaccc5bca7f12fcdcc302e6e1c6d4b311b"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gaf451664a62c1f6c7cc5a6401f32908c9"><td class="memItemLeft" align="right" valign="top">DLLEXPORT unsigned long DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9">tjBufSizeYUV2</a> (int width, int pad, int height, int subsamp)</td></tr>
|
||||
<tr class="memdesc:gaf451664a62c1f6c7cc5a6401f32908c9"><td class="mdescLeft"> </td><td class="mdescRight">The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters. <a href="#gaf451664a62c1f6c7cc5a6401f32908c9">More...</a><br/></td></tr>
|
||||
<tr class="separator:gaf451664a62c1f6c7cc5a6401f32908c9"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga6f98d977bfa9d167c97172e876ba61e2"><td class="memItemLeft" align="right" valign="top">DLLEXPORT unsigned long DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga6f98d977bfa9d167c97172e876ba61e2">tjPlaneSizeYUV</a> (int componentID, int width, int stride, int height, int subsamp)</td></tr>
|
||||
<tr class="memdesc:ga6f98d977bfa9d167c97172e876ba61e2"><td class="mdescLeft"> </td><td class="mdescRight">The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters. <a href="#ga6f98d977bfa9d167c97172e876ba61e2">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga6f98d977bfa9d167c97172e876ba61e2"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga63fb66bb1e36c74008c4634360becbb1"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga63fb66bb1e36c74008c4634360becbb1">tjPlaneWidth</a> (int componentID, int width, int subsamp)</td></tr>
|
||||
<tr class="memdesc:ga63fb66bb1e36c74008c4634360becbb1"><td class="mdescLeft"> </td><td class="mdescRight">The plane width of a YUV image plane with the given parameters. <a href="#ga63fb66bb1e36c74008c4634360becbb1">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga63fb66bb1e36c74008c4634360becbb1"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga1a209696c6a80748f20e134b3c64789f"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga1a209696c6a80748f20e134b3c64789f">tjPlaneHeight</a> (int componentID, int height, int subsamp)</td></tr>
|
||||
<tr class="memdesc:ga1a209696c6a80748f20e134b3c64789f"><td class="mdescLeft"> </td><td class="mdescRight">The plane height of a YUV image plane with the given parameters. <a href="#ga1a209696c6a80748f20e134b3c64789f">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga1a209696c6a80748f20e134b3c64789f"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga0a5ffbf7cb58a5b6a8201114fe889360"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga0a5ffbf7cb58a5b6a8201114fe889360">tjEncodeYUV3</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char *dstBuf, int pad, int subsamp, int flags)</td></tr>
|
||||
<tr class="memdesc:ga0a5ffbf7cb58a5b6a8201114fe889360"><td class="mdescLeft"> </td><td class="mdescRight">Encode an RGB or grayscale image into a YUV planar image. <a href="#ga0a5ffbf7cb58a5b6a8201114fe889360">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga0a5ffbf7cb58a5b6a8201114fe889360"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gaa791db8598853ddcad24e42897ef1269"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gaa791db8598853ddcad24e42897ef1269">tjEncodeYUVPlanes</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char *srcBuf, int width, int pitch, int height, int pixelFormat, unsigned char **dstPlanes, int *strides, int subsamp, int flags)</td></tr>
|
||||
<tr class="memdesc:gaa791db8598853ddcad24e42897ef1269"><td class="mdescLeft"> </td><td class="mdescRight">Encode an RGB or grayscale image into separate Y, U (Cb), and V (Cr) image planes. <a href="#gaa791db8598853ddcad24e42897ef1269">More...</a><br/></td></tr>
|
||||
<tr class="separator:gaa791db8598853ddcad24e42897ef1269"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:gae5408179d041e2a2f7199c8283cf649e"><td class="memItemLeft" align="right" valign="top">DLLEXPORT <a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#gae5408179d041e2a2f7199c8283cf649e">tjInitDecompress</a> (void)</td></tr>
|
||||
<tr class="memdesc:gae5408179d041e2a2f7199c8283cf649e"><td class="mdescLeft"> </td><td class="mdescRight">Create a TurboJPEG decompressor instance. <a href="#gae5408179d041e2a2f7199c8283cf649e">More...</a><br/></td></tr>
|
||||
<tr class="separator:gae5408179d041e2a2f7199c8283cf649e"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
@@ -255,9 +271,15 @@ Functions</h2></td></tr>
|
||||
<tr class="memitem:ga7c08b340ad7f8e85d407bd9e81d44d07"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga7c08b340ad7f8e85d407bd9e81d44d07">tjDecompressToYUV2</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf, int width, int pad, int height, int flags)</td></tr>
|
||||
<tr class="memdesc:ga7c08b340ad7f8e85d407bd9e81d44d07"><td class="mdescLeft"> </td><td class="mdescRight">Decompress a JPEG image to a YUV planar image. <a href="#ga7c08b340ad7f8e85d407bd9e81d44d07">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga7c08b340ad7f8e85d407bd9e81d44d07"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga0828a38ae29631ac28b6857cefb0eebf"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga0828a38ae29631ac28b6857cefb0eebf">tjDecompressToYUVPlanes</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char *jpegBuf, unsigned long jpegSize, unsigned char **dstPlanes, int width, int *strides, int height, int flags)</td></tr>
|
||||
<tr class="memdesc:ga0828a38ae29631ac28b6857cefb0eebf"><td class="mdescLeft"> </td><td class="mdescRight">Decompress a JPEG image into separate Y, U (Cb), and V (Cr) image planes. <a href="#ga0828a38ae29631ac28b6857cefb0eebf">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga0828a38ae29631ac28b6857cefb0eebf"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga132ae2c2cadcf64c8bb0f3bdf69da3ed"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga132ae2c2cadcf64c8bb0f3bdf69da3ed">tjDecodeYUV</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char *srcBuf, int pad, int subsamp, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags)</td></tr>
|
||||
<tr class="memdesc:ga132ae2c2cadcf64c8bb0f3bdf69da3ed"><td class="mdescLeft"> </td><td class="mdescRight">Decode a YUV planar image into an RGB or grayscale image. <a href="#ga132ae2c2cadcf64c8bb0f3bdf69da3ed">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga132ae2c2cadcf64c8bb0f3bdf69da3ed"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga6cb5b0e1101a2b20edea576e11faf93d"><td class="memItemLeft" align="right" valign="top">DLLEXPORT int DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga6cb5b0e1101a2b20edea576e11faf93d">tjDecodeYUVPlanes</a> (<a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> handle, unsigned char **srcPlanes, int *strides, int subsamp, unsigned char *dstBuf, int width, int pitch, int height, int pixelFormat, int flags)</td></tr>
|
||||
<tr class="memdesc:ga6cb5b0e1101a2b20edea576e11faf93d"><td class="mdescLeft"> </td><td class="mdescRight">Decode a set of Y, U (Cb), and V (Cr) image planes into an RGB or grayscale image. <a href="#ga6cb5b0e1101a2b20edea576e11faf93d">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga6cb5b0e1101a2b20edea576e11faf93d"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ga3155b775bfbac9dbba869b95a0367902"><td class="memItemLeft" align="right" valign="top">DLLEXPORT <a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> DLLCALL </td><td class="memItemRight" valign="bottom"><a class="el" href="group___turbo_j_p_e_g.html#ga3155b775bfbac9dbba869b95a0367902">tjInitTransform</a> (void)</td></tr>
|
||||
<tr class="memdesc:ga3155b775bfbac9dbba869b95a0367902"><td class="mdescLeft"> </td><td class="mdescRight">Create a new TurboJPEG transformer instance. <a href="#ga3155b775bfbac9dbba869b95a0367902">More...</a><br/></td></tr>
|
||||
<tr class="separator:ga3155b775bfbac9dbba869b95a0367902"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
@@ -301,6 +323,11 @@ Variables</h2></td></tr>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<p>TurboJPEG API. </p>
|
||||
<p>This API provides an interface for generating, decoding, and transforming planar YUV and JPEG images in memory.</p>
|
||||
<p><a class="anchor" id="YUVnotes"></a></p>
|
||||
<h2>YUV Image Format Notes</h2>
|
||||
<p>Technically, the JPEG format uses the YCbCr colorspace (which is technically not a colorspace but a color transform), but per the convention of the digital video community, the TurboJPEG API uses "YUV" to refer to an image format consisting of Y, Cb, and Cr image planes.</p>
|
||||
<p>Each plane is simply a 2D array of bytes, each byte representing the value of one of the components (Y, Cb, or Cr) at a particular location in the image. The width and height of each plane are determined by the image width, height, and level of chrominance subsampling. The luminance plane width is the image width padded to the nearest multiple of the horizontal subsampling factor (2 in the case of 4:2:0 and 4:2:2, 4 in the case of 4:1:1, 1 in the case of 4:4:4 or grayscale.) Similarly, the luminance plane height is the image height padded to the nearest multiple of the vertical subsampling factor (2 in the case of 4:2:0 or 4:4:0, 1 in the case of 4:4:4 or grayscale.) This is irrespective of any additional padding that may be specified as an argument to the various YUV functions. The chrominance plane width is equal to the luminance plane width divided by the horizontal subsampling factor, and the chrominance plane height is equal to the luminance plane height divided by the vertical subsampling factor.</p>
|
||||
<p>For example, if the source image is 35 x 35 pixels and 4:2:2 subsampling is used, then the luminance plane would be 36 x 35 bytes, and each of the chrominance planes would be 18 x 35 bytes. If you specify a line padding of 4 bytes on top of this, then the luminance plane would be 36 x 35 bytes, and each of the chrominance planes would be 20 x 35 bytes. </p>
|
||||
<h2 class="groupheader">Macro Definition Documentation</h2>
|
||||
<a class="anchor" id="ga39f57a6fb02d9cf32e7b6890099b5a71"></a>
|
||||
<div class="memitem">
|
||||
@@ -693,7 +720,6 @@ Variables</h2></td></tr>
|
||||
|
||||
<p>Chrominance subsampling options. </p>
|
||||
<p>When pixels are converted from RGB to YCbCr (see <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75" title="YCbCr colorspace.">TJCS_YCbCr</a>) or from CMYK to YCCK (see <a class="el" href="group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e" title="YCCK colorspace.">TJCS_YCCK</a>) as part of the JPEG compression process, some of the Cb and Cr (chrominance) components can be discarded or averaged together to produce a smaller image with little perceptible loss of image clarity (the human eye is more sensitive to small changes in brightness than to small changes in color.) This is called "chrominance subsampling". </p>
|
||||
<p>NOTE: Technically, the JPEG format uses the YCbCr colorspace, but per the convention of the digital video community, the TurboJPEG API uses "YUV" to refer to an image format consisting of Y, Cb, and Cr image planes. </p>
|
||||
<table class="fieldtable">
|
||||
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="gga1d047060ea80bb9820d540bb928e9074afb8da4f44197837bdec0a4f593dacae3"></a>TJSAMP_444</em> </td><td class="fielddoc">
|
||||
<p>4:4:4 chrominance subsampling (no chrominance subsampling). </p>
|
||||
@@ -713,11 +739,13 @@ Variables</h2></td></tr>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><em><a class="anchor" id="gga1d047060ea80bb9820d540bb928e9074accf740e6f3aa6ba20ba922cad13cb974"></a>TJSAMP_440</em> </td><td class="fielddoc">
|
||||
<p>4:4:0 chrominance subsampling. </p>
|
||||
<p>The JPEG or YUV image will contain one chrominance component for every 1x2 block of pixels in the source image. Note that 4:4:0 subsampling is not fully accelerated in libjpeg-turbo. </p>
|
||||
<p>The JPEG or YUV image will contain one chrominance component for every 1x2 block of pixels in the source image.</p>
|
||||
<dl class="section note"><dt>Note</dt><dd>4:4:0 subsampling is not fully accelerated in libjpeg-turbo. </dd></dl>
|
||||
</td></tr>
|
||||
<tr><td class="fieldname"><em><a class="anchor" id="gga1d047060ea80bb9820d540bb928e9074a28ec62575e5ea295c3fde3001dc628e2"></a>TJSAMP_411</em> </td><td class="fielddoc">
|
||||
<p>4:1:1 chrominance subsampling. </p>
|
||||
<p>The JPEG or YUV image will contain one chrominance component for every 4x1 block of pixels in the source image. JPEG images compressed with 4:1:1 subsampling will be almost exactly the same size as those compressed with 4:2:0 subsampling, and in the aggregate, both subsampling methods produce approximately the same perceptual quality. However, 4:1:1 is better able to reproduce sharp horizontal features. Note that 4:1:1 subsampling is not fully accelerated in libjpeg-turbo. </p>
|
||||
<p>The JPEG or YUV image will contain one chrominance component for every 4x1 block of pixels in the source image. JPEG images compressed with 4:1:1 subsampling will be almost exactly the same size as those compressed with 4:2:0 subsampling, and in the aggregate, both subsampling methods produce approximately the same perceptual quality. However, 4:1:1 is better able to reproduce sharp horizontal features.</p>
|
||||
<dl class="section note"><dt>Note</dt><dd>4:1:1 subsampling is not fully accelerated in libjpeg-turbo. </dd></dl>
|
||||
</td></tr>
|
||||
</table>
|
||||
|
||||
@@ -791,7 +819,7 @@ Variables</h2></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>a pointer to a newly-allocated buffer with the specified number of bytes</dd></dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>a pointer to a newly-allocated buffer with the specified number of bytes.</dd></dl>
|
||||
<dl class="section see"><dt>See Also</dt><dd><a class="el" href="group___turbo_j_p_e_g.html#ga8c4a1231dc06a450514c835f6471f137" title="Free an image buffer previously allocated by TurboJPEG.">tjFree()</a> </dd></dl>
|
||||
|
||||
</div>
|
||||
@@ -830,8 +858,8 @@ Variables</h2></td></tr>
|
||||
<p>The number of bytes returned by this function is larger than the size of the uncompressed source image. The reason for this is that the JPEG format uses 16-bit coefficients, and it is thus possible for a very high-quality JPEG image with very high-frequency content to expand rather than compress when converted to the JPEG format. Such images represent a very rare corner case, but since there is no way to predict the size of a JPEG image prior to compression, the corner case has to be handled.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">width</td><td>width of the image (in pixels) </td></tr>
|
||||
<tr><td class="paramname">height</td><td>height of the image (in pixels) </td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the image</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the image</td></tr>
|
||||
<tr><td class="paramname">jpegSubsamp</td><td>the level of chrominance subsampling to be used when generating the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
@@ -879,9 +907,9 @@ Variables</h2></td></tr>
|
||||
<p>The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">width</td><td>width of the image (in pixels) </td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the image</td></tr>
|
||||
<tr><td class="paramname">pad</td><td>the width of each line in each plane of the image is padded to the nearest multiple of this number of bytes (must be a power of 2.)</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height of the image (in pixels) </td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the image</td></tr>
|
||||
<tr><td class="paramname">subsamp</td><td>level of chrominance subsampling in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
@@ -974,7 +1002,7 @@ Variables</h2></td></tr>
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>
|
||||
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing RGB, grayscale, or CMYK pixels to be compressed</td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source image</td></tr>
|
||||
<tr><td class="paramname">pitch</td><td>bytes per line of the source image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>. </td></tr>
|
||||
<tr><td class="paramname">pitch</td><td>bytes per line in the source image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source image</td></tr>
|
||||
<tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
|
||||
<tr><td class="paramname">jpegBuf</td><td>address of a pointer to an image buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
|
||||
@@ -983,10 +1011,10 @@ Variables</h2></td></tr>
|
||||
<li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gaccc5bca7f12fcdcc302e6e1c6d4b311b" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters...">tjBufSize()</a>. This should ensure that the buffer never has to be re-allocated (setting <a class="el" href="group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a> guarantees this.)</li>
|
||||
</ol>
|
||||
If you choose option 1, <code>*jpegSize</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>
|
||||
<tr><td class="paramname">jpegSize</td><td>pointer to an unsigned long variable that holds the size of the JPEG image buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) </td></tr>
|
||||
<tr><td class="paramname">jpegSize</td><td>pointer to an unsigned long variable that holds the size of the JPEG image buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) If <code>*jpegBuf</code> points to a JPEG image buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr>
|
||||
<tr><td class="paramname">jpegSubsamp</td><td>the level of chrominance subsampling to be used when generating the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||
<tr><td class="paramname">jpegQual</td><td>the image quality of the generated JPEG image (1 = worst, 100 = best)</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -1067,14 +1095,13 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Compress a YUV planar image into a JPEG image. </p>
|
||||
<p>Note that, if the width or height of the YUV image is not an even multiple of the MCU block size (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a> and <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>
|
||||
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing a YUV planar image to be compressed. The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the buffer, and the size of each plane is determined by the specified width, height, padding, and level of chrominance subsampling. If the chrominance components are subsampled along the horizontal dimension, then the width of the luminance plane should be padded to the nearest multiple of 2 (same goes for the height of the luminance plane, if the chrominance components are subsampled along the vertical dimension.) This is irrespective of any additional padding specified in the <code>pad</code> parameter. </td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source image </td></tr>
|
||||
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing a YUV planar image to be compressed. The size of this buffer should match the value returned by <a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV2()</a> for the given image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the source buffer (refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.)</td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source image. If the width is not an even multiple of the MCU block width (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||
<tr><td class="paramname">pad</td><td>the line padding used in the source image. For instance, if each line in each plane of the YUV image is padded to the nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source image </td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source image. If the height is not an even multiple of the MCU block height (see <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling used in the source image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||
<tr><td class="paramname">jpegBuf</td><td>address of a pointer to an image buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
|
||||
<li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</a> and let TurboJPEG grow the buffer as needed,</li>
|
||||
@@ -1082,9 +1109,106 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gaccc5bca7f12fcdcc302e6e1c6d4b311b" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters...">tjBufSize()</a>. This should ensure that the buffer never has to be re-allocated (setting <a class="el" href="group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a> guarantees this.)</li>
|
||||
</ol>
|
||||
If you choose option 1, <code>*jpegSize</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>
|
||||
<tr><td class="paramname">jpegSize</td><td>pointer to an unsigned long variable that holds the size of the JPEG image buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) </td></tr>
|
||||
<tr><td class="paramname">jpegSize</td><td>pointer to an unsigned long variable that holds the size of the JPEG image buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) If <code>*jpegBuf</code> points to a JPEG image buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr>
|
||||
<tr><td class="paramname">jpegQual</td><td>the image quality of the generated JPEG image (1 = worst, 100 = best)</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr()</a>.) </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="gaa89a1982cb4556b12ae7af4439991af6"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">DLLEXPORT int DLLCALL tjCompressFromYUVPlanes </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> </td>
|
||||
<td class="paramname"><em>handle</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char ** </td>
|
||||
<td class="paramname"><em>srcPlanes</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>width</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int * </td>
|
||||
<td class="paramname"><em>strides</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>height</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>subsamp</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char ** </td>
|
||||
<td class="paramname"><em>jpegBuf</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned long * </td>
|
||||
<td class="paramname"><em>jpegSize</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>jpegQual</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>flags</em> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>)</td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Compress a set of Y, U (Cb), and V (Cr) image planes into a JPEG image. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>
|
||||
<tr><td class="paramname">srcPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if compressing a grayscale image) that contain a YUV image to be compressed. These planes can be contiguous or non-contiguous in memory. The size of each plane should match the value returned by <a class="el" href="group___turbo_j_p_e_g.html#ga6f98d977bfa9d167c97172e876ba61e2" title="The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters...">tjPlaneSizeYUV()</a> for the given image width, height, strides, and level of chrominance subsampling. Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for more details.</td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source image. If the width is not an even multiple of the MCU block width (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||
<tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per line in the corresponding plane of the YUV source image. Setting the stride for any plane to 0 is the same as setting it to the plane width (see <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.) If <code>strides</code> is NULL, then the strides for all planes will be set to their respective plane widths. You can adjust the strides in order to specify an arbitrary amount of line padding in each plane or to create a JPEG image from a subregion of a larger YUV planar image.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source image. If the height is not an even multiple of the MCU block height (see <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling used in the source image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||
<tr><td class="paramname">jpegBuf</td><td>address of a pointer to an image buffer that will receive the JPEG image. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
|
||||
<li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</a> and let TurboJPEG grow the buffer as needed,</li>
|
||||
<li>set <code>*jpegBuf</code> to NULL to tell TurboJPEG to allocate the buffer for you, or</li>
|
||||
<li>pre-allocate the buffer to a "worst case" size determined by calling <a class="el" href="group___turbo_j_p_e_g.html#gaccc5bca7f12fcdcc302e6e1c6d4b311b" title="The maximum size of the buffer (in bytes) required to hold a JPEG image with the given parameters...">tjBufSize()</a>. This should ensure that the buffer never has to be re-allocated (setting <a class="el" href="group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a> guarantees this.)</li>
|
||||
</ol>
|
||||
If you choose option 1, <code>*jpegSize</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a>, you should always check <code>*jpegBuf</code> upon return from this function, as it may have changed.</td></tr>
|
||||
<tr><td class="paramname">jpegSize</td><td>pointer to an unsigned long variable that holds the size of the JPEG image buffer. If <code>*jpegBuf</code> points to a pre-allocated buffer, then <code>*jpegSize</code> should be set to the size of the buffer. Upon return, <code>*jpegSize</code> will contain the size of the JPEG image (in bytes.) If <code>*jpegBuf</code> points to a JPEG image buffer that is being reused from a previous call to one of the JPEG compression functions, then <code>*jpegSize</code> is ignored.</td></tr>
|
||||
<tr><td class="paramname">jpegQual</td><td>the image quality of the generated JPEG image (1 = worst, 100 = best)</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -1165,20 +1289,112 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Decode a YUV planar image into an RGB or grayscale image. </p>
|
||||
<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG decompression process. The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the source buffer, and the size of each plane is determined by the width and height of the source image, as well as the specified padding and level of chrominance subsampling. If the chrominance components are subsampled along the horizontal dimension, then the width of the luminance plane should be padded to the nearest multiple of 2 in the input image (same goes for the height of the luminance plane, if the chrominance components are subsampled along the vertical dimension.) </p>
|
||||
<p>NOTE: Technically, the JPEG format uses the YCbCr colorspace, but per the convention of the digital video community, the TurboJPEG API uses "YUV" to refer to an image format consisting of Y, Cb, and Cr image planes.</p>
|
||||
<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG decompression process.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>
|
||||
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing a YUV planar image to be decoded. The size of this buffer should match the value returned by <a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV2()</a> for the given image width, height, padding, and level of chrominance subsampling. </td></tr>
|
||||
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing a YUV planar image to be decoded. The size of this buffer should match the value returned by <a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV2()</a> for the given image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes should be stored sequentially in the source buffer (refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.)</td></tr>
|
||||
<tr><td class="paramname">pad</td><td>Use this parameter to specify that the width of each line in each plane of the YUV source image is padded to the nearest multiple of this number of bytes (must be a power of 2.)</td></tr>
|
||||
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling used in the YUV source image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the decoded image. This buffer should normally be <code>pitch * height</code> bytes in size, but the <code>dstBuf</code> pointer can also be used to decode into a specific region of a larger buffer.</td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source and destination images</td></tr>
|
||||
<tr><td class="paramname">pitch</td><td>bytes per line of the destination image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the destination image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the destination image should be padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use the pitch parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>. </td></tr>
|
||||
<tr><td class="paramname">pitch</td><td>bytes per line in the destination image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the destination image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the destination image should be padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use the pitch parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source and destination images</td></tr>
|
||||
<tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr()</a>.) </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="ga6cb5b0e1101a2b20edea576e11faf93d"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">DLLEXPORT int DLLCALL tjDecodeYUVPlanes </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> </td>
|
||||
<td class="paramname"><em>handle</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char ** </td>
|
||||
<td class="paramname"><em>srcPlanes</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int * </td>
|
||||
<td class="paramname"><em>strides</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>subsamp</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char * </td>
|
||||
<td class="paramname"><em>dstBuf</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>width</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>pitch</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>height</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>pixelFormat</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>flags</em> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>)</td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Decode a set of Y, U (Cb), and V (Cr) image planes into an RGB or grayscale image. </p>
|
||||
<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG decompression process.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>
|
||||
<tr><td class="paramname">srcPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if decoding a grayscale image) that contain a YUV image to be decoded. These planes can be contiguous or non-contiguous in memory. The size of each plane should match the value returned by <a class="el" href="group___turbo_j_p_e_g.html#ga6f98d977bfa9d167c97172e876ba61e2" title="The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters...">tjPlaneSizeYUV()</a> for the given image width, height, strides, and level of chrominance subsampling. Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for more details.</td></tr>
|
||||
<tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per line in the corresponding plane of the YUV source image. Setting the stride for any plane to 0 is the same as setting it to the plane width (see <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.) If <code>strides</code> is NULL, then the strides for all planes will be set to their respective plane widths. You can adjust the strides in order to specify an arbitrary amount of line padding in each plane or to decode a subregion of a larger YUV planar image.</td></tr>
|
||||
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling used in the YUV source image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the decoded image. This buffer should normally be <code>pitch * height</code> bytes in size, but the <code>dstBuf</code> pointer can also be used to decode into a specific region of a larger buffer.</td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source and destination images</td></tr>
|
||||
<tr><td class="paramname">pitch</td><td>bytes per line in the destination image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the destination image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the destination image should be padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use the pitch parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source and destination images</td></tr>
|
||||
<tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -1260,10 +1476,10 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
|
||||
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the decompressed image. This buffer should normally be <code>pitch * scaledHeight</code> bytes in size, where <code>scaledHeight</code> can be determined by calling <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a> with the JPEG image height and one of the scaling factors returned by <a class="el" href="group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8" title="Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of Tur...">tjGetScalingFactors()</a>. The <code>dstBuf</code> pointer may also be used to decompress into a specific region of a larger buffer.</td></tr>
|
||||
<tr><td class="paramname">width</td><td>desired width (in pixels) of the destination image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If <code>width</code> is set to 0, then only the height will be considered when determining the scaled image size.</td></tr>
|
||||
<tr><td class="paramname">pitch</td><td>bytes per line of the destination image. Normally, this is <code>scaledWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the decompressed image is unpadded, else <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(scaledWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the decompressed image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. (NOTE: <code>scaledWidth</code> can be determined by calling <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a> with the JPEG image width and one of the scaling factors returned by <a class="el" href="group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8" title="Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of Tur...">tjGetScalingFactors()</a>.) You can also be clever and use the pitch parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>scaledWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>. </td></tr>
|
||||
<tr><td class="paramname">pitch</td><td>bytes per line in the destination image. Normally, this is <code>scaledWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the decompressed image is unpadded, else <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(scaledWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the decompressed image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. (NOTE: <code>scaledWidth</code> can be determined by calling <a class="el" href="group___turbo_j_p_e_g.html#ga84878bb65404204743aa18cac02781df" title="Compute the scaled value of dimension using the given scaling factor.">TJSCALED()</a> with the JPEG image width and one of the scaling factors returned by <a class="el" href="group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8" title="Returns a list of fractional scaling factors that the JPEG decompressor in this implementation of Tur...">tjGetScalingFactors()</a>.) You can also be clever and use the pitch parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>scaledWidth * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>desired height (in pixels) of the destination image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If <code>height</code> is set to 0, then only the width will be considered when determining the scaled image size.</td></tr>
|
||||
<tr><td class="paramname">pixelFormat</td><td>pixel format of the destination image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -1333,7 +1549,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
|
||||
<tr><td class="paramname">width</td><td>pointer to an integer variable that will receive the width (in pixels) of the JPEG image</td></tr>
|
||||
<tr><td class="paramname">height</td><td>pointer to an integer variable that will receive the height (in pixels) of the JPEG image</td></tr>
|
||||
<tr><td class="paramname">jpegSubsamp</td><td>pointer to an integer variable that will receive the level of chrominance subsampling used when compressing the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) </td></tr>
|
||||
<tr><td class="paramname">jpegSubsamp</td><td>pointer to an integer variable that will receive the level of chrominance subsampling used when the JPEG image was compressed (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||
<tr><td class="paramname">jpegColorspace</td><td>pointer to an integer variable that will receive one of the JPEG colorspace constants, indicating the colorspace of the JPEG image (see <a class="el" href="group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720">JPEG colorspaces</a>.)</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
@@ -1403,18 +1619,96 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Decompress a JPEG image to a YUV planar image. </p>
|
||||
<p>This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of an RGB image. The structure of the planes in this image is the same as in the images generated by <a class="el" href="group___turbo_j_p_e_g.html#ga0a5ffbf7cb58a5b6a8201114fe889360" title="Encode an RGB or grayscale image into a YUV planar image.">tjEncodeYUV3()</a>. Note that, if the width or height of the JPEG image is not an even multiple of the MCU block size (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a> and <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG. </p>
|
||||
<p>NOTE: Technically, the JPEG format uses the YCbCr colorspace, but per the convention of the digital video community, the TurboJPEG API uses "YUV" to refer to an image format consisting of Y, Cb, and Cr image planes.</p>
|
||||
<p>This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of an RGB image.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>
|
||||
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG image to decompress</td></tr>
|
||||
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
|
||||
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the YUV image. Use <a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV2()</a> to determine the appropriate size for this buffer based on the image width, height, padding, and level of subsampling. </td></tr>
|
||||
<tr><td class="paramname">width</td><td>desired width (in pixels) of the YUV image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If <code>width</code> is set to 0, then only the height will be considered when determining the scaled image size. </td></tr>
|
||||
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the YUV image. Use <a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV2()</a> to determine the appropriate size for this buffer based on the image width, height, padding, and level of subsampling. The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the buffer (refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.)</td></tr>
|
||||
<tr><td class="paramname">width</td><td>desired width (in pixels) of the YUV image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If <code>width</code> is set to 0, then only the height will be considered when determining the scaled image size. If the scaled width is not an even multiple of the MCU block width (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||
<tr><td class="paramname">pad</td><td>the width of each line in each plane of the YUV image will be padded to the nearest multiple of this number of bytes (must be a power of 2.) To generate images suitable for X Video, <code>pad</code> should be set to 4.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>desired height (in pixels) of the YUV image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If <code>height</code> is set to 0, then only the width will be considered when determining the scaled image size. </td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>desired height (in pixels) of the YUV image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If <code>height</code> is set to 0, then only the width will be considered when determining the scaled image size. If the scaled height is not an even multiple of the MCU block height (see <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr()</a>.) </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="ga0828a38ae29631ac28b6857cefb0eebf"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">DLLEXPORT int DLLCALL tjDecompressToYUVPlanes </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> </td>
|
||||
<td class="paramname"><em>handle</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char * </td>
|
||||
<td class="paramname"><em>jpegBuf</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned long </td>
|
||||
<td class="paramname"><em>jpegSize</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char ** </td>
|
||||
<td class="paramname"><em>dstPlanes</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>width</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int * </td>
|
||||
<td class="paramname"><em>strides</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>height</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>flags</em> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>)</td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Decompress a JPEG image into separate Y, U (Cb), and V (Cr) image planes. </p>
|
||||
<p>This function performs JPEG decompression but leaves out the color conversion step, so a planar YUV image is generated instead of an RGB image.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG decompressor or transformer instance</td></tr>
|
||||
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG image to decompress</td></tr>
|
||||
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes)</td></tr>
|
||||
<tr><td class="paramname">dstPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if decompressing a grayscale image) that will receive the YUV image. These planes can be contiguous or non-contiguous in memory. Use <a class="el" href="group___turbo_j_p_e_g.html#ga6f98d977bfa9d167c97172e876ba61e2" title="The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters...">tjPlaneSizeYUV()</a> to determine the appropriate size for each plane based on the scaled image width, scaled image height, strides, and level of chrominance subsampling. Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for more details.</td></tr>
|
||||
<tr><td class="paramname">width</td><td>desired width (in pixels) of the YUV image. If this is different than the width of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired width. If <code>width</code> is set to 0, then only the height will be considered when determining the scaled image size. If the scaled width is not an even multiple of the MCU block width (see <a class="el" href="group___turbo_j_p_e_g.html#ga9e61e7cd47a15a173283ba94e781308c" title="MCU block width (in pixels) for a given level of chrominance subsampling.">tjMCUWidth</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||
<tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per line in the corresponding plane of the output image. Setting the stride for any plane to 0 is the same as setting it to the scaled plane width (see <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.) If <code>strides</code> is NULL, then the strides for all planes will be set to their respective scaled plane widths. You can adjust the strides in order to add an arbitrary amount of line padding to each plane or to decompress the JPEG image into a subregion of a larger YUV planar image.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>desired height (in pixels) of the YUV image. If this is different than the height of the JPEG image being decompressed, then TurboJPEG will use scaling in the JPEG decompressor to generate the largest possible image that will fit within the desired height. If <code>height</code> is set to 0, then only the width will be considered when determining the scaled image size. If the scaled height is not an even multiple of the MCU block height (see <a class="el" href="group___turbo_j_p_e_g.html#gabd247bb9fecb393eca57366feb8327bf" title="MCU block height (in pixels) for a given level of chrominance subsampling.">tjMCUHeight</a>), then an intermediate buffer copy will be performed within TurboJPEG.</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -1520,20 +1814,112 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Encode an RGB or grayscale image into a YUV planar image. </p>
|
||||
<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG compression process. The Y, U (Cb), and V (Cr) image planes are stored sequentially into the destination buffer, and the size of each plane is determined by the width and height of the source image, as well as the specified padding and level of chrominance subsampling. If the chrominance components are subsampled along the horizontal dimension, then the width of the luminance plane is padded to the nearest multiple of 2 in the output image (same goes for the height of the luminance plane, if the chrominance components are subsampled along the vertical dimension.) </p>
|
||||
<p>NOTE: Technically, the JPEG format uses the YCbCr colorspace, but per the convention of the digital video community, the TurboJPEG API uses "YUV" to refer to an image format consisting of Y, Cb, and Cr image planes.</p>
|
||||
<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG compression process.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>
|
||||
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing RGB or grayscale pixels to be encoded</td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source image</td></tr>
|
||||
<tr><td class="paramname">pitch</td><td>bytes per line of the source image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>. </td></tr>
|
||||
<tr><td class="paramname">pitch</td><td>bytes per line in the source image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source image</td></tr>
|
||||
<tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
|
||||
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the YUV image. Use <a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV2()</a> to determine the appropriate size for this buffer based on the image width, height, padding, and level of chrominance subsampling. </td></tr>
|
||||
<tr><td class="paramname">dstBuf</td><td>pointer to an image buffer that will receive the YUV image. Use <a class="el" href="group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9" title="The size of the buffer (in bytes) required to hold a YUV planar image with the given parameters...">tjBufSizeYUV2()</a> to determine the appropriate size for this buffer based on the image width, height, padding, and level of chrominance subsampling. The Y, U (Cb), and V (Cr) image planes will be stored sequentially in the buffer (refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.)</td></tr>
|
||||
<tr><td class="paramname">pad</td><td>the width of each line in each plane of the YUV image will be padded to the nearest multiple of this number of bytes (must be a power of 2.) To generate images suitable for X Video, <code>pad</code> should be set to 4.</td></tr>
|
||||
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling to be used when generating the YUV image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) To generate images suitable for X Video, <code>subsamp</code> should be set to <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737">TJSAMP_420</a>. This produces an image compatible with the I420 (AKA "YUV420P") format.</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>0 if successful, or -1 if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr()</a>.) </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="gaa791db8598853ddcad24e42897ef1269"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">DLLEXPORT int DLLCALL tjEncodeYUVPlanes </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype"><a class="el" href="group___turbo_j_p_e_g.html#ga758d2634ecb4949de7815cba621f5763">tjhandle</a> </td>
|
||||
<td class="paramname"><em>handle</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char * </td>
|
||||
<td class="paramname"><em>srcBuf</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>width</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>pitch</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>height</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>pixelFormat</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">unsigned char ** </td>
|
||||
<td class="paramname"><em>dstPlanes</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int * </td>
|
||||
<td class="paramname"><em>strides</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>subsamp</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>flags</em> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>)</td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Encode an RGB or grayscale image into separate Y, U (Cb), and V (Cr) image planes. </p>
|
||||
<p>This function uses the accelerated color conversion routines in the underlying codec but does not execute any of the other steps in the JPEG compression process.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG compressor or transformer instance</td></tr>
|
||||
<tr><td class="paramname">srcBuf</td><td>pointer to an image buffer containing RGB or grayscale pixels to be encoded</td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the source image</td></tr>
|
||||
<tr><td class="paramname">pitch</td><td>bytes per line in the source image. Normally, this should be <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code> if the image is unpadded, or <code><a class="el" href="group___turbo_j_p_e_g.html#ga0aba955473315e405295d978f0c16511" title="Pad the given width to the nearest 32-bit boundary.">TJPAD</a>(width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat])</code> if each line of the image is padded to the nearest 32-bit boundary, as is the case for Windows bitmaps. You can also be clever and use this parameter to skip lines, etc. Setting this parameter to 0 is the equivalent of setting it to <code>width * <a class="el" href="group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c" title="Pixel size (in bytes) for a given pixel format.">tjPixelSize</a>[pixelFormat]</code>.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the source image</td></tr>
|
||||
<tr><td class="paramname">pixelFormat</td><td>pixel format of the source image (see <a class="el" href="group___turbo_j_p_e_g.html#gac916144e26c3817ac514e64ae5d12e2a">Pixel formats</a>.)</td></tr>
|
||||
<tr><td class="paramname">dstPlanes</td><td>an array of pointers to Y, U (Cb), and V (Cr) image planes (or just a Y plane, if generating a grayscale image) that will receive the encoded image. These planes can be contiguous or non-contiguous in memory. Use <a class="el" href="group___turbo_j_p_e_g.html#ga6f98d977bfa9d167c97172e876ba61e2" title="The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters...">tjPlaneSizeYUV()</a> to determine the appropriate size for each plane based on the image width, height, strides, and level of chrominance subsampling. Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for more details.</td></tr>
|
||||
<tr><td class="paramname">strides</td><td>an array of integers, each specifying the number of bytes per line in the corresponding plane of the output image. Setting the stride for any plane to 0 is the same as setting it to the plane width (see <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a>.) If <code>strides</code> is NULL, then the strides for all planes will be set to their respective plane widths. You can adjust the strides in order to add an arbitrary amount of line padding to each plane or to encode an RGB or grayscale image into a subregion of a larger YUV planar image.</td></tr>
|
||||
<tr><td class="paramname">subsamp</td><td>the level of chrominance subsampling to be used when generating the YUV image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.) To generate images suitable for X Video, <code>subsamp</code> should be set to <a class="el" href="group___turbo_j_p_e_g.html#gga1d047060ea80bb9820d540bb928e9074a63085dbf683cfe39e513cdb6343e3737">TJSAMP_420</a>. This produces an image compatible with the I420 (AKA "YUV420P") format.</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -1666,6 +2052,151 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
<p>Create a new TurboJPEG transformer instance. </p>
|
||||
<dl class="section return"><dt>Returns</dt><dd>a handle to the newly-created instance, or NULL if an error occurred (see <a class="el" href="group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf" title="Returns a descriptive error message explaining why the last command failed.">tjGetErrorStr()</a>.) </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="ga1a209696c6a80748f20e134b3c64789f"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">DLLEXPORT int tjPlaneHeight </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>componentID</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>height</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>subsamp</em> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>)</td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>The plane height of a YUV image plane with the given parameters. </p>
|
||||
<p>Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for a description of plane height.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">componentID</td><td>ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the YUV image</td></tr>
|
||||
<tr><td class="paramname">subsamp</td><td>level of chrominance subsampling in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>the plane height of a YUV image plane with the given parameters, or -1 if the arguments are out of bounds. </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="ga6f98d977bfa9d167c97172e876ba61e2"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">DLLEXPORT unsigned long DLLCALL tjPlaneSizeYUV </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>componentID</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>width</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>stride</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>height</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>subsamp</em> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>)</td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>The size of the buffer (in bytes) required to hold a YUV image plane with the given parameters. </p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">componentID</td><td>ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)</td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the YUV image. NOTE: this is the width of the whole image, not the plane width.</td></tr>
|
||||
<tr><td class="paramname">stride</td><td>bytes per line in the image plane. Setting this to 0 is the equivalent of setting it to the plane width.</td></tr>
|
||||
<tr><td class="paramname">height</td><td>height (in pixels) of the YUV image. NOTE: this is the height of the whole image, not the plane height.</td></tr>
|
||||
<tr><td class="paramname">subsamp</td><td>level of chrominance subsampling in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>the size of the buffer (in bytes) required to hold the YUV image plane, or -1 if the arguments are out of bounds. </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="ga63fb66bb1e36c74008c4634360becbb1"></a>
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">DLLEXPORT int tjPlaneWidth </td>
|
||||
<td>(</td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>componentID</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>width</em>, </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="paramkey"></td>
|
||||
<td></td>
|
||||
<td class="paramtype">int </td>
|
||||
<td class="paramname"><em>subsamp</em> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>)</td>
|
||||
<td></td><td></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>The plane width of a YUV image plane with the given parameters. </p>
|
||||
<p>Refer to <a class="el" href="group___turbo_j_p_e_g.html#YUVnotes">YUV Image Format Notes</a> for a description of plane width.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">componentID</td><td>ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr)</td></tr>
|
||||
<tr><td class="paramname">width</td><td>width (in pixels) of the YUV image</td></tr>
|
||||
<tr><td class="paramname">subsamp</td><td>level of chrominance subsampling in the image (see <a class="el" href="group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074">Chrominance subsampling options</a>.)</td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl class="section return"><dt>Returns</dt><dd>the plane width of a YUV image plane with the given parameters, or -1 if the arguments are out of bounds. </dd></dl>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a class="anchor" id="gae403193ceb4aafb7e0f56ab587b48616"></a>
|
||||
@@ -1729,12 +2260,12 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Losslessly transform a JPEG image into another JPEG image. </p>
|
||||
<p>Lossless transforms work by moving the raw coefficients from one JPEG image structure to another without altering the values of the coefficients. While this is typically faster than decompressing the image, transforming it, and re-compressing it, lossless transforms are not free. Each lossless transform requires reading and performing Huffman decoding on all of the coefficients in the source image, regardless of the size of the destination image. Thus, this function provides a means of generating multiple transformed images from the same source or applying multiple transformations simultaneously, in order to eliminate the need to read the source coefficients multiple times.</p>
|
||||
<p>Lossless transforms work by moving the raw DCT coefficients from one JPEG image structure to another without altering the values of the coefficients. While this is typically faster than decompressing the image, transforming it, and re-compressing it, lossless transforms are not free. Each lossless transform requires reading and performing Huffman decoding on all of the coefficients in the source image, regardless of the size of the destination image. Thus, this function provides a means of generating multiple transformed images from the same source or applying multiple transformations simultaneously, in order to eliminate the need to read the source coefficients multiple times.</p>
|
||||
<dl class="params"><dt>Parameters</dt><dd>
|
||||
<table class="params">
|
||||
<tr><td class="paramname">handle</td><td>a handle to a TurboJPEG transformer instance</td></tr>
|
||||
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG image to transform </td></tr>
|
||||
<tr><td class="paramname">jpegSize</td><td>size of the JPEG image (in bytes) </td></tr>
|
||||
<tr><td class="paramname">jpegBuf</td><td>pointer to a buffer containing the JPEG source image to transform</td></tr>
|
||||
<tr><td class="paramname">jpegSize</td><td>size of the JPEG source image (in bytes)</td></tr>
|
||||
<tr><td class="paramname">n</td><td>the number of transformed JPEG images to generate</td></tr>
|
||||
<tr><td class="paramname">dstBufs</td><td>pointer to an array of n image buffers. <code>dstBufs[i]</code> will receive a JPEG image that has been transformed using the parameters in <code>transforms[i]</code>. TurboJPEG has the ability to reallocate the JPEG buffer to accommodate the size of the JPEG image. Thus, you can choose to:<ol type="1">
|
||||
<li>pre-allocate the JPEG buffer with an arbitrary size using <a class="el" href="group___turbo_j_p_e_g.html#ga5c9234bda6d993cdaffdd89bf81a00ff" title="Allocate an image buffer for use with TurboJPEG.">tjAlloc()</a> and let TurboJPEG grow the buffer as needed,</li>
|
||||
@@ -1744,7 +2275,7 @@ If you choose option 1, <code>*jpegSize</code> should be set to the size of your
|
||||
If you choose option 1, <code>dstSizes[i]</code> should be set to the size of your pre-allocated buffer. In any case, unless you have set <a class="el" href="group___turbo_j_p_e_g.html#ga8808d403c68b62aaa58a4c1e58e98963" title="Disable buffer (re)allocation.">TJFLAG_NOREALLOC</a>, you should always check <code>dstBufs[i]</code> upon return from this function, as it may have changed.</td></tr>
|
||||
<tr><td class="paramname">dstSizes</td><td>pointer to an array of n unsigned long variables that will receive the actual sizes (in bytes) of each transformed JPEG image. If <code>dstBufs[i]</code> points to a pre-allocated buffer, then <code>dstSizes[i]</code> should be set to the size of the buffer. Upon return, <code>dstSizes[i]</code> will contain the size of the JPEG image (in bytes.)</td></tr>
|
||||
<tr><td class="paramname">transforms</td><td>pointer to an array of n <a class="el" href="structtjtransform.html" title="Lossless transform.">tjtransform</a> structures, each of which specifies the transform parameters and/or cropping region for the corresponding transformed output image.</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a>.</td></tr>
|
||||
<tr><td class="paramname">flags</td><td>the bitwise OR of one or more of the <a class="el" href="group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec">flags</a></td></tr>
|
||||
</table>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
@@ -10,6 +10,7 @@ var searchData=
|
||||
['tjbufsizeyuv2',['tjBufSizeYUV2',['../group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9',1,'turbojpeg.h']]],
|
||||
['tjcompress2',['tjCompress2',['../group___turbo_j_p_e_g.html#gaba62b7a98f960839b588579898495cf2',1,'turbojpeg.h']]],
|
||||
['tjcompressfromyuv',['tjCompressFromYUV',['../group___turbo_j_p_e_g.html#ga0b931126c7a615ddc3bbd0cca6698d67',1,'turbojpeg.h']]],
|
||||
['tjcompressfromyuvplanes',['tjCompressFromYUVPlanes',['../group___turbo_j_p_e_g.html#gaa89a1982cb4556b12ae7af4439991af6',1,'turbojpeg.h']]],
|
||||
['tjcs',['TJCS',['../group___turbo_j_p_e_g.html#ga4f83ad3368e0e29d1957be0efa7c3720',1,'turbojpeg.h']]],
|
||||
['tjcs_5fcmyk',['TJCS_CMYK',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a6c8b636152ac8195b869587db315ee53',1,'turbojpeg.h']]],
|
||||
['tjcs_5fgray',['TJCS_GRAY',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720ab3e7d6a87f695e45b81c1b5262b5a50a',1,'turbojpeg.h']]],
|
||||
@@ -17,11 +18,14 @@ var searchData=
|
||||
['tjcs_5fycbcr',['TJCS_YCbCr',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a7389b8f65bb387ffedce3efd0d78ec75',1,'turbojpeg.h']]],
|
||||
['tjcs_5fycck',['TJCS_YCCK',['../group___turbo_j_p_e_g.html#gga4f83ad3368e0e29d1957be0efa7c3720a53839e0fe867b76b58d16b0a1a7c598e',1,'turbojpeg.h']]],
|
||||
['tjdecodeyuv',['tjDecodeYUV',['../group___turbo_j_p_e_g.html#ga132ae2c2cadcf64c8bb0f3bdf69da3ed',1,'turbojpeg.h']]],
|
||||
['tjdecodeyuvplanes',['tjDecodeYUVPlanes',['../group___turbo_j_p_e_g.html#ga6cb5b0e1101a2b20edea576e11faf93d',1,'turbojpeg.h']]],
|
||||
['tjdecompress2',['tjDecompress2',['../group___turbo_j_p_e_g.html#gada69cc6443d1bb493b40f1626259e5e9',1,'turbojpeg.h']]],
|
||||
['tjdecompressheader3',['tjDecompressHeader3',['../group___turbo_j_p_e_g.html#gacd0fac3af74b3511d39b4781b7103086',1,'turbojpeg.h']]],
|
||||
['tjdecompresstoyuv2',['tjDecompressToYUV2',['../group___turbo_j_p_e_g.html#ga7c08b340ad7f8e85d407bd9e81d44d07',1,'turbojpeg.h']]],
|
||||
['tjdecompresstoyuvplanes',['tjDecompressToYUVPlanes',['../group___turbo_j_p_e_g.html#ga0828a38ae29631ac28b6857cefb0eebf',1,'turbojpeg.h']]],
|
||||
['tjdestroy',['tjDestroy',['../group___turbo_j_p_e_g.html#ga674adee917b95ad4a896f1ba39e12540',1,'turbojpeg.h']]],
|
||||
['tjencodeyuv3',['tjEncodeYUV3',['../group___turbo_j_p_e_g.html#ga0a5ffbf7cb58a5b6a8201114fe889360',1,'turbojpeg.h']]],
|
||||
['tjencodeyuvplanes',['tjEncodeYUVPlanes',['../group___turbo_j_p_e_g.html#gaa791db8598853ddcad24e42897ef1269',1,'turbojpeg.h']]],
|
||||
['tjflag_5faccuratedct',['TJFLAG_ACCURATEDCT',['../group___turbo_j_p_e_g.html#gacb233cfd722d66d1ccbf48a7de81f0e0',1,'turbojpeg.h']]],
|
||||
['tjflag_5fbottomup',['TJFLAG_BOTTOMUP',['../group___turbo_j_p_e_g.html#ga72ecf4ebe6eb702d3c6f5ca27455e1ec',1,'turbojpeg.h']]],
|
||||
['tjflag_5ffastdct',['TJFLAG_FASTDCT',['../group___turbo_j_p_e_g.html#gaabce235db80d3f698b27f36cbd453da2',1,'turbojpeg.h']]],
|
||||
@@ -52,6 +56,9 @@ var searchData=
|
||||
['tjpf_5fxbgr',['TJPF_XBGR',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aaf6603b27147de47e212e75dac027b2af',1,'turbojpeg.h']]],
|
||||
['tjpf_5fxrgb',['TJPF_XRGB',['../group___turbo_j_p_e_g.html#ggac916144e26c3817ac514e64ae5d12e2aadae996905efcfa3b42a0bb3bea7f9d84',1,'turbojpeg.h']]],
|
||||
['tjpixelsize',['tjPixelSize',['../group___turbo_j_p_e_g.html#gad77cf8fe5b2bfd3cb3f53098146abb4c',1,'turbojpeg.h']]],
|
||||
['tjplaneheight',['tjPlaneHeight',['../group___turbo_j_p_e_g.html#ga1a209696c6a80748f20e134b3c64789f',1,'turbojpeg.h']]],
|
||||
['tjplanesizeyuv',['tjPlaneSizeYUV',['../group___turbo_j_p_e_g.html#ga6f98d977bfa9d167c97172e876ba61e2',1,'turbojpeg.h']]],
|
||||
['tjplanewidth',['tjPlaneWidth',['../group___turbo_j_p_e_g.html#ga63fb66bb1e36c74008c4634360becbb1',1,'turbojpeg.h']]],
|
||||
['tjredoffset',['tjRedOffset',['../group___turbo_j_p_e_g.html#gadd9b446742ac8a3923f7992c7988fea8',1,'turbojpeg.h']]],
|
||||
['tjregion',['tjregion',['../structtjregion.html',1,'']]],
|
||||
['tjsamp',['TJSAMP',['../group___turbo_j_p_e_g.html#ga1d047060ea80bb9820d540bb928e9074',1,'turbojpeg.h']]],
|
||||
|
||||
@@ -5,17 +5,24 @@ var searchData=
|
||||
['tjbufsizeyuv2',['tjBufSizeYUV2',['../group___turbo_j_p_e_g.html#gaf451664a62c1f6c7cc5a6401f32908c9',1,'turbojpeg.h']]],
|
||||
['tjcompress2',['tjCompress2',['../group___turbo_j_p_e_g.html#gaba62b7a98f960839b588579898495cf2',1,'turbojpeg.h']]],
|
||||
['tjcompressfromyuv',['tjCompressFromYUV',['../group___turbo_j_p_e_g.html#ga0b931126c7a615ddc3bbd0cca6698d67',1,'turbojpeg.h']]],
|
||||
['tjcompressfromyuvplanes',['tjCompressFromYUVPlanes',['../group___turbo_j_p_e_g.html#gaa89a1982cb4556b12ae7af4439991af6',1,'turbojpeg.h']]],
|
||||
['tjdecodeyuv',['tjDecodeYUV',['../group___turbo_j_p_e_g.html#ga132ae2c2cadcf64c8bb0f3bdf69da3ed',1,'turbojpeg.h']]],
|
||||
['tjdecodeyuvplanes',['tjDecodeYUVPlanes',['../group___turbo_j_p_e_g.html#ga6cb5b0e1101a2b20edea576e11faf93d',1,'turbojpeg.h']]],
|
||||
['tjdecompress2',['tjDecompress2',['../group___turbo_j_p_e_g.html#gada69cc6443d1bb493b40f1626259e5e9',1,'turbojpeg.h']]],
|
||||
['tjdecompressheader3',['tjDecompressHeader3',['../group___turbo_j_p_e_g.html#gacd0fac3af74b3511d39b4781b7103086',1,'turbojpeg.h']]],
|
||||
['tjdecompresstoyuv2',['tjDecompressToYUV2',['../group___turbo_j_p_e_g.html#ga7c08b340ad7f8e85d407bd9e81d44d07',1,'turbojpeg.h']]],
|
||||
['tjdecompresstoyuvplanes',['tjDecompressToYUVPlanes',['../group___turbo_j_p_e_g.html#ga0828a38ae29631ac28b6857cefb0eebf',1,'turbojpeg.h']]],
|
||||
['tjdestroy',['tjDestroy',['../group___turbo_j_p_e_g.html#ga674adee917b95ad4a896f1ba39e12540',1,'turbojpeg.h']]],
|
||||
['tjencodeyuv3',['tjEncodeYUV3',['../group___turbo_j_p_e_g.html#ga0a5ffbf7cb58a5b6a8201114fe889360',1,'turbojpeg.h']]],
|
||||
['tjencodeyuvplanes',['tjEncodeYUVPlanes',['../group___turbo_j_p_e_g.html#gaa791db8598853ddcad24e42897ef1269',1,'turbojpeg.h']]],
|
||||
['tjfree',['tjFree',['../group___turbo_j_p_e_g.html#ga8c4a1231dc06a450514c835f6471f137',1,'turbojpeg.h']]],
|
||||
['tjgeterrorstr',['tjGetErrorStr',['../group___turbo_j_p_e_g.html#ga9af79c908ec131b1ae8d52fe40375abf',1,'turbojpeg.h']]],
|
||||
['tjgetscalingfactors',['tjGetScalingFactors',['../group___turbo_j_p_e_g.html#ga6449044b9af402999ccf52f401333be8',1,'turbojpeg.h']]],
|
||||
['tjinitcompress',['tjInitCompress',['../group___turbo_j_p_e_g.html#ga3d10c47fbe4a2489a2b30c931551d01a',1,'turbojpeg.h']]],
|
||||
['tjinitdecompress',['tjInitDecompress',['../group___turbo_j_p_e_g.html#gae5408179d041e2a2f7199c8283cf649e',1,'turbojpeg.h']]],
|
||||
['tjinittransform',['tjInitTransform',['../group___turbo_j_p_e_g.html#ga3155b775bfbac9dbba869b95a0367902',1,'turbojpeg.h']]],
|
||||
['tjplaneheight',['tjPlaneHeight',['../group___turbo_j_p_e_g.html#ga1a209696c6a80748f20e134b3c64789f',1,'turbojpeg.h']]],
|
||||
['tjplanesizeyuv',['tjPlaneSizeYUV',['../group___turbo_j_p_e_g.html#ga6f98d977bfa9d167c97172e876ba61e2',1,'turbojpeg.h']]],
|
||||
['tjplanewidth',['tjPlaneWidth',['../group___turbo_j_p_e_g.html#ga63fb66bb1e36c74008c4634360becbb1',1,'turbojpeg.h']]],
|
||||
['tjtransform',['tjTransform',['../group___turbo_j_p_e_g.html#gae403193ceb4aafb7e0f56ab587b48616',1,'turbojpeg.h']]]
|
||||
];
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
$(document).ready(function() { searchBox.OnSelectItem(0); });
|
||||
</script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
<link href="doxygen-extra.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
|
||||
3
doxygen-extra.css
Normal file
3
doxygen-extra.css
Normal file
@@ -0,0 +1,3 @@
|
||||
code {
|
||||
color: #4665A2;
|
||||
}
|
||||
@@ -13,3 +13,4 @@ JAVADOC_AUTOBRIEF = YES
|
||||
MAX_INITIALIZER_LINES = 0
|
||||
ALWAYS_DETAILED_SEC = YES
|
||||
HTML_TIMESTAMP = NO
|
||||
HTML_EXTRA_STYLESHEET = doxygen-extra.css
|
||||
|
||||
@@ -236,7 +236,7 @@ class TJBench {
|
||||
"_" + sizeStr + ".bmp");
|
||||
|
||||
saveImage(tempStr, dstBuf, scaledw, scaledh, pf);
|
||||
int ndx = tempStr.indexOf('.');
|
||||
int ndx = tempStr.lastIndexOf('.');
|
||||
tempStr = new String(tempStr.substring(0, ndx) + "-err.bmp");
|
||||
if (srcBuf != null && sf.getNum() == 1 && sf.getDenom() == 1) {
|
||||
if (quiet == 0)
|
||||
@@ -432,7 +432,7 @@ class TJBench {
|
||||
fis.read(srcBuf, 0, srcSize);
|
||||
fis.close();
|
||||
|
||||
int index = fileName.indexOf('.');
|
||||
int index = fileName.lastIndexOf('.');
|
||||
if (index >= 0)
|
||||
fileName = new String(fileName.substring(0, index));
|
||||
|
||||
@@ -846,7 +846,7 @@ class TJBench {
|
||||
srcBuf = loadImage(argv[0], width, height, pf);
|
||||
w = width[0]; h = height[0];
|
||||
int index = -1;
|
||||
if ((index = argv[0].indexOf('.')) >= 0)
|
||||
if ((index = argv[0].lastIndexOf('.')) >= 0)
|
||||
argv[0] = argv[0].substring(0, index);
|
||||
}
|
||||
|
||||
|
||||
@@ -277,7 +277,7 @@ public class TJExample implements TJCustomFilter {
|
||||
scaleFactor.isOne()) {
|
||||
file = new File(argv[1]);
|
||||
FileOutputStream fos = new FileOutputStream(file);
|
||||
fos.write(tjd.getSourceBuf(), 0, tjd.getSourceSize());
|
||||
fos.write(tjd.getJPEGBuf(), 0, tjd.getJPEGSize());
|
||||
fos.close();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
@@ -106,83 +106,73 @@
|
||||
</tr>
|
||||
<tbody>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int)">org.libjpegturbo.turbojpeg.TJ.bufSizeYUV(int, int, int)</a>
|
||||
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int, int)"><code>TJ.bufSizeYUV(int, int, int, int)</code></a> instead.</i></div>
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int)">org.libjpegturbo.turbojpeg.TJ.bufSizeYUV(int, int, int)</a>
|
||||
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)"><code>TJ.bufSizeYUV(int, int, int, int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage, byte[], int)">org.libjpegturbo.turbojpeg.TJCompressor.compress(BufferedImage, byte[], int)</a>
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage,%20byte[],%20int)">org.libjpegturbo.turbojpeg.TJCompressor.compress(BufferedImage, byte[], int)</a>
|
||||
<div class="block"><i>Use
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[], int)"><code>TJCompressor.compress(byte[], int)</code></a> instead.</i></div>
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[],%20int)"><code>TJCompressor.compress(byte[], int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage, int)">org.libjpegturbo.turbojpeg.TJCompressor.compress(BufferedImage, int)</a>
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage,%20int)">org.libjpegturbo.turbojpeg.TJCompressor.compress(BufferedImage, int)</a>
|
||||
<div class="block"><i>Use
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#compress(int)"><code>TJCompressor.compress(int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int)">org.libjpegturbo.turbojpeg.TJDecompressor.decompress(byte[], int, int, int, int, int)</a>
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int)">org.libjpegturbo.turbojpeg.TJDecompressor.decompress(byte[], int, int, int, int, int)</a>
|
||||
<div class="block"><i>Use
|
||||
<a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)"><code>TJDecompressor.decompress(byte[], int, int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
<a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)"><code>TJDecompressor.decompress(byte[], int, int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[], int)">org.libjpegturbo.turbojpeg.TJDecompressor.decompressToYUV(byte[], int)</a>
|
||||
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage, int)"><code>TJDecompressor.decompressToYUV(YUVImage, int)</code></a> instead.</i></div>
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[],%20int)">org.libjpegturbo.turbojpeg.TJDecompressor.decompressToYUV(byte[], int)</a>
|
||||
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)"><code>TJDecompressor.decompressToYUV(YUVImage, int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)">org.libjpegturbo.turbojpeg.TJDecompressor.decompressToYUV(int)</a>
|
||||
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int, int, int, int)"><code>TJDecompressor.decompressToYUV(int, int, int, int)</code></a> instead.</i></div>
|
||||
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)"><code>TJDecompressor.decompressToYUV(int, int, int, int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage, byte[], int)">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(BufferedImage, byte[], int)</a>
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage,%20byte[],%20int)">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(BufferedImage, byte[], int)</a>
|
||||
<div class="block"><i>Use
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[], int)"><code>TJCompressor.encodeYUV(byte[], int)</code></a> instead.</i></div>
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)"><code>TJCompressor.encodeYUV(byte[], int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage, int)">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(BufferedImage, int)</a>
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage,%20int)">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(BufferedImage, int)</a>
|
||||
<div class="block"><i>Use
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int)"><code>TJCompressor.encodeYUV(int)</code></a> instead.</i></div>
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)"><code>TJCompressor.encodeYUV(int, int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[], int)">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(byte[], int)</a>
|
||||
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage, int)"><code>TJCompressor.encodeYUV(YUVImage, int)</code></a> instead.</i></div>
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(byte[], int)</a>
|
||||
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)"><code>TJCompressor.encodeYUV(YUVImage, int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int)">org.libjpegturbo.turbojpeg.TJCompressor.encodeYUV(int)</a>
|
||||
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int, int)"><code>TJCompressor.encodeYUV(int, int)</code></a> instead.</i></div>
|
||||
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)"><code>TJCompressor.encodeYUV(int, int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGBuf()">org.libjpegturbo.turbojpeg.TJDecompressor.getJPEGBuf()</a>
|
||||
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#getSourceBuf()"><code>TJDecompressor.getSourceBuf()</code></a> instead.</i></div>
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[],%20int)">org.libjpegturbo.turbojpeg.TJDecompressor.setJPEGImage(byte[], int)</a>
|
||||
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)"><code>TJDecompressor.setSourceImage(byte[], int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGSize()">org.libjpegturbo.turbojpeg.TJDecompressor.getJPEGSize()</a>
|
||||
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#getSourceSize()"><code>TJDecompressor.getSourceSize()</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[], int)">org.libjpegturbo.turbojpeg.TJDecompressor.setJPEGImage(byte[], int)</a>
|
||||
<div class="block"><i>Use <a href="org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[], int)"><code>TJDecompressor.setSourceImage(byte[], int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int)">org.libjpegturbo.turbojpeg.TJCompressor.setSourceImage(byte[], int, int, int, int)</a>
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int)">org.libjpegturbo.turbojpeg.TJCompressor.setSourceImage(byte[], int, int, int, int)</a>
|
||||
<div class="block"><i>Use
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><code>TJCompressor.setSourceImage(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -201,9 +191,9 @@
|
||||
</tr>
|
||||
<tbody>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[], int, int, int, int)">org.libjpegturbo.turbojpeg.TJCompressor(byte[], int, int, int, int)</a>
|
||||
<td class="colOne"><a href="org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int)">org.libjpegturbo.turbojpeg.TJCompressor(byte[], int, int, int, int)</a>
|
||||
<div class="block"><i>Use
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[], int, int, int, int, int, int)"><code>TJCompressor.TJCompressor(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
<a href="org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>TJCompressor.TJCompressor(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -63,20 +63,20 @@
|
||||
</a>
|
||||
<h2 class="title">B</h2>
|
||||
<dl>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#bufSize(int, int, int)">bufSize(int, int, int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#bufSize(int,%20int,%20int)">bufSize(int, int, int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">Returns the maximum size of the buffer (in bytes) required to hold a JPEG
|
||||
image with the given width, height, and level of chrominance subsampling.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int, int)">bufSizeYUV(int, int, int, int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)">bufSizeYUV(int, int, int, int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">Returns the size of the buffer (in bytes) required to hold a YUV planar
|
||||
image with the given width, height, and level of chrominance subsampling.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int)">bufSizeYUV(int, int, int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int)">bufSizeYUV(int, int, int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block"><span class="strong">Deprecated.</span>
|
||||
<div class="block"><i>Use <a href="./org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int, int)"><code>TJ.bufSizeYUV(int, int, int, int)</code></a> instead.</i></div>
|
||||
<div class="block"><i>Use <a href="./org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)"><code>TJ.bufSizeYUV(int, int, int, int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -97,7 +97,7 @@
|
||||
<dd>
|
||||
<div class="block">Free the native structures associated with this decompressor instance.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[], int)">compress(byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[],%20int)">compress(byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Compress the uncompressed source image associated with this compressor
|
||||
instance and output a JPEG image to the given destination buffer.</div>
|
||||
@@ -107,19 +107,19 @@
|
||||
<div class="block">Compress the uncompressed source image associated with this compressor
|
||||
instance and return a buffer containing a JPEG image.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage, byte[], int)">compress(BufferedImage, byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage,%20byte[],%20int)">compress(BufferedImage, byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block"><span class="strong">Deprecated.</span>
|
||||
<div class="block"><i>Use
|
||||
<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[], int)"><code>TJCompressor.compress(byte[], int)</code></a> instead.</i></div>
|
||||
<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[],%20int)"><code>TJCompressor.compress(byte[], int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage, int)">compress(BufferedImage, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage,%20int)">compress(BufferedImage, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block"><span class="strong">Deprecated.</span>
|
||||
<div class="block"><i>Use
|
||||
<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#compress(int)"><code>TJCompressor.compress(int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</dd>
|
||||
@@ -143,7 +143,7 @@
|
||||
<dd>
|
||||
<div class="block">YCCK colorspace.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCustomFilter.html#customFilter(java.nio.ShortBuffer, java.awt.Rectangle, java.awt.Rectangle, int, int, org.libjpegturbo.turbojpeg.TJTransform)">customFilter(ShortBuffer, Rectangle, Rectangle, int, int, TJTransform)</a></span> - Method in interface org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCustomFilter.html#customFilter(java.nio.ShortBuffer,%20java.awt.Rectangle,%20java.awt.Rectangle,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJTransform)">customFilter(ShortBuffer, Rectangle, Rectangle, int, int, TJTransform)</a></span> - Method in interface org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a></dt>
|
||||
<dd>
|
||||
<div class="block">A callback function that can be used to modify the DCT coefficients after
|
||||
they are losslessly transformed but before they are transcoded to a new
|
||||
@@ -155,64 +155,70 @@
|
||||
</a>
|
||||
<h2 class="title">D</h2>
|
||||
<dl>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)">decompress(byte[], int, int, int, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)">decompress(byte[], int, int, int, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Decompress the JPEG source image or decode the YUV source image associated
|
||||
with this decompressor instance and output a grayscale, RGB, or CMYK image
|
||||
to the given destination buffer.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int)">decompress(byte[], int, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int)">decompress(byte[], int, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block"><span class="strong">Deprecated.</span>
|
||||
<div class="block"><i>Use
|
||||
<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)"><code>TJDecompressor.decompress(byte[], int, int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)"><code>TJDecompressor.decompress(byte[], int, int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int, int, int, int, int)">decompress(int, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int,%20int)">decompress(int, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Decompress the JPEG source image associated with this decompressor
|
||||
instance and return a buffer containing the decompressed image.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int[], int, int, int, int, int, int, int)">decompress(int[], int, int, int, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)">decompress(int[], int, int, int, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Decompress the JPEG source image or decode the YUV source image associated
|
||||
with this decompressor instance and output a grayscale, RGB, or CMYK image
|
||||
to the given destination buffer.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(java.awt.image.BufferedImage, int)">decompress(BufferedImage, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(java.awt.image.BufferedImage,%20int)">decompress(BufferedImage, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Decompress the JPEG source image or decode the YUV source image associated
|
||||
with this decompressor instance and output a decompressed/decoded image to
|
||||
the given <code>BufferedImage</code> instance.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int, int, int, int)">decompress(int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int)">decompress(int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Decompress the JPEG source image or decode the YUV source image associated
|
||||
with this decompressor instance and return a <code>BufferedImage</code>
|
||||
instance containing the decompressed/decoded image.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage, int)">decompressToYUV(YUVImage, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)">decompressToYUV(YUVImage, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Decompress the JPEG source image associated with this decompressor
|
||||
instance into a YUV planar image and store it in the given
|
||||
<code>YUVImage</code> instance.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[], int)">decompressToYUV(byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[],%20int)">decompressToYUV(byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block"><span class="strong">Deprecated.</span>
|
||||
<div class="block"><i>Use <a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage, int)"><code>TJDecompressor.decompressToYUV(YUVImage, int)</code></a> instead.</i></div>
|
||||
<div class="block"><i>Use <a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)"><code>TJDecompressor.decompressToYUV(YUVImage, int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int, int, int, int)">decompressToYUV(int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int[],%20int,%20int)">decompressToYUV(int, int[], int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Decompress the JPEG source image associated with this decompressor
|
||||
instance into a YUV planar image and return a <code>YUVImage</code>
|
||||
instance containing the decompressed image.</div>
|
||||
instance into a set of Y, U (Cb), and V (Cr) image planes and return a
|
||||
<code>YUVImage</code> instance containing the decompressed image planes.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)">decompressToYUV(int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Decompress the JPEG source image associated with this decompressor
|
||||
instance into a unified YUV planar image buffer and return a
|
||||
<code>YUVImage</code> instance containing the decompressed image.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)">decompressToYUV(int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block"><span class="strong">Deprecated.</span>
|
||||
<div class="block"><i>Use <a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int, int, int, int)"><code>TJDecompressor.decompressToYUV(int, int, int, int)</code></a> instead.</i></div>
|
||||
<div class="block"><i>Use <a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)"><code>TJDecompressor.decompressToYUV(int, int, int, int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</dd>
|
||||
</dl>
|
||||
@@ -221,44 +227,50 @@
|
||||
</a>
|
||||
<h2 class="title">E</h2>
|
||||
<dl>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage, int)">encodeYUV(YUVImage, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)">encodeYUV(YUVImage, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Encode the uncompressed source image associated with this compressor
|
||||
instance into a YUV planar image and store it in the given
|
||||
<code>YUVImage</code> instance.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[], int)">encodeYUV(byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)">encodeYUV(byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block"><span class="strong">Deprecated.</span>
|
||||
<div class="block"><i>Use <a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage, int)"><code>TJCompressor.encodeYUV(YUVImage, int)</code></a> instead.</i></div>
|
||||
<div class="block"><i>Use <a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)"><code>TJCompressor.encodeYUV(YUVImage, int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int, int)">encodeYUV(int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)">encodeYUV(int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Encode the uncompressed source image associated with this compressor
|
||||
instance into a YUV planar image and return a <code>YUVImage</code>
|
||||
instance containing the encoded image.</div>
|
||||
instance into a unified YUV planar image buffer and return a
|
||||
<code>YUVImage</code> instance containing the encoded image.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int[],%20int)">encodeYUV(int[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Encode the uncompressed source image associated with this compressor
|
||||
instance into separate Y, U (Cb), and V (Cr) image planes and return a
|
||||
<code>YUVImage</code> instance containing the encoded image planes.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int)">encodeYUV(int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block"><span class="strong">Deprecated.</span>
|
||||
<div class="block"><i>Use <a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int, int)"><code>TJCompressor.encodeYUV(int, int)</code></a> instead.</i></div>
|
||||
<div class="block"><i>Use <a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)"><code>TJCompressor.encodeYUV(int, int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage, byte[], int)">encodeYUV(BufferedImage, byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage,%20byte[],%20int)">encodeYUV(BufferedImage, byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block"><span class="strong">Deprecated.</span>
|
||||
<div class="block"><i>Use
|
||||
<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[], int)"><code>TJCompressor.encodeYUV(byte[], int)</code></a> instead.</i></div>
|
||||
<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)"><code>TJCompressor.encodeYUV(byte[], int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage, int)">encodeYUV(BufferedImage, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage,%20int)">encodeYUV(BufferedImage, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block"><span class="strong">Deprecated.</span>
|
||||
<div class="block"><i>Use
|
||||
<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int)"><code>TJCompressor.encodeYUV(int)</code></a> instead.</i></div>
|
||||
<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)"><code>TJCompressor.encodeYUV(int, int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJScalingFactor.html#equals(org.libjpegturbo.turbojpeg.TJScalingFactor)">equals(TJScalingFactor)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a></dt>
|
||||
@@ -325,7 +337,8 @@
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#getBuf()">getBuf()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dd>
|
||||
<div class="block">Returns the YUV image buffer</div>
|
||||
<div class="block">Returns the YUV image buffer (if this image is stored in a unified
|
||||
buffer rather than separate image planes.)</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getColorspace()">getColorspace()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd>
|
||||
@@ -335,7 +348,7 @@
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#getCompressedSize()">getCompressedSize()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Returns the size of the image (in bytes) generated by the most recent
|
||||
compress/encode operation.</div>
|
||||
compress operation.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJScalingFactor.html#getDenom()">getDenom()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a></dt>
|
||||
<dd>
|
||||
@@ -353,19 +366,16 @@
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#getHeight()">getHeight()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dd>
|
||||
<div class="block">Returns the height of the YUV image.</div>
|
||||
<div class="block">Returns the height of the YUV image (or subregion.)</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGBuf()">getJPEGBuf()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block"><span class="strong">Deprecated.</span>
|
||||
<div class="block"><i>Use <a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getSourceBuf()"><code>TJDecompressor.getSourceBuf()</code></a> instead.</i></div>
|
||||
</div>
|
||||
<div class="block">Returns the JPEG image buffer associated with this decompressor instance.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGSize()">getJPEGSize()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block"><span class="strong">Deprecated.</span>
|
||||
<div class="block"><i>Use <a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getSourceSize()"><code>TJDecompressor.getSourceSize()</code></a> instead.</i></div>
|
||||
</div>
|
||||
<div class="block">Returns the size of the JPEG image (in bytes) associated with this
|
||||
decompressor instance.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#getMCUHeight(int)">getMCUHeight(int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
@@ -381,14 +391,24 @@
|
||||
<dd>
|
||||
<div class="block">Returns numerator</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#getOffsets()">getOffsets()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dd>
|
||||
<div class="block">Returns the offsets (in bytes) of each plane within the planes of a larger
|
||||
YUV image.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#getPad()">getPad()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dd>
|
||||
<div class="block">Returns the line padding used in the YUV image buffer.</div>
|
||||
<div class="block">Returns the line padding used in the YUV image buffer (if this image is
|
||||
stored in a unified buffer rather than separate image planes.)</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#getPixelSize(int)">getPixelSize(int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">Returns the pixel size (in bytes) for the given pixel format.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#getPlanes()">getPlanes()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dd>
|
||||
<div class="block">Returns the YUV image planes.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#getRedOffset(int)">getRedOffset(int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">For the given pixel format, returns the number of bytes that the red
|
||||
@@ -398,13 +418,13 @@
|
||||
<dd>
|
||||
<div class="block">Returns the scaled value of <code>dimension</code>.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int, int)">getScaledHeight(int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int,%20int)">getScaledHeight(int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Returns the height of the largest scaled-down image that the TurboJPEG
|
||||
decompressor can generate without exceeding the desired image width and
|
||||
height.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int, int)">getScaledWidth(int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int,%20int)">getScaledWidth(int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Returns the width of the largest scaled-down image that the TurboJPEG
|
||||
decompressor can generate without exceeding the desired image width and
|
||||
@@ -417,17 +437,12 @@
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#getSize()">getSize()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dd>
|
||||
<div class="block">Returns the size (in bytes) of the YUV image buffer</div>
|
||||
<div class="block">Returns the size (in bytes) of the YUV image buffer (if this image is
|
||||
stored in a unified buffer rather than separate image planes.)</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getSourceBuf()">getSourceBuf()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#getStrides()">getStrides()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dd>
|
||||
<div class="block">Returns the source image buffer associated with this decompressor
|
||||
instance.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getSourceSize()">getSourceSize()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Returns the size of the source image (in bytes) associated with this
|
||||
decompressor instance.</div>
|
||||
<div class="block">Returns the number of bytes per line of each plane in the YUV image.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#getSubsamp()">getSubsamp()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd>
|
||||
@@ -450,7 +465,7 @@
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#getWidth()">getWidth()</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dd>
|
||||
<div class="block">Returns the width of the YUV image.</div>
|
||||
<div class="block">Returns the width of the YUV image (or subregion.)</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="_H_">
|
||||
@@ -483,6 +498,14 @@
|
||||
<dd> </dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBufSize">jpegBufSize</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegColorspace">jpegColorspace</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegHeight">jpegHeight</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegSubsamp">jpegSubsamp</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegWidth">jpegWidth</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd> </dd>
|
||||
</dl>
|
||||
<a name="_N_">
|
||||
<!-- -->
|
||||
@@ -559,12 +582,12 @@
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_NOOUTPUT">OPT_NOOUTPUT</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt>
|
||||
<dd>
|
||||
<div class="block">This option will prevent <a href="./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><code>TJTransformer.transform()</code></a> from outputting a JPEG image for this
|
||||
<div class="block">This option will prevent <a href="./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a> from outputting a JPEG image for this
|
||||
particular transform.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT">OPT_PERFECT</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt>
|
||||
<dd>
|
||||
<div class="block">This option will cause <a href="./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><code>TJTransformer.transform()</code></a> to throw an exception if the transform is not
|
||||
<div class="block">This option will cause <a href="./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a> to throw an exception if the transform is not
|
||||
perfect.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#OPT_TRIM">OPT_TRIM</a></span> - Static variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt>
|
||||
@@ -632,6 +655,19 @@
|
||||
<dd>
|
||||
<div class="block">XRGB pixel format.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#planeHeight(int,%20int,%20int)">planeHeight(int, int, int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">Returns the plane height of a YUV image plane with the given parameters.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#planeSizeYUV(int,%20int,%20int,%20int,%20int)">planeSizeYUV(int, int, int, int, int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">Returns the size of the buffer (in bytes) required to hold a YUV image
|
||||
plane with the given parameters.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJ.html#planeWidth(int,%20int,%20int)">planeWidth(int, int, int)</a></span> - Static method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg">TJ</a></dt>
|
||||
<dd>
|
||||
<div class="block">Returns the plane width of a YUV image plane with the given parameters.</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<a name="_S_">
|
||||
<!-- -->
|
||||
@@ -662,34 +698,37 @@
|
||||
<dd>
|
||||
<div class="block">Grayscale.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#setBuf(byte[], int, int, int, int)">setBuf(byte[], int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#setBuf(byte[][],%20int[],%20int,%20int[],%20int,%20int)">setBuf(byte[][], int[], int, int[], int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dd>
|
||||
<div class="block">Assign an existing YUV planar image buffer to this <code>YUVImage</code>
|
||||
instance.</div>
|
||||
<div class="block">Assign a set of image planes to this <code>YUVImage</code> instance.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[], int)">setJPEGImage(byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#setBuf(byte[],%20int,%20int,%20int,%20int)">setBuf(byte[], int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dd>
|
||||
<div class="block">Assign a unified image buffer to this <code>YUVImage</code> instance.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[],%20int)">setJPEGImage(byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block"><span class="strong">Deprecated.</span>
|
||||
<div class="block"><i>Use <a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[], int)"><code>TJDecompressor.setSourceImage(byte[], int)</code></a> instead.</i></div>
|
||||
<div class="block"><i>Use <a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)"><code>TJDecompressor.setSourceImage(byte[], int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setJPEGQuality(int)">setJPEGQuality(int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Set the JPEG image quality level for subsequent compress operations.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)">setSourceImage(byte[], int, int, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)">setSourceImage(byte[], int, int, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Associate an uncompressed RGB, grayscale, or CMYK source image with this
|
||||
compressor instance.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int)">setSourceImage(byte[], int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int)">setSourceImage(byte[], int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block"><span class="strong">Deprecated.</span>
|
||||
<div class="block"><i>Use
|
||||
<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><code>TJCompressor.setSourceImage(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>TJCompressor.setSourceImage(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)">setSourceImage(BufferedImage, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)">setSourceImage(BufferedImage, int, int, int, int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Associate an uncompressed RGB or grayscale source image with this
|
||||
compressor instance.</div>
|
||||
@@ -699,10 +738,10 @@
|
||||
<div class="block">Associate an uncompressed YUV planar source image with this compressor
|
||||
instance.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[], int)">setSourceImage(byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)">setSourceImage(byte[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Associate the JPEG image of length <code>imageSize</code> bytes stored in
|
||||
<code>srcImage</code> with this decompressor instance.</div>
|
||||
<code>jpegImage</code> with this decompressor instance.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">setSourceImage(YUVImage)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd>
|
||||
@@ -714,14 +753,6 @@
|
||||
<div class="block">Set the level of chrominance subsampling for subsequent compress/encode
|
||||
operations.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#srcColorspace">srcColorspace</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#srcHeight">srcHeight</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#srcSubsamp">srcSubsamp</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#srcWidth">srcWidth</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd> </dd>
|
||||
</dl>
|
||||
<a name="_T_">
|
||||
<!-- -->
|
||||
@@ -742,20 +773,20 @@
|
||||
<dd>
|
||||
<div class="block">Create a TurboJPEG compressor instance.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[], int, int, int, int, int, int)">TJCompressor(byte[], int, int, int, int, int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int,%20int,%20int)">TJCompressor(byte[], int, int, int, int, int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Create a TurboJPEG compressor instance and associate the uncompressed
|
||||
source image stored in <code>srcImage</code> with the newly created
|
||||
instance.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[], int, int, int, int)">TJCompressor(byte[], int, int, int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int)">TJCompressor(byte[], int, int, int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block"><span class="strong">Deprecated.</span>
|
||||
<div class="block"><i>Use
|
||||
<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[], int, int, int, int, int, int)"><code>TJCompressor.TJCompressor(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>TJCompressor.TJCompressor(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(java.awt.image.BufferedImage, int, int, int, int)">TJCompressor(BufferedImage, int, int, int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)">TJCompressor(BufferedImage, int, int, int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJCompressor.html" title="class in org.libjpegturbo.turbojpeg">TJCompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Create a TurboJPEG compressor instance and associate the uncompressed
|
||||
source image stored in <code>srcImage</code> with the newly created
|
||||
@@ -778,7 +809,7 @@
|
||||
<div class="block">Create a TurboJPEG decompressor instance and associate the JPEG source
|
||||
image stored in <code>jpegImage</code> with the newly created instance.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor(byte[], int)">TJDecompressor(byte[], int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor(byte[],%20int)">TJDecompressor(byte[], int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd>
|
||||
<div class="block">Create a TurboJPEG decompressor instance and associate the JPEG source
|
||||
image of length <code>imageSize</code> bytes stored in
|
||||
@@ -794,7 +825,7 @@
|
||||
<dd>
|
||||
<div class="block">Fractional scaling factor</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJScalingFactor.html#TJScalingFactor(int, int)">TJScalingFactor(int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJScalingFactor.html#TJScalingFactor(int,%20int)">TJScalingFactor(int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJScalingFactor.html" title="class in org.libjpegturbo.turbojpeg">TJScalingFactor</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">TJTransform</span></a> - Class in <a href="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</a></dt>
|
||||
<dd>
|
||||
@@ -804,11 +835,11 @@
|
||||
<dd>
|
||||
<div class="block">Create a new lossless transform instance.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(int, int, int, int, int, int, org.libjpegturbo.turbojpeg.TJCustomFilter)">TJTransform(int, int, int, int, int, int, TJCustomFilter)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(int,%20int,%20int,%20int,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJCustomFilter)">TJTransform(int, int, int, int, int, int, TJCustomFilter)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt>
|
||||
<dd>
|
||||
<div class="block">Create a new lossless transform instance with the given parameters.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(java.awt.Rectangle, int, int, org.libjpegturbo.turbojpeg.TJCustomFilter)">TJTransform(Rectangle, int, int, TJCustomFilter)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(java.awt.Rectangle,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJCustomFilter)">TJTransform(Rectangle, int, int, TJCustomFilter)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a></dt>
|
||||
<dd>
|
||||
<div class="block">Create a new lossless transform instance with the given parameters.</div>
|
||||
</dd>
|
||||
@@ -825,19 +856,19 @@
|
||||
<div class="block">Create a TurboJPEG lossless transformer instance and associate the JPEG
|
||||
image stored in <code>jpegImage</code> with the newly created instance.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[], int)">TJTransformer(byte[], int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[],%20int)">TJTransformer(byte[], int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</a></dt>
|
||||
<dd>
|
||||
<div class="block">Create a TurboJPEG lossless transformer instance and associate the JPEG
|
||||
image of length <code>imageSize</code> bytes stored in
|
||||
<code>jpegImage</code> with the newly created instance.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)">transform(byte[][], TJTransform[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)">transform(byte[][], TJTransform[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</a></dt>
|
||||
<dd>
|
||||
<div class="block">Losslessly transform the JPEG image associated with this transformer
|
||||
instance into one or more JPEG images stored in the given destination
|
||||
buffers.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(org.libjpegturbo.turbojpeg.TJTransform[], int)">transform(TJTransform[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJTransformer.html#transform(org.libjpegturbo.turbojpeg.TJTransform[],%20int)">transform(TJTransform[], int)</a></span> - Method in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJTransformer.html" title="class in org.libjpegturbo.turbojpeg">TJTransformer</a></dt>
|
||||
<dd>
|
||||
<div class="block">Losslessly transform the JPEG image associated with this transformer
|
||||
instance and return an array of <a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><code>TJDecompressor</code></a> instances, each of
|
||||
@@ -849,28 +880,43 @@
|
||||
</a>
|
||||
<h2 class="title">Y</h2>
|
||||
<dl>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#yuvBuf">yuvBuf</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#yuvHeight">yuvHeight</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html#yuvImage">yuvImage</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><span class="strong">YUVImage</span></a> - Class in <a href="./org/libjpegturbo/turbojpeg/package-summary.html">org.libjpegturbo.turbojpeg</a></dt>
|
||||
<dd>
|
||||
<div class="block">This class encapsulates a YUV planar image buffer and the metadata
|
||||
<div class="block">This class encapsulates a YUV planar image and the metadata
|
||||
associated with it.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(int, int, int, int)">YUVImage(int, int, int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(int,%20int[],%20int,%20int)">YUVImage(int, int[], int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dd>
|
||||
<div class="block">Create a <code>YUVImage</code> instance with a new image buffer.</div>
|
||||
<div class="block">Create a new <code>YUVImage</code> instance backed by separate image
|
||||
planes, and allocate memory for the image planes.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(byte[], int, int, int, int)">YUVImage(byte[], int, int, int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(int,%20int,%20int,%20int)">YUVImage(int, int, int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dd>
|
||||
<div class="block">Create a <code>YUVImage</code> instance from an existing YUV planar image
|
||||
<div class="block">Create a new <code>YUVImage</code> instance backed by a unified image
|
||||
buffer, and allocate memory for the image buffer.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(byte[][],%20int[],%20int,%20int[],%20int,%20int)">YUVImage(byte[][], int[], int, int[], int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dd>
|
||||
<div class="block">Create a new <code>YUVImage</code> instance from a set of existing image
|
||||
planes.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(byte[],%20int,%20int,%20int,%20int)">YUVImage(byte[], int, int, int, int)</a></span> - Constructor for class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dd>
|
||||
<div class="block">Create a new <code>YUVImage</code> instance from an existing unified image
|
||||
buffer.</div>
|
||||
</dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#yuvOffsets">yuvOffsets</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#yuvPad">yuvPad</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#yuvPlanes">yuvPlanes</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#yuvStrides">yuvStrides</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#yuvSubsamp">yuvSubsamp</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
<dd> </dd>
|
||||
<dt><span class="strong"><a href="./org/libjpegturbo/turbojpeg/YUVImage.html#yuvWidth">yuvWidth</a></span> - Variable in class org.libjpegturbo.turbojpeg.<a href="./org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></dt>
|
||||
|
||||
@@ -10,6 +10,12 @@
|
||||
if (targetPage.indexOf(":") != -1 || (targetPage != "" && !validURL(targetPage)))
|
||||
targetPage = "undefined";
|
||||
function validURL(url) {
|
||||
try {
|
||||
url = decodeURIComponent(url);
|
||||
}
|
||||
catch (error) {
|
||||
return false;
|
||||
}
|
||||
var pos = url.indexOf(".html");
|
||||
if (pos == -1 || pos != url.length - 5)
|
||||
return false;
|
||||
@@ -21,7 +27,8 @@
|
||||
if ('a' <= ch && ch <= 'z' ||
|
||||
'A' <= ch && ch <= 'Z' ||
|
||||
ch == '$' ||
|
||||
ch == '_') {
|
||||
ch == '_' ||
|
||||
ch.charCodeAt(0) > 127) {
|
||||
allowNumber = true;
|
||||
allowSep = true;
|
||||
} else if ('0' <= ch && ch <= '9'
|
||||
|
||||
@@ -355,7 +355,7 @@ extends java.lang.Object</pre>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int, int, int)">bufSize</a></strong>(int width,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int,%20int,%20int)">bufSize</a></strong>(int width,
|
||||
int height,
|
||||
int jpegSubsamp)</code>
|
||||
<div class="block">Returns the maximum size of the buffer (in bytes) required to hold a JPEG
|
||||
@@ -364,17 +364,17 @@ extends java.lang.Object</pre>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int)">bufSizeYUV</a></strong>(int width,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int)">bufSizeYUV</a></strong>(int width,
|
||||
int height,
|
||||
int subsamp)</code>
|
||||
<div class="block"><strong>Deprecated.</strong>
|
||||
<div class="block"><i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int, int)"><code>bufSizeYUV(int, int, int, int)</code></a> instead.</i></div>
|
||||
<div class="block"><i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)"><code>bufSizeYUV(int, int, int, int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int, int)">bufSizeYUV</a></strong>(int width,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)">bufSizeYUV</a></strong>(int width,
|
||||
int pad,
|
||||
int height,
|
||||
int subsamp)</code>
|
||||
@@ -430,6 +430,33 @@ extends java.lang.Object</pre>
|
||||
this implementation of TurboJPEG supports.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#planeHeight(int,%20int,%20int)">planeHeight</a></strong>(int componentID,
|
||||
int height,
|
||||
int subsamp)</code>
|
||||
<div class="block">Returns the plane height of a YUV image plane with the given parameters.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#planeSizeYUV(int,%20int,%20int,%20int,%20int)">planeSizeYUV</a></strong>(int componentID,
|
||||
int width,
|
||||
int stride,
|
||||
int height,
|
||||
int subsamp)</code>
|
||||
<div class="block">Returns the size of the buffer (in bytes) required to hold a YUV image
|
||||
plane with the given parameters.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJ.html#planeWidth(int,%20int,%20int)">planeWidth</a></strong>(int componentID,
|
||||
int width,
|
||||
int subsamp)</code>
|
||||
<div class="block">Returns the plane width of a YUV image plane with the given parameters.</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
|
||||
@@ -962,7 +989,8 @@ public static final int FLAG_FORCESSE3</pre>
|
||||
subsampling.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>subsamp</code> - the level of chrominance subsampling (one of
|
||||
<code>SAMP_*</code>)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the MCU block width for the given level of chrominance subsampling</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the MCU block width for the given level of chrominance
|
||||
subsampling.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -980,7 +1008,7 @@ public static final int FLAG_FORCESSE3</pre>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>subsamp</code> - the level of chrominance subsampling (one of
|
||||
<code>SAMP_*</code>)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the MCU block height for the given level of chrominance
|
||||
subsampling</dd>
|
||||
subsampling.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -995,7 +1023,7 @@ public static final int FLAG_FORCESSE3</pre>
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Returns the pixel size (in bytes) for the given pixel format.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>pixelFormat</code> - the pixel format (one of <code>PF_*</code>)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the pixel size (in bytes) for the given pixel format</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the pixel size (in bytes) for the given pixel format.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -1014,7 +1042,7 @@ public static final int FLAG_FORCESSE3</pre>
|
||||
then the red component will be
|
||||
<code>pixel[TJ.getRedOffset(TJ.PF_BGRX)]</code>.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>pixelFormat</code> - the pixel format (one of <code>PF_*</code>)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the red offset for the given pixel format</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the red offset for the given pixel format.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -1033,7 +1061,7 @@ public static final int FLAG_FORCESSE3</pre>
|
||||
then the green component will be
|
||||
<code>pixel[TJ.getGreenOffset(TJ.PF_BGRX)]</code>.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>pixelFormat</code> - the pixel format (one of <code>PF_*</code>)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the green offset for the given pixel format</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the green offset for the given pixel format.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -1052,7 +1080,7 @@ public static final int FLAG_FORCESSE3</pre>
|
||||
then the blue component will be
|
||||
<code>pixel[TJ.getBlueOffset(TJ.PF_BGRX)]</code>.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>pixelFormat</code> - the pixel format (one of <code>PF_*</code>)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the blue offset for the given pixel format</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the blue offset for the given pixel format.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -1072,7 +1100,7 @@ public static final int FLAG_FORCESSE3</pre>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>width</code> - the width (in pixels) of the JPEG image</dd><dd><code>height</code> - the height (in pixels) of the JPEG image</dd><dd><code>jpegSubsamp</code> - the level of chrominance subsampling to be used when
|
||||
generating the JPEG image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the maximum size of the buffer (in bytes) required to hold a JPEG
|
||||
image with the given width, height, and level of chrominance subsampling</dd>
|
||||
image with the given width, height, and level of chrominance subsampling.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -1091,11 +1119,10 @@ public static final int FLAG_FORCESSE3</pre>
|
||||
<div class="block">Returns the size of the buffer (in bytes) required to hold a YUV planar
|
||||
image with the given width, height, and level of chrominance subsampling.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>width</code> - the width (in pixels) of the YUV image</dd><dd><code>pad</code> - the width of each line in each plane of the image is padded to
|
||||
the nearest multiple of this number of bytes (must be a power of
|
||||
2.)</dd><dd><code>height</code> - the height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
|
||||
the nearest multiple of this number of bytes (must be a power of 2.)</dd><dd><code>height</code> - the height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the size of the buffer (in bytes) required to hold a YUV planar
|
||||
image with the given width, height, and level of chrominance subsampling</dd>
|
||||
image with the given width, height, and level of chrominance subsampling.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -1111,11 +1138,76 @@ public static int bufSizeYUV(int width,
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int, int)"><code>bufSizeYUV(int, int, int, int)</code></a> instead.</i></div>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)"><code>bufSizeYUV(int, int, int, int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="planeSizeYUV(int, int, int, int, int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>planeSizeYUV</h4>
|
||||
<pre>public static int planeSizeYUV(int componentID,
|
||||
int width,
|
||||
int stride,
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Returns the size of the buffer (in bytes) required to hold a YUV image
|
||||
plane with the given parameters.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>componentID</code> - ID number of the image plane (0 = Y, 1 = U/Cb,
|
||||
2 = V/Cr)</dd><dd><code>width</code> - width (in pixels) of the YUV image. NOTE: this is the width
|
||||
of the whole image, not the plane width.</dd><dd><code>stride</code> - bytes per line in the image plane.</dd><dd><code>height</code> - height (in pixels) of the YUV image. NOTE: this is the
|
||||
height of the whole image, not the plane height.</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the size of the buffer (in bytes) required to hold a YUV planar
|
||||
image with the given parameters.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="planeWidth(int, int, int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>planeWidth</h4>
|
||||
<pre>public static int planeWidth(int componentID,
|
||||
int width,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Returns the plane width of a YUV image plane with the given parameters.
|
||||
Refer to <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> for a description of plane width.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>componentID</code> - ID number of the image plane (0 = Y, 1 = U/Cb,
|
||||
2 = V/Cr)</dd><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV image
|
||||
(one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the plane width of a YUV image plane with the given parameters.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="planeHeight(int, int, int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>planeHeight</h4>
|
||||
<pre>public static int planeHeight(int componentID,
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Returns the plane height of a YUV image plane with the given parameters.
|
||||
Refer to <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>YUVImage</code></a> for a description of plane height.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>componentID</code> - ID number of the image plane (0 = Y, 1 = U/Cb,
|
||||
2 = V/Cr)</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV image
|
||||
(one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html" title="class in org.libjpegturbo.turbojpeg"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the plane height of a YUV image plane with the given parameters.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getScalingFactors()">
|
||||
<!-- -->
|
||||
</a>
|
||||
@@ -1127,7 +1219,7 @@ public static int bufSizeYUV(int width,
|
||||
<div class="block">Returns a list of fractional scaling factors that the JPEG decompressor in
|
||||
this implementation of TurboJPEG supports.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>a list of fractional scaling factors that the JPEG decompressor in
|
||||
this implementation of TurboJPEG supports</dd>
|
||||
this implementation of TurboJPEG supports.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
|
||||
@@ -118,7 +118,7 @@ extends java.lang.Object</pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(java.awt.image.BufferedImage, int, int, int, int)">TJCompressor</a></strong>(java.awt.image.BufferedImage srcImage,
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)">TJCompressor</a></strong>(java.awt.image.BufferedImage srcImage,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
@@ -129,19 +129,19 @@ extends java.lang.Object</pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[], int, int, int, int)">TJCompressor</a></strong>(byte[] srcImage,
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int)">TJCompressor</a></strong>(byte[] srcImage,
|
||||
int width,
|
||||
int pitch,
|
||||
int height,
|
||||
int pixelFormat)</code>
|
||||
<div class="block"><strong>Deprecated.</strong>
|
||||
<div class="block"><i>Use
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[], int, int, int, int, int, int)"><code>TJCompressor(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>TJCompressor(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[], int, int, int, int, int, int)">TJCompressor</a></strong>(byte[] srcImage,
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int,%20int,%20int)">TJCompressor</a></strong>(byte[] srcImage,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
@@ -176,30 +176,30 @@ extends java.lang.Object</pre>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage, byte[], int)">compress</a></strong>(java.awt.image.BufferedImage srcImage,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage,%20byte[],%20int)">compress</a></strong>(java.awt.image.BufferedImage srcImage,
|
||||
byte[] dstBuf,
|
||||
int flags)</code>
|
||||
<div class="block"><strong>Deprecated.</strong>
|
||||
<div class="block"><i>Use
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[], int)"><code>compress(byte[], int)</code></a> instead.</i></div>
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[],%20int)"><code>compress(byte[], int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>byte[]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage, int)">compress</a></strong>(java.awt.image.BufferedImage srcImage,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(java.awt.image.BufferedImage,%20int)">compress</a></strong>(java.awt.image.BufferedImage srcImage,
|
||||
int flags)</code>
|
||||
<div class="block"><strong>Deprecated.</strong>
|
||||
<div class="block"><i>Use
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(int)"><code>compress(int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[], int)">compress</a></strong>(byte[] dstBuf,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[],%20int)">compress</a></strong>(byte[] dstBuf,
|
||||
int flags)</code>
|
||||
<div class="block">Compress the uncompressed source image associated with this compressor
|
||||
instance and output a JPEG image to the given destination buffer.</div>
|
||||
@@ -214,33 +214,33 @@ extends java.lang.Object</pre>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage, byte[], int)">encodeYUV</a></strong>(java.awt.image.BufferedImage srcImage,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage,%20byte[],%20int)">encodeYUV</a></strong>(java.awt.image.BufferedImage srcImage,
|
||||
byte[] dstBuf,
|
||||
int flags)</code>
|
||||
<div class="block"><strong>Deprecated.</strong>
|
||||
<div class="block"><i>Use
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[], int)"><code>encodeYUV(byte[], int)</code></a> instead.</i></div>
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)"><code>encodeYUV(byte[], int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>byte[]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage, int)">encodeYUV</a></strong>(java.awt.image.BufferedImage srcImage,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(java.awt.image.BufferedImage,%20int)">encodeYUV</a></strong>(java.awt.image.BufferedImage srcImage,
|
||||
int flags)</code>
|
||||
<div class="block"><strong>Deprecated.</strong>
|
||||
<div class="block"><i>Use
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int)"><code>encodeYUV(int)</code></a> instead.</i></div>
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)"><code>encodeYUV(int, int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[], int)">encodeYUV</a></strong>(byte[] dstBuf,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)">encodeYUV</a></strong>(byte[] dstBuf,
|
||||
int flags)</code>
|
||||
<div class="block"><strong>Deprecated.</strong>
|
||||
<div class="block"><i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage, int)"><code>encodeYUV(YUVImage, int)</code></a> instead.</i></div>
|
||||
<div class="block"><i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)"><code>encodeYUV(YUVImage, int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -248,48 +248,57 @@ extends java.lang.Object</pre>
|
||||
<td class="colFirst"><code>byte[]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int)">encodeYUV</a></strong>(int flags)</code>
|
||||
<div class="block"><strong>Deprecated.</strong>
|
||||
<div class="block"><i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int, int)"><code>encodeYUV(int, int)</code></a> instead.</i></div>
|
||||
<div class="block"><i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)"><code>encodeYUV(int, int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int, int)">encodeYUV</a></strong>(int pad,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int[],%20int)">encodeYUV</a></strong>(int[] strides,
|
||||
int flags)</code>
|
||||
<div class="block">Encode the uncompressed source image associated with this compressor
|
||||
instance into a YUV planar image and return a <code>YUVImage</code>
|
||||
instance containing the encoded image.</div>
|
||||
instance into separate Y, U (Cb), and V (Cr) image planes and return a
|
||||
<code>YUVImage</code> instance containing the encoded image planes.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)">encodeYUV</a></strong>(int pad,
|
||||
int flags)</code>
|
||||
<div class="block">Encode the uncompressed source image associated with this compressor
|
||||
instance into a unified YUV planar image buffer and return a
|
||||
<code>YUVImage</code> instance containing the encoded image.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage, int)">encodeYUV</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> dstImage,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)">encodeYUV</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> dstImage,
|
||||
int flags)</code>
|
||||
<div class="block">Encode the uncompressed source image associated with this compressor
|
||||
instance into a YUV planar image and store it in the given
|
||||
<code>YUVImage</code> instance.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>protected void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#finalize()">finalize</a></strong>()</code> </td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#getCompressedSize()">getCompressedSize</a></strong>()</code>
|
||||
<div class="block">Returns the size of the image (in bytes) generated by the most recent
|
||||
compress/encode operation.</div>
|
||||
compress operation.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setJPEGQuality(int)">setJPEGQuality</a></strong>(int quality)</code>
|
||||
<div class="block">Set the JPEG image quality level for subsequent compress operations.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)">setSourceImage</a></strong>(java.awt.image.BufferedImage srcImage,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)">setSourceImage</a></strong>(java.awt.image.BufferedImage srcImage,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
@@ -298,22 +307,22 @@ extends java.lang.Object</pre>
|
||||
compressor instance.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int)">setSourceImage</a></strong>(byte[] srcImage,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int)">setSourceImage</a></strong>(byte[] srcImage,
|
||||
int width,
|
||||
int pitch,
|
||||
int height,
|
||||
int pixelFormat)</code>
|
||||
<div class="block"><strong>Deprecated.</strong>
|
||||
<div class="block"><i>Use
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)">setSourceImage</a></strong>(byte[] srcImage,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)">setSourceImage</a></strong>(byte[] srcImage,
|
||||
int x,
|
||||
int y,
|
||||
int width,
|
||||
@@ -324,14 +333,14 @@ extends java.lang.Object</pre>
|
||||
compressor instance.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">setSourceImage</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> srcImage)</code>
|
||||
<div class="block">Associate an uncompressed YUV planar source image with this compressor
|
||||
instance.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSubsamp(int)">setSubsamp</a></strong>(int newSubsamp)</code>
|
||||
<div class="block">Set the level of chrominance subsampling for subsequent compress/encode
|
||||
@@ -390,7 +399,7 @@ extends java.lang.Object</pre>
|
||||
<div class="block">Create a TurboJPEG compressor instance and associate the uncompressed
|
||||
source image stored in <code>srcImage</code> with the newly created
|
||||
instance.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>srcImage</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>x</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>y</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>width</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>pitch</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>height</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>pixelFormat</code> - pixel format of the source image (one of
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>srcImage</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>x</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>y</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>width</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>pitch</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>height</code> - see <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> for description</dd><dd><code>pixelFormat</code> - pixel format of the source image (one of
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
@@ -410,7 +419,7 @@ public TJCompressor(byte[] srcImage,
|
||||
int pixelFormat)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[], int, int, int, int, int, int)"><code>TJCompressor(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#TJCompressor(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>TJCompressor(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -431,11 +440,11 @@ public TJCompressor(byte[] srcImage,
|
||||
source image stored in <code>srcImage</code> with the newly created
|
||||
instance.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>srcImage</code> - see
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd><dd><code>x</code> - see
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd><dd><code>y</code> - see
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd><dd><code>width</code> - see
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd><dd><code>height</code> - see
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd>
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd><dd><code>x</code> - see
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd><dd><code>y</code> - see
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd><dd><code>width</code> - see
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd><dd><code>height</code> - see
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> for description</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -496,7 +505,7 @@ public void setSourceImage(byte[] srcImage,
|
||||
int pixelFormat)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[], int, int, int, int, int, int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(byte[],%20int,%20int,%20int,%20int,%20int,%20int)"><code>setSourceImage(byte[], int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -599,7 +608,7 @@ public void setSourceImage(byte[] srcImage,
|
||||
<div class="block">Compress the uncompressed source image associated with this compressor
|
||||
instance and output a JPEG image to the given destination buffer.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>dstBuf</code> - buffer that will receive the JPEG image. Use
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int, int, int)"><code>TJ.bufSize(int, int, int)</code></a> to determine the maximum size for this buffer based on
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int,%20int,%20int)"><code>TJ.bufSize(int, int, int)</code></a> to determine the maximum size for this buffer based on
|
||||
the source image's width and height and the desired level of chrominance
|
||||
subsampling.</dd><dd><code>flags</code> - the bitwise OR of one or more of
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
|
||||
@@ -637,8 +646,8 @@ public void compress(java.awt.image.BufferedImage srcImage,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[], int)"><code>compress(byte[], int)</code></a> instead.</i></div>
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(byte[],%20int)"><code>compress(byte[], int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -654,7 +663,7 @@ public byte[] compress(java.awt.image.BufferedImage srcImage,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#compress(int)"><code>compress(int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
@@ -692,7 +701,7 @@ public byte[] compress(java.awt.image.BufferedImage srcImage,
|
||||
public void encodeYUV(byte[] dstBuf,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage, int)"><code>encodeYUV(YUVImage, int)</code></a> instead.</i></div>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)"><code>encodeYUV(YUVImage, int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -707,16 +716,44 @@ public void encodeYUV(byte[] dstBuf,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Encode the uncompressed source image associated with this compressor
|
||||
instance into a YUV planar image and return a <code>YUVImage</code>
|
||||
instance containing the encoded image. This method uses the accelerated
|
||||
color conversion routines in TurboJPEG's underlying codec but does not
|
||||
execute any of the other steps in the JPEG compression process. Encoding
|
||||
CMYK source images to YUV is not supported.</div>
|
||||
instance into a unified YUV planar image buffer and return a
|
||||
<code>YUVImage</code> instance containing the encoded image. This method
|
||||
uses the accelerated color conversion routines in TurboJPEG's underlying
|
||||
codec but does not execute any of the other steps in the JPEG compression
|
||||
process. Encoding CMYK source images to YUV is not supported.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>pad</code> - the width of each line in each plane of the YUV image will be
|
||||
padded to the nearest multiple of this number of bytes (must be a power of
|
||||
2.)</dd><dd><code>flags</code> - the bitwise OR of one or more of
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>a YUV planar image</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>a YUV planar image.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="encodeYUV(int[], int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>encodeYUV</h4>
|
||||
<pre>public <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> encodeYUV(int[] strides,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Encode the uncompressed source image associated with this compressor
|
||||
instance into separate Y, U (Cb), and V (Cr) image planes and return a
|
||||
<code>YUVImage</code> instance containing the encoded image planes. This
|
||||
method uses the accelerated color conversion routines in TurboJPEG's
|
||||
underlying codec but does not execute any of the other steps in the JPEG
|
||||
compression process. Encoding CMYK source images to YUV is not supported.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>strides</code> - an array of integers, each specifying the number of bytes
|
||||
per line in the corresponding plane of the output image. Setting the
|
||||
stride for any plane to 0 is the same as setting it to the component width
|
||||
of the plane. If <code>strides</code> is null, then the strides for all
|
||||
planes will be set to their respective component widths. You can adjust
|
||||
the strides in order to add an arbitrary amount of line padding to each
|
||||
plane.</dd><dd><code>flags</code> - the bitwise OR of one or more of
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>a YUV planar image.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -730,7 +767,7 @@ public void encodeYUV(byte[] dstBuf,
|
||||
<pre>@Deprecated
|
||||
public byte[] encodeYUV(int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int, int)"><code>encodeYUV(int, int)</code></a> instead.</i></div>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)"><code>encodeYUV(int, int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -747,8 +784,8 @@ public void encodeYUV(java.awt.image.BufferedImage srcImage,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[], int)"><code>encodeYUV(byte[], int)</code></a> instead.</i></div>
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(byte[],%20int)"><code>encodeYUV(byte[], int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -764,8 +801,8 @@ public byte[] encodeYUV(java.awt.image.BufferedImage srcImage,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage, int, int, int, int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int)"><code>encodeYUV(int)</code></a> instead.</i></div>
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#setSourceImage(java.awt.image.BufferedImage,%20int,%20int,%20int,%20int)"><code>setSourceImage(BufferedImage, int, int, int, int)</code></a> and
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCompressor.html#encodeYUV(int,%20int)"><code>encodeYUV(int, int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -778,9 +815,9 @@ public byte[] encodeYUV(java.awt.image.BufferedImage srcImage,
|
||||
<h4>getCompressedSize</h4>
|
||||
<pre>public int getCompressedSize()</pre>
|
||||
<div class="block">Returns the size of the image (in bytes) generated by the most recent
|
||||
compress/encode operation.</div>
|
||||
compress operation.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the size of the image (in bytes) generated by the most recent
|
||||
compress/encode operation</dd></dl>
|
||||
compress operation.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="close()">
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html#customFilter(java.nio.ShortBuffer, java.awt.Rectangle, java.awt.Rectangle, int, int, org.libjpegturbo.turbojpeg.TJTransform)">customFilter</a></strong>(java.nio.ShortBuffer coeffBuffer,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html#customFilter(java.nio.ShortBuffer,%20java.awt.Rectangle,%20java.awt.Rectangle,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJTransform)">customFilter</a></strong>(java.nio.ShortBuffer coeffBuffer,
|
||||
java.awt.Rectangle bufferRegion,
|
||||
java.awt.Rectangle planeRegion,
|
||||
int componentID,
|
||||
@@ -162,7 +162,7 @@
|
||||
<code>coeffBuffer</code> belongs (Y, Cb, and Cr have, respectively, ID's
|
||||
of 0, 1, and 2 in typical JPEG images.)</dd><dd><code>transformID</code> - ID number of the transformed image to which
|
||||
<code>coeffBuffer</code> belongs. This is the same as the index of the
|
||||
transform in the <code>transforms</code> array that was passed to <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><code>TJTransformer.transform()</code></a>.</dd><dd><code>transform</code> - a <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><code>TJTransform</code></a> instance that specifies the
|
||||
transform in the <code>transforms</code> array that was passed to <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a>.</dd><dd><code>transform</code> - a <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><code>TJTransform</code></a> instance that specifies the
|
||||
parameters and/or cropping region for this transform</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
|
||||
@@ -131,19 +131,19 @@ extends java.lang.Object</pre>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>protected int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#srcColorspace">srcColorspace</a></strong></code> </td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegColorspace">jpegColorspace</a></strong></code> </td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>protected int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#srcHeight">srcHeight</a></strong></code> </td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegHeight">jpegHeight</a></strong></code> </td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>protected int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#srcSubsamp">srcSubsamp</a></strong></code> </td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegSubsamp">jpegSubsamp</a></strong></code> </td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>protected int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#srcWidth">srcWidth</a></strong></code> </td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegWidth">jpegWidth</a></strong></code> </td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>protected <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td>
|
||||
@@ -175,7 +175,7 @@ extends java.lang.Object</pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor(byte[], int)">TJDecompressor</a></strong>(byte[] jpegImage,
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#TJDecompressor(byte[],%20int)">TJDecompressor</a></strong>(byte[] jpegImage,
|
||||
int imageSize)</code>
|
||||
<div class="block">Create a TurboJPEG decompressor instance and associate the JPEG source
|
||||
image of length <code>imageSize</code> bytes stored in
|
||||
@@ -212,7 +212,7 @@ extends java.lang.Object</pre>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(java.awt.image.BufferedImage, int)">decompress</a></strong>(java.awt.image.BufferedImage dstImage,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(java.awt.image.BufferedImage,%20int)">decompress</a></strong>(java.awt.image.BufferedImage dstImage,
|
||||
int flags)</code>
|
||||
<div class="block">Decompress the JPEG source image or decode the YUV source image associated
|
||||
with this decompressor instance and output a decompressed/decoded image to
|
||||
@@ -221,7 +221,7 @@ extends java.lang.Object</pre>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int)">decompress</a></strong>(byte[] dstBuf,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int)">decompress</a></strong>(byte[] dstBuf,
|
||||
int desiredWidth,
|
||||
int pitch,
|
||||
int desiredHeight,
|
||||
@@ -229,13 +229,13 @@ extends java.lang.Object</pre>
|
||||
int flags)</code>
|
||||
<div class="block"><strong>Deprecated.</strong>
|
||||
<div class="block"><i>Use
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)">decompress</a></strong>(byte[] dstBuf,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)">decompress</a></strong>(byte[] dstBuf,
|
||||
int x,
|
||||
int y,
|
||||
int desiredWidth,
|
||||
@@ -250,7 +250,7 @@ extends java.lang.Object</pre>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int[], int, int, int, int, int, int, int)">decompress</a></strong>(int[] dstBuf,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)">decompress</a></strong>(int[] dstBuf,
|
||||
int x,
|
||||
int y,
|
||||
int desiredWidth,
|
||||
@@ -265,7 +265,7 @@ extends java.lang.Object</pre>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>java.awt.image.BufferedImage</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int, int, int, int)">decompress</a></strong>(int desiredWidth,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int)">decompress</a></strong>(int desiredWidth,
|
||||
int desiredHeight,
|
||||
int bufferedImageType,
|
||||
int flags)</code>
|
||||
@@ -276,7 +276,7 @@ extends java.lang.Object</pre>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>byte[]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int, int, int, int, int)">decompress</a></strong>(int desiredWidth,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int,%20int)">decompress</a></strong>(int desiredWidth,
|
||||
int pitch,
|
||||
int desiredHeight,
|
||||
int pixelFormat,
|
||||
@@ -287,10 +287,10 @@ extends java.lang.Object</pre>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[], int)">decompressToYUV</a></strong>(byte[] dstBuf,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[],%20int)">decompressToYUV</a></strong>(byte[] dstBuf,
|
||||
int flags)</code>
|
||||
<div class="block"><strong>Deprecated.</strong>
|
||||
<div class="block"><i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage, int)"><code>decompressToYUV(YUVImage, int)</code></a> instead.</i></div>
|
||||
<div class="block"><i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)"><code>decompressToYUV(YUVImage, int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -298,128 +298,122 @@ extends java.lang.Object</pre>
|
||||
<td class="colFirst"><code>byte[]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)">decompressToYUV</a></strong>(int flags)</code>
|
||||
<div class="block"><strong>Deprecated.</strong>
|
||||
<div class="block"><i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int, int, int, int)"><code>decompressToYUV(int, int, int, int)</code></a> instead.</i></div>
|
||||
<div class="block"><i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)"><code>decompressToYUV(int, int, int, int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int, int, int, int)">decompressToYUV</a></strong>(int desiredWidth,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int[],%20int,%20int)">decompressToYUV</a></strong>(int desiredWidth,
|
||||
int[] strides,
|
||||
int desiredHeight,
|
||||
int flags)</code>
|
||||
<div class="block">Decompress the JPEG source image associated with this decompressor
|
||||
instance into a set of Y, U (Cb), and V (Cr) image planes and return a
|
||||
<code>YUVImage</code> instance containing the decompressed image planes.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)">decompressToYUV</a></strong>(int desiredWidth,
|
||||
int pad,
|
||||
int desiredHeight,
|
||||
int flags)</code>
|
||||
<div class="block">Decompress the JPEG source image associated with this decompressor
|
||||
instance into a YUV planar image and return a <code>YUVImage</code>
|
||||
instance containing the decompressed image.</div>
|
||||
instance into a unified YUV planar image buffer and return a
|
||||
<code>YUVImage</code> instance containing the decompressed image.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage, int)">decompressToYUV</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> dstImage,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)">decompressToYUV</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> dstImage,
|
||||
int flags)</code>
|
||||
<div class="block">Decompress the JPEG source image associated with this decompressor
|
||||
instance into a YUV planar image and store it in the given
|
||||
<code>YUVImage</code> instance.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>protected void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#finalize()">finalize</a></strong>()</code> </td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getColorspace()">getColorspace</a></strong>()</code>
|
||||
<div class="block">Returns the colorspace used in the source image (JPEG or YUV) associated
|
||||
with this decompressor instance.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getHeight()">getHeight</a></strong>()</code>
|
||||
<div class="block">Returns the height of the source image (JPEG or YUV) associated with this
|
||||
decompressor instance.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>byte[]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGBuf()">getJPEGBuf</a></strong>()</code>
|
||||
<div class="block"><strong>Deprecated.</strong>
|
||||
<div class="block"><i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSourceBuf()"><code>getSourceBuf()</code></a> instead.</i></div>
|
||||
</div>
|
||||
<div class="block">Returns the JPEG image buffer associated with this decompressor instance.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGSize()">getJPEGSize</a></strong>()</code>
|
||||
<div class="block">Returns the size of the JPEG image (in bytes) associated with this
|
||||
decompressor instance.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGSize()">getJPEGSize</a></strong>()</code>
|
||||
<div class="block"><strong>Deprecated.</strong>
|
||||
<div class="block"><i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSourceSize()"><code>getSourceSize()</code></a> instead.</i></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int, int)">getScaledHeight</a></strong>(int desiredWidth,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int,%20int)">getScaledHeight</a></strong>(int desiredWidth,
|
||||
int desiredHeight)</code>
|
||||
<div class="block">Returns the height of the largest scaled-down image that the TurboJPEG
|
||||
decompressor can generate without exceeding the desired image width and
|
||||
height.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int, int)">getScaledWidth</a></strong>(int desiredWidth,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int,%20int)">getScaledWidth</a></strong>(int desiredWidth,
|
||||
int desiredHeight)</code>
|
||||
<div class="block">Returns the width of the largest scaled-down image that the TurboJPEG
|
||||
decompressor can generate without exceeding the desired image width and
|
||||
height.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>byte[]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSourceBuf()">getSourceBuf</a></strong>()</code>
|
||||
<div class="block">Returns the source image buffer associated with this decompressor
|
||||
instance.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSourceSize()">getSourceSize</a></strong>()</code>
|
||||
<div class="block">Returns the size of the source image (in bytes) associated with this
|
||||
decompressor instance.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSubsamp()">getSubsamp</a></strong>()</code>
|
||||
<div class="block">Returns the level of chrominance subsampling used in the source image
|
||||
(JPEG or YUV) associated with this decompressor instance.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getWidth()">getWidth</a></strong>()</code>
|
||||
<div class="block">Returns the width of the source image (JPEG or YUV) associated with this
|
||||
decompressor instance.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[], int)">setJPEGImage</a></strong>(byte[] jpegImage,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[],%20int)">setJPEGImage</a></strong>(byte[] jpegImage,
|
||||
int imageSize)</code>
|
||||
<div class="block"><strong>Deprecated.</strong>
|
||||
<div class="block"><i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[], int)"><code>setSourceImage(byte[], int)</code></a> instead.</i></div>
|
||||
<div class="block"><i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)"><code>setSourceImage(byte[], int)</code></a> instead.</i></div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[], int)">setSourceImage</a></strong>(byte[] srcImage,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)">setSourceImage</a></strong>(byte[] jpegImage,
|
||||
int imageSize)</code>
|
||||
<div class="block">Associate the JPEG image of length <code>imageSize</code> bytes stored in
|
||||
<code>srcImage</code> with this decompressor instance.</div>
|
||||
<code>jpegImage</code> with this decompressor instance.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">setSourceImage</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> srcImage)</code>
|
||||
<div class="block">Associate the specified YUV planar source image with this decompressor
|
||||
@@ -484,40 +478,40 @@ extends java.lang.Object</pre>
|
||||
<pre>protected <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> yuvImage</pre>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="srcWidth">
|
||||
<a name="jpegWidth">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>srcWidth</h4>
|
||||
<pre>protected int srcWidth</pre>
|
||||
<h4>jpegWidth</h4>
|
||||
<pre>protected int jpegWidth</pre>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="srcHeight">
|
||||
<a name="jpegHeight">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>srcHeight</h4>
|
||||
<pre>protected int srcHeight</pre>
|
||||
<h4>jpegHeight</h4>
|
||||
<pre>protected int jpegHeight</pre>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="srcSubsamp">
|
||||
<a name="jpegSubsamp">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>srcSubsamp</h4>
|
||||
<pre>protected int srcSubsamp</pre>
|
||||
<h4>jpegSubsamp</h4>
|
||||
<pre>protected int jpegSubsamp</pre>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="srcColorspace">
|
||||
<a name="jpegColorspace">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockListLast">
|
||||
<li class="blockList">
|
||||
<h4>srcColorspace</h4>
|
||||
<pre>protected int srcColorspace</pre>
|
||||
<h4>jpegColorspace</h4>
|
||||
<pre>protected int jpegColorspace</pre>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
@@ -605,13 +599,13 @@ extends java.lang.Object</pre>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>setSourceImage</h4>
|
||||
<pre>public void setSourceImage(byte[] srcImage,
|
||||
<pre>public void setSourceImage(byte[] jpegImage,
|
||||
int imageSize)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Associate the JPEG image of length <code>imageSize</code> bytes stored in
|
||||
<code>srcImage</code> with this decompressor instance. This image will
|
||||
<code>jpegImage</code> with this decompressor instance. This image will
|
||||
be used as the source image for subsequent decompress operations.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>srcImage</code> - JPEG image buffer</dd><dd><code>imageSize</code> - size of the JPEG image (in bytes)</dd>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>jpegImage</code> - JPEG image buffer</dd><dd><code>imageSize</code> - size of the JPEG image (in bytes)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -626,7 +620,7 @@ extends java.lang.Object</pre>
|
||||
public void setJPEGImage(byte[] jpegImage,
|
||||
int imageSize)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[], int)"><code>setSourceImage(byte[], int)</code></a> instead.</i></div>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)"><code>setSourceImage(byte[], int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -659,7 +653,7 @@ public void setJPEGImage(byte[] jpegImage,
|
||||
<div class="block">Returns the width of the source image (JPEG or YUV) associated with this
|
||||
decompressor instance.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the width of the source image (JPEG or YUV) associated with this
|
||||
decompressor instance</dd>
|
||||
decompressor instance.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -675,7 +669,7 @@ public void setJPEGImage(byte[] jpegImage,
|
||||
<div class="block">Returns the height of the source image (JPEG or YUV) associated with this
|
||||
decompressor instance.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the height of the source image (JPEG or YUV) associated with this
|
||||
decompressor instance</dd>
|
||||
decompressor instance.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -692,7 +686,7 @@ public void setJPEGImage(byte[] jpegImage,
|
||||
(JPEG or YUV) associated with this decompressor instance. See
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the level of chrominance subsampling used in the source image
|
||||
(JPEG or YUV) associated with this decompressor instance</dd>
|
||||
(JPEG or YUV) associated with this decompressor instance.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -709,22 +703,7 @@ public void setJPEGImage(byte[] jpegImage,
|
||||
with this decompressor instance. See <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_RGB"><code>TJ.CS_*</code></a>. If the
|
||||
source image is YUV, then this always returns <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#CS_YCbCr"><code>TJ.CS_YCbCr</code></a>.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the colorspace used in the source image (JPEG or YUV) associated
|
||||
with this decompressor instance</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getSourceBuf()">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getSourceBuf</h4>
|
||||
<pre>public byte[] getSourceBuf()
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Returns the source image buffer associated with this decompressor
|
||||
instance.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the source image buffer associated with this decompressor instance</dd>
|
||||
with this decompressor instance.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -735,26 +714,10 @@ public void setJPEGImage(byte[] jpegImage,
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getJPEGBuf</h4>
|
||||
<pre>@Deprecated
|
||||
public byte[] getJPEGBuf()
|
||||
<pre>public byte[] getJPEGBuf()
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSourceBuf()"><code>getSourceBuf()</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getSourceSize()">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getSourceSize</h4>
|
||||
<pre>public int getSourceSize()
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Returns the size of the source image (in bytes) associated with this
|
||||
decompressor instance.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the size of the source image (in bytes) associated with this
|
||||
decompressor instance</dd>
|
||||
<div class="block">Returns the JPEG image buffer associated with this decompressor instance.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the JPEG image buffer associated with this decompressor instance.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -765,11 +728,13 @@ public byte[] getJPEGBuf()
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getJPEGSize</h4>
|
||||
<pre>@Deprecated
|
||||
public int getJPEGSize()
|
||||
<pre>public int getJPEGSize()
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSourceSize()"><code>getSourceSize()</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<div class="block">Returns the size of the JPEG image (in bytes) associated with this
|
||||
decompressor instance.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the size of the JPEG image (in bytes) associated with this
|
||||
decompressor instance.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -794,7 +759,7 @@ public int getJPEGSize()
|
||||
the scaled image size.)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the width of the largest scaled-down image that the TurboJPEG
|
||||
decompressor can generate without exceeding the desired image width and
|
||||
height</dd>
|
||||
height.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -820,7 +785,7 @@ public int getJPEGSize()
|
||||
the scaled image size.)</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>the height of the largest scaled-down image that the TurboJPEG
|
||||
decompressor can generate without exceeding the desired image width and
|
||||
height</dd>
|
||||
height.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -848,7 +813,7 @@ public int getJPEGSize()
|
||||
<code>pitch * scaledHeight</code> bytes in size, where
|
||||
<code>scaledHeight</code> can be determined by calling <code>
|
||||
scalingFactor.<a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)"><code>getScaled</code></a>(jpegHeight)
|
||||
</code> with one of the scaling factors returned from <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getScalingFactors()"><code>TJ.getScalingFactors()</code></a> or by calling <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int, int)"><code>getScaledHeight(int, int)</code></a>. If the
|
||||
</code> with one of the scaling factors returned from <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getScalingFactors()"><code>TJ.getScalingFactors()</code></a> or by calling <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int,%20int)"><code>getScaledHeight(int, int)</code></a>. If the
|
||||
source image is a YUV image, then this buffer should normally be
|
||||
<code>pitch * height</code> bytes in size, where <code>height</code> is
|
||||
the height of the YUV image. However, the buffer may also be larger than
|
||||
@@ -872,7 +837,7 @@ public int getJPEGSize()
|
||||
if the source image is a JPEG image, then <code>scaledWidth</code> can be
|
||||
determined by calling <code>
|
||||
scalingFactor.<a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)"><code>getScaled</code></a>(jpegWidth)
|
||||
</code> or by calling <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int, int)"><code>getScaledWidth(int, int)</code></a>. If the source image is a
|
||||
</code> or by calling <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int,%20int)"><code>getScaledWidth(int, int)</code></a>. If the source image is a
|
||||
YUV image, then <code>scaledWidth</code> is the width of the YUV image.
|
||||
Setting this parameter to 0 is the equivalent of setting it to
|
||||
<code>scaledWidth * TJ.pixelSize(pixelFormat)</code>.</dd><dd><code>desiredHeight</code> - If the source image is a JPEG image, then this
|
||||
@@ -905,7 +870,7 @@ public void decompress(byte[] dstBuf,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -925,15 +890,15 @@ public void decompress(byte[] dstBuf,
|
||||
<div class="block">Decompress the JPEG source image associated with this decompressor
|
||||
instance and return a buffer containing the decompressed image.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>desiredWidth</code> - see
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a>
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a>
|
||||
for description</dd><dd><code>pitch</code> - see
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a>
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a>
|
||||
for description</dd><dd><code>desiredHeight</code> - see
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a>
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a>
|
||||
for description</dd><dd><code>pixelFormat</code> - pixel format of the decompressed image (one of
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#PF_RGB"><code>TJ.PF_*</code></a>)</dd><dd><code>flags</code> - the bitwise OR of one or more of
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>a buffer containing the decompressed image</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>a buffer containing the decompressed image.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -974,11 +939,54 @@ public void decompress(byte[] dstBuf,
|
||||
public void decompressToYUV(byte[] dstBuf,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage, int)"><code>decompressToYUV(YUVImage, int)</code></a> instead.</i></div>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)"><code>decompressToYUV(YUVImage, int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="decompressToYUV(int, int[], int, int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>decompressToYUV</h4>
|
||||
<pre>public <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a> decompressToYUV(int desiredWidth,
|
||||
int[] strides,
|
||||
int desiredHeight,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Decompress the JPEG source image associated with this decompressor
|
||||
instance into a set of Y, U (Cb), and V (Cr) image planes and return a
|
||||
<code>YUVImage</code> instance containing the decompressed image planes.
|
||||
This method performs JPEG decompression but leaves out the color
|
||||
conversion step, so a planar YUV image is generated instead of an RGB or
|
||||
grayscale image. This method cannot be used to decompress JPEG source
|
||||
images with the CMYK or YCCK colorspace.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>desiredWidth</code> - desired width (in pixels) of the YUV image. If the
|
||||
desired image dimensions are different than the dimensions of the JPEG
|
||||
image being decompressed, then TurboJPEG will use scaling in the JPEG
|
||||
decompressor to generate the largest possible image that will fit within
|
||||
the desired dimensions. Setting this to 0 is the same as setting it to
|
||||
the width of the JPEG image (in other words, the width will not be
|
||||
considered when determining the scaled image size.)</dd><dd><code>strides</code> - an array of integers, each specifying the number of bytes
|
||||
per line in the corresponding plane of the output image. Setting the
|
||||
stride for any plane to 0 is the same as setting it to the scaled
|
||||
component width of the plane. If <tt>strides</tt> is NULL, then the
|
||||
strides for all planes will be set to their respective scaled component
|
||||
widths. You can adjust the strides in order to add an arbitrary amount of
|
||||
line padding to each plane.</dd><dd><code>desiredHeight</code> - desired height (in pixels) of the YUV image. If the
|
||||
desired image dimensions are different than the dimensions of the JPEG
|
||||
image being decompressed, then TurboJPEG will use scaling in the JPEG
|
||||
decompressor to generate the largest possible image that will fit within
|
||||
the desired dimensions. Setting this to 0 is the same as setting it to
|
||||
the height of the JPEG image (in other words, the height will not be
|
||||
considered when determining the scaled image size.)</dd><dd><code>flags</code> - the bitwise OR of one or more of
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>a YUV planar image.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="decompressToYUV(int, int, int, int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
@@ -991,12 +999,12 @@ public void decompressToYUV(byte[] dstBuf,
|
||||
int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Decompress the JPEG source image associated with this decompressor
|
||||
instance into a YUV planar image and return a <code>YUVImage</code>
|
||||
instance containing the decompressed image. This method performs JPEG
|
||||
decompression but leaves out the color conversion step, so a planar YUV
|
||||
image is generated instead of an RGB or grayscale image. This method
|
||||
cannot be used to decompress JPEG source images with the CMYK or YCCK
|
||||
colorspace.</div>
|
||||
instance into a unified YUV planar image buffer and return a
|
||||
<code>YUVImage</code> instance containing the decompressed image. This
|
||||
method performs JPEG decompression but leaves out the color conversion
|
||||
step, so a planar YUV image is generated instead of an RGB or grayscale
|
||||
image. This method cannot be used to decompress JPEG source images with
|
||||
the CMYK or YCCK colorspace.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>desiredWidth</code> - desired width (in pixels) of the YUV image. If the
|
||||
desired image dimensions are different than the dimensions of the JPEG
|
||||
image being decompressed, then TurboJPEG will use scaling in the JPEG
|
||||
@@ -1013,7 +1021,7 @@ public void decompressToYUV(byte[] dstBuf,
|
||||
the height of the JPEG image (in other words, the height will not be
|
||||
considered when determining the scaled image size.)</dd><dd><code>flags</code> - the bitwise OR of one or more of
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>a YUV planar image</dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>a YUV planar image.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -1027,7 +1035,7 @@ public void decompressToYUV(byte[] dstBuf,
|
||||
<pre>@Deprecated
|
||||
public byte[] decompressToYUV(int flags)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int, int, int, int)"><code>decompressToYUV(int, int, int, int)</code></a> instead.</i></div>
|
||||
<div class="block"><span class="strong">Deprecated.</span> <i>Use <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)"><code>decompressToYUV(int, int, int, int)</code></a> instead.</i></div>
|
||||
<dl><dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -1055,7 +1063,7 @@ public byte[] decompressToYUV(int flags)
|
||||
<code>stride * scaledHeight</code> pixels in size, where
|
||||
<code>scaledHeight</code> can be determined by calling <code>
|
||||
scalingFactor.<a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)"><code>getScaled</code></a>(jpegHeight)
|
||||
</code> with one of the scaling factors returned from <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getScalingFactors()"><code>TJ.getScalingFactors()</code></a> or by calling <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int, int)"><code>getScaledHeight(int, int)</code></a>. If the
|
||||
</code> with one of the scaling factors returned from <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getScalingFactors()"><code>TJ.getScalingFactors()</code></a> or by calling <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int,%20int)"><code>getScaledHeight(int, int)</code></a>. If the
|
||||
source image is a YUV image, then this buffer should normally be
|
||||
<code>stride * height</code> pixels in size, where <code>height</code> is
|
||||
the height of the YUV image. However, the buffer may also be larger than
|
||||
@@ -1077,7 +1085,7 @@ public byte[] decompressToYUV(int flags)
|
||||
NOTE: if the source image is a JPEG image, then <code>scaledWidth</code>
|
||||
can be determined by calling <code>
|
||||
scalingFactor.<a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#getScaled(int)"><code>getScaled</code></a>(jpegWidth)
|
||||
</code> or by calling <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int, int)"><code>getScaledWidth(int, int)</code></a>. If the source image is a
|
||||
</code> or by calling <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int,%20int)"><code>getScaledWidth(int, int)</code></a>. If the source image is a
|
||||
YUV image, then <code>scaledWidth</code> is the width of the YUV image.
|
||||
Setting this parameter to 0 is the equivalent of setting it to
|
||||
<code>scaledWidth</code>.</dd><dd><code>desiredHeight</code> - If the source image is a JPEG image, then this
|
||||
@@ -1134,15 +1142,15 @@ public byte[] decompressToYUV(int flags)
|
||||
with this decompressor instance and return a <code>BufferedImage</code>
|
||||
instance containing the decompressed/decoded image.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>desiredWidth</code> - see
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a> for
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a> for
|
||||
description</dd><dd><code>desiredHeight</code> - see
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a> for
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)"><code>decompress(byte[], int, int, int, int, int, int, int)</code></a> for
|
||||
description</dd><dd><code>bufferedImageType</code> - the image type of the <code>BufferedImage</code>
|
||||
instance that will be created (for instance,
|
||||
<code>BufferedImage.TYPE_INT_RGB</code>)</dd><dd><code>flags</code> - the bitwise OR of one or more of
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>a <code>BufferedImage</code> instance containing the
|
||||
decompressed/decoded image</dd>
|
||||
decompressed/decoded image.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
|
||||
@@ -113,7 +113,7 @@ extends java.lang.Object</pre>
|
||||
<th class="colOne" scope="col">Constructor and Description</th>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#TJScalingFactor(int, int)">TJScalingFactor</a></strong>(int num,
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJScalingFactor.html#TJScalingFactor(int,%20int)">TJScalingFactor</a></strong>(int num,
|
||||
int denom)</code> </td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -238,7 +238,7 @@ extends java.lang.Object</pre>
|
||||
<div class="block">Returns the scaled value of <code>dimension</code>. This function
|
||||
performs the integer equivalent of
|
||||
<code>ceil(dimension * scalingFactor)</code>.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the scaled value of <code>dimension</code></dd></dl>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the scaled value of <code>dimension</code>.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="equals(org.libjpegturbo.turbojpeg.TJScalingFactor)">
|
||||
@@ -251,7 +251,7 @@ extends java.lang.Object</pre>
|
||||
<div class="block">Returns true or false, depending on whether this instance and
|
||||
<code>other</code> have the same numerator and denominator.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>true or false, depending on whether this instance and
|
||||
<code>other</code> have the same numerator and denominator</dd></dl>
|
||||
<code>other</code> have the same numerator and denominator.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="isOne()">
|
||||
@@ -264,7 +264,7 @@ extends java.lang.Object</pre>
|
||||
<div class="block">Returns true or false, depending on whether this instance is equal to
|
||||
1/1.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>true or false, depending on whether this instance is equal to
|
||||
1/1</dd></dl>
|
||||
1/1.</dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -231,14 +231,14 @@ extends java.awt.Rectangle</pre>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_NOOUTPUT">OPT_NOOUTPUT</a></strong></code>
|
||||
<div class="block">This option will prevent <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><code>TJTransformer.transform()</code></a> from outputting a JPEG image for this
|
||||
<div class="block">This option will prevent <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a> from outputting a JPEG image for this
|
||||
particular transform.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>static int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#OPT_PERFECT">OPT_PERFECT</a></strong></code>
|
||||
<div class="block">This option will cause <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><code>TJTransformer.transform()</code></a> to throw an exception if the transform is not
|
||||
<div class="block">This option will cause <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a> to throw an exception if the transform is not
|
||||
perfect.</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -289,7 +289,7 @@ extends java.awt.Rectangle</pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(int, int, int, int, int, int, org.libjpegturbo.turbojpeg.TJCustomFilter)">TJTransform</a></strong>(int x,
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(int,%20int,%20int,%20int,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJCustomFilter)">TJTransform</a></strong>(int x,
|
||||
int y,
|
||||
int w,
|
||||
int h,
|
||||
@@ -300,7 +300,7 @@ extends java.awt.Rectangle</pre>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(java.awt.Rectangle, int, int, org.libjpegturbo.turbojpeg.TJCustomFilter)">TJTransform</a></strong>(java.awt.Rectangle r,
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(java.awt.Rectangle,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJCustomFilter)">TJTransform</a></strong>(java.awt.Rectangle r,
|
||||
int op,
|
||||
int options,
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg">TJCustomFilter</a> cf)</code>
|
||||
@@ -486,7 +486,7 @@ extends java.awt.Rectangle</pre>
|
||||
<li class="blockList">
|
||||
<h4>OPT_PERFECT</h4>
|
||||
<pre>public static final int OPT_PERFECT</pre>
|
||||
<div class="block">This option will cause <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><code>TJTransformer.transform()</code></a> to throw an exception if the transform is not
|
||||
<div class="block">This option will cause <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a> to throw an exception if the transform is not
|
||||
perfect. Lossless transforms operate on MCU blocks, whose size depends on
|
||||
the level of chrominance subsampling used. If the image's width or height
|
||||
is not evenly divisible by the MCU block size (see <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#getMCUWidth(int)"><code>TJ.getMCUWidth(int)</code></a>
|
||||
@@ -541,7 +541,7 @@ extends java.awt.Rectangle</pre>
|
||||
<li class="blockList">
|
||||
<h4>OPT_NOOUTPUT</h4>
|
||||
<pre>public static final int OPT_NOOUTPUT</pre>
|
||||
<div class="block">This option will prevent <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)"><code>TJTransformer.transform()</code></a> from outputting a JPEG image for this
|
||||
<div class="block">This option will prevent <a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)"><code>TJTransformer.transform()</code></a> from outputting a JPEG image for this
|
||||
particular transform. This can be used in conjunction with a custom
|
||||
filter to capture the transformed DCT coefficients without transcoding
|
||||
them.</div>
|
||||
@@ -636,7 +636,7 @@ extends java.awt.Rectangle</pre>
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Create a new lossless transform instance with the given parameters.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>r</code> - a <code>Rectangle</code> instance that specifies the cropping
|
||||
region. See <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(int, int, int, int, int, int, org.libjpegturbo.turbojpeg.TJCustomFilter)"><code>TJTransform(int, int, int, int, int, int, TJCustomFilter)</code></a> for more
|
||||
region. See <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html#TJTransform(int,%20int,%20int,%20int,%20int,%20int,%20org.libjpegturbo.turbojpeg.TJCustomFilter)"><code>TJTransform(int, int, int, int, int, int, TJCustomFilter)</code></a> for more
|
||||
detail.</dd><dd><code>op</code> - one of the transform operations (<code>OP_*</code>)</dd><dd><code>options</code> - the bitwise OR of one or more of the transform options
|
||||
(<code>OPT_*</code>)</dd><dd><code>cf</code> - an instance of an object that implements the <a href="../../../org/libjpegturbo/turbojpeg/TJCustomFilter.html" title="interface in org.libjpegturbo.turbojpeg"><code>TJCustomFilter</code></a> interface, or null if no custom filter is needed</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
|
||||
@@ -117,7 +117,7 @@ extends <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title=
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Fields inherited from class org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></h3>
|
||||
<code><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#handle">handle</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBuf">jpegBuf</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBufSize">jpegBufSize</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#srcColorspace">srcColorspace</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#srcHeight">srcHeight</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#srcSubsamp">srcSubsamp</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#srcWidth">srcWidth</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#yuvImage">yuvImage</a></code></li>
|
||||
<code><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#handle">handle</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBuf">jpegBuf</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegBufSize">jpegBufSize</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegColorspace">jpegColorspace</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegHeight">jpegHeight</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegSubsamp">jpegSubsamp</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#jpegWidth">jpegWidth</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#yuvImage">yuvImage</a></code></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -144,7 +144,7 @@ extends <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title=
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[], int)">TJTransformer</a></strong>(byte[] jpegImage,
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#TJTransformer(byte[],%20int)">TJTransformer</a></strong>(byte[] jpegImage,
|
||||
int imageSize)</code>
|
||||
<div class="block">Create a TurboJPEG lossless transformer instance and associate the JPEG
|
||||
image of length <code>imageSize</code> bytes stored in
|
||||
@@ -175,7 +175,7 @@ extends <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title=
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][], org.libjpegturbo.turbojpeg.TJTransform[], int)">transform</a></strong>(byte[][] dstBufs,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(byte[][],%20org.libjpegturbo.turbojpeg.TJTransform[],%20int)">transform</a></strong>(byte[][] dstBufs,
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a>[] transforms,
|
||||
int flags)</code>
|
||||
<div class="block">Losslessly transform the JPEG image associated with this transformer
|
||||
@@ -185,7 +185,7 @@ extends <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title=
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a>[]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(org.libjpegturbo.turbojpeg.TJTransform[], int)">transform</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a>[] transforms,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/TJTransformer.html#transform(org.libjpegturbo.turbojpeg.TJTransform[],%20int)">transform</a></strong>(<a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg">TJTransform</a>[] transforms,
|
||||
int flags)</code>
|
||||
<div class="block">Losslessly transform the JPEG image associated with this transformer
|
||||
instance and return an array of <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><code>TJDecompressor</code></a> instances, each of
|
||||
@@ -198,7 +198,7 @@ extends <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title=
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Methods inherited from class org.libjpegturbo.turbojpeg.<a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg">TJDecompressor</a></h3>
|
||||
<code><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#close()">close</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(java.awt.image.BufferedImage, int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[], int, int, int, int, int, int, int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int[], int, int, int, int, int, int, int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int, int, int, int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int, int, int, int, int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[], int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int, int, int, int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage, int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#finalize()">finalize</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getColorspace()">getColorspace</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getHeight()">getHeight</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGBuf()">getJPEGBuf</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGSize()">getJPEGSize</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int, int)">getScaledHeight</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int, int)">getScaledWidth</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSourceBuf()">getSourceBuf</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSourceSize()">getSourceSize</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSubsamp()">getSubsamp</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getWidth()">getWidth</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[], int)">setJPEGImage</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[], int)">setSourceImage</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">setSourceImage</a></code></li>
|
||||
<code><a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#close()">close</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(java.awt.image.BufferedImage,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(byte[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int[],%20int,%20int,%20int,%20int,%20int,%20int,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompress(int,%20int,%20int,%20int,%20int)">decompress</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(byte[],%20int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int[],%20int,%20int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(int,%20int,%20int,%20int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#decompressToYUV(org.libjpegturbo.turbojpeg.YUVImage,%20int)">decompressToYUV</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#finalize()">finalize</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getColorspace()">getColorspace</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getHeight()">getHeight</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGBuf()">getJPEGBuf</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getJPEGSize()">getJPEGSize</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledHeight(int,%20int)">getScaledHeight</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getScaledWidth(int,%20int)">getScaledWidth</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getSubsamp()">getSubsamp</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#getWidth()">getWidth</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setJPEGImage(byte[],%20int)">setJPEGImage</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(byte[],%20int)">setSourceImage</a>, <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html#setSourceImage(org.libjpegturbo.turbojpeg.YUVImage)">setSourceImage</a></code></li>
|
||||
</ul>
|
||||
<ul class="blockList">
|
||||
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
|
||||
@@ -299,7 +299,7 @@ extends <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title=
|
||||
read the source coefficients multiple times.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>dstBufs</code> - an array of image buffers. <code>dstbufs[i]</code> will
|
||||
receive a JPEG image that has been transformed using the parameters in
|
||||
<code>transforms[i]</code>. Use <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int, int, int)"><code>TJ.bufSize(int, int, int)</code></a> to determine the
|
||||
<code>transforms[i]</code>. Use <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSize(int,%20int,%20int)"><code>TJ.bufSize(int, int, int)</code></a> to determine the
|
||||
maximum size for each buffer based on the transformed or cropped width and
|
||||
height and the level of subsampling used in the source image.</dd><dd><code>transforms</code> - an array of <a href="../../../org/libjpegturbo/turbojpeg/TJTransform.html" title="class in org.libjpegturbo.turbojpeg"><code>TJTransform</code></a> instances, each of
|
||||
which specifies the transform parameters and/or cropping region for the
|
||||
@@ -326,7 +326,7 @@ extends <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title=
|
||||
corresponding transformed output image</dd><dd><code>flags</code> - the bitwise OR of one or more of
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#FLAG_BOTTOMUP"><code>TJ.FLAG_*</code></a></dd>
|
||||
<dt><span class="strong">Returns:</span></dt><dd>an array of <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title="class in org.libjpegturbo.turbojpeg"><code>TJDecompressor</code></a> instances, each of
|
||||
which has a transformed JPEG image associated with it</dd>
|
||||
which has a transformed JPEG image associated with it.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -342,7 +342,7 @@ extends <a href="../../../org/libjpegturbo/turbojpeg/TJDecompressor.html" title=
|
||||
<div class="block">Returns an array containing the sizes of the transformed JPEG images
|
||||
generated by the most recent transform operation.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>an array containing the sizes of the transformed JPEG images
|
||||
generated by the most recent transform operation</dd>
|
||||
generated by the most recent transform operation.</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
<br>
|
||||
<pre>public class <span class="strong">YUVImage</span>
|
||||
extends java.lang.Object</pre>
|
||||
<div class="block">This class encapsulates a YUV planar image buffer and the metadata
|
||||
<div class="block">This class encapsulates a YUV planar image and the metadata
|
||||
associated with it. The TurboJPEG API allows both the JPEG compression and
|
||||
decompression pipelines to be split into stages: YUV encode, compress from
|
||||
YUV, decompress to YUV, and YUV decode. A <code>YUVImage</code> instance
|
||||
@@ -105,18 +105,26 @@ extends java.lang.Object</pre>
|
||||
Technically, the JPEG format uses the YCbCr colorspace (which technically is
|
||||
not a "colorspace" but rather a "color transform"), but per the convention
|
||||
of the digital video community, the TurboJPEG API uses "YUV" to refer to an
|
||||
image format consisting of Y, Cb, and Cr image planes. In this image
|
||||
format, the Y, Cb (U), and Cr (V) planes are stored sequentially in the same
|
||||
image buffer, and the size of each plane is determined by the image width,
|
||||
height, line padding, and level of chrominance subsampling. If the
|
||||
chrominance components are subsampled along the horizontal dimension, then
|
||||
the width of the luminance plane would be padded to the nearest multiple of
|
||||
2 (same goes for the height of the luminance plane, if the chrominance
|
||||
components are subsampled along the vertical dimension.) For instance, if
|
||||
the source image is 35 x 35 pixels and 4:2:2 subsampling is used, then the
|
||||
luminance plane would be 36 x 35 bytes, and each of the chrominance planes
|
||||
would be 18 x 35 bytes. If you specify, for instance, a line padding of 4
|
||||
bytes on top of this, then the luminance plane would be 36 x 35 bytes, and
|
||||
image format consisting of Y, Cb, and Cr image planes.
|
||||
<p>
|
||||
Each plane is simply a 2D array of bytes, each byte representing the value
|
||||
of one of the components (Y, Cb, or Cr) at a particular location in the
|
||||
image. The width and height of each plane are determined by the image
|
||||
width, height, and level of chrominance subsampling. The luminance plane
|
||||
width is the image width padded to the nearest multiple of the horizontal
|
||||
subsampling factor (2 in the case of 4:2:0 and 4:2:2, 4 in the case of
|
||||
4:1:1, 1 in the case of 4:4:4 or grayscale.) Similarly, the luminance plane
|
||||
height is the image height padded to the nearest multiple of the vertical
|
||||
subsampling factor (2 in the case of 4:2:0 or 4:4:0, 1 in the case of 4:4:4
|
||||
or grayscale.) The chrominance plane width is equal to the luminance plane
|
||||
width divided by the horizontal subsampling factor, and the chrominance
|
||||
plane height is equal to the luminance plane height divided by the vertical
|
||||
subsampling factor.
|
||||
<p>
|
||||
For example, if the source image is 35 x 35 pixels and 4:2:2 subsampling is
|
||||
used, then the luminance plane would be 36 x 35 bytes, and each of the
|
||||
chrominance planes would be 18 x 35 bytes. If you specify a line padding of
|
||||
4 bytes on top of this, then the luminance plane would be 36 x 35 bytes, and
|
||||
each of the chrominance planes would be 20 x 35 bytes.</div>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -141,18 +149,26 @@ extends java.lang.Object</pre>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#handle">handle</a></strong></code> </td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>protected byte[]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvBuf">yuvBuf</a></strong></code> </td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>protected int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvHeight">yuvHeight</a></strong></code> </td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>protected int[]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvOffsets">yuvOffsets</a></strong></code> </td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>protected int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvPad">yuvPad</a></strong></code> </td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>protected byte[][]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvPlanes">yuvPlanes</a></strong></code> </td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>protected int[]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvStrides">yuvStrides</a></strong></code> </td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>protected int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#yuvSubsamp">yuvSubsamp</a></strong></code> </td>
|
||||
</tr>
|
||||
@@ -175,21 +191,42 @@ extends java.lang.Object</pre>
|
||||
<th class="colOne" scope="col">Constructor and Description</th>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(byte[], int, int, int, int)">YUVImage</a></strong>(byte[] yuvImage,
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(byte[][],%20int[],%20int,%20int[],%20int,%20int)">YUVImage</a></strong>(byte[][] planes,
|
||||
int[] offsets,
|
||||
int width,
|
||||
int[] strides,
|
||||
int height,
|
||||
int subsamp)</code>
|
||||
<div class="block">Create a new <code>YUVImage</code> instance from a set of existing image
|
||||
planes.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(byte[],%20int,%20int,%20int,%20int)">YUVImage</a></strong>(byte[] yuvImage,
|
||||
int width,
|
||||
int pad,
|
||||
int height,
|
||||
int subsamp)</code>
|
||||
<div class="block">Create a <code>YUVImage</code> instance from an existing YUV planar image
|
||||
<div class="block">Create a new <code>YUVImage</code> instance from an existing unified image
|
||||
buffer.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(int,%20int[],%20int,%20int)">YUVImage</a></strong>(int width,
|
||||
int[] strides,
|
||||
int height,
|
||||
int subsamp)</code>
|
||||
<div class="block">Create a new <code>YUVImage</code> instance backed by separate image
|
||||
planes, and allocate memory for the image planes.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(int, int, int, int)">YUVImage</a></strong>(int width,
|
||||
<td class="colOne"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#YUVImage(int,%20int,%20int,%20int)">YUVImage</a></strong>(int width,
|
||||
int pad,
|
||||
int height,
|
||||
int subsamp)</code>
|
||||
<div class="block">Create a <code>YUVImage</code> instance with a new image buffer.</div>
|
||||
<div class="block">Create a new <code>YUVImage</code> instance backed by a unified image
|
||||
buffer, and allocate memory for the image buffer.</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -210,48 +247,80 @@ extends java.lang.Object</pre>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>byte[]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getBuf()">getBuf</a></strong>()</code>
|
||||
<div class="block">Returns the YUV image buffer</div>
|
||||
<div class="block">Returns the YUV image buffer (if this image is stored in a unified
|
||||
buffer rather than separate image planes.)</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getHeight()">getHeight</a></strong>()</code>
|
||||
<div class="block">Returns the height of the YUV image.</div>
|
||||
<div class="block">Returns the height of the YUV image (or subregion.)</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>int[]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getOffsets()">getOffsets</a></strong>()</code>
|
||||
<div class="block">Returns the offsets (in bytes) of each plane within the planes of a larger
|
||||
YUV image.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getPad()">getPad</a></strong>()</code>
|
||||
<div class="block">Returns the line padding used in the YUV image buffer.</div>
|
||||
<div class="block">Returns the line padding used in the YUV image buffer (if this image is
|
||||
stored in a unified buffer rather than separate image planes.)</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>byte[][]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getPlanes()">getPlanes</a></strong>()</code>
|
||||
<div class="block">Returns the YUV image planes.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getSize()">getSize</a></strong>()</code>
|
||||
<div class="block">Returns the size (in bytes) of the YUV image buffer</div>
|
||||
<div class="block">Returns the size (in bytes) of the YUV image buffer (if this image is
|
||||
stored in a unified buffer rather than separate image planes.)</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>int[]</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getStrides()">getStrides</a></strong>()</code>
|
||||
<div class="block">Returns the number of bytes per line of each plane in the YUV image.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getSubsamp()">getSubsamp</a></strong>()</code>
|
||||
<div class="block">Returns the level of chrominance subsampling used in the YUV image.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>int</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#getWidth()">getWidth</a></strong>()</code>
|
||||
<div class="block">Returns the width of the YUV image.</div>
|
||||
<div class="block">Returns the width of the YUV image (or subregion.)</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="rowColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#setBuf(byte[][],%20int[],%20int,%20int[],%20int,%20int)">setBuf</a></strong>(byte[][] planes,
|
||||
int[] offsets,
|
||||
int width,
|
||||
int[] strides,
|
||||
int height,
|
||||
int subsamp)</code>
|
||||
<div class="block">Assign a set of image planes to this <code>YUVImage</code> instance.</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#setBuf(byte[], int, int, int, int)">setBuf</a></strong>(byte[] yuvImage,
|
||||
<td class="colLast"><code><strong><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html#setBuf(byte[],%20int,%20int,%20int,%20int)">setBuf</a></strong>(byte[] yuvImage,
|
||||
int width,
|
||||
int pad,
|
||||
int height,
|
||||
int subsamp)</code>
|
||||
<div class="block">Assign an existing YUV planar image buffer to this <code>YUVImage</code>
|
||||
instance.</div>
|
||||
<div class="block">Assign a unified image buffer to this <code>YUVImage</code> instance.</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -285,13 +354,31 @@ extends java.lang.Object</pre>
|
||||
<pre>protected long handle</pre>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="yuvBuf">
|
||||
<a name="yuvPlanes">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>yuvBuf</h4>
|
||||
<pre>protected byte[] yuvBuf</pre>
|
||||
<h4>yuvPlanes</h4>
|
||||
<pre>protected byte[][] yuvPlanes</pre>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="yuvOffsets">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>yuvOffsets</h4>
|
||||
<pre>protected int[] yuvOffsets</pre>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="yuvStrides">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>yuvStrides</h4>
|
||||
<pre>protected int[] yuvStrides</pre>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="yuvPad">
|
||||
@@ -338,6 +425,31 @@ extends java.lang.Object</pre>
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Constructor Detail</h3>
|
||||
<a name="YUVImage(int, int[], int, int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>YUVImage</h4>
|
||||
<pre>public YUVImage(int width,
|
||||
int[] strides,
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Create a new <code>YUVImage</code> instance backed by separate image
|
||||
planes, and allocate memory for the image planes.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>strides</code> - an array of integers, each specifying the number of bytes
|
||||
per line in the corresponding plane of the YUV image. Setting the stride
|
||||
for any plane to 0 is the same as setting it to the plane width (see
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</code></a>.) If <code>strides</code> is null, then the
|
||||
strides for all planes will be set to their respective plane widths. When
|
||||
using this constructor, the stride for each plane must be equal to or
|
||||
greater than the plane width.</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling to be used in the YUV
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="YUVImage(int, int, int, int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
@@ -349,7 +461,8 @@ extends java.lang.Object</pre>
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Create a <code>YUVImage</code> instance with a new image buffer.</div>
|
||||
<div class="block">Create a new <code>YUVImage</code> instance backed by a unified image
|
||||
buffer, and allocate memory for the image buffer.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>pad</code> - Each line of each plane in the YUV image buffer will be padded
|
||||
to this number of bytes (must be a power of 2.)</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling to be used in the YUV
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
@@ -357,6 +470,44 @@ extends java.lang.Object</pre>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="YUVImage(byte[][], int[], int, int[], int, int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>YUVImage</h4>
|
||||
<pre>public YUVImage(byte[][] planes,
|
||||
int[] offsets,
|
||||
int width,
|
||||
int[] strides,
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Create a new <code>YUVImage</code> instance from a set of existing image
|
||||
planes.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>planes</code> - an array of buffers representing the Y, U (Cb), and V (Cr)
|
||||
image planes (or just the Y plane, if the image is grayscale.) These
|
||||
planes can be contiguous or non-contiguous in memory. Plane
|
||||
<code>i</code> should be at least <code>offsets[i] +
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#planeSizeYUV(int,%20int,%20int,%20int,%20int)"><code>TJ.planeSizeYUV</code></a>(i, width, strides[i], height, subsamp)</code>
|
||||
bytes in size.</dd><dd><code>offsets</code> - If this <code>YUVImage</code> instance represents a
|
||||
subregion of a larger image, then <code>offsets[i]</code> specifies the
|
||||
offset (in bytes) of the subregion within plane <code>i</code> of the
|
||||
larger image. Setting this to null is the same as setting the offsets for
|
||||
all planes to 0.</dd><dd><code>width</code> - width (in pixels) of the new YUV image (or subregion)</dd><dd><code>strides</code> - an array of integers, each specifying the number of bytes
|
||||
per line in the corresponding plane of the YUV image. Setting the stride
|
||||
for any plane to 0 is the same as setting it to the plane width (see
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</code></a>.) If <code>strides</code> is null, then the
|
||||
strides for all planes will be set to their respective plane widths. You
|
||||
can adjust the strides in order to add an arbitrary amount of line padding
|
||||
to each plane or to specify that this <code>YUVImage</code> instance is a
|
||||
subregion of a larger image (in which case, <code>strides[i]</code> should
|
||||
be set to the plane width of plane <code>i</code> in the larger image.)</dd><dd><code>height</code> - height (in pixels) of the new YUV image (or subregion)</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="YUVImage(byte[], int, int, int, int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
@@ -369,12 +520,13 @@ extends java.lang.Object</pre>
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Create a <code>YUVImage</code> instance from an existing YUV planar image
|
||||
<div class="block">Create a new <code>YUVImage</code> instance from an existing unified image
|
||||
buffer.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>yuvImage</code> - image buffer that contains or will contain YUV planar
|
||||
image data. See <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</code></a> for a description of the image
|
||||
format. Use <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int, int)"><code>TJ.bufSizeYUV(int, int, int, int)</code></a> to determine the minimum size for this
|
||||
buffer.</dd><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>pad</code> - the line padding used in the YUV image buffer. For
|
||||
image data. Use <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)"><code>TJ.bufSizeYUV(int, int, int, int)</code></a> to determine the minimum size for
|
||||
this buffer. The Y, U (Cb), and V (Cr) image planes are stored
|
||||
sequentially in the buffer (see <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</code></a> for a description
|
||||
of the image format.)</dd><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>pad</code> - the line padding used in the YUV image buffer. For
|
||||
instance, if each line in each plane of the buffer is padded to the
|
||||
nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
@@ -390,6 +542,43 @@ extends java.lang.Object</pre>
|
||||
<!-- -->
|
||||
</a>
|
||||
<h3>Method Detail</h3>
|
||||
<a name="setBuf(byte[][], int[], int, int[], int, int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>setBuf</h4>
|
||||
<pre>public void setBuf(byte[][] planes,
|
||||
int[] offsets,
|
||||
int width,
|
||||
int[] strides,
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Assign a set of image planes to this <code>YUVImage</code> instance.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>planes</code> - an array of buffers representing the Y, U (Cb), and V (Cr)
|
||||
image planes (or just the Y plane, if the image is grayscale.) These
|
||||
planes can be contiguous or non-contiguous in memory. Plane
|
||||
<code>i</code> should be at least <code>offsets[i] +
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/TJ.html#planeSizeYUV(int,%20int,%20int,%20int,%20int)"><code>TJ.planeSizeYUV</code></a>(i, width, strides[i], height, subsamp)</code>
|
||||
bytes in size.</dd><dd><code>offsets</code> - If this <code>YUVImage</code> instance represents a
|
||||
subregion of a larger image, then <code>offsets[i]</code> specifies the
|
||||
offset (in bytes) of the subregion within plane <code>i</code> of the
|
||||
larger image. Setting this to null is the same as setting the offsets for
|
||||
all planes to 0.</dd><dd><code>width</code> - width (in pixels) of the YUV image (or subregion)</dd><dd><code>strides</code> - an array of integers, each specifying the number of bytes
|
||||
per line in the corresponding plane of the YUV image. Setting the stride
|
||||
for any plane to 0 is the same as setting it to the plane width (see
|
||||
<a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</code></a>.) If <code>strides</code> is null, then the
|
||||
strides for all planes will be set to their respective plane widths. You
|
||||
can adjust the strides in order to add an arbitrary amount of line padding
|
||||
to each plane or to specify that this <code>YUVImage</code> image is a
|
||||
subregion of a larger image (in which case, <code>strides[i]</code> should
|
||||
be set to the plane width of plane <code>i</code> in the larger image.)</dd><dd><code>height</code> - height (in pixels) of the YUV image (or subregion)</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="setBuf(byte[], int, int, int, int)">
|
||||
<!-- -->
|
||||
</a>
|
||||
@@ -402,12 +591,12 @@ extends java.lang.Object</pre>
|
||||
int height,
|
||||
int subsamp)
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Assign an existing YUV planar image buffer to this <code>YUVImage</code>
|
||||
instance.</div>
|
||||
<div class="block">Assign a unified image buffer to this <code>YUVImage</code> instance.</div>
|
||||
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>yuvImage</code> - image buffer that contains or will contain YUV planar
|
||||
image data. See <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</code></a> for a description of the image
|
||||
format. Use <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int, int, int, int)"><code>TJ.bufSizeYUV(int, int, int, int)</code></a> to determine the minimum size for this
|
||||
buffer.</dd><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>pad</code> - the line padding used in the YUV image buffer. For
|
||||
image data. Use <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#bufSizeYUV(int,%20int,%20int,%20int)"><code>TJ.bufSizeYUV(int, int, int, int)</code></a> to determine the minimum size for
|
||||
this buffer. The Y, U (Cb), and V (Cr) image planes are stored
|
||||
sequentially in the buffer (see <a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg"><code>above</code></a> for a description
|
||||
of the image format.)</dd><dd><code>width</code> - width (in pixels) of the YUV image</dd><dd><code>pad</code> - the line padding used in the YUV image buffer. For
|
||||
instance, if each line in each plane of the buffer is padded to the
|
||||
nearest multiple of 4 bytes, then <code>pad</code> should be set to 4.</dd><dd><code>height</code> - height (in pixels) of the YUV image</dd><dd><code>subsamp</code> - the level of chrominance subsampling used in the YUV
|
||||
image (one of <a href="../../../org/libjpegturbo/turbojpeg/TJ.html#SAMP_444"><code>TJ.SAMP_*</code></a>)</dd>
|
||||
@@ -423,8 +612,8 @@ extends java.lang.Object</pre>
|
||||
<h4>getWidth</h4>
|
||||
<pre>public int getWidth()
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Returns the width of the YUV image.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the width of the YUV image</dd>
|
||||
<div class="block">Returns the width of the YUV image (or subregion.)</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the width of the YUV image (or subregion)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -437,8 +626,8 @@ extends java.lang.Object</pre>
|
||||
<h4>getHeight</h4>
|
||||
<pre>public int getHeight()
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Returns the height of the YUV image.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the height of the YUV image</dd>
|
||||
<div class="block">Returns the height of the YUV image (or subregion.)</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the height of the YUV image (or subregion)</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
@@ -451,12 +640,43 @@ extends java.lang.Object</pre>
|
||||
<h4>getPad</h4>
|
||||
<pre>public int getPad()
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Returns the line padding used in the YUV image buffer.</div>
|
||||
<div class="block">Returns the line padding used in the YUV image buffer (if this image is
|
||||
stored in a unified buffer rather than separate image planes.)</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the line padding used in the YUV image buffer</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getStrides()">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getStrides</h4>
|
||||
<pre>public int[] getStrides()
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Returns the number of bytes per line of each plane in the YUV image.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the number of bytes per line of each plane in the YUV image</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getOffsets()">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getOffsets</h4>
|
||||
<pre>public int[] getOffsets()
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Returns the offsets (in bytes) of each plane within the planes of a larger
|
||||
YUV image.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the offsets (in bytes) of each plane within the planes of a larger
|
||||
YUV image</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getSubsamp()">
|
||||
<!-- -->
|
||||
</a>
|
||||
@@ -472,6 +692,21 @@ extends java.lang.Object</pre>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getPlanes()">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getPlanes</h4>
|
||||
<pre>public byte[][] getPlanes()
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Returns the YUV image planes. If the image is stored in a unified buffer,
|
||||
then all image planes will point to that buffer.</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the YUV image planes</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="getBuf()">
|
||||
<!-- -->
|
||||
</a>
|
||||
@@ -480,7 +715,8 @@ extends java.lang.Object</pre>
|
||||
<h4>getBuf</h4>
|
||||
<pre>public byte[] getBuf()
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Returns the YUV image buffer</div>
|
||||
<div class="block">Returns the YUV image buffer (if this image is stored in a unified
|
||||
buffer rather than separate image planes.)</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the YUV image buffer</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
@@ -494,7 +730,8 @@ extends java.lang.Object</pre>
|
||||
<h4>getSize</h4>
|
||||
<pre>public int getSize()
|
||||
throws java.lang.Exception</pre>
|
||||
<div class="block">Returns the size (in bytes) of the YUV image buffer</div>
|
||||
<div class="block">Returns the size (in bytes) of the YUV image buffer (if this image is
|
||||
stored in a unified buffer rather than separate image planes.)</div>
|
||||
<dl><dt><span class="strong">Returns:</span></dt><dd>the size (in bytes) of the YUV image buffer</dd>
|
||||
<dt><span class="strong">Throws:</span></dt>
|
||||
<dd><code>java.lang.Exception</code></dd></dl>
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
<tr class="altColor">
|
||||
<td class="colFirst"><a href="../../../org/libjpegturbo/turbojpeg/YUVImage.html" title="class in org.libjpegturbo.turbojpeg">YUVImage</a></td>
|
||||
<td class="colLast">
|
||||
<div class="block">This class encapsulates a YUV planar image buffer and the metadata
|
||||
<div class="block">This class encapsulates a YUV planar image and the metadata
|
||||
associated with it.</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -84,7 +84,8 @@ public final class TJ {
|
||||
* @param subsamp the level of chrominance subsampling (one of
|
||||
* <code>SAMP_*</code>)
|
||||
*
|
||||
* @return the MCU block width for the given level of chrominance subsampling
|
||||
* @return the MCU block width for the given level of chrominance
|
||||
* subsampling.
|
||||
*/
|
||||
public static int getMCUWidth(int subsamp) throws Exception {
|
||||
if (subsamp < 0 || subsamp >= NUMSAMP)
|
||||
@@ -105,7 +106,7 @@ public final class TJ {
|
||||
* <code>SAMP_*</code>)
|
||||
*
|
||||
* @return the MCU block height for the given level of chrominance
|
||||
* subsampling
|
||||
* subsampling.
|
||||
*/
|
||||
public static int getMCUHeight(int subsamp) throws Exception {
|
||||
if (subsamp < 0 || subsamp >= NUMSAMP)
|
||||
@@ -214,7 +215,7 @@ public final class TJ {
|
||||
*
|
||||
* @param pixelFormat the pixel format (one of <code>PF_*</code>)
|
||||
*
|
||||
* @return the pixel size (in bytes) for the given pixel format
|
||||
* @return the pixel size (in bytes) for the given pixel format.
|
||||
*/
|
||||
public static int getPixelSize(int pixelFormat) throws Exception {
|
||||
if (pixelFormat < 0 || pixelFormat >= NUMPF)
|
||||
@@ -236,7 +237,7 @@ public final class TJ {
|
||||
*
|
||||
* @param pixelFormat the pixel format (one of <code>PF_*</code>)
|
||||
*
|
||||
* @return the red offset for the given pixel format
|
||||
* @return the red offset for the given pixel format.
|
||||
*/
|
||||
public static int getRedOffset(int pixelFormat) throws Exception {
|
||||
if (pixelFormat < 0 || pixelFormat >= NUMPF)
|
||||
@@ -258,7 +259,7 @@ public final class TJ {
|
||||
*
|
||||
* @param pixelFormat the pixel format (one of <code>PF_*</code>)
|
||||
*
|
||||
* @return the green offset for the given pixel format
|
||||
* @return the green offset for the given pixel format.
|
||||
*/
|
||||
public static int getGreenOffset(int pixelFormat) throws Exception {
|
||||
if (pixelFormat < 0 || pixelFormat >= NUMPF)
|
||||
@@ -280,7 +281,7 @@ public final class TJ {
|
||||
*
|
||||
* @param pixelFormat the pixel format (one of <code>PF_*</code>)
|
||||
*
|
||||
* @return the blue offset for the given pixel format
|
||||
* @return the blue offset for the given pixel format.
|
||||
*/
|
||||
public static int getBlueOffset(int pixelFormat) throws Exception {
|
||||
if (pixelFormat < 0 || pixelFormat >= NUMPF)
|
||||
@@ -404,7 +405,7 @@ public final class TJ {
|
||||
* generating the JPEG image (one of {@link TJ TJ.SAMP_*})
|
||||
*
|
||||
* @return the maximum size of the buffer (in bytes) required to hold a JPEG
|
||||
* image with the given width, height, and level of chrominance subsampling
|
||||
* image with the given width, height, and level of chrominance subsampling.
|
||||
*/
|
||||
public static native int bufSize(int width, int height, int jpegSubsamp)
|
||||
throws Exception;
|
||||
@@ -416,8 +417,7 @@ public final class TJ {
|
||||
* @param width the width (in pixels) of the YUV image
|
||||
*
|
||||
* @param pad the width of each line in each plane of the image is padded to
|
||||
* the nearest multiple of this number of bytes (must be a power of
|
||||
* 2.)
|
||||
* the nearest multiple of this number of bytes (must be a power of 2.)
|
||||
*
|
||||
* @param height the height (in pixels) of the YUV image
|
||||
*
|
||||
@@ -425,7 +425,7 @@ public final class TJ {
|
||||
* image (one of {@link TJ TJ.SAMP_*})
|
||||
*
|
||||
* @return the size of the buffer (in bytes) required to hold a YUV planar
|
||||
* image with the given width, height, and level of chrominance subsampling
|
||||
* image with the given width, height, and level of chrominance subsampling.
|
||||
*/
|
||||
public static native int bufSizeYUV(int width, int pad, int height,
|
||||
int subsamp)
|
||||
@@ -438,12 +438,72 @@ public final class TJ {
|
||||
public static native int bufSizeYUV(int width, int height, int subsamp)
|
||||
throws Exception;
|
||||
|
||||
/**
|
||||
* Returns the size of the buffer (in bytes) required to hold a YUV image
|
||||
* plane with the given parameters.
|
||||
*
|
||||
* @param componentID ID number of the image plane (0 = Y, 1 = U/Cb,
|
||||
* 2 = V/Cr)
|
||||
*
|
||||
* @param width width (in pixels) of the YUV image. NOTE: this is the width
|
||||
* of the whole image, not the plane width.
|
||||
*
|
||||
* @param stride bytes per line in the image plane.
|
||||
*
|
||||
* @param height height (in pixels) of the YUV image. NOTE: this is the
|
||||
* height of the whole image, not the plane height.
|
||||
*
|
||||
* @param subsamp the level of chrominance subsampling used in the YUV
|
||||
* image (one of {@link TJ TJ.SAMP_*})
|
||||
*
|
||||
* @return the size of the buffer (in bytes) required to hold a YUV planar
|
||||
* image with the given parameters.
|
||||
*/
|
||||
public static native int planeSizeYUV(int componentID, int width, int stride,
|
||||
int height, int subsamp)
|
||||
throws Exception;
|
||||
|
||||
/**
|
||||
* Returns the plane width of a YUV image plane with the given parameters.
|
||||
* Refer to {@link YUVImage YUVImage} for a description of plane width.
|
||||
*
|
||||
* @param componentID ID number of the image plane (0 = Y, 1 = U/Cb,
|
||||
* 2 = V/Cr)
|
||||
*
|
||||
* @param width width (in pixels) of the YUV image
|
||||
*
|
||||
* @param subsamp the level of chrominance subsampling used in the YUV image
|
||||
* (one of {@link TJ TJ.SAMP_*})
|
||||
*
|
||||
* @return the plane width of a YUV image plane with the given parameters.
|
||||
*/
|
||||
public static native int planeWidth(int componentID, int width, int subsamp)
|
||||
throws Exception;
|
||||
|
||||
/**
|
||||
* Returns the plane height of a YUV image plane with the given parameters.
|
||||
* Refer to {@link YUVImage YUVImage} for a description of plane height.
|
||||
*
|
||||
* @param componentID ID number of the image plane (0 = Y, 1 = U/Cb,
|
||||
* 2 = V/Cr)
|
||||
*
|
||||
* @param height height (in pixels) of the YUV image
|
||||
*
|
||||
* @param subsamp the level of chrominance subsampling used in the YUV image
|
||||
* (one of {@link TJ TJ.SAMP_*})
|
||||
*
|
||||
* @return the plane height of a YUV image plane with the given parameters.
|
||||
*/
|
||||
public static native int planeHeight(int componentID, int height,
|
||||
int subsamp)
|
||||
throws Exception;
|
||||
|
||||
/**
|
||||
* Returns a list of fractional scaling factors that the JPEG decompressor in
|
||||
* this implementation of TurboJPEG supports.
|
||||
*
|
||||
* @return a list of fractional scaling factors that the JPEG decompressor in
|
||||
* this implementation of TurboJPEG supports
|
||||
* this implementation of TurboJPEG supports.
|
||||
*/
|
||||
public static native TJScalingFactor[] getScalingFactors()
|
||||
throws Exception;
|
||||
|
||||
@@ -332,9 +332,10 @@ public class TJCompressor {
|
||||
throw new Exception("Subsampling level not set");
|
||||
|
||||
if (srcYUVImage != null)
|
||||
compressedSize = compressFromYUV(srcYUVImage.getBuf(),
|
||||
compressedSize = compressFromYUV(srcYUVImage.getPlanes(),
|
||||
srcYUVImage.getOffsets(),
|
||||
srcYUVImage.getWidth(),
|
||||
srcYUVImage.getPad(),
|
||||
srcYUVImage.getStrides(),
|
||||
srcYUVImage.getHeight(),
|
||||
srcYUVImage.getSubsamp(),
|
||||
dstBuf, jpegQuality, flags);
|
||||
@@ -429,14 +430,14 @@ public class TJCompressor {
|
||||
|
||||
if (srcBufInt != null) {
|
||||
encodeYUV(srcBufInt, srcX, srcY, srcWidth, srcStride, srcHeight,
|
||||
srcPixelFormat, dstImage.getBuf(), dstImage.getPad(),
|
||||
dstImage.getSubsamp(), flags);
|
||||
srcPixelFormat, dstImage.getPlanes(), dstImage.getOffsets(),
|
||||
dstImage.getStrides(), dstImage.getSubsamp(), flags);
|
||||
} else {
|
||||
encodeYUV(srcBuf, srcX, srcY, srcWidth, srcPitch, srcHeight,
|
||||
srcPixelFormat, dstImage.getBuf(), dstImage.getPad(),
|
||||
dstImage.getSubsamp(), flags);
|
||||
srcPixelFormat, dstImage.getPlanes(), dstImage.getOffsets(),
|
||||
dstImage.getStrides(), dstImage.getSubsamp(), flags);
|
||||
}
|
||||
compressedSize = dstImage.getSize();
|
||||
compressedSize = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -456,11 +457,11 @@ public class TJCompressor {
|
||||
|
||||
/**
|
||||
* Encode the uncompressed source image associated with this compressor
|
||||
* instance into a YUV planar image and return a <code>YUVImage</code>
|
||||
* instance containing the encoded image. This method uses the accelerated
|
||||
* color conversion routines in TurboJPEG's underlying codec but does not
|
||||
* execute any of the other steps in the JPEG compression process. Encoding
|
||||
* CMYK source images to YUV is not supported.
|
||||
* instance into a unified YUV planar image buffer and return a
|
||||
* <code>YUVImage</code> instance containing the encoded image. This method
|
||||
* uses the accelerated color conversion routines in TurboJPEG's underlying
|
||||
* codec but does not execute any of the other steps in the JPEG compression
|
||||
* process. Encoding CMYK source images to YUV is not supported.
|
||||
*
|
||||
* @param pad the width of each line in each plane of the YUV image will be
|
||||
* padded to the nearest multiple of this number of bytes (must be a power of
|
||||
@@ -469,7 +470,7 @@ public class TJCompressor {
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*
|
||||
* @return a YUV planar image
|
||||
* @return a YUV planar image.
|
||||
*/
|
||||
public YUVImage encodeYUV(int pad, int flags) throws Exception {
|
||||
if (srcWidth < 1 || srcHeight < 1)
|
||||
@@ -483,6 +484,37 @@ public class TJCompressor {
|
||||
return yuvImage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode the uncompressed source image associated with this compressor
|
||||
* instance into separate Y, U (Cb), and V (Cr) image planes and return a
|
||||
* <code>YUVImage</code> instance containing the encoded image planes. This
|
||||
* method uses the accelerated color conversion routines in TurboJPEG's
|
||||
* underlying codec but does not execute any of the other steps in the JPEG
|
||||
* compression process. Encoding CMYK source images to YUV is not supported.
|
||||
*
|
||||
* @param strides an array of integers, each specifying the number of bytes
|
||||
* per line in the corresponding plane of the output image. Setting the
|
||||
* stride for any plane to 0 is the same as setting it to the component width
|
||||
* of the plane. If <code>strides</code> is null, then the strides for all
|
||||
* planes will be set to their respective component widths. You can adjust
|
||||
* the strides in order to add an arbitrary amount of line padding to each
|
||||
* plane.
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*
|
||||
* @return a YUV planar image.
|
||||
*/
|
||||
public YUVImage encodeYUV(int[] strides, int flags) throws Exception {
|
||||
if (srcWidth < 1 || srcHeight < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (subsamp < 0)
|
||||
throw new Exception("Subsampling level not set");
|
||||
YUVImage yuvImage = new YUVImage(srcWidth, strides, srcHeight, subsamp);
|
||||
encodeYUV(yuvImage, flags);
|
||||
return yuvImage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #encodeYUV(int, int)} instead.
|
||||
*/
|
||||
@@ -512,7 +544,7 @@ public class TJCompressor {
|
||||
/**
|
||||
* @deprecated Use
|
||||
* {@link #setSourceImage(BufferedImage, int, int, int, int)} and
|
||||
* {@link #encodeYUV(int)} instead.
|
||||
* {@link #encodeYUV(int, int)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public byte[] encodeYUV(BufferedImage srcImage, int flags) throws Exception {
|
||||
@@ -522,10 +554,10 @@ public class TJCompressor {
|
||||
|
||||
/**
|
||||
* Returns the size of the image (in bytes) generated by the most recent
|
||||
* compress/encode operation.
|
||||
* compress operation.
|
||||
*
|
||||
* @return the size of the image (in bytes) generated by the most recent
|
||||
* compress/encode operation
|
||||
* compress operation.
|
||||
*/
|
||||
public int getCompressedSize() {
|
||||
return compressedSize;
|
||||
@@ -568,8 +600,9 @@ public class TJCompressor {
|
||||
int stride, int height, int pixelFormat, byte[] dstBuf, int jpegSubsamp,
|
||||
int jpegQual, int flags) throws Exception;
|
||||
|
||||
private native int compressFromYUV(byte[] srcBuf, int width, int pad,
|
||||
int height, int subsamp, byte[] dstBuf, int jpegQual, int flags)
|
||||
private native int compressFromYUV(byte[][] srcPlanes, int[] srcOffsets,
|
||||
int width, int[] srcStrides, int height, int subsamp, byte[] dstBuf,
|
||||
int jpegQual, int flags)
|
||||
throws Exception;
|
||||
|
||||
private native void encodeYUV(byte[] srcBuf, int width, int pitch,
|
||||
@@ -577,16 +610,18 @@ public class TJCompressor {
|
||||
throws Exception; // deprecated
|
||||
|
||||
private native void encodeYUV(byte[] srcBuf, int x, int y, int width,
|
||||
int pitch, int height, int pixelFormat, byte[] dstBuf, int pad,
|
||||
int subsamp, int flags) throws Exception;
|
||||
int pitch, int height, int pixelFormat, byte[][] dstPlanes,
|
||||
int[] dstOffsets, int[] dstStrides, int subsamp, int flags)
|
||||
throws Exception;
|
||||
|
||||
private native void encodeYUV(int[] srcBuf, int width, int stride,
|
||||
int height, int pixelFormat, byte[] dstBuf, int subsamp, int flags)
|
||||
throws Exception; // deprecated
|
||||
|
||||
private native void encodeYUV(int[] srcBuf, int x, int y, int width,
|
||||
int pitch, int height, int pixelFormat, byte[] dstBuf, int pad,
|
||||
int subsamp, int flags) throws Exception;
|
||||
int srcStride, int height, int pixelFormat, byte[][] dstPlanes,
|
||||
int[] dstOffsets, int[] dstStrides, int subsamp, int flags)
|
||||
throws Exception;
|
||||
|
||||
static {
|
||||
TJLoader.load();
|
||||
|
||||
@@ -37,7 +37,7 @@ import java.nio.*;
|
||||
public class TJDecompressor {
|
||||
|
||||
private static final String NO_ASSOC_ERROR =
|
||||
"No source image is associated with this instance";
|
||||
"No JPEG image is associated with this instance";
|
||||
|
||||
/**
|
||||
* Create a TurboJPEG decompresssor instance.
|
||||
@@ -87,18 +87,18 @@ public class TJDecompressor {
|
||||
|
||||
/**
|
||||
* Associate the JPEG image of length <code>imageSize</code> bytes stored in
|
||||
* <code>srcImage</code> with this decompressor instance. This image will
|
||||
* <code>jpegImage</code> with this decompressor instance. This image will
|
||||
* be used as the source image for subsequent decompress operations.
|
||||
*
|
||||
* @param srcImage JPEG image buffer
|
||||
* @param jpegImage JPEG image buffer
|
||||
*
|
||||
* @param imageSize size of the JPEG image (in bytes)
|
||||
*/
|
||||
public void setSourceImage(byte[] srcImage, int imageSize)
|
||||
public void setSourceImage(byte[] jpegImage, int imageSize)
|
||||
throws Exception {
|
||||
if (srcImage == null || imageSize < 1)
|
||||
if (jpegImage == null || imageSize < 1)
|
||||
throw new Exception("Invalid argument in setSourceImage()");
|
||||
jpegBuf = srcImage;
|
||||
jpegBuf = jpegImage;
|
||||
jpegBufSize = imageSize;
|
||||
decompressHeader(jpegBuf, jpegBufSize);
|
||||
yuvImage = null;
|
||||
@@ -134,14 +134,14 @@ public class TJDecompressor {
|
||||
* decompressor instance.
|
||||
*
|
||||
* @return the width of the source image (JPEG or YUV) associated with this
|
||||
* decompressor instance
|
||||
* decompressor instance.
|
||||
*/
|
||||
public int getWidth() throws Exception {
|
||||
if (yuvImage != null)
|
||||
return yuvImage.getWidth();
|
||||
if (srcWidth < 1)
|
||||
if (jpegWidth < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
return srcWidth;
|
||||
return jpegWidth;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -149,14 +149,14 @@ public class TJDecompressor {
|
||||
* decompressor instance.
|
||||
*
|
||||
* @return the height of the source image (JPEG or YUV) associated with this
|
||||
* decompressor instance
|
||||
* decompressor instance.
|
||||
*/
|
||||
public int getHeight() throws Exception {
|
||||
if (yuvImage != null)
|
||||
return yuvImage.getHeight();
|
||||
if (srcHeight < 1)
|
||||
if (jpegHeight < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
return srcHeight;
|
||||
return jpegHeight;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -165,16 +165,16 @@ public class TJDecompressor {
|
||||
* {@link TJ#SAMP_444 TJ.SAMP_*}.
|
||||
*
|
||||
* @return the level of chrominance subsampling used in the source image
|
||||
* (JPEG or YUV) associated with this decompressor instance
|
||||
* (JPEG or YUV) associated with this decompressor instance.
|
||||
*/
|
||||
public int getSubsamp() throws Exception {
|
||||
if (yuvImage != null)
|
||||
return yuvImage.getSubsamp();
|
||||
if (srcSubsamp < 0)
|
||||
if (jpegSubsamp < 0)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (srcSubsamp >= TJ.NUMSAMP)
|
||||
if (jpegSubsamp >= TJ.NUMSAMP)
|
||||
throw new Exception("JPEG header information is invalid");
|
||||
return srcSubsamp;
|
||||
return jpegSubsamp;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -183,36 +183,23 @@ public class TJDecompressor {
|
||||
* source image is YUV, then this always returns {@link TJ#CS_YCbCr}.
|
||||
*
|
||||
* @return the colorspace used in the source image (JPEG or YUV) associated
|
||||
* with this decompressor instance
|
||||
* with this decompressor instance.
|
||||
*/
|
||||
public int getColorspace() throws Exception {
|
||||
if (yuvImage != null)
|
||||
return TJ.CS_YCbCr;
|
||||
if (srcColorspace < 0)
|
||||
if (jpegColorspace < 0)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (srcColorspace >= TJ.NUMCS)
|
||||
if (jpegColorspace >= TJ.NUMCS)
|
||||
throw new Exception("JPEG header information is invalid");
|
||||
return srcColorspace;
|
||||
return jpegColorspace;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the source image buffer associated with this decompressor
|
||||
* instance.
|
||||
* Returns the JPEG image buffer associated with this decompressor instance.
|
||||
*
|
||||
* @return the source image buffer associated with this decompressor instance
|
||||
* @return the JPEG image buffer associated with this decompressor instance.
|
||||
*/
|
||||
public byte[] getSourceBuf() throws Exception {
|
||||
if (yuvImage != null)
|
||||
return yuvImage.getBuf();
|
||||
if (jpegBuf == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
return jpegBuf;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #getSourceBuf} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public byte[] getJPEGBuf() throws Exception {
|
||||
if (jpegBuf == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
@@ -220,24 +207,12 @@ public class TJDecompressor {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the size of the source image (in bytes) associated with this
|
||||
* Returns the size of the JPEG image (in bytes) associated with this
|
||||
* decompressor instance.
|
||||
*
|
||||
* @return the size of the source image (in bytes) associated with this
|
||||
* decompressor instance
|
||||
* @return the size of the JPEG image (in bytes) associated with this
|
||||
* decompressor instance.
|
||||
*/
|
||||
public int getSourceSize() throws Exception {
|
||||
if (yuvImage != null)
|
||||
return yuvImage.getSize();
|
||||
if (jpegBufSize < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
return jpegBufSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link #getSourceSize} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public int getJPEGSize() throws Exception {
|
||||
if (jpegBufSize < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
@@ -261,23 +236,23 @@ public class TJDecompressor {
|
||||
*
|
||||
* @return the width of the largest scaled-down image that the TurboJPEG
|
||||
* decompressor can generate without exceeding the desired image width and
|
||||
* height
|
||||
* height.
|
||||
*/
|
||||
public int getScaledWidth(int desiredWidth, int desiredHeight)
|
||||
throws Exception {
|
||||
if (srcWidth < 1 || srcHeight < 1)
|
||||
if (jpegWidth < 1 || jpegHeight < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (desiredWidth < 0 || desiredHeight < 0)
|
||||
throw new Exception("Invalid argument in getScaledWidth()");
|
||||
TJScalingFactor[] sf = TJ.getScalingFactors();
|
||||
if (desiredWidth == 0)
|
||||
desiredWidth = srcWidth;
|
||||
desiredWidth = jpegWidth;
|
||||
if (desiredHeight == 0)
|
||||
desiredHeight = srcHeight;
|
||||
int scaledWidth = srcWidth, scaledHeight = srcHeight;
|
||||
desiredHeight = jpegHeight;
|
||||
int scaledWidth = jpegWidth, scaledHeight = jpegHeight;
|
||||
for (int i = 0; i < sf.length; i++) {
|
||||
scaledWidth = sf[i].getScaled(srcWidth);
|
||||
scaledHeight = sf[i].getScaled(srcHeight);
|
||||
scaledWidth = sf[i].getScaled(jpegWidth);
|
||||
scaledHeight = sf[i].getScaled(jpegHeight);
|
||||
if (scaledWidth <= desiredWidth && scaledHeight <= desiredHeight)
|
||||
break;
|
||||
}
|
||||
@@ -303,23 +278,23 @@ public class TJDecompressor {
|
||||
*
|
||||
* @return the height of the largest scaled-down image that the TurboJPEG
|
||||
* decompressor can generate without exceeding the desired image width and
|
||||
* height
|
||||
* height.
|
||||
*/
|
||||
public int getScaledHeight(int desiredWidth, int desiredHeight)
|
||||
throws Exception {
|
||||
if (srcWidth < 1 || srcHeight < 1)
|
||||
if (jpegWidth < 1 || jpegHeight < 1)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (desiredWidth < 0 || desiredHeight < 0)
|
||||
throw new Exception("Invalid argument in getScaledHeight()");
|
||||
TJScalingFactor[] sf = TJ.getScalingFactors();
|
||||
if (desiredWidth == 0)
|
||||
desiredWidth = srcWidth;
|
||||
desiredWidth = jpegWidth;
|
||||
if (desiredHeight == 0)
|
||||
desiredHeight = srcHeight;
|
||||
int scaledWidth = srcWidth, scaledHeight = srcHeight;
|
||||
desiredHeight = jpegHeight;
|
||||
int scaledWidth = jpegWidth, scaledHeight = jpegHeight;
|
||||
for (int i = 0; i < sf.length; i++) {
|
||||
scaledWidth = sf[i].getScaled(srcWidth);
|
||||
scaledHeight = sf[i].getScaled(srcHeight);
|
||||
scaledWidth = sf[i].getScaled(jpegWidth);
|
||||
scaledHeight = sf[i].getScaled(jpegHeight);
|
||||
if (scaledWidth <= desiredWidth && scaledHeight <= desiredHeight)
|
||||
break;
|
||||
}
|
||||
@@ -402,9 +377,10 @@ public class TJDecompressor {
|
||||
pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0)
|
||||
throw new Exception("Invalid argument in decompress()");
|
||||
if (yuvImage != null)
|
||||
decodeYUV(yuvImage.getBuf(), yuvImage.getPad(), yuvImage.getSubsamp(),
|
||||
dstBuf, x, y, yuvImage.getWidth(), pitch, yuvImage.getHeight(),
|
||||
pixelFormat, flags);
|
||||
decodeYUV(yuvImage.getPlanes(), yuvImage.getOffsets(),
|
||||
yuvImage.getStrides(), yuvImage.getSubsamp(), dstBuf, x, y,
|
||||
yuvImage.getWidth(), pitch, yuvImage.getHeight(), pixelFormat,
|
||||
flags);
|
||||
else {
|
||||
if (x > 0 || y > 0)
|
||||
decompress(jpegBuf, jpegBufSize, dstBuf, x, y, desiredWidth, pitch,
|
||||
@@ -449,7 +425,7 @@ public class TJDecompressor {
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*
|
||||
* @return a buffer containing the decompressed image
|
||||
* @return a buffer containing the decompressed image.
|
||||
*/
|
||||
public byte[] decompress(int desiredWidth, int pitch, int desiredHeight,
|
||||
int pixelFormat, int flags) throws Exception {
|
||||
@@ -497,12 +473,12 @@ public class TJDecompressor {
|
||||
if (scaledWidth != dstImage.getWidth() ||
|
||||
scaledHeight != dstImage.getHeight())
|
||||
throw new Exception("YUVImage dimensions do not match one of the scaled image sizes that TurboJPEG is capable of generating.");
|
||||
if (srcSubsamp != dstImage.getSubsamp())
|
||||
if (jpegSubsamp != dstImage.getSubsamp())
|
||||
throw new Exception("YUVImage subsampling level does not match that of the JPEG image");
|
||||
|
||||
decompressToYUV(jpegBuf, jpegBufSize, dstImage.getBuf(),
|
||||
dstImage.getWidth(), dstImage.getPad(),
|
||||
dstImage.getHeight(), flags);
|
||||
decompressToYUV(jpegBuf, jpegBufSize, dstImage.getPlanes(),
|
||||
dstImage.getOffsets(), dstImage.getWidth(),
|
||||
dstImage.getStrides(), dstImage.getHeight(), flags);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -510,19 +486,77 @@ public class TJDecompressor {
|
||||
*/
|
||||
@Deprecated
|
||||
public void decompressToYUV(byte[] dstBuf, int flags) throws Exception {
|
||||
YUVImage dstImage = new YUVImage(dstBuf, srcWidth, 4, srcHeight,
|
||||
srcSubsamp);
|
||||
YUVImage dstImage = new YUVImage(dstBuf, jpegWidth, 4, jpegHeight,
|
||||
jpegSubsamp);
|
||||
decompressToYUV(dstImage, flags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Decompress the JPEG source image associated with this decompressor
|
||||
* instance into a YUV planar image and return a <code>YUVImage</code>
|
||||
* instance containing the decompressed image. This method performs JPEG
|
||||
* decompression but leaves out the color conversion step, so a planar YUV
|
||||
* image is generated instead of an RGB or grayscale image. This method
|
||||
* cannot be used to decompress JPEG source images with the CMYK or YCCK
|
||||
* colorspace.
|
||||
* instance into a set of Y, U (Cb), and V (Cr) image planes and return a
|
||||
* <code>YUVImage</code> instance containing the decompressed image planes.
|
||||
* This method performs JPEG decompression but leaves out the color
|
||||
* conversion step, so a planar YUV image is generated instead of an RGB or
|
||||
* grayscale image. This method cannot be used to decompress JPEG source
|
||||
* images with the CMYK or YCCK colorspace.
|
||||
*
|
||||
* @param desiredWidth desired width (in pixels) of the YUV image. If the
|
||||
* desired image dimensions are different than the dimensions of the JPEG
|
||||
* image being decompressed, then TurboJPEG will use scaling in the JPEG
|
||||
* decompressor to generate the largest possible image that will fit within
|
||||
* the desired dimensions. Setting this to 0 is the same as setting it to
|
||||
* the width of the JPEG image (in other words, the width will not be
|
||||
* considered when determining the scaled image size.)
|
||||
*
|
||||
* @param strides an array of integers, each specifying the number of bytes
|
||||
* per line in the corresponding plane of the output image. Setting the
|
||||
* stride for any plane to 0 is the same as setting it to the scaled
|
||||
* component width of the plane. If <tt>strides</tt> is NULL, then the
|
||||
* strides for all planes will be set to their respective scaled component
|
||||
* widths. You can adjust the strides in order to add an arbitrary amount of
|
||||
* line padding to each plane.
|
||||
*
|
||||
* @param desiredHeight desired height (in pixels) of the YUV image. If the
|
||||
* desired image dimensions are different than the dimensions of the JPEG
|
||||
* image being decompressed, then TurboJPEG will use scaling in the JPEG
|
||||
* decompressor to generate the largest possible image that will fit within
|
||||
* the desired dimensions. Setting this to 0 is the same as setting it to
|
||||
* the height of the JPEG image (in other words, the height will not be
|
||||
* considered when determining the scaled image size.)
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*
|
||||
* @return a YUV planar image.
|
||||
*/
|
||||
public YUVImage decompressToYUV(int desiredWidth, int[] strides,
|
||||
int desiredHeight,
|
||||
int flags) throws Exception {
|
||||
if (flags < 0)
|
||||
throw new Exception("Invalid argument in decompressToYUV()");
|
||||
if (jpegWidth < 1 || jpegHeight < 1 || jpegSubsamp < 0)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (jpegSubsamp >= TJ.NUMSAMP)
|
||||
throw new Exception("JPEG header information is invalid");
|
||||
if (yuvImage != null)
|
||||
throw new Exception("Source image is the wrong type");
|
||||
|
||||
int scaledWidth = getScaledWidth(desiredWidth, desiredHeight);
|
||||
int scaledHeight = getScaledHeight(desiredWidth, desiredHeight);
|
||||
YUVImage yuvImage = new YUVImage(scaledWidth, null, scaledHeight,
|
||||
jpegSubsamp);
|
||||
decompressToYUV(yuvImage, flags);
|
||||
return yuvImage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decompress the JPEG source image associated with this decompressor
|
||||
* instance into a unified YUV planar image buffer and return a
|
||||
* <code>YUVImage</code> instance containing the decompressed image. This
|
||||
* method performs JPEG decompression but leaves out the color conversion
|
||||
* step, so a planar YUV image is generated instead of an RGB or grayscale
|
||||
* image. This method cannot be used to decompress JPEG source images with
|
||||
* the CMYK or YCCK colorspace.
|
||||
*
|
||||
* @param desiredWidth desired width (in pixels) of the YUV image. If the
|
||||
* desired image dimensions are different than the dimensions of the JPEG
|
||||
@@ -547,15 +581,15 @@ public class TJDecompressor {
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*
|
||||
* @return a YUV planar image
|
||||
* @return a YUV planar image.
|
||||
*/
|
||||
public YUVImage decompressToYUV(int desiredWidth, int pad, int desiredHeight,
|
||||
int flags) throws Exception {
|
||||
if (flags < 0)
|
||||
throw new Exception("Invalid argument in decompressToYUV()");
|
||||
if (srcWidth < 1 || srcHeight < 1 || srcSubsamp < 0)
|
||||
if (jpegWidth < 1 || jpegHeight < 1 || jpegSubsamp < 0)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (srcSubsamp >= TJ.NUMSAMP)
|
||||
if (jpegSubsamp >= TJ.NUMSAMP)
|
||||
throw new Exception("JPEG header information is invalid");
|
||||
if (yuvImage != null)
|
||||
throw new Exception("Source image is the wrong type");
|
||||
@@ -563,7 +597,7 @@ public class TJDecompressor {
|
||||
int scaledWidth = getScaledWidth(desiredWidth, desiredHeight);
|
||||
int scaledHeight = getScaledHeight(desiredWidth, desiredHeight);
|
||||
YUVImage yuvImage = new YUVImage(scaledWidth, pad, scaledHeight,
|
||||
srcSubsamp);
|
||||
jpegSubsamp);
|
||||
decompressToYUV(yuvImage, flags);
|
||||
return yuvImage;
|
||||
}
|
||||
@@ -573,7 +607,7 @@ public class TJDecompressor {
|
||||
*/
|
||||
@Deprecated
|
||||
public byte[] decompressToYUV(int flags) throws Exception {
|
||||
YUVImage dstImage = new YUVImage(srcWidth, 4, srcHeight, srcSubsamp);
|
||||
YUVImage dstImage = new YUVImage(jpegWidth, 4, jpegHeight, jpegSubsamp);
|
||||
decompressToYUV(dstImage, flags);
|
||||
return dstImage.getBuf();
|
||||
}
|
||||
@@ -650,9 +684,10 @@ public class TJDecompressor {
|
||||
pixelFormat < 0 || pixelFormat >= TJ.NUMPF || flags < 0)
|
||||
throw new Exception("Invalid argument in decompress()");
|
||||
if (yuvImage != null)
|
||||
decodeYUV(yuvImage.getBuf(), yuvImage.getPad(), yuvImage.getSubsamp(),
|
||||
dstBuf, x, y, yuvImage.getWidth(), stride,
|
||||
yuvImage.getHeight(), pixelFormat, flags);
|
||||
decodeYUV(yuvImage.getPlanes(), yuvImage.getOffsets(),
|
||||
yuvImage.getStrides(), yuvImage.getSubsamp(), dstBuf, x, y,
|
||||
yuvImage.getWidth(), stride, yuvImage.getHeight(), pixelFormat,
|
||||
flags);
|
||||
else
|
||||
decompress(jpegBuf, jpegBufSize, dstBuf, x, y, desiredWidth, stride,
|
||||
desiredHeight, pixelFormat, flags);
|
||||
@@ -734,8 +769,9 @@ public class TJDecompressor {
|
||||
DataBufferInt db = (DataBufferInt)wr.getDataBuffer();
|
||||
int[] buf = db.getData();
|
||||
if (yuvImage != null)
|
||||
decodeYUV(yuvImage.getBuf(), yuvImage.getPad(), yuvImage.getSubsamp(),
|
||||
buf, 0, 0, yuvImage.getWidth(), stride, yuvImage.getHeight(),
|
||||
decodeYUV(yuvImage.getPlanes(), yuvImage.getOffsets(),
|
||||
yuvImage.getStrides(), yuvImage.getSubsamp(), buf, 0, 0,
|
||||
yuvImage.getWidth(), stride, yuvImage.getHeight(),
|
||||
pixelFormat, flags);
|
||||
else {
|
||||
if (jpegBuf == null)
|
||||
@@ -778,7 +814,7 @@ public class TJDecompressor {
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
*
|
||||
* @return a <code>BufferedImage</code> instance containing the
|
||||
* decompressed/decoded image
|
||||
* decompressed/decoded image.
|
||||
*/
|
||||
public BufferedImage decompress(int desiredWidth, int desiredHeight,
|
||||
int bufferedImageType, int flags)
|
||||
@@ -836,16 +872,17 @@ public class TJDecompressor {
|
||||
private native void decompressToYUV(byte[] srcBuf, int size, byte[] dstBuf,
|
||||
int flags) throws Exception; // deprecated
|
||||
|
||||
private native void decompressToYUV(byte[] srcBuf, int size, byte[] dstBuf,
|
||||
int desiredWidth, int pad, int desiredheight, int flags) throws Exception;
|
||||
private native void decompressToYUV(byte[] srcBuf, int size,
|
||||
byte[][] dstPlanes, int[] dstOffsets, int desiredWidth, int[] dstStrides,
|
||||
int desiredheight, int flags) throws Exception;
|
||||
|
||||
private native void decodeYUV(byte[] srcBuf, int pad, int subsamp,
|
||||
byte[] dstBuf, int x, int y, int width, int pitch, int height,
|
||||
int pixelFormat, int flags) throws Exception;
|
||||
private native void decodeYUV(byte[][] srcPlanes, int[] srcOffsets,
|
||||
int[] srcStrides, int subsamp, byte[] dstBuf, int x, int y, int width,
|
||||
int pitch, int height, int pixelFormat, int flags) throws Exception;
|
||||
|
||||
private native void decodeYUV(byte[] srcBuf, int pad, int subsamp,
|
||||
int[] dstBuf, int x, int y, int width, int stride, int height,
|
||||
int pixelFormat, int flags) throws Exception;
|
||||
private native void decodeYUV(byte[][] srcPlanes, int[] srcOffsets,
|
||||
int[] srcStrides, int subsamp, int[] dstBuf, int x, int y, int width,
|
||||
int stride, int height, int pixelFormat, int flags) throws Exception;
|
||||
|
||||
static {
|
||||
TJLoader.load();
|
||||
@@ -855,9 +892,9 @@ public class TJDecompressor {
|
||||
protected byte[] jpegBuf = null;
|
||||
protected int jpegBufSize = 0;
|
||||
protected YUVImage yuvImage = null;
|
||||
protected int srcWidth = 0;
|
||||
protected int srcHeight = 0;
|
||||
protected int srcSubsamp = -1;
|
||||
protected int srcColorspace = -1;
|
||||
protected int jpegWidth = 0;
|
||||
protected int jpegHeight = 0;
|
||||
protected int jpegSubsamp = -1;
|
||||
protected int jpegColorspace = -1;
|
||||
private ByteOrder byteOrder = null;
|
||||
};
|
||||
|
||||
@@ -42,6 +42,7 @@ public class TJScalingFactor {
|
||||
|
||||
/**
|
||||
* Returns numerator
|
||||
*
|
||||
* @return numerator
|
||||
*/
|
||||
public int getNum() {
|
||||
@@ -50,6 +51,7 @@ public class TJScalingFactor {
|
||||
|
||||
/**
|
||||
* Returns denominator
|
||||
*
|
||||
* @return denominator
|
||||
*/
|
||||
public int getDenom() {
|
||||
@@ -60,7 +62,8 @@ public class TJScalingFactor {
|
||||
* Returns the scaled value of <code>dimension</code>. This function
|
||||
* performs the integer equivalent of
|
||||
* <code>ceil(dimension * scalingFactor)</code>.
|
||||
* @return the scaled value of <code>dimension</code>
|
||||
*
|
||||
* @return the scaled value of <code>dimension</code>.
|
||||
*/
|
||||
public int getScaled(int dimension) {
|
||||
return (dimension * num + denom - 1) / denom;
|
||||
@@ -69,8 +72,9 @@ public class TJScalingFactor {
|
||||
/**
|
||||
* Returns true or false, depending on whether this instance and
|
||||
* <code>other</code> have the same numerator and denominator.
|
||||
*
|
||||
* @return true or false, depending on whether this instance and
|
||||
* <code>other</code> have the same numerator and denominator
|
||||
* <code>other</code> have the same numerator and denominator.
|
||||
*/
|
||||
public boolean equals(TJScalingFactor other) {
|
||||
return (this.num == other.num && this.denom == other.denom);
|
||||
@@ -79,8 +83,9 @@ public class TJScalingFactor {
|
||||
/**
|
||||
* Returns true or false, depending on whether this instance is equal to
|
||||
* 1/1.
|
||||
*
|
||||
* @return true or false, depending on whether this instance is equal to
|
||||
* 1/1
|
||||
* 1/1.
|
||||
*/
|
||||
public boolean isOne() {
|
||||
return (num == 1 && denom == 1);
|
||||
|
||||
@@ -111,7 +111,7 @@ public class TJTransformer extends TJDecompressor {
|
||||
* corresponding transformed output image
|
||||
*
|
||||
* @return an array of {@link TJDecompressor} instances, each of
|
||||
* which has a transformed JPEG image associated with it
|
||||
* which has a transformed JPEG image associated with it.
|
||||
*
|
||||
* @param flags the bitwise OR of one or more of
|
||||
* {@link TJ#FLAG_BOTTOMUP TJ.FLAG_*}
|
||||
@@ -119,15 +119,15 @@ public class TJTransformer extends TJDecompressor {
|
||||
public TJDecompressor[] transform(TJTransform[] transforms, int flags)
|
||||
throws Exception {
|
||||
byte[][] dstBufs = new byte[transforms.length][];
|
||||
if (srcWidth < 1 || srcHeight < 1)
|
||||
if (jpegWidth < 1 || jpegHeight < 1)
|
||||
throw new Exception("JPEG buffer not initialized");
|
||||
for (int i = 0; i < transforms.length; i++) {
|
||||
int w = srcWidth, h = srcHeight;
|
||||
int w = jpegWidth, h = jpegHeight;
|
||||
if ((transforms[i].options & TJTransform.OPT_CROP) != 0) {
|
||||
if (transforms[i].width != 0) w = transforms[i].width;
|
||||
if (transforms[i].height != 0) h = transforms[i].height;
|
||||
}
|
||||
dstBufs[i] = new byte[TJ.bufSize(w, h, srcSubsamp)];
|
||||
dstBufs[i] = new byte[TJ.bufSize(w, h, jpegSubsamp)];
|
||||
}
|
||||
TJDecompressor[] tjd = new TJDecompressor[transforms.length];
|
||||
transform(dstBufs, transforms, flags);
|
||||
@@ -141,7 +141,7 @@ public class TJTransformer extends TJDecompressor {
|
||||
* generated by the most recent transform operation.
|
||||
*
|
||||
* @return an array containing the sizes of the transformed JPEG images
|
||||
* generated by the most recent transform operation
|
||||
* generated by the most recent transform operation.
|
||||
*/
|
||||
public int[] getTransformedSizes() throws Exception {
|
||||
if (transformedSizes == null)
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
package org.libjpegturbo.turbojpeg;
|
||||
|
||||
/**
|
||||
* This class encapsulates a YUV planar image buffer and the metadata
|
||||
* This class encapsulates a YUV planar image and the metadata
|
||||
* associated with it. The TurboJPEG API allows both the JPEG compression and
|
||||
* decompression pipelines to be split into stages: YUV encode, compress from
|
||||
* YUV, decompress to YUV, and YUV decode. A <code>YUVImage</code> instance
|
||||
@@ -40,27 +40,60 @@ package org.libjpegturbo.turbojpeg;
|
||||
* Technically, the JPEG format uses the YCbCr colorspace (which technically is
|
||||
* not a "colorspace" but rather a "color transform"), but per the convention
|
||||
* of the digital video community, the TurboJPEG API uses "YUV" to refer to an
|
||||
* image format consisting of Y, Cb, and Cr image planes. In this image
|
||||
* format, the Y, Cb (U), and Cr (V) planes are stored sequentially in the same
|
||||
* image buffer, and the size of each plane is determined by the image width,
|
||||
* height, line padding, and level of chrominance subsampling. If the
|
||||
* chrominance components are subsampled along the horizontal dimension, then
|
||||
* the width of the luminance plane would be padded to the nearest multiple of
|
||||
* 2 (same goes for the height of the luminance plane, if the chrominance
|
||||
* components are subsampled along the vertical dimension.) For instance, if
|
||||
* the source image is 35 x 35 pixels and 4:2:2 subsampling is used, then the
|
||||
* luminance plane would be 36 x 35 bytes, and each of the chrominance planes
|
||||
* would be 18 x 35 bytes. If you specify, for instance, a line padding of 4
|
||||
* bytes on top of this, then the luminance plane would be 36 x 35 bytes, and
|
||||
* image format consisting of Y, Cb, and Cr image planes.
|
||||
* <p>
|
||||
* Each plane is simply a 2D array of bytes, each byte representing the value
|
||||
* of one of the components (Y, Cb, or Cr) at a particular location in the
|
||||
* image. The width and height of each plane are determined by the image
|
||||
* width, height, and level of chrominance subsampling. The luminance plane
|
||||
* width is the image width padded to the nearest multiple of the horizontal
|
||||
* subsampling factor (2 in the case of 4:2:0 and 4:2:2, 4 in the case of
|
||||
* 4:1:1, 1 in the case of 4:4:4 or grayscale.) Similarly, the luminance plane
|
||||
* height is the image height padded to the nearest multiple of the vertical
|
||||
* subsampling factor (2 in the case of 4:2:0 or 4:4:0, 1 in the case of 4:4:4
|
||||
* or grayscale.) The chrominance plane width is equal to the luminance plane
|
||||
* width divided by the horizontal subsampling factor, and the chrominance
|
||||
* plane height is equal to the luminance plane height divided by the vertical
|
||||
* subsampling factor.
|
||||
* <p>
|
||||
* For example, if the source image is 35 x 35 pixels and 4:2:2 subsampling is
|
||||
* used, then the luminance plane would be 36 x 35 bytes, and each of the
|
||||
* chrominance planes would be 18 x 35 bytes. If you specify a line padding of
|
||||
* 4 bytes on top of this, then the luminance plane would be 36 x 35 bytes, and
|
||||
* each of the chrominance planes would be 20 x 35 bytes.
|
||||
*/
|
||||
public class YUVImage {
|
||||
|
||||
private static final String NO_ASSOC_ERROR =
|
||||
"No YUV buffer is associated with this instance";
|
||||
"No image data is associated with this instance";
|
||||
|
||||
/**
|
||||
* Create a <code>YUVImage</code> instance with a new image buffer.
|
||||
* Create a new <code>YUVImage</code> instance backed by separate image
|
||||
* planes, and allocate memory for the image planes.
|
||||
*
|
||||
* @param width width (in pixels) of the YUV image
|
||||
*
|
||||
* @param strides an array of integers, each specifying the number of bytes
|
||||
* per line in the corresponding plane of the YUV image. Setting the stride
|
||||
* for any plane to 0 is the same as setting it to the plane width (see
|
||||
* {@link YUVImage above}.) If <code>strides</code> is null, then the
|
||||
* strides for all planes will be set to their respective plane widths. When
|
||||
* using this constructor, the stride for each plane must be equal to or
|
||||
* greater than the plane width.
|
||||
*
|
||||
* @param height height (in pixels) of the YUV image
|
||||
*
|
||||
* @param subsamp the level of chrominance subsampling to be used in the YUV
|
||||
* image (one of {@link TJ#SAMP_444 TJ.SAMP_*})
|
||||
*/
|
||||
public YUVImage(int width, int[] strides, int height, int subsamp)
|
||||
throws Exception {
|
||||
setBuf(null, null, width, strides, height, subsamp, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new <code>YUVImage</code> instance backed by a unified image
|
||||
* buffer, and allocate memory for the image buffer.
|
||||
*
|
||||
* @param width width (in pixels) of the YUV image
|
||||
*
|
||||
@@ -79,13 +112,53 @@ public class YUVImage {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a <code>YUVImage</code> instance from an existing YUV planar image
|
||||
* Create a new <code>YUVImage</code> instance from a set of existing image
|
||||
* planes.
|
||||
*
|
||||
* @param planes an array of buffers representing the Y, U (Cb), and V (Cr)
|
||||
* image planes (or just the Y plane, if the image is grayscale.) These
|
||||
* planes can be contiguous or non-contiguous in memory. Plane
|
||||
* <code>i</code> should be at least <code>offsets[i] +
|
||||
* {@link TJ#planeSizeYUV TJ.planeSizeYUV}(i, width, strides[i], height, subsamp)</code>
|
||||
* bytes in size.
|
||||
*
|
||||
* @param offsets If this <code>YUVImage</code> instance represents a
|
||||
* subregion of a larger image, then <code>offsets[i]</code> specifies the
|
||||
* offset (in bytes) of the subregion within plane <code>i</code> of the
|
||||
* larger image. Setting this to null is the same as setting the offsets for
|
||||
* all planes to 0.
|
||||
*
|
||||
* @param width width (in pixels) of the new YUV image (or subregion)
|
||||
*
|
||||
* @param strides an array of integers, each specifying the number of bytes
|
||||
* per line in the corresponding plane of the YUV image. Setting the stride
|
||||
* for any plane to 0 is the same as setting it to the plane width (see
|
||||
* {@link YUVImage above}.) If <code>strides</code> is null, then the
|
||||
* strides for all planes will be set to their respective plane widths. You
|
||||
* can adjust the strides in order to add an arbitrary amount of line padding
|
||||
* to each plane or to specify that this <code>YUVImage</code> instance is a
|
||||
* subregion of a larger image (in which case, <code>strides[i]</code> should
|
||||
* be set to the plane width of plane <code>i</code> in the larger image.)
|
||||
*
|
||||
* @param height height (in pixels) of the new YUV image (or subregion)
|
||||
*
|
||||
* @param subsamp the level of chrominance subsampling used in the YUV
|
||||
* image (one of {@link TJ#SAMP_444 TJ.SAMP_*})
|
||||
*/
|
||||
public YUVImage(byte[][] planes, int[] offsets, int width, int[] strides,
|
||||
int height, int subsamp) throws Exception {
|
||||
setBuf(planes, offsets, width, strides, height, subsamp, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new <code>YUVImage</code> instance from an existing unified image
|
||||
* buffer.
|
||||
*
|
||||
* @param yuvImage image buffer that contains or will contain YUV planar
|
||||
* image data. See {@link YUVImage above} for a description of the image
|
||||
* format. Use {@link TJ#bufSizeYUV} to determine the minimum size for this
|
||||
* buffer.
|
||||
* image data. Use {@link TJ#bufSizeYUV} to determine the minimum size for
|
||||
* this buffer. The Y, U (Cb), and V (Cr) image planes are stored
|
||||
* sequentially in the buffer (see {@link YUVImage above} for a description
|
||||
* of the image format.)
|
||||
*
|
||||
* @param width width (in pixels) of the YUV image
|
||||
*
|
||||
@@ -104,13 +177,95 @@ public class YUVImage {
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign an existing YUV planar image buffer to this <code>YUVImage</code>
|
||||
* instance.
|
||||
* Assign a set of image planes to this <code>YUVImage</code> instance.
|
||||
*
|
||||
* @param planes an array of buffers representing the Y, U (Cb), and V (Cr)
|
||||
* image planes (or just the Y plane, if the image is grayscale.) These
|
||||
* planes can be contiguous or non-contiguous in memory. Plane
|
||||
* <code>i</code> should be at least <code>offsets[i] +
|
||||
* {@link TJ#planeSizeYUV TJ.planeSizeYUV}(i, width, strides[i], height, subsamp)</code>
|
||||
* bytes in size.
|
||||
*
|
||||
* @param offsets If this <code>YUVImage</code> instance represents a
|
||||
* subregion of a larger image, then <code>offsets[i]</code> specifies the
|
||||
* offset (in bytes) of the subregion within plane <code>i</code> of the
|
||||
* larger image. Setting this to null is the same as setting the offsets for
|
||||
* all planes to 0.
|
||||
*
|
||||
* @param width width (in pixels) of the YUV image (or subregion)
|
||||
*
|
||||
* @param strides an array of integers, each specifying the number of bytes
|
||||
* per line in the corresponding plane of the YUV image. Setting the stride
|
||||
* for any plane to 0 is the same as setting it to the plane width (see
|
||||
* {@link YUVImage above}.) If <code>strides</code> is null, then the
|
||||
* strides for all planes will be set to their respective plane widths. You
|
||||
* can adjust the strides in order to add an arbitrary amount of line padding
|
||||
* to each plane or to specify that this <code>YUVImage</code> image is a
|
||||
* subregion of a larger image (in which case, <code>strides[i]</code> should
|
||||
* be set to the plane width of plane <code>i</code> in the larger image.)
|
||||
*
|
||||
* @param height height (in pixels) of the YUV image (or subregion)
|
||||
*
|
||||
* @param subsamp the level of chrominance subsampling used in the YUV
|
||||
* image (one of {@link TJ#SAMP_444 TJ.SAMP_*})
|
||||
*/
|
||||
public void setBuf(byte[][] planes, int[] offsets, int width, int strides[],
|
||||
int height, int subsamp) throws Exception {
|
||||
setBuf(planes, offsets, width, strides, height, subsamp, false);
|
||||
}
|
||||
|
||||
private void setBuf(byte[][] planes, int[] offsets, int width, int strides[],
|
||||
int height, int subsamp, boolean alloc) throws Exception {
|
||||
if ((planes == null && !alloc) || width < 1 || height < 1 || subsamp < 0 ||
|
||||
subsamp >= TJ.NUMSAMP)
|
||||
throw new Exception("Invalid argument in YUVImage::setBuf()");
|
||||
|
||||
int nc = (subsamp == TJ.SAMP_GRAY ? 1 : 3);
|
||||
if (planes.length != nc || (offsets != null && offsets.length != nc) ||
|
||||
(strides != null && strides.length != nc))
|
||||
throw new Exception("YUVImage::setBuf(): planes, offsets, or strides array is the wrong size");
|
||||
|
||||
if (offsets == null)
|
||||
offsets = new int[nc];
|
||||
if (strides == null)
|
||||
strides = new int[nc];
|
||||
|
||||
for (int i = 0; i < nc; i++) {
|
||||
int pw = TJ.planeWidth(i, width, subsamp);
|
||||
int ph = TJ.planeHeight(i, height, subsamp);
|
||||
int planeSize = TJ.planeSizeYUV(i, width, strides[i], height, subsamp);
|
||||
|
||||
if (strides[i] == 0)
|
||||
strides[i] = pw;
|
||||
if (alloc) {
|
||||
if (strides[i] < pw)
|
||||
throw new Exception("Stride must be >= plane width when allocating a new YUV image");
|
||||
planes[i] = new byte[strides[i] * ph];
|
||||
}
|
||||
if (planes[i] == null || offsets[i] < 0)
|
||||
throw new Exception("Invalid argument in YUVImage::setBuf()");
|
||||
if (strides[i] < 0 && offsets[i] - planeSize + pw < 0)
|
||||
throw new Exception("Stride for plane " + i + " would cause memory to be accessed below plane boundary");
|
||||
if (planes[i].length < offsets[i] + planeSize)
|
||||
throw new Exception("Image plane " + i + " is not large enough");
|
||||
}
|
||||
|
||||
yuvPlanes = planes;
|
||||
yuvOffsets = offsets;
|
||||
yuvWidth = width;
|
||||
yuvStrides = strides;
|
||||
yuvHeight = height;
|
||||
yuvSubsamp = subsamp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Assign a unified image buffer to this <code>YUVImage</code> instance.
|
||||
*
|
||||
* @param yuvImage image buffer that contains or will contain YUV planar
|
||||
* image data. See {@link YUVImage above} for a description of the image
|
||||
* format. Use {@link TJ#bufSizeYUV} to determine the minimum size for this
|
||||
* buffer.
|
||||
* image data. Use {@link TJ#bufSizeYUV} to determine the minimum size for
|
||||
* this buffer. The Y, U (Cb), and V (Cr) image planes are stored
|
||||
* sequentially in the buffer (see {@link YUVImage above} for a description
|
||||
* of the image format.)
|
||||
*
|
||||
* @param width width (in pixels) of the YUV image
|
||||
*
|
||||
@@ -127,20 +282,34 @@ public class YUVImage {
|
||||
int subsamp) throws Exception {
|
||||
if (yuvImage == null || width < 1 || pad < 1 || ((pad & (pad - 1)) != 0) ||
|
||||
height < 1 || subsamp < 0 || subsamp >= TJ.NUMSAMP)
|
||||
throw new Exception("Invalid argument in YUVImage()");
|
||||
throw new Exception("Invalid argument in YUVImage::setBuf()");
|
||||
if (yuvImage.length < TJ.bufSizeYUV(width, pad, height, subsamp))
|
||||
throw new Exception("YUV image buffer is not large enough");
|
||||
yuvBuf = yuvImage;
|
||||
yuvWidth = width;
|
||||
|
||||
int nc = (subsamp == TJ.SAMP_GRAY ? 1 : 3);
|
||||
byte[][] planes = new byte[nc][];
|
||||
int[] strides = new int[nc];
|
||||
int[] offsets = new int[nc];
|
||||
|
||||
planes[0] = yuvImage;
|
||||
strides[0] = PAD(TJ.planeWidth(0, width, subsamp), pad);
|
||||
if (subsamp != TJ.SAMP_GRAY) {
|
||||
strides[1] = strides[2] = PAD(TJ.planeWidth(1, width, subsamp), pad);
|
||||
planes[1] = planes[2] = yuvImage;
|
||||
offsets[1] = offsets[0] +
|
||||
strides[0] * TJ.planeHeight(0, height, subsamp);
|
||||
offsets[2] = offsets[1] +
|
||||
strides[1] * TJ.planeHeight(1, height, subsamp);
|
||||
}
|
||||
|
||||
yuvPad = pad;
|
||||
yuvHeight = height;
|
||||
yuvSubsamp = subsamp;
|
||||
setBuf(planes, offsets, width, strides, height, subsamp);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the width of the YUV image.
|
||||
* Returns the width of the YUV image (or subregion.)
|
||||
*
|
||||
* @return the width of the YUV image
|
||||
* @return the width of the YUV image (or subregion)
|
||||
*/
|
||||
public int getWidth() throws Exception {
|
||||
if (yuvWidth < 1)
|
||||
@@ -149,9 +318,9 @@ public class YUVImage {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the height of the YUV image.
|
||||
* Returns the height of the YUV image (or subregion.)
|
||||
*
|
||||
* @return the height of the YUV image
|
||||
* @return the height of the YUV image (or subregion)
|
||||
*/
|
||||
public int getHeight() throws Exception {
|
||||
if (yuvHeight < 1)
|
||||
@@ -160,16 +329,43 @@ public class YUVImage {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the line padding used in the YUV image buffer.
|
||||
* Returns the line padding used in the YUV image buffer (if this image is
|
||||
* stored in a unified buffer rather than separate image planes.)
|
||||
*
|
||||
* @return the line padding used in the YUV image buffer
|
||||
*/
|
||||
public int getPad() throws Exception {
|
||||
if (yuvPad < 1 || ((yuvPad & (yuvPad - 1)) != 0))
|
||||
if (yuvPlanes == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
if (yuvPad < 1 || ((yuvPad & (yuvPad - 1)) != 0))
|
||||
throw new Exception("Image is not stored in a unified buffer");
|
||||
return yuvPad;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of bytes per line of each plane in the YUV image.
|
||||
*
|
||||
* @return the number of bytes per line of each plane in the YUV image
|
||||
*/
|
||||
public int[] getStrides() throws Exception {
|
||||
if (yuvStrides == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
return yuvStrides;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the offsets (in bytes) of each plane within the planes of a larger
|
||||
* YUV image.
|
||||
*
|
||||
* @return the offsets (in bytes) of each plane within the planes of a larger
|
||||
* YUV image
|
||||
*/
|
||||
public int[] getOffsets() throws Exception {
|
||||
if (yuvOffsets == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
return yuvOffsets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the level of chrominance subsampling used in the YUV image. See
|
||||
* {@link TJ#SAMP_444 TJ.SAMP_*}.
|
||||
@@ -183,29 +379,61 @@ public class YUVImage {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the YUV image buffer
|
||||
* Returns the YUV image planes. If the image is stored in a unified buffer,
|
||||
* then all image planes will point to that buffer.
|
||||
*
|
||||
* @return the YUV image planes
|
||||
*/
|
||||
public byte[][] getPlanes() throws Exception {
|
||||
if (yuvPlanes == null)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
return yuvPlanes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the YUV image buffer (if this image is stored in a unified
|
||||
* buffer rather than separate image planes.)
|
||||
*
|
||||
* @return the YUV image buffer
|
||||
*/
|
||||
public byte[] getBuf() throws Exception {
|
||||
if (yuvBuf == null)
|
||||
if (yuvPlanes == null || yuvSubsamp < 0 || yuvSubsamp >= TJ.NUMSAMP)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
return yuvBuf;
|
||||
int nc = (yuvSubsamp == TJ.SAMP_GRAY ? 1 : 3);
|
||||
for (int i = 1; i < nc; i++) {
|
||||
if (yuvPlanes[i] != yuvPlanes[0])
|
||||
throw new Exception("Image is not stored in a unified buffer");
|
||||
}
|
||||
return yuvPlanes[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the size (in bytes) of the YUV image buffer
|
||||
* Returns the size (in bytes) of the YUV image buffer (if this image is
|
||||
* stored in a unified buffer rather than separate image planes.)
|
||||
*
|
||||
* @return the size (in bytes) of the YUV image buffer
|
||||
*/
|
||||
public int getSize() throws Exception {
|
||||
if (yuvBuf == null)
|
||||
if (yuvPlanes == null || yuvSubsamp < 0 || yuvSubsamp >= TJ.NUMSAMP)
|
||||
throw new Exception(NO_ASSOC_ERROR);
|
||||
int nc = (yuvSubsamp == TJ.SAMP_GRAY ? 1 : 3);
|
||||
if (yuvPad < 1)
|
||||
throw new Exception("Image is not stored in a unified buffer");
|
||||
for (int i = 1; i < nc; i++) {
|
||||
if (yuvPlanes[i] != yuvPlanes[0])
|
||||
throw new Exception("Image is not stored in a unified buffer");
|
||||
}
|
||||
return TJ.bufSizeYUV(yuvWidth, yuvPad, yuvHeight, yuvSubsamp);
|
||||
}
|
||||
|
||||
private static final int PAD(int v, int p) {
|
||||
return (v + p - 1) & (~(p - 1));
|
||||
}
|
||||
|
||||
protected long handle = 0;
|
||||
protected byte[] yuvBuf = null;
|
||||
protected byte[][] yuvPlanes = null;
|
||||
protected int[] yuvOffsets = null;
|
||||
protected int[] yuvStrides = null;
|
||||
protected int yuvPad = 0;
|
||||
protected int yuvWidth = 0;
|
||||
protected int yuvHeight = 0;
|
||||
|
||||
@@ -91,6 +91,30 @@ JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV__IIII
|
||||
JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV__III
|
||||
(JNIEnv *, jclass, jint, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJ
|
||||
* Method: planeSizeYUV
|
||||
* Signature: (IIIII)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_planeSizeYUV__IIIII
|
||||
(JNIEnv *, jclass, jint, jint, jint, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJ
|
||||
* Method: planeWidth
|
||||
* Signature: (III)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_planeWidth__III
|
||||
(JNIEnv *, jclass, jint, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJ
|
||||
* Method: planeHeight
|
||||
* Signature: (III)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJ_planeHeight__III
|
||||
(JNIEnv *, jclass, jint, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJ
|
||||
* Method: getScalingFactors
|
||||
|
||||
@@ -58,10 +58,10 @@ JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compress___3
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJCompressor
|
||||
* Method: compressFromYUV
|
||||
* Signature: ([BIIII[BII)I
|
||||
* Signature: ([[B[II[III[BII)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3BIIII_3BII
|
||||
(JNIEnv *, jobject, jbyteArray, jint, jint, jint, jint, jbyteArray, jint, jint);
|
||||
JNIEXPORT jint JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII
|
||||
(JNIEnv *, jobject, jobjectArray, jintArray, jint, jintArray, jint, jint, jbyteArray, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJCompressor
|
||||
@@ -74,10 +74,10 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJCompressor
|
||||
* Method: encodeYUV
|
||||
* Signature: ([BIIIIII[BIII)V
|
||||
* Signature: ([BIIIIII[[B[I[III)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIIIII_3BIII
|
||||
(JNIEnv *, jobject, jbyteArray, jint, jint, jint, jint, jint, jint, jbyteArray, jint, jint, jint);
|
||||
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIIIII_3_3B_3I_3III
|
||||
(JNIEnv *, jobject, jbyteArray, jint, jint, jint, jint, jint, jint, jobjectArray, jintArray, jintArray, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJCompressor
|
||||
@@ -90,10 +90,10 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJCompressor
|
||||
* Method: encodeYUV
|
||||
* Signature: ([IIIIIII[BIII)V
|
||||
* Signature: ([IIIIIII[[B[I[III)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIIIII_3BIII
|
||||
(JNIEnv *, jobject, jintArray, jint, jint, jint, jint, jint, jint, jbyteArray, jint, jint, jint);
|
||||
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIIIII_3_3B_3I_3III
|
||||
(JNIEnv *, jobject, jintArray, jint, jint, jint, jint, jint, jint, jobjectArray, jintArray, jintArray, jint, jint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -74,26 +74,26 @@ JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompress
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJDecompressor
|
||||
* Method: decompressToYUV
|
||||
* Signature: ([BI[BIIII)V
|
||||
* Signature: ([BI[[B[II[III)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BIIII
|
||||
(JNIEnv *, jobject, jbyteArray, jint, jbyteArray, jint, jint, jint, jint);
|
||||
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III
|
||||
(JNIEnv *, jobject, jbyteArray, jint, jobjectArray, jintArray, jint, jintArray, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJDecompressor
|
||||
* Method: decodeYUV
|
||||
* Signature: ([BII[BIIIIIII)V
|
||||
* Signature: ([[B[I[II[BIIIIIII)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3BII_3BIIIIIII
|
||||
(JNIEnv *, jobject, jbyteArray, jint, jint, jbyteArray, jint, jint, jint, jint, jint, jint, jint);
|
||||
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3_3B_3I_3II_3BIIIIIII
|
||||
(JNIEnv *, jobject, jobjectArray, jintArray, jintArray, jint, jbyteArray, jint, jint, jint, jint, jint, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: org_libjpegturbo_turbojpeg_TJDecompressor
|
||||
* Method: decodeYUV
|
||||
* Signature: ([BII[IIIIIIII)V
|
||||
* Signature: ([[B[I[II[IIIIIIII)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3BII_3IIIIIIII
|
||||
(JNIEnv *, jobject, jbyteArray, jint, jint, jintArray, jint, jint, jint, jint, jint, jint, jint);
|
||||
JNIEXPORT void JNICALL Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3_3B_3I_3II_3IIIIIIII
|
||||
(JNIEnv *, jobject, jobjectArray, jintArray, jintArray, jint, jintArray, jint, jint, jint, jint, jint, jint, jint);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -360,10 +360,13 @@ compress_trellis_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
||||
JBLOCKARRAY buffer_dst;
|
||||
|
||||
for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
|
||||
c_derived_tbl dctbl_data;
|
||||
c_derived_tbl *dctbl = &dctbl_data;
|
||||
c_derived_tbl actbl_data;
|
||||
c_derived_tbl *actbl = &actbl_data;
|
||||
compptr = cinfo->cur_comp_info[ci];
|
||||
|
||||
jpeg_make_c_derived_tbl(cinfo, TRUE, compptr->dc_tbl_no, &dctbl);
|
||||
jpeg_make_c_derived_tbl(cinfo, FALSE, compptr->ac_tbl_no, &actbl);
|
||||
|
||||
/* Align the virtual buffer for this component. */
|
||||
@@ -391,12 +394,15 @@ compress_trellis_pass (j_compress_ptr cinfo, JSAMPIMAGE input_buf)
|
||||
ndummy = (int) (blocks_across % h_samp_factor);
|
||||
if (ndummy > 0)
|
||||
ndummy = h_samp_factor - ndummy;
|
||||
|
||||
lastDC = 0;
|
||||
|
||||
/* Perform DCT for all non-dummy blocks in this iMCU row. Each call
|
||||
* on forward_DCT processes a complete horizontal row of DCT blocks.
|
||||
*/
|
||||
for (block_row = 0; block_row < block_rows; block_row++) {
|
||||
thisblockrow = buffer[block_row];
|
||||
quantize_trellis(cinfo, actbl, thisblockrow, buffer_dst[block_row], blocks_across, cinfo->quant_tbl_ptrs[compptr->quant_tbl_no], cinfo->norm_src[compptr->quant_tbl_no], cinfo->norm_coef[compptr->quant_tbl_no]);
|
||||
quantize_trellis(cinfo, dctbl, actbl, thisblockrow, buffer_dst[block_row], blocks_across, cinfo->quant_tbl_ptrs[compptr->quant_tbl_no], cinfo->norm_src[compptr->quant_tbl_no], cinfo->norm_coef[compptr->quant_tbl_no], &lastDC);
|
||||
|
||||
if (ndummy > 0) {
|
||||
/* Create dummy blocks at the right edge of the image. */
|
||||
|
||||
174
jcdctmgr.c
174
jcdctmgr.c
@@ -6,7 +6,7 @@
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 1999-2006, MIYASAKA Masaru.
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2011 D. R. Commander
|
||||
* Copyright (C) 2011, 2014 D. R. Commander
|
||||
* mozjpeg Modifications:
|
||||
* Copyright (C) 2014, Mozilla Corporation.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
@@ -75,9 +75,12 @@ typedef struct {
|
||||
typedef my_fdct_controller * my_fdct_ptr;
|
||||
|
||||
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
|
||||
/*
|
||||
* Find the highest bit in an integer through binary search.
|
||||
*/
|
||||
|
||||
LOCAL(int)
|
||||
flss (UINT16 val)
|
||||
{
|
||||
@@ -108,6 +111,7 @@ flss (UINT16 val)
|
||||
return bit;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Compute values to do a division using reciprocal.
|
||||
*
|
||||
@@ -166,6 +170,7 @@ flss (UINT16 val)
|
||||
* of in a consecutive manner, yet again in order to allow SIMD
|
||||
* routines.
|
||||
*/
|
||||
|
||||
LOCAL(int)
|
||||
compute_reciprocal (UINT16 divisor, DCTELEM * dtbl)
|
||||
{
|
||||
@@ -200,6 +205,9 @@ compute_reciprocal (UINT16 divisor, DCTELEM * dtbl)
|
||||
else return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Initialize for a processing pass.
|
||||
* Verify that all referenced Q-tables are present, and set up
|
||||
@@ -241,9 +249,13 @@ start_pass_fdctmgr (j_compress_ptr cinfo)
|
||||
}
|
||||
dtbl = fdct->divisors[qtblno];
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
if(!compute_reciprocal(qtbl->quantval[i] << 3, &dtbl[i])
|
||||
&& fdct->quantize == jsimd_quantize)
|
||||
fdct->quantize = quantize;
|
||||
#else
|
||||
dtbl[i] = ((DCTELEM) qtbl->quantval[i]) << 3;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
@@ -277,12 +289,19 @@ start_pass_fdctmgr (j_compress_ptr cinfo)
|
||||
}
|
||||
dtbl = fdct->divisors[qtblno];
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
if(!compute_reciprocal(
|
||||
DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
|
||||
(INT32) aanscales[i]),
|
||||
CONST_BITS-3), &dtbl[i])
|
||||
&& fdct->quantize == jsimd_quantize)
|
||||
fdct->quantize = quantize;
|
||||
#else
|
||||
dtbl[i] = (DCTELEM)
|
||||
DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
|
||||
(INT32) aanscales[i]),
|
||||
CONST_BITS-3);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -375,9 +394,12 @@ quantize (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace)
|
||||
{
|
||||
int i;
|
||||
DCTELEM temp;
|
||||
JCOEFPTR output_ptr = coef_block;
|
||||
|
||||
#if BITS_IN_JSAMPLE == 8
|
||||
|
||||
UDCTELEM recip, corr, shift;
|
||||
UDCTELEM2 product;
|
||||
JCOEFPTR output_ptr = coef_block;
|
||||
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
temp = workspace[i];
|
||||
@@ -396,9 +418,47 @@ quantize (JCOEFPTR coef_block, DCTELEM * divisors, DCTELEM * workspace)
|
||||
product >>= shift + sizeof(DCTELEM)*8;
|
||||
temp = product;
|
||||
}
|
||||
|
||||
output_ptr[i] = (JCOEF) temp;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
register DCTELEM qval;
|
||||
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
qval = divisors[i];
|
||||
temp = workspace[i];
|
||||
/* Divide the coefficient value by qval, ensuring proper rounding.
|
||||
* Since C does not specify the direction of rounding for negative
|
||||
* quotients, we have to force the dividend positive for portability.
|
||||
*
|
||||
* In most files, at least half of the output values will be zero
|
||||
* (at default quantization settings, more like three-quarters...)
|
||||
* so we should ensure that this case is fast. On many machines,
|
||||
* a comparison is enough cheaper than a divide to make a special test
|
||||
* a win. Since both inputs will be nonnegative, we need only test
|
||||
* for a < b to discover whether a/b is 0.
|
||||
* If your machine's division is fast enough, define FAST_DIVIDE.
|
||||
*/
|
||||
#ifdef FAST_DIVIDE
|
||||
#define DIVIDE_BY(a,b) a /= b
|
||||
#else
|
||||
#define DIVIDE_BY(a,b) if (a >= b) a /= b; else a = 0
|
||||
#endif
|
||||
if (temp < 0) {
|
||||
temp = -temp;
|
||||
temp += qval>>1; /* for rounding */
|
||||
DIVIDE_BY(temp, qval);
|
||||
temp = -temp;
|
||||
} else {
|
||||
temp += qval>>1; /* for rounding */
|
||||
DIVIDE_BY(temp, qval);
|
||||
}
|
||||
output_ptr[i] = (JCOEF) temp;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -614,10 +674,10 @@ static const float jpeg_lambda_weights_csf_luma[64] = {
|
||||
};
|
||||
|
||||
GLOBAL(void)
|
||||
quantize_trellis(j_compress_ptr cinfo, c_derived_tbl *actbl, JBLOCKROW coef_blocks, JBLOCKROW src, JDIMENSION num_blocks,
|
||||
JQUANT_TBL * qtbl, double *norm_src, double *norm_coef)
|
||||
quantize_trellis(j_compress_ptr cinfo, c_derived_tbl *dctbl, c_derived_tbl *actbl, JBLOCKROW coef_blocks, JBLOCKROW src, JDIMENSION num_blocks,
|
||||
JQUANT_TBL * qtbl, double *norm_src, double *norm_coef, JCOEF *last_dc_val)
|
||||
{
|
||||
int i, j, k;
|
||||
int i, j, k, l;
|
||||
float accumulated_zero_dist[DCTSIZE2];
|
||||
float accumulated_cost[DCTSIZE2];
|
||||
int run_start[DCTSIZE2];
|
||||
@@ -627,6 +687,7 @@ quantize_trellis(j_compress_ptr cinfo, c_derived_tbl *actbl, JBLOCKROW coef_bloc
|
||||
float norm = 0.0;
|
||||
float lambda_base;
|
||||
float lambda;
|
||||
float lambda_dc;
|
||||
const float *lambda_tbl = (cinfo->use_lambda_weight_tbl) ? jpeg_lambda_weights_csf_luma : jpeg_lambda_weights_flat;
|
||||
int Ss, Se;
|
||||
float *accumulated_zero_block_cost = NULL;
|
||||
@@ -640,6 +701,9 @@ quantize_trellis(j_compress_ptr cinfo, c_derived_tbl *actbl, JBLOCKROW coef_bloc
|
||||
int zero_run;
|
||||
int run_bits;
|
||||
int rate;
|
||||
float *accumulated_dc_cost[3];
|
||||
int *dc_cost_backtrack[3];
|
||||
JCOEF *dc_candidate[3];
|
||||
|
||||
Ss = cinfo->Ss;
|
||||
Se = cinfo->Se;
|
||||
@@ -652,11 +716,29 @@ quantize_trellis(j_compress_ptr cinfo, c_derived_tbl *actbl, JBLOCKROW coef_bloc
|
||||
accumulated_block_cost = (float *)malloc((num_blocks + 1) * sizeof(float));
|
||||
block_run_start = (int *)malloc(num_blocks * sizeof(int));
|
||||
requires_eob = (int *)malloc((num_blocks + 1) * sizeof(int));
|
||||
if (!accumulated_zero_block_cost ||
|
||||
!accumulated_block_cost ||
|
||||
!block_run_start ||
|
||||
!requires_eob) {
|
||||
ERREXIT(cinfo, JERR_OUT_OF_MEMORY);
|
||||
}
|
||||
|
||||
accumulated_zero_block_cost[0] = 0;
|
||||
accumulated_block_cost[0] = 0;
|
||||
requires_eob[0] = 0;
|
||||
}
|
||||
|
||||
if (cinfo->trellis_quant_dc) {
|
||||
for (i = 0; i < 3; i++) {
|
||||
accumulated_dc_cost[i] = (float *)malloc(num_blocks * sizeof(float));
|
||||
dc_cost_backtrack[i] = (int *)malloc(num_blocks * sizeof(int));
|
||||
dc_candidate[i] = (JCOEF *)malloc(num_blocks * sizeof(JCOEF));
|
||||
if (!accumulated_dc_cost[i] ||
|
||||
!dc_cost_backtrack[i] ||
|
||||
!dc_candidate[i]) {
|
||||
ERREXIT(cinfo, JERR_OUT_OF_MEMORY);
|
||||
}
|
||||
}
|
||||
}
|
||||
norm = 0.0;
|
||||
for (i = 1; i < DCTSIZE2; i++) {
|
||||
norm += qtbl->quantval[i] * qtbl->quantval[i];
|
||||
@@ -678,9 +760,65 @@ quantize_trellis(j_compress_ptr cinfo, c_derived_tbl *actbl, JBLOCKROW coef_bloc
|
||||
else
|
||||
lambda = pow(2.0, cinfo->lambda_log_scale1-12.0) * lambda_base;
|
||||
|
||||
lambda_dc = lambda * lambda_tbl[0];
|
||||
|
||||
accumulated_zero_dist[Ss-1] = 0.0;
|
||||
accumulated_cost[Ss-1] = 0.0;
|
||||
|
||||
// Do DC coefficient
|
||||
if (cinfo->trellis_quant_dc) {
|
||||
int sign = src[bi][0] >> 31;
|
||||
int x = abs(src[bi][0]);
|
||||
int q = 8 * qtbl->quantval[0];
|
||||
int qval;
|
||||
float dc_candidate_dist;
|
||||
|
||||
qval = (x + q/2) / q; /* quantized value (round nearest) */
|
||||
for (k = 0; k < 3; k++) {
|
||||
int delta;
|
||||
int dc_delta;
|
||||
int bits;
|
||||
|
||||
dc_candidate[k][bi] = qval - 1 + k;
|
||||
delta = dc_candidate[k][bi] * q - x;
|
||||
dc_candidate_dist = delta * delta * lambda_dc;
|
||||
dc_candidate[k][bi] *= 1 + 2*sign;
|
||||
|
||||
if (bi == 0) {
|
||||
dc_delta = dc_candidate[k][bi] - *last_dc_val;
|
||||
|
||||
// Derive number of suffix bits
|
||||
bits = 0;
|
||||
dc_delta = abs(dc_delta);
|
||||
while (dc_delta) {
|
||||
dc_delta >>= 1;
|
||||
bits++;
|
||||
}
|
||||
cost = bits + dctbl->ehufsi[bits] + dc_candidate_dist;
|
||||
accumulated_dc_cost[k][0] = cost;
|
||||
dc_cost_backtrack[k][0] = -1;
|
||||
} else {
|
||||
for (l = 0; l < 3; l++) {
|
||||
dc_delta = dc_candidate[k][bi] - dc_candidate[l][bi-1];
|
||||
|
||||
// Derive number of suffix bits
|
||||
bits = 0;
|
||||
dc_delta = abs(dc_delta);
|
||||
while (dc_delta) {
|
||||
dc_delta >>= 1;
|
||||
bits++;
|
||||
}
|
||||
cost = bits + dctbl->ehufsi[bits] + dc_candidate_dist + accumulated_dc_cost[l][bi-1];
|
||||
if (l == 0 || cost < accumulated_dc_cost[k][bi]) {
|
||||
accumulated_dc_cost[k][bi] = cost;
|
||||
dc_cost_backtrack[k][bi] = l;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Do AC coefficients
|
||||
for (i = Ss; i <= Se; i++) {
|
||||
int z = jpeg_natural_order[i];
|
||||
|
||||
@@ -864,6 +1002,28 @@ quantize_trellis(j_compress_ptr cinfo, c_derived_tbl *actbl, JBLOCKROW coef_bloc
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cinfo->trellis_quant_dc) {
|
||||
j = 0;
|
||||
for (i = 1; i < 3; i++) {
|
||||
if (accumulated_dc_cost[i][num_blocks-1] < accumulated_dc_cost[j][num_blocks-1])
|
||||
j = i;
|
||||
}
|
||||
for (bi = num_blocks-1; bi >= 0; bi--) {
|
||||
coef_blocks[bi][0] = dc_candidate[j][bi];
|
||||
j = dc_cost_backtrack[j][bi];
|
||||
}
|
||||
|
||||
// Save DC predictor
|
||||
*last_dc_val = coef_blocks[num_blocks-1][0];
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
free(accumulated_dc_cost[i]);
|
||||
free(dc_cost_backtrack[i]);
|
||||
free(dc_candidate[i]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
4
jchuff.c
4
jchuff.c
@@ -4,7 +4,7 @@
|
||||
* This file was part of the Independent JPEG Group's software:
|
||||
* Copyright (C) 1991-1997, Thomas G. Lane.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2009-2011, D. R. Commander.
|
||||
* Copyright (C) 2009-2011, 2014 D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file contains Huffman entropy encoding routines.
|
||||
@@ -408,7 +408,7 @@ dump_buffer (working_state * state)
|
||||
#endif
|
||||
|
||||
|
||||
#define BUFSIZE (DCTSIZE2 * 2)
|
||||
#define BUFSIZE (DCTSIZE2 * 2) + 8
|
||||
|
||||
#define LOAD_BUFFER() { \
|
||||
if (state->free_in_buffer < BUFSIZE) { \
|
||||
|
||||
4
jchuff.h
4
jchuff.h
@@ -44,5 +44,5 @@ EXTERN(void) jpeg_gen_optimal_table
|
||||
(j_compress_ptr cinfo, JHUFF_TBL * htbl, long freq[]);
|
||||
|
||||
EXTERN(void) quantize_trellis
|
||||
(j_compress_ptr cinfo, c_derived_tbl *actbl, JBLOCKROW coef_blocks, JBLOCKROW src, JDIMENSION num_blocks,
|
||||
JQUANT_TBL * qtbl, double *norm_src, double *norm_coef);
|
||||
(j_compress_ptr cinfo, c_derived_tbl *dctbl, c_derived_tbl *actbl, JBLOCKROW coef_blocks, JBLOCKROW src, JDIMENSION num_blocks,
|
||||
JQUANT_TBL * qtbl, double *norm_src, double *norm_coef, JCOEF *last_dc_val);
|
||||
|
||||
174
jcmarker.c
174
jcmarker.c
@@ -183,6 +183,69 @@ emit_dqt (j_compress_ptr cinfo, int index)
|
||||
return prec;
|
||||
}
|
||||
|
||||
LOCAL(int)
|
||||
emit_multi_dqt (j_compress_ptr cinfo)
|
||||
/* Emits a DQT marker containing all quantization tables */
|
||||
/* Returns number of emitted 16-bit tables, or -1 for failed for baseline checking. */
|
||||
{
|
||||
int prec[MAX_COMPONENTS];
|
||||
int seen[MAX_COMPONENTS] = { 0 };
|
||||
int fin_prec = 0;
|
||||
int ci;
|
||||
|
||||
for (ci = 0; ci < cinfo->num_components; ci++) {
|
||||
int tbl_num = cinfo->comp_info[ci].quant_tbl_no;
|
||||
int i;
|
||||
JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[tbl_num];
|
||||
|
||||
if (qtbl == NULL || qtbl->sent_table == TRUE)
|
||||
return -1;
|
||||
|
||||
prec[ci] = 0;
|
||||
for (i = 0; i < DCTSIZE2; i++)
|
||||
prec[ci] = !!(prec[ci] + (qtbl->quantval[i] > 255));
|
||||
|
||||
fin_prec += prec[ci];
|
||||
}
|
||||
|
||||
emit_marker(cinfo, M_DQT);
|
||||
|
||||
int size = 0;
|
||||
for (ci = 0; ci < cinfo->num_components; ci++) {
|
||||
int tbl_num = cinfo->comp_info[ci].quant_tbl_no;
|
||||
|
||||
if (!seen[tbl_num]) {
|
||||
size += DCTSIZE2 * (prec[ci] + 1) + 1;
|
||||
seen[tbl_num] = 1;
|
||||
}
|
||||
}
|
||||
size += 2;
|
||||
|
||||
emit_2bytes(cinfo, size);
|
||||
|
||||
for (ci = 0; ci < cinfo->num_components; ci++) {
|
||||
int tbl_num = cinfo->comp_info[ci].quant_tbl_no;
|
||||
int i;
|
||||
JQUANT_TBL * qtbl = cinfo->quant_tbl_ptrs[tbl_num];
|
||||
|
||||
if (qtbl->sent_table == TRUE)
|
||||
continue;
|
||||
|
||||
emit_byte(cinfo, tbl_num + (prec[ci] << 4));
|
||||
|
||||
for (i = 0; i < DCTSIZE2; i++) {
|
||||
unsigned int qval = qtbl->quantval[jpeg_natural_order[i]];
|
||||
|
||||
if (prec[ci])
|
||||
emit_byte(cinfo, (int) (qval >> 8));
|
||||
emit_byte(cinfo, (int) (qval & 0xFF));
|
||||
}
|
||||
|
||||
qtbl->sent_table = TRUE;
|
||||
}
|
||||
|
||||
return fin_prec;
|
||||
}
|
||||
|
||||
LOCAL(void)
|
||||
emit_dht (j_compress_ptr cinfo, int index, boolean is_ac)
|
||||
@@ -221,6 +284,112 @@ emit_dht (j_compress_ptr cinfo, int index, boolean is_ac)
|
||||
}
|
||||
}
|
||||
|
||||
LOCAL(boolean)
|
||||
emit_multi_dht (j_compress_ptr cinfo)
|
||||
/* Emit all DHT markers */
|
||||
/* Returns FALSE on failure, TRUE otherwise. */
|
||||
{
|
||||
int i, j;
|
||||
int length = 2;
|
||||
int dclens[NUM_HUFF_TBLS] = { 0 };
|
||||
int aclens[NUM_HUFF_TBLS] = { 0 };
|
||||
JHUFF_TBL *dcseen[NUM_HUFF_TBLS] = { NULL };
|
||||
JHUFF_TBL *acseen[NUM_HUFF_TBLS] = { NULL };
|
||||
|
||||
/* Calclate the total length. */
|
||||
for (i = 0; i < cinfo->comps_in_scan; i++) {
|
||||
jpeg_component_info *compptr = cinfo->cur_comp_info[i];
|
||||
int dcidx = compptr->dc_tbl_no;
|
||||
int acidx = compptr->ac_tbl_no;
|
||||
JHUFF_TBL *dctbl = cinfo->dc_huff_tbl_ptrs[dcidx];
|
||||
JHUFF_TBL *actbl = cinfo->ac_huff_tbl_ptrs[acidx];
|
||||
int seen = 0;
|
||||
|
||||
/* Handle DC table lenghts */
|
||||
if (cinfo->Ss == 0 && cinfo->Ah == 0) {
|
||||
if (dctbl == NULL)
|
||||
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, dcidx);
|
||||
|
||||
if (dctbl->sent_table)
|
||||
continue;
|
||||
|
||||
for (j = 0; j < NUM_HUFF_TBLS; j++)
|
||||
seen += (dctbl == dcseen[j]);
|
||||
if (seen)
|
||||
continue;
|
||||
dcseen[i] = dctbl;
|
||||
|
||||
for (j = 1; j <= 16; j++)
|
||||
dclens[i] += dctbl->bits[j];
|
||||
length += dclens[i] + 16 + 1;
|
||||
}
|
||||
|
||||
/* Handle AC table lengths */
|
||||
if (cinfo->Se) {
|
||||
if (actbl == NULL)
|
||||
ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, acidx + 0x10);
|
||||
|
||||
if (actbl->sent_table)
|
||||
continue;
|
||||
|
||||
seen = 0;
|
||||
for (j = 0; j < NUM_HUFF_TBLS; j++)
|
||||
seen += (actbl == acseen[j]);
|
||||
if (seen)
|
||||
continue;
|
||||
acseen[i] = actbl;
|
||||
|
||||
for (j = 1; j <= 16; j++)
|
||||
aclens[i] += actbl->bits[j];
|
||||
length += aclens[i] + 16 + 1;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* Make sure we can fit it all into one DHT marker */
|
||||
if (length > (1 << 16) - 1)
|
||||
return FALSE;
|
||||
|
||||
emit_marker(cinfo, M_DHT);
|
||||
emit_2bytes(cinfo, length);
|
||||
|
||||
for (i = 0; i < cinfo->comps_in_scan; i++) {
|
||||
jpeg_component_info *compptr = cinfo->cur_comp_info[i];
|
||||
int dcidx = compptr->dc_tbl_no;
|
||||
int acidx = compptr->ac_tbl_no;
|
||||
JHUFF_TBL *dctbl = cinfo->dc_huff_tbl_ptrs[dcidx];
|
||||
JHUFF_TBL *actbl = cinfo->ac_huff_tbl_ptrs[acidx];
|
||||
|
||||
acidx += 0x10;
|
||||
|
||||
/* DC */
|
||||
if (cinfo->Ss == 0 && cinfo->Ah == 0 && !dctbl->sent_table) {
|
||||
emit_byte(cinfo, dcidx);
|
||||
|
||||
for (j = 1; j <= 16; j++)
|
||||
emit_byte(cinfo, dctbl->bits[j]);
|
||||
|
||||
for (j = 0; j < dclens[i]; j++)
|
||||
emit_byte(cinfo, dctbl->huffval[j]);
|
||||
|
||||
dctbl->sent_table = TRUE;
|
||||
}
|
||||
|
||||
if (cinfo->Se && !actbl->sent_table) {
|
||||
emit_byte(cinfo, acidx);
|
||||
|
||||
for (j = 1; j <= 16; j++)
|
||||
emit_byte(cinfo, actbl->bits[j]);
|
||||
|
||||
for (j = 0; j < aclens[i]; j++)
|
||||
emit_byte(cinfo, actbl->huffval[j]);
|
||||
|
||||
actbl->sent_table = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
LOCAL(void)
|
||||
emit_dac (j_compress_ptr cinfo)
|
||||
@@ -504,11 +673,14 @@ write_frame_header (j_compress_ptr cinfo)
|
||||
/* Emit DQT for each quantization table.
|
||||
* Note that emit_dqt() suppresses any duplicate tables.
|
||||
*/
|
||||
prec = emit_multi_dqt(cinfo);
|
||||
if (prec == -1) {
|
||||
prec = 0;
|
||||
for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
|
||||
ci++, compptr++) {
|
||||
prec += emit_dqt(cinfo, compptr->quant_tbl_no);
|
||||
}
|
||||
}
|
||||
/* now prec is nonzero iff there are any 16-bit quant tables. */
|
||||
|
||||
/* Check for a non-baseline specification.
|
||||
@@ -571,6 +743,7 @@ write_scan_header (j_compress_ptr cinfo)
|
||||
/* Emit Huffman tables.
|
||||
* Note that emit_dht() suppresses any duplicate tables.
|
||||
*/
|
||||
if (!emit_multi_dht(cinfo)) {
|
||||
for (i = 0; i < cinfo->comps_in_scan; i++) {
|
||||
compptr = cinfo->cur_comp_info[i];
|
||||
/* DC needs no table for refinement scan */
|
||||
@@ -581,6 +754,7 @@ write_scan_header (j_compress_ptr cinfo)
|
||||
emit_dht(cinfo, compptr->ac_tbl_no, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Emit DRI if required --- note that DRI value could change for each scan.
|
||||
* We avoid wasting space with unnecessary DRIs, however.
|
||||
|
||||
19
jcmaster.c
19
jcmaster.c
@@ -45,6 +45,7 @@ typedef struct {
|
||||
int pass_number_scan_opt_base; /* pass number where scan optimization begins */
|
||||
unsigned char * scan_buffer[64]; /* buffer for a given scan */
|
||||
unsigned long scan_size[64]; /* size for a given scan */
|
||||
int actual_Al[64]; /* actual value of Al used for a scan */
|
||||
unsigned long best_cost; /* bit count for best frequency split */
|
||||
int best_freq_split_idx_luma; /* index for best frequency split (luma) */
|
||||
int best_freq_split_idx_chroma; /* index for best frequency split (chroma) */
|
||||
@@ -364,6 +365,8 @@ select_scan_parameters (j_compress_ptr cinfo)
|
||||
master->scan_number < cinfo->num_scans)
|
||||
cinfo->Al = master->best_Al_chroma;
|
||||
}
|
||||
/* save value for later retrieval during printout of scans */
|
||||
master->actual_Al[master->scan_number] = cinfo->Al;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
@@ -613,7 +616,7 @@ copy_buffer (j_compress_ptr cinfo, int scan_idx)
|
||||
for (i = 0; i < cinfo->scan_info[scan_idx].comps_in_scan; i++)
|
||||
fprintf(stderr, "%s%d", (i==0)?"":",", cinfo->scan_info[scan_idx].component_index[i]);
|
||||
fprintf(stderr, ": %d %d", cinfo->scan_info[scan_idx].Ss, cinfo->scan_info[scan_idx].Se);
|
||||
fprintf(stderr, " %d %d", cinfo->scan_info[scan_idx].Ah, cinfo->scan_info[scan_idx].Al);
|
||||
fprintf(stderr, " %d %d", cinfo->scan_info[scan_idx].Ah, master->actual_Al[scan_idx]);
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
|
||||
@@ -757,7 +760,7 @@ select_scans (j_compress_ptr cinfo, int next_scan_number)
|
||||
if (cinfo->num_scans > cinfo->num_scans_luma && !cinfo->one_dc_scan) {
|
||||
base_scan_idx = cinfo->num_scans_luma;
|
||||
|
||||
if (master->interleave_chroma_dc)
|
||||
if (master->interleave_chroma_dc && !cinfo->sep_dc_scan)
|
||||
copy_buffer(cinfo, base_scan_idx);
|
||||
else {
|
||||
copy_buffer(cinfo, base_scan_idx+1);
|
||||
@@ -933,8 +936,11 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
|
||||
else
|
||||
master->total_passes = cinfo->num_scans;
|
||||
|
||||
if (cinfo->trellis_quant)
|
||||
master->total_passes += ((cinfo->use_scans_in_trellis) ? 4 : 2) * cinfo->num_components * cinfo->trellis_num_loops;
|
||||
master->pass_number_scan_opt_base = 0;
|
||||
if (cinfo->trellis_quant) {
|
||||
master->pass_number_scan_opt_base = ((cinfo->use_scans_in_trellis) ? 4 : 2) * cinfo->num_components * cinfo->trellis_num_loops;
|
||||
master->total_passes += master->pass_number_scan_opt_base;
|
||||
}
|
||||
|
||||
if (cinfo->optimize_scans) {
|
||||
int i;
|
||||
@@ -943,9 +949,4 @@ jinit_c_master_control (j_compress_ptr cinfo, boolean transcode_only)
|
||||
for (i = 0; i < cinfo->num_scans; i++)
|
||||
master->scan_buffer[i] = NULL;
|
||||
}
|
||||
|
||||
if (cinfo->trellis_quant)
|
||||
master->pass_number_scan_opt_base = ((cinfo->use_scans_in_trellis) ? 4 : 2) * cinfo->num_components * cinfo->trellis_num_loops;
|
||||
else
|
||||
master->pass_number_scan_opt_base = 0;
|
||||
}
|
||||
|
||||
11
jconfig.h.in
11
jconfig.h.in
@@ -12,6 +12,17 @@
|
||||
/* Support arithmetic decoding */
|
||||
#undef D_ARITH_CODING_SUPPORTED
|
||||
|
||||
/*
|
||||
* Define BITS_IN_JSAMPLE as either
|
||||
* 8 for 8-bit sample values (the usual setting)
|
||||
* 12 for 12-bit sample values
|
||||
* Only 8 and 12 are legal data precisions for lossy JPEG according to the
|
||||
* JPEG standard, and the IJG code does not support anything else!
|
||||
* We do not support run-time selection of data precision, sorry.
|
||||
*/
|
||||
|
||||
#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
|
||||
|
||||
/* Define to 1 if you have the <locale.h> header file. */
|
||||
#undef HAVE_LOCALE_H
|
||||
|
||||
|
||||
@@ -114,6 +114,7 @@ typedef unsigned char boolean;
|
||||
|
||||
/* These defines indicate which image (non-JPEG) file formats are allowed. */
|
||||
|
||||
#define PNG_SUPPORTED /* PNG image file format */
|
||||
#define BMP_SUPPORTED /* BMP image file format */
|
||||
#define GIF_SUPPORTED /* GIF image file format */
|
||||
#define PPM_SUPPORTED /* PBMPLUS PPM/PGM image file format */
|
||||
|
||||
22
jcparam.c
22
jcparam.c
@@ -152,14 +152,20 @@ jpeg_set_linear_quality (j_compress_ptr cinfo, int scale_factor,
|
||||
|
||||
GLOBAL(int)
|
||||
jpeg_quality_scaling (int quality)
|
||||
{
|
||||
return jpeg_float_quality_scaling(quality);
|
||||
}
|
||||
|
||||
GLOBAL(float)
|
||||
jpeg_float_quality_scaling(float quality)
|
||||
/* Convert a user-specified quality rating to a percentage scaling factor
|
||||
* for an underlying quantization table, using our recommended scaling curve.
|
||||
* The input 'quality' factor should be 0 (terrible) to 100 (very good).
|
||||
*/
|
||||
{
|
||||
/* Safety limit on quality factor. Convert 0 to 1 to avoid zero divide. */
|
||||
if (quality <= 0) quality = 1;
|
||||
if (quality > 100) quality = 100;
|
||||
if (quality <= 0.f) quality = 1.f;
|
||||
if (quality > 100.f) quality = 100.f;
|
||||
|
||||
/* The basic table is used as-is (scaling 100) for a quality of 50.
|
||||
* Qualities 50..100 are converted to scaling percentage 200 - 2*Q;
|
||||
@@ -167,10 +173,10 @@ jpeg_quality_scaling (int quality)
|
||||
* to make all the table entries 1 (hence, minimum quantization loss).
|
||||
* Qualities 1..50 are converted to scaling percentage 5000/Q.
|
||||
*/
|
||||
if (quality < 50)
|
||||
quality = 5000 / quality;
|
||||
if (quality < 50.f)
|
||||
quality = 5000.f / quality;
|
||||
else
|
||||
quality = 200 - quality*2;
|
||||
quality = 200.f - quality*2.f;
|
||||
|
||||
return quality;
|
||||
}
|
||||
@@ -335,6 +341,7 @@ jpeg_set_defaults (j_compress_ptr cinfo)
|
||||
cinfo->trellis_freq_split = 8;
|
||||
cinfo->trellis_num_loops = 1;
|
||||
cinfo->trellis_q_opt = FALSE;
|
||||
cinfo->trellis_quant_dc = TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -730,6 +737,11 @@ jpeg_simple_progression (j_compress_ptr cinfo)
|
||||
/* Initial DC scan */
|
||||
if (cinfo->one_dc_scan)
|
||||
scanptr = fill_dc_scans(scanptr, ncomps, 0, 0);
|
||||
else if (cinfo->sep_dc_scan) {
|
||||
scanptr = fill_a_scan(scanptr, 0, 0, 0, 0, 0);
|
||||
scanptr = fill_a_scan(scanptr, 1, 0, 0, 0, 0);
|
||||
scanptr = fill_a_scan(scanptr, 2, 0, 0, 0, 0);
|
||||
}
|
||||
else {
|
||||
scanptr = fill_dc_scans(scanptr, 1, 0, 0);
|
||||
scanptr = fill_a_scan_pair(scanptr, 1, 0, 0, 0, 0);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* Copyright (C) 1994-1996, Thomas G. Lane.
|
||||
* Modified 2009-2012 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright (C) 2011, D. R. Commander.
|
||||
* Copyright (C) 2011, 2014 D. R. Commander.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
* This file contains compression data destination routines for the case of
|
||||
@@ -150,6 +150,7 @@ jpeg_mem_dest_tj (j_compress_ptr cinfo,
|
||||
unsigned char ** outbuffer, unsigned long * outsize,
|
||||
boolean alloc)
|
||||
{
|
||||
boolean reused = FALSE;
|
||||
my_mem_dest_ptr dest;
|
||||
|
||||
if (outbuffer == NULL || outsize == NULL) /* sanity check */
|
||||
@@ -164,12 +165,15 @@ jpeg_mem_dest_tj (j_compress_ptr cinfo,
|
||||
sizeof(my_mem_destination_mgr));
|
||||
dest = (my_mem_dest_ptr) cinfo->dest;
|
||||
dest->newbuffer = NULL;
|
||||
dest->buffer = NULL;
|
||||
}
|
||||
|
||||
dest = (my_mem_dest_ptr) cinfo->dest;
|
||||
dest->pub.init_destination = init_mem_destination;
|
||||
dest->pub.empty_output_buffer = empty_mem_output_buffer;
|
||||
dest->pub.term_destination = term_mem_destination;
|
||||
if (dest->buffer == *outbuffer && *outbuffer != NULL && alloc)
|
||||
reused = TRUE;
|
||||
dest->outbuffer = outbuffer;
|
||||
dest->outsize = outsize;
|
||||
dest->alloc = alloc;
|
||||
@@ -186,5 +190,7 @@ jpeg_mem_dest_tj (j_compress_ptr cinfo,
|
||||
}
|
||||
|
||||
dest->pub.next_output_byte = dest->buffer = *outbuffer;
|
||||
dest->pub.free_in_buffer = dest->bufsize = *outsize;
|
||||
if (!reused)
|
||||
dest->bufsize = *outsize;
|
||||
dest->pub.free_in_buffer = dest->bufsize;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* Modified 2011 by Guido Vollbeding.
|
||||
* libjpeg-turbo Modifications:
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright (C) 2009, 2011-2012, D. R. Commander.
|
||||
* Copyright (C) 2009, 2011-2012, 2014, D. R. Commander.
|
||||
* Copyright (C) 2013, Linaro Limited.
|
||||
* For conditions of distribution and use, see the accompanying README file.
|
||||
*
|
||||
@@ -657,8 +657,12 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
|
||||
cinfo->out_color_components = 3;
|
||||
if (cinfo->dither_mode == JDITHER_NONE) {
|
||||
if (cinfo->jpeg_color_space == JCS_YCbCr) {
|
||||
if (jsimd_can_ycc_rgb565())
|
||||
cconvert->pub.color_convert = jsimd_ycc_rgb565_convert;
|
||||
else {
|
||||
cconvert->pub.color_convert = ycc_rgb565_convert;
|
||||
build_ycc_rgb_table(cinfo);
|
||||
}
|
||||
} else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {
|
||||
cconvert->pub.color_convert = gray_rgb565_convert;
|
||||
} else if (cinfo->jpeg_color_space == JCS_RGB) {
|
||||
|
||||
1
jdct.h
1
jdct.h
@@ -41,7 +41,6 @@ typedef unsigned int UDCTELEM2;
|
||||
#endif
|
||||
#else
|
||||
typedef INT32 DCTELEM; /* must have 32 bits */
|
||||
typedef UINT32 UDCTELEM;
|
||||
typedef unsigned long long UDCTELEM2;
|
||||
#endif
|
||||
|
||||
|
||||
12
jmorecfg.h
12
jmorecfg.h
@@ -13,18 +13,6 @@
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Define BITS_IN_JSAMPLE as either
|
||||
* 8 for 8-bit sample values (the usual setting)
|
||||
* 12 for 12-bit sample values
|
||||
* Only 8 and 12 are legal data precisions for lossy JPEG according to the
|
||||
* JPEG standard, and the IJG code does not support anything else!
|
||||
* We do not support run-time selection of data precision, sorry.
|
||||
*/
|
||||
|
||||
#define BITS_IN_JSAMPLE 8 /* use 8 or 12 */
|
||||
|
||||
|
||||
/*
|
||||
* Maximum number of components (color channels) allowed in JPEG image.
|
||||
* To meet the letter of the JPEG spec, set this to 255. However, darn
|
||||
|
||||
@@ -377,7 +377,9 @@ struct jpeg_compress_struct {
|
||||
boolean use_moz_defaults; /* TRUE=use Mozilla defaults */
|
||||
boolean optimize_scans; /* TRUE=optimize progressive coding scans */
|
||||
boolean one_dc_scan; /* TRUE=use a single DC scan interleaving all components */
|
||||
boolean sep_dc_scan; /* TRUE=each DC scan is separate */
|
||||
boolean trellis_quant; /* TRUE=use trellis quantization */
|
||||
boolean trellis_quant_dc; /* TRUE=use trellis quant for DC coefficient */
|
||||
boolean trellis_eob_opt; /* TRUE=optimize for sequences of EOB */
|
||||
boolean use_flat_quant_tbl; /* TRUE=use flat quantization table */
|
||||
boolean use_lambda_weight_tbl; /* TRUE=use lambda weighting table */
|
||||
@@ -960,6 +962,7 @@ EXTERN(void) jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
|
||||
const unsigned int *basic_table,
|
||||
int scale_factor, boolean force_baseline);
|
||||
EXTERN(int) jpeg_quality_scaling (int quality);
|
||||
EXTERN(float) jpeg_float_quality_scaling (float quality);
|
||||
EXTERN(void) jpeg_simple_progression (j_compress_ptr cinfo);
|
||||
EXTERN(void) jpeg_suppress_tables (j_compress_ptr cinfo, boolean suppress);
|
||||
EXTERN(JQUANT_TBL *) jpeg_alloc_quant_table (j_common_ptr cinfo);
|
||||
|
||||
@@ -104,11 +104,19 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
yuv_size = luma_width*luma_height + 2*chroma_width*chroma_height;
|
||||
yuv_buffer = malloc(yuv_size);
|
||||
if (!yuv_buffer) {
|
||||
fprintf(stderr, "Memory allocation failure!\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
frame_width = (cinfo.output_width + (16 - 1)) & ~(16 - 1);
|
||||
frame_height = (cinfo.output_height + (16 - 1)) & ~(16 - 1);
|
||||
|
||||
image_buffer = malloc(frame_width*16 + 2*(frame_width/2)*8);
|
||||
if (!image_buffer) {
|
||||
fprintf(stderr, "Memory allocation failure!\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
plane_pointer[0] = yrow_pointer;
|
||||
plane_pointer[1] = cbrow_pointer;
|
||||
|
||||
6
jsimd.h
6
jsimd.h
@@ -2,7 +2,7 @@
|
||||
* jsimd.h
|
||||
*
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright 2011 D. R. Commander
|
||||
* Copyright 2011, 2014 D. R. Commander
|
||||
*
|
||||
* Based on the x86 SIMD extension for IJG JPEG library,
|
||||
* Copyright (C) 1999-2006, MIYASAKA Masaru.
|
||||
@@ -13,6 +13,7 @@
|
||||
EXTERN(int) jsimd_can_rgb_ycc (void);
|
||||
EXTERN(int) jsimd_can_rgb_gray (void);
|
||||
EXTERN(int) jsimd_can_ycc_rgb (void);
|
||||
EXTERN(int) jsimd_can_ycc_rgb565 (void);
|
||||
EXTERN(int) jsimd_c_can_null_convert (void);
|
||||
|
||||
EXTERN(void) jsimd_rgb_ycc_convert
|
||||
@@ -24,6 +25,9 @@ EXTERN(void) jsimd_rgb_gray_convert
|
||||
EXTERN(void) jsimd_ycc_rgb_convert
|
||||
(j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows);
|
||||
EXTERN(void) jsimd_ycc_rgb565_convert
|
||||
(j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows);
|
||||
EXTERN(void) jsimd_c_null_convert
|
||||
(j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
JDIMENSION output_row, int num_rows);
|
||||
|
||||
15
jsimd_none.c
15
jsimd_none.c
@@ -2,7 +2,7 @@
|
||||
* jsimd_none.c
|
||||
*
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright 2009-2011 D. R. Commander
|
||||
* Copyright 2009-2011, 2014 D. R. Commander
|
||||
*
|
||||
* Based on the x86 SIMD extension for IJG JPEG library,
|
||||
* Copyright (C) 1999-2006, MIYASAKA Masaru.
|
||||
@@ -36,6 +36,12 @@ jsimd_can_ycc_rgb (void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_ycc_rgb565 (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_c_can_null_convert (void)
|
||||
{
|
||||
@@ -63,6 +69,13 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_ycc_rgb565_convert (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_c_null_convert (j_compress_ptr cinfo,
|
||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
|
||||
116
rdpng.c
Normal file
116
rdpng.c
Normal file
@@ -0,0 +1,116 @@
|
||||
|
||||
#include "cdjpeg.h" /* Common decls for cjpeg/djpeg applications */
|
||||
|
||||
#ifdef PNG_SUPPORTED
|
||||
|
||||
#include <png.h> /* if this fails, you need to install libpng-devel */
|
||||
|
||||
|
||||
typedef struct png_source_struct {
|
||||
struct cjpeg_source_struct pub;
|
||||
png_structp png_ptr;
|
||||
png_infop info_ptr;
|
||||
JDIMENSION current_row;
|
||||
} png_source_struct;
|
||||
|
||||
|
||||
METHODDEF(void)
|
||||
finish_input_png (j_compress_ptr cinfo, cjpeg_source_ptr sinfo);
|
||||
|
||||
METHODDEF(JDIMENSION)
|
||||
get_pixel_rows_png (j_compress_ptr cinfo, cjpeg_source_ptr sinfo);
|
||||
|
||||
METHODDEF(void)
|
||||
start_input_png (j_compress_ptr cinfo, cjpeg_source_ptr sinfo);
|
||||
|
||||
|
||||
GLOBAL(cjpeg_source_ptr)
|
||||
jinit_read_png(j_compress_ptr cinfo)
|
||||
{
|
||||
png_source_struct *source = (*cinfo->mem->alloc_small)((j_common_ptr) cinfo, JPOOL_IMAGE, sizeof(png_source_struct));
|
||||
|
||||
memset(source, 0, sizeof(*source));
|
||||
|
||||
/* Fill in method ptrs, except get_pixel_rows which start_input sets */
|
||||
source->pub.start_input = start_input_png;
|
||||
source->pub.finish_input = finish_input_png;
|
||||
|
||||
return &source->pub;
|
||||
}
|
||||
|
||||
METHODDEF(void) error_input_png(png_structp png_ptr, png_const_charp msg) {
|
||||
j_compress_ptr cinfo = png_get_error_ptr(png_ptr);
|
||||
ERREXITS(cinfo, JERR_PNG_ERROR, msg);
|
||||
}
|
||||
|
||||
METHODDEF(void)
|
||||
start_input_png (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
|
||||
{
|
||||
png_source_struct *source = (png_source_struct *)sinfo;
|
||||
|
||||
source->png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, cinfo, error_input_png, NULL);
|
||||
source->info_ptr = png_create_info_struct(source->png_ptr);
|
||||
|
||||
if (!source->png_ptr || !source->info_ptr) {
|
||||
ERREXITS(cinfo, JERR_PNG_ERROR, "Can't create read/info_struct");
|
||||
return;
|
||||
}
|
||||
|
||||
png_set_palette_to_rgb(source->png_ptr);
|
||||
png_set_expand_gray_1_2_4_to_8(source->png_ptr);
|
||||
png_set_strip_alpha(source->png_ptr);
|
||||
png_set_interlace_handling(source->png_ptr);
|
||||
|
||||
png_init_io(source->png_ptr, source->pub.input_file);
|
||||
png_read_info(source->png_ptr, source->info_ptr);
|
||||
|
||||
png_uint_32 width, height;
|
||||
int bit_depth, color_type;
|
||||
png_get_IHDR(source->png_ptr, source->info_ptr, &width, &height,
|
||||
&bit_depth, &color_type, NULL, NULL, NULL);
|
||||
|
||||
if (color_type == PNG_COLOR_TYPE_GRAY) {
|
||||
cinfo->in_color_space = JCS_GRAYSCALE;
|
||||
cinfo->input_components = 1;
|
||||
} else {
|
||||
cinfo->in_color_space = JCS_RGB;
|
||||
cinfo->input_components = 3;
|
||||
}
|
||||
cinfo->data_precision = 8;
|
||||
cinfo->image_width = width;
|
||||
cinfo->image_height = height;
|
||||
|
||||
double gamma = 0.45455;
|
||||
if (!png_get_valid(source->png_ptr, source->info_ptr, PNG_INFO_sRGB)) {
|
||||
png_get_gAMA(source->png_ptr, source->info_ptr, &gamma);
|
||||
}
|
||||
cinfo->input_gamma = gamma;
|
||||
sinfo->get_pixel_rows = get_pixel_rows_png;
|
||||
|
||||
png_read_update_info(source->png_ptr, source->info_ptr);
|
||||
|
||||
png_size_t rowbytes = png_get_rowbytes(source->png_ptr, source->info_ptr);
|
||||
|
||||
source->pub.buffer = (*cinfo->mem->alloc_sarray)((j_common_ptr)cinfo, JPOOL_IMAGE, (JDIMENSION)rowbytes, 1);
|
||||
source->pub.buffer_height = 1;
|
||||
}
|
||||
|
||||
METHODDEF(JDIMENSION)
|
||||
get_pixel_rows_png (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
|
||||
{
|
||||
png_source_struct *source = (png_source_struct *)sinfo;
|
||||
|
||||
png_read_row(source->png_ptr, source->pub.buffer[0], NULL);
|
||||
return 1;
|
||||
}
|
||||
|
||||
METHODDEF(void)
|
||||
finish_input_png (j_compress_ptr cinfo, cjpeg_source_ptr sinfo)
|
||||
{
|
||||
png_source_struct *source = (png_source_struct *)sinfo;
|
||||
|
||||
png_read_end(source->png_ptr, source->info_ptr);
|
||||
png_destroy_read_struct(&source->png_ptr, &source->info_ptr, NULL);
|
||||
}
|
||||
|
||||
#endif
|
||||
12
rdswitch.c
12
rdswitch.c
@@ -336,31 +336,31 @@ set_quality_ratings (j_compress_ptr cinfo, char *arg, boolean force_baseline)
|
||||
* If there are more q-table slots than parameters, the last value is replicated.
|
||||
*/
|
||||
{
|
||||
int val = 75; /* default value */
|
||||
float val = 75.f; /* default value */
|
||||
int tblno;
|
||||
char ch;
|
||||
|
||||
for (tblno = 0; tblno < NUM_QUANT_TBLS; tblno++) {
|
||||
if (*arg) {
|
||||
ch = ','; /* if not set by sscanf, will be ',' */
|
||||
if (sscanf(arg, "%d%c", &val, &ch) < 1)
|
||||
if (sscanf(arg, "%f%c", &val, &ch) < 1)
|
||||
return FALSE;
|
||||
if (ch != ',') /* syntax check */
|
||||
return FALSE;
|
||||
/* Convert user 0-100 rating to percentage scaling */
|
||||
#if JPEG_LIB_VERSION >= 70
|
||||
cinfo->q_scale_factor[tblno] = jpeg_quality_scaling(val);
|
||||
cinfo->q_scale_factor[tblno] = jpeg_float_quality_scaling(val);
|
||||
#else
|
||||
q_scale_factor[tblno] = jpeg_quality_scaling(val);
|
||||
q_scale_factor[tblno] = jpeg_float_quality_scaling(val);
|
||||
#endif
|
||||
while (*arg && *arg++ != ',') /* advance to next segment of arg string */
|
||||
;
|
||||
} else {
|
||||
/* reached end of parameter, set remaining factors to last value */
|
||||
#if JPEG_LIB_VERSION >= 70
|
||||
cinfo->q_scale_factor[tblno] = jpeg_quality_scaling(val);
|
||||
cinfo->q_scale_factor[tblno] = jpeg_float_quality_scaling(val);
|
||||
#else
|
||||
q_scale_factor[tblno] = jpeg_quality_scaling(val);
|
||||
q_scale_factor[tblno] = jpeg_float_quality_scaling(val);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ Architecture: {__ARCH}
|
||||
Essential: no
|
||||
Maintainer: The libmozjpeg Project <joshmoz@gmail.com>
|
||||
Homepage: https://github.com/mozilla/mozjpeg
|
||||
Installed-Size: {__SIZE}
|
||||
Description: A SIMD-accelerated JPEG codec that provides both the libjpeg and TurboJPEG APIs
|
||||
libmozjpeg is a JPEG image codec that uses SIMD instructions (MMX, SSE2,
|
||||
NEON) to accelerate baseline JPEG compression and decompression on x86,
|
||||
|
||||
@@ -7,14 +7,20 @@ trap onexit TERM
|
||||
trap onexit EXIT
|
||||
|
||||
TMPDIR=
|
||||
SUDO=
|
||||
|
||||
onexit()
|
||||
{
|
||||
if [ ! "$TMPDIR" = "" ]; then
|
||||
sudo rm -rf $TMPDIR
|
||||
$SUDO rm -rf $TMPDIR
|
||||
fi
|
||||
}
|
||||
|
||||
uid()
|
||||
{
|
||||
id | cut -f2 -d = | cut -f1 -d \(;
|
||||
}
|
||||
|
||||
makedeb()
|
||||
{
|
||||
SUPPLEMENT=$1
|
||||
@@ -29,9 +35,6 @@ makedeb()
|
||||
rm -f $PACKAGE_NAME\_$VERSION\_$DEBARCH.deb
|
||||
TMPDIR=`mktemp -d /tmp/$PACKAGE_NAME-build.XXXXXX`
|
||||
mkdir $TMPDIR/DEBIAN
|
||||
(cat $SRCDIR/release/deb-control.tmpl | sed s/{__PKGNAME}/$PACKAGE_NAME/g \
|
||||
| sed s/{__VERSION}/$VERSION/g | sed s/{__BUILD}/$BUILD/g \
|
||||
| sed s/{__ARCH}/$DEBARCH/g > $TMPDIR/DEBIAN/control)
|
||||
|
||||
if [ $SUPPLEMENT = 1 ]; then
|
||||
make install DESTDIR=$TMPDIR bindir=/dummy/bin datadir=/dummy/data \
|
||||
@@ -47,9 +50,16 @@ makedeb()
|
||||
fi
|
||||
fi
|
||||
|
||||
SIZE=`du -s $TMPDIR | cut -f1`
|
||||
(cat $SRCDIR/release/deb-control.tmpl | sed s/{__PKGNAME}/$PACKAGE_NAME/g \
|
||||
| sed s/{__VERSION}/$VERSION/g | sed s/{__BUILD}/$BUILD/g \
|
||||
| sed s/{__ARCH}/$DEBARCH/g | sed s/{__SIZE}/$SIZE/g \
|
||||
> $TMPDIR/DEBIAN/control)
|
||||
|
||||
|
||||
/sbin/ldconfig -n $TMPDIR$LIBDIR
|
||||
|
||||
sudo chown -Rh root:root $TMPDIR/*
|
||||
$SUDO chown -Rh root:root $TMPDIR/*
|
||||
dpkg -b $TMPDIR $PACKAGE_NAME\_$VERSION\_$DEBARCH.deb
|
||||
}
|
||||
|
||||
@@ -62,6 +72,10 @@ PREFIX=%{__prefix}
|
||||
DOCDIR=%{__docdir}
|
||||
LIBDIR=%{__libdir}
|
||||
|
||||
if [ ! `uid` -eq 0 ]; then
|
||||
SUDO=sudo
|
||||
fi
|
||||
|
||||
makedeb 0
|
||||
if [ "$DEBARCH" = "i386" ]; then makedeb 1; fi
|
||||
|
||||
|
||||
@@ -42,16 +42,22 @@ if(WITH_SIMD)
|
||||
add_dependencies(jpeg simd)
|
||||
endif()
|
||||
|
||||
add_executable(cjpeg ../cjpeg.c ../cdjpeg.c ../rdbmp.c ../rdgif.c ../rdppm.c
|
||||
../rdswitch.c ../rdtarga.c ../rdjpeg.c)
|
||||
set_property(TARGET cjpeg PROPERTY COMPILE_FLAGS
|
||||
"-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED -DUSE_SETMODE")
|
||||
if(WITH_12BIT)
|
||||
set(COMPILE_FLAGS "-DGIF_SUPPORTED -DPPM_SUPPORTED -DUSE_SETMODE")
|
||||
else()
|
||||
set(COMPILE_FLAGS "-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED -DUSE_SETMODE")
|
||||
set(CJPEG_BMP_SOURCES ../rdbmp.c ../rdtarga.c)
|
||||
set(DJPEG_BMP_SOURCES ../wrbmp.c ../wrtarga.c)
|
||||
endif()
|
||||
|
||||
add_executable(cjpeg ../cjpeg.c ../cdjpeg.c ../rdgif.c ../rdppm.c ../rdjpeg.c
|
||||
../rdswitch.c ${CJPEG_BMP_SOURCES})
|
||||
set_property(TARGET cjpeg PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS})
|
||||
target_link_libraries(cjpeg jpeg)
|
||||
|
||||
add_executable(djpeg ../djpeg.c ../cdjpeg.c ../rdcolmap.c ../rdswitch.c
|
||||
../wrbmp.c ../wrgif.c ../wrppm.c ../wrtarga.c)
|
||||
set_property(TARGET djpeg PROPERTY COMPILE_FLAGS
|
||||
"-DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED -DTARGA_SUPPORTED -DUSE_SETMODE")
|
||||
../wrgif.c ../wrppm.c ${DJPEG_BMP_SOURCES})
|
||||
set_property(TARGET djpeg PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS})
|
||||
target_link_libraries(djpeg jpeg)
|
||||
|
||||
add_executable(jpegtran ../jpegtran.c ../cdjpeg.c ../rdswitch.c ../transupp.c)
|
||||
|
||||
@@ -3,12 +3,15 @@ if(NOT DEFINED NASM)
|
||||
endif()
|
||||
|
||||
if(SIMD_X86_64)
|
||||
set(NAFLAGS -fwin64 -DWIN64 -D__x86_64__ "-I${CMAKE_SOURCE_DIR}/win/"
|
||||
"-I${CMAKE_CURRENT_SOURCE_DIR}/")
|
||||
set(NAFLAGS -fwin64 -DWIN64 -D__x86_64__)
|
||||
else()
|
||||
set(NAFLAGS -fwin32 -DWIN32 "-I${CMAKE_SOURCE_DIR}/win/"
|
||||
"-I${CMAKE_CURRENT_SOURCE_DIR}/")
|
||||
if(BORLAND)
|
||||
set(NAFLAGS -fobj -DOBJ32)
|
||||
else()
|
||||
set(NAFLAGS -fwin32 -DWIN32)
|
||||
endif()
|
||||
endif()
|
||||
set(NAFLAGS ${NAFLAGS} -I${CMAKE_SOURCE_DIR}/win/ -I${CMAKE_CURRENT_SOURCE_DIR}/)
|
||||
|
||||
# This only works if building from the command line. There is currently no way
|
||||
# to set a variable's value based on the build type when using the MSVC IDE.
|
||||
|
||||
@@ -60,7 +60,7 @@ endif
|
||||
|
||||
if SIMD_ARM_64
|
||||
|
||||
libsimd_la_SOURCES = jsimd_arm64.c jsimd_arm_neon_64.S
|
||||
libsimd_la_SOURCES = jsimd_arm64.c jsimd_arm64_neon.S
|
||||
|
||||
endif
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright 2011 D. R. Commander
|
||||
* Copyright (C) 2013-2014, MIPS Technologies, Inc., California
|
||||
* Copyright (C) 2014 Linaro Limited
|
||||
*
|
||||
* Based on the x86 SIMD extension for IJG JPEG library,
|
||||
* Copyright (C) 1999-2006, MIYASAKA Masaru.
|
||||
@@ -249,6 +250,9 @@ EXTERN(void) jsimd_ycc_extxbgr_convert_neon
|
||||
EXTERN(void) jsimd_ycc_extxrgb_convert_neon
|
||||
(JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows);
|
||||
EXTERN(void) jsimd_ycc_rgb565_convert_neon
|
||||
(JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows);
|
||||
|
||||
EXTERN(void) jsimd_ycc_rgb_convert_mips_dspr2
|
||||
(JDIMENSION out_width, JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* jsimd_arm.c
|
||||
*
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright 2009-2011, 2013 D. R. Commander
|
||||
* Copyright 2009-2011, 2013-2014 D. R. Commander
|
||||
*
|
||||
* Based on the x86 SIMD extension for IJG JPEG library,
|
||||
* Copyright (C) 1999-2006, MIYASAKA Masaru.
|
||||
@@ -175,6 +175,23 @@ jsimd_can_ycc_rgb (void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_ycc_rgb565 (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_ARM_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
|
||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
@@ -260,6 +277,16 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
|
||||
neonfct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_ycc_rgb565_convert (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
if (simd_support & JSIMD_ARM_NEON)
|
||||
jsimd_ycc_rgb565_convert_neon(cinfo->output_width, input_buf, input_row,
|
||||
output_buf, num_rows);
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v2_downsample (void)
|
||||
{
|
||||
|
||||
@@ -27,98 +27,29 @@
|
||||
|
||||
static unsigned int simd_support = ~0;
|
||||
|
||||
#if defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)
|
||||
|
||||
#define SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT (1024 * 1024)
|
||||
|
||||
LOCAL(int)
|
||||
check_feature (char *buffer, char *feature)
|
||||
{
|
||||
char *p;
|
||||
if (*feature == 0)
|
||||
return 0;
|
||||
if (strncmp(buffer, "Features", 8) != 0)
|
||||
return 0;
|
||||
buffer += 8;
|
||||
while (isspace(*buffer))
|
||||
buffer++;
|
||||
|
||||
/* Check if 'feature' is present in the buffer as a separate word */
|
||||
while ((p = strstr(buffer, feature))) {
|
||||
if (p > buffer && !isspace(*(p - 1))) {
|
||||
buffer++;
|
||||
continue;
|
||||
}
|
||||
p += strlen(feature);
|
||||
if (*p != 0 && !isspace(*p)) {
|
||||
buffer++;
|
||||
continue;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
LOCAL(int)
|
||||
parse_proc_cpuinfo (int bufsize)
|
||||
{
|
||||
char *buffer = (char *)malloc(bufsize);
|
||||
FILE *fd;
|
||||
simd_support = 0;
|
||||
|
||||
if (!buffer)
|
||||
return 0;
|
||||
|
||||
fd = fopen("/proc/cpuinfo", "r");
|
||||
if (fd) {
|
||||
while (fgets(buffer, bufsize, fd)) {
|
||||
if (!strchr(buffer, '\n') && !feof(fd)) {
|
||||
/* "impossible" happened - insufficient size of the buffer! */
|
||||
fclose(fd);
|
||||
free(buffer);
|
||||
return 0;
|
||||
}
|
||||
if (check_feature(buffer, "neon"))
|
||||
simd_support |= JSIMD_ARM_NEON;
|
||||
}
|
||||
fclose(fd);
|
||||
}
|
||||
free(buffer);
|
||||
return 1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Check what SIMD accelerations are supported.
|
||||
*
|
||||
* FIXME: This code is racy under a multi-threaded environment.
|
||||
*/
|
||||
|
||||
/*
|
||||
* ARMv8 architectures support NEON extensions by default.
|
||||
* It is no longer optional as it was with ARMv7.
|
||||
*/
|
||||
|
||||
|
||||
LOCAL(void)
|
||||
init_simd (void)
|
||||
{
|
||||
char *env = NULL;
|
||||
#if !defined(__ARM_NEON__) && defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)
|
||||
int bufsize = 1024; /* an initial guess for the line buffer size limit */
|
||||
#endif
|
||||
|
||||
if (simd_support != ~0U)
|
||||
return;
|
||||
|
||||
simd_support = 0;
|
||||
|
||||
#if defined(__ARM_NEON__)
|
||||
simd_support |= JSIMD_ARM_NEON;
|
||||
#elif defined(__linux__) || defined(ANDROID) || defined(__ANDROID__)
|
||||
/* We still have a chance to use NEON regardless of globally used
|
||||
* -mcpu/-mfpu options passed to gcc by performing runtime detection via
|
||||
* /proc/cpuinfo parsing on linux/android */
|
||||
while (!parse_proc_cpuinfo(bufsize)) {
|
||||
bufsize *= 2;
|
||||
if (bufsize > SOMEWHAT_SANE_PROC_CPUINFO_SIZE_LIMIT)
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Force different settings through environment variables */
|
||||
env = getenv("JSIMD_FORCENEON");
|
||||
@@ -164,6 +95,23 @@ jsimd_can_ycc_rgb (void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_ycc_rgb565 (void)
|
||||
{
|
||||
init_simd();
|
||||
|
||||
/* The code is optimised for these values only */
|
||||
if (BITS_IN_JSAMPLE != 8)
|
||||
return 0;
|
||||
if (sizeof(JDIMENSION) != 4)
|
||||
return 0;
|
||||
|
||||
if (simd_support & JSIMD_ARM_NEON)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
|
||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
@@ -217,6 +165,16 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
|
||||
neonfct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_ycc_rgb565_convert (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
if (simd_support & JSIMD_ARM_NEON)
|
||||
jsimd_ycc_rgb565_convert_neon(cinfo->output_width, input_buf, input_row,
|
||||
output_buf, num_rows);
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v2_downsample (void)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
* All rights reserved.
|
||||
* Author: Siarhei Siamashka <siarhei.siamashka@nokia.com>
|
||||
* Copyright (C) 2013, Linaro Limited
|
||||
* Copyright (C) 2013-2014, Linaro Limited
|
||||
* Author: Ragesh Radhakrishnan <ragesh.r@linaro.org>
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
@@ -34,19 +34,15 @@
|
||||
|
||||
#define RESPECT_STRICT_ALIGNMENT 1
|
||||
|
||||
#define RTSM_SQSHRN_SIM_ISSUE
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/* Supplementary macro for setting function attributes */
|
||||
.macro asm_function fname
|
||||
#ifdef __APPLE__
|
||||
.func _\fname
|
||||
.globl _\fname
|
||||
_\fname:
|
||||
#else
|
||||
.func \fname
|
||||
.global \fname
|
||||
#ifdef __ELF__
|
||||
.hidden \fname
|
||||
@@ -257,8 +253,18 @@ asm_function jsimd_idct_islow_neon
|
||||
ROW6R .req v29
|
||||
ROW7L .req v30
|
||||
ROW7R .req v31
|
||||
|
||||
/* Save all NEON registers and x15 (32 NEON registers * 8 bytes + 16) */
|
||||
sub sp, sp, 272
|
||||
str x15, [sp], 16
|
||||
adr x15, jsimd_idct_islow_neon_consts
|
||||
st1 {v0.8b - v3.8b}, [sp], 32
|
||||
st1 {v4.8b - v7.8b}, [sp], 32
|
||||
st1 {v8.8b - v11.8b}, [sp], 32
|
||||
st1 {v12.8b - v15.8b}, [sp], 32
|
||||
st1 {v16.8b - v19.8b}, [sp], 32
|
||||
st1 {v20.8b - v23.8b}, [sp], 32
|
||||
st1 {v24.8b - v27.8b}, [sp], 32
|
||||
st1 {v28.8b - v31.8b}, [sp], 32
|
||||
ld1 {v16.4h, v17.4h, v18.4h, v19.4h}, [COEF_BLOCK], 32
|
||||
ld1 {v0.4h, v1.4h, v2.4h, v3.4h}, [DCT_TABLE], 32
|
||||
ld1 {v20.4h, v21.4h, v22.4h, v23.4h}, [COEF_BLOCK], 32
|
||||
@@ -277,7 +283,7 @@ asm_function jsimd_idct_islow_neon
|
||||
mul v22.4h, v22.4h, v6.4h
|
||||
mul v23.4h, v23.4h, v7.4h
|
||||
ins v22.2d[1], v23.2d[0] /* 128 bit q11 */
|
||||
ld1 {v28.4h, v29.4h, v30.4h, v31.4h}, [COEF_BLOCK], 32
|
||||
ld1 {v28.4h, v29.4h, v30.4h, v31.4h}, [COEF_BLOCK]
|
||||
mul v24.4h, v24.4h, v0.4h
|
||||
mul v25.4h, v25.4h, v1.4h
|
||||
ins v24.2d[1], v25.2d[0] /* 128 bit q12 */
|
||||
@@ -293,10 +299,11 @@ asm_function jsimd_idct_islow_neon
|
||||
mul v30.4h, v30.4h, v6.4h
|
||||
mul v31.4h, v31.4h, v7.4h
|
||||
ins v30.2d[1], v31.2d[0] /* 128 bit q15 */
|
||||
sub sp, sp, #32
|
||||
st1 {v8.4h-v11.4h}, [sp] /* save NEON registers */
|
||||
sub sp, sp, #32
|
||||
st1 {v12.4h-v15.4h}, [sp]
|
||||
/* Go to the bottom of the stack */
|
||||
sub sp, sp, 352
|
||||
stp x4, x5, [sp], 16
|
||||
st1 {v8.4h - v11.4h}, [sp], 32 /* save NEON registers */
|
||||
st1 {v12.4h - v15.4h}, [sp], 32
|
||||
/* 1-D IDCT, pass 1, left 4x8 half */
|
||||
add v4.4h, ROW7L.4h, ROW3L.4h
|
||||
add v5.4h, ROW5L.4h, ROW1L.4h
|
||||
@@ -304,25 +311,22 @@ asm_function jsimd_idct_islow_neon
|
||||
smlal v12.4s, v5.4h, XFIX_1_175875602
|
||||
smull v14.4s, v4.4h, XFIX_1_175875602
|
||||
/* Check for the zero coefficients in the right 4x8 half */
|
||||
/* push {x4, x5} */
|
||||
stp x4, x5, [sp, -16]!
|
||||
mov x5, #0
|
||||
smlal v14.4s, v5.4h, XFIX_1_175875602_MINUS_0_390180644
|
||||
ssubl v6.4s, ROW0L.4h, ROW4L.4h
|
||||
ldr x4, [COEF_BLOCK, #(-96 + 2 * (4 + 1 * 8))]
|
||||
ldp w4, w5, [COEF_BLOCK, #(-96 + 2 * (4 + 1 * 8))]
|
||||
smull v4.4s, ROW2L.4h, XFIX_0_541196100
|
||||
smlal v4.4s, ROW6L.4h, XFIX_0_541196100_MINUS_1_847759065
|
||||
orr x0, x4, x5
|
||||
mov v8.16b, v12.16b
|
||||
smlsl v12.4s, ROW5L.4h, XFIX_2_562915447
|
||||
ldr x4, [COEF_BLOCK, #(-96 + 2 * (4 + 2 * 8))]
|
||||
ldp w4, w5, [COEF_BLOCK, #(-96 + 2 * (4 + 2 * 8))]
|
||||
smlal v12.4s, ROW3L.4h, XFIX_3_072711026_MINUS_2_562915447
|
||||
shl v6.4s, v6.4s, #13
|
||||
orr x0, x0, x4
|
||||
smlsl v8.4s, ROW1L.4h, XFIX_0_899976223
|
||||
orr x0, x0 , x5
|
||||
add v2.4s, v6.4s, v4.4s
|
||||
ldr x4, [COEF_BLOCK, #(-96 + 2 * (4 + 3 * 8))]
|
||||
ldp w4, w5, [COEF_BLOCK, #(-96 + 2 * (4 + 3 * 8))]
|
||||
mov v10.16b, v14.16b
|
||||
add v2.4s, v2.4s, v12.4s
|
||||
orr x0, x0, x4
|
||||
@@ -330,7 +334,7 @@ asm_function jsimd_idct_islow_neon
|
||||
orr x0, x0, x5
|
||||
smlal v14.4s, ROW1L.4h, XFIX_1_501321110_MINUS_0_899976223
|
||||
rshrn ROW1L.4h, v2.4s, #11
|
||||
ldr x4, [COEF_BLOCK, #(-96 + 2 * (4 + 4 * 8))]
|
||||
ldp w4, w5, [COEF_BLOCK, #(-96 + 2 * (4 + 4 * 8))]
|
||||
sub v2.4s, v2.4s, v12.4s
|
||||
smlal v10.4s, ROW5L.4h, XFIX_2_053119869_MINUS_2_562915447
|
||||
orr x0, x0, x4
|
||||
@@ -338,40 +342,41 @@ asm_function jsimd_idct_islow_neon
|
||||
orr x0, x0, x5
|
||||
sub v2.4s, v2.4s, v12.4s
|
||||
smull v12.4s, ROW2L.4h, XFIX_0_541196100_PLUS_0_765366865
|
||||
ldr x4, [COEF_BLOCK, #(-96 + 2 * (4 + 5 * 8))]
|
||||
ldp w4, w5, [COEF_BLOCK, #(-96 + 2 * (4 + 5 * 8))]
|
||||
smlal v12.4s, ROW6L.4h, XFIX_0_541196100
|
||||
sub v6.4s, v6.4s, v4.4s
|
||||
orr x0, x0, x4
|
||||
rshrn ROW6L.4h, v2.4s, #11
|
||||
orr x0, x0, x5
|
||||
add v2.4s, v6.4s, v10.4s
|
||||
ldr x4, [COEF_BLOCK, #(-96 + 2 * (4 + 6 * 8))]
|
||||
ldp w4, w5, [COEF_BLOCK, #(-96 + 2 * (4 + 6 * 8))]
|
||||
sub v6.4s, v6.4s, v10.4s
|
||||
saddl v10.4s, ROW0L.4h, ROW4L.4h
|
||||
orr x0, x0, x4
|
||||
rshrn ROW2L.4h, v2.4s, #11
|
||||
orr x0, x0, x5
|
||||
rshrn ROW5L.4h, v6.4s, #11
|
||||
ldr x4, [COEF_BLOCK, #(-96 + 2 * (4 + 7 * 8))]
|
||||
ldp w4, w5, [COEF_BLOCK, #(-96 + 2 * (4 + 7 * 8))]
|
||||
shl v10.4s, v10.4s, #13
|
||||
smlal v8.4s, ROW7L.4h, XFIX_0_298631336_MINUS_0_899976223
|
||||
orr x0, x0, x4
|
||||
add v4.4s, v10.4s, v12.4s
|
||||
orr x0, x0, x5
|
||||
cmp x0, #0 /* orrs instruction removed */
|
||||
sub v2.4s, v10.4s, v12.4s
|
||||
add v12.4s, v4.4s, v14.4s
|
||||
ldr x4, [COEF_BLOCK, #(-96 + 2 * (4 + 0 * 8))]
|
||||
ldp w4, w5, [COEF_BLOCK, #(-96 + 2 * (4 + 0 * 8))]
|
||||
sub v4.4s, v4.4s, v14.4s
|
||||
add v10.4s, v2.4s, v8.4s
|
||||
orr x0, x4, x5
|
||||
sub v6.4s, v2.4s, v8.4s
|
||||
/* pop {x4, x5} */
|
||||
sub sp, sp, 80
|
||||
ldp x4, x5, [sp], 16
|
||||
rshrn ROW7L.4h, v4.4s, #11
|
||||
rshrn ROW3L.4h, v10.4s, #11
|
||||
rshrn ROW0L.4h, v12.4s, #11
|
||||
rshrn ROW4L.4h, v6.4s, #11
|
||||
cmp x0, #0 /* orrs instruction removed */
|
||||
|
||||
beq 3f /* Go to do some special handling for the sparse right 4x8 half */
|
||||
|
||||
@@ -433,7 +438,7 @@ asm_function jsimd_idct_islow_neon
|
||||
add v12.4s, v4.4s, v14.4s
|
||||
sub v4.4s, v4.4s, v14.4s
|
||||
add v10.4s, v2.4s, v8.4s
|
||||
sub v12.4s, v2.4s, v8.4s
|
||||
sub v6.4s, v2.4s, v8.4s
|
||||
rshrn ROW7R.4h, v4.4s, #11
|
||||
rshrn ROW3R.4h, v10.4s, #11
|
||||
rshrn ROW0R.4h, v12.4s, #11
|
||||
@@ -552,48 +557,27 @@ asm_function jsimd_idct_islow_neon
|
||||
ins v18.2d[1], v19.2d[0]
|
||||
ins v20.2d[1], v21.2d[0]
|
||||
ins v22.2d[1], v23.2d[0]
|
||||
#ifdef RTSM_SQSHRN_SIM_ISSUE
|
||||
sqrshrn v16.8b, v16.8h, #2
|
||||
sqrshrn2 v16.16b, v18.8h, #2
|
||||
sqrshrn v18.8b, v20.8h, #2
|
||||
sqrshrn2 v18.16b, v22.8h, #2
|
||||
#else
|
||||
sqrshrn v16.4h, v16.4s, #2
|
||||
sqrshrn2 v16.8h, v18.4s, #2
|
||||
sqrshrn v18.4h, v20.4s, #2
|
||||
sqrshrn2 v18.8h, v22.4s, #2
|
||||
#endif
|
||||
/* vpop {v8.4h-d15.4h} */ /* restore NEON registers */
|
||||
|
||||
ld1 {v12.4h-v15.4h}, [sp], 32
|
||||
/* vpop {v8.4h - d15.4h} */ /* restore NEON registers */
|
||||
ld1 {v8.4h - v11.4h}, [sp], 32
|
||||
ld1 {v12.4h - v15.4h}, [sp], 32
|
||||
ins v24.2d[1], v25.2d[0]
|
||||
#ifdef RTSM_SQSHRN_SIM_ISSUE
|
||||
|
||||
sqrshrn v20.8b, v24.8h, #2
|
||||
#else
|
||||
|
||||
sqrshrn v20.4h, v24.4s, #2
|
||||
#endif
|
||||
/* Transpose the final 8-bit samples and do signed->unsigned conversion */
|
||||
/* trn1 v16.8h, v16.8h, v18.8h */
|
||||
transpose v16, v18, v3, .16b, .8h
|
||||
ins v26.2d[1], v27.2d[0]
|
||||
ins v28.2d[1], v29.2d[0]
|
||||
ins v30.2d[1], v31.2d[0]
|
||||
#ifdef RTSM_SQSHRN_SIM_ISSUE
|
||||
sqrshrn2 v20.16b, v26.8h, #2
|
||||
sqrshrn v22.8b, v28.8h, #2
|
||||
#else
|
||||
sqrshrn2 v20.8h, v26.4s, #2
|
||||
sqrshrn v22.4h, v28.4s, #2
|
||||
#endif
|
||||
movi v0.16b, #(CENTERJSAMPLE)
|
||||
#ifdef RTSM_SQSHRN_SIM_ISSUE
|
||||
sqrshrn2 v22.16b, v30.8h, #2
|
||||
#else
|
||||
sqrshrn2 v22.8h, v30.4s, #2
|
||||
#endif
|
||||
transpose_single v16, v17, v3, .2d, .8b
|
||||
transpose_single v18, v19, v3, .2d, .8b
|
||||
add v16.8b, v16.8b, v0.8b
|
||||
@@ -628,6 +612,15 @@ asm_function jsimd_idct_islow_neon
|
||||
st1 {v21.8b}, [TMP2]
|
||||
st1 {v22.8b}, [TMP3]
|
||||
st1 {v23.8b}, [TMP4]
|
||||
ldr x15, [sp], 16
|
||||
ld1 {v0.8b - v3.8b}, [sp], 32
|
||||
ld1 {v4.8b - v7.8b}, [sp], 32
|
||||
ld1 {v8.8b - v11.8b}, [sp], 32
|
||||
ld1 {v12.8b - v15.8b}, [sp], 32
|
||||
ld1 {v16.8b - v19.8b}, [sp], 32
|
||||
ld1 {v20.8b - v23.8b}, [sp], 32
|
||||
ld1 {v24.8b - v27.8b}, [sp], 32
|
||||
ld1 {v28.8b - v31.8b}, [sp], 32
|
||||
blr x30
|
||||
|
||||
3: /* Left 4x8 half is done, right 4x8 half contains mostly zeros */
|
||||
@@ -757,7 +750,6 @@ asm_function jsimd_idct_islow_neon
|
||||
.unreq ROW6R
|
||||
.unreq ROW7L
|
||||
.unreq ROW7R
|
||||
.endfunc
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
@@ -799,7 +791,8 @@ asm_function jsimd_idct_ifast_neon
|
||||
TMP1 .req x0
|
||||
TMP2 .req x1
|
||||
TMP3 .req x2
|
||||
TMP4 .req x15
|
||||
TMP4 .req x22
|
||||
TMP5 .req x23
|
||||
|
||||
/* Load and dequantize coefficients into NEON registers
|
||||
* with the following allocation:
|
||||
@@ -814,7 +807,15 @@ asm_function jsimd_idct_ifast_neon
|
||||
* 6 | d28 | d29 ( v14.8h )
|
||||
* 7 | d30 | d31 ( v15.8h )
|
||||
*/
|
||||
adr x15, jsimd_idct_ifast_neon_consts
|
||||
/* Save NEON registers used in fast IDCT */
|
||||
sub sp, sp, #176
|
||||
stp x22, x23, [sp], 16
|
||||
adr x23, jsimd_idct_ifast_neon_consts
|
||||
st1 {v0.8b - v3.8b}, [sp], 32
|
||||
st1 {v4.8b - v7.8b}, [sp], 32
|
||||
st1 {v8.8b - v11.8b}, [sp], 32
|
||||
st1 {v12.8b - v15.8b}, [sp], 32
|
||||
st1 {v16.8b - v19.8b}, [sp], 32
|
||||
ld1 {v8.8h, v9.8h}, [COEF_BLOCK], 32
|
||||
ld1 {v0.8h, v1.8h}, [DCT_TABLE], 32
|
||||
ld1 {v10.8h, v11.8h}, [COEF_BLOCK], 32
|
||||
@@ -830,14 +831,9 @@ asm_function jsimd_idct_ifast_neon
|
||||
ld1 {v2.8h, v3.8h}, [DCT_TABLE], 32
|
||||
mul v14.8h, v14.8h, v2.8h
|
||||
mul v13.8h, v13.8h, v1.8h
|
||||
ld1 {v0.4h}, [x15] /* load constants */
|
||||
ld1 {v0.4h}, [x23] /* load constants */
|
||||
mul v15.8h, v15.8h, v3.8h
|
||||
|
||||
/* vpush {v4.8h-v6.8h} */ /* save NEON registers */
|
||||
sub sp, sp, #32
|
||||
st1 {v4.8h-v5.8h}, [sp] /* save NEON registers */
|
||||
sub sp, sp, #16
|
||||
st1 {v6.8h}, [sp]
|
||||
/* 1-D IDCT, pass 1 */
|
||||
sub v2.8h, v10.8h, v14.8h
|
||||
add v14.8h, v10.8h, v14.8h
|
||||
@@ -912,25 +908,25 @@ asm_function jsimd_idct_ifast_neon
|
||||
trn1 v13.4s, v13.4s, v15.4s
|
||||
trn2 v15.4s, v18.4s, v15.4s
|
||||
/* vswp v14.4h, v10-MSB.4h */
|
||||
umov x10, v14.d[0]
|
||||
umov x22, v14.d[0]
|
||||
ins v14.2d[0], v10.2d[1]
|
||||
ins v10.2d[1], x10
|
||||
ins v10.2d[1], x22
|
||||
/* vswp v13.4h, v9MSB.4h */
|
||||
|
||||
umov x10, v13.d[0]
|
||||
umov x22, v13.d[0]
|
||||
ins v13.2d[0], v9.2d[1]
|
||||
ins v9.2d[1], x10
|
||||
ins v9.2d[1], x22
|
||||
/* 1-D IDCT, pass 2 */
|
||||
sub v2.8h, v10.8h, v14.8h
|
||||
/* vswp v15.4h, v11MSB.4h */
|
||||
umov x10, v15.d[0]
|
||||
umov x22, v15.d[0]
|
||||
ins v15.2d[0], v11.2d[1]
|
||||
ins v11.2d[1], x10
|
||||
ins v11.2d[1], x22
|
||||
add v14.8h, v10.8h, v14.8h
|
||||
/* vswp v12.4h, v8-MSB.4h */
|
||||
umov x10, v12.d[0]
|
||||
umov x22, v12.d[0]
|
||||
ins v12.2d[0], v8.2d[1]
|
||||
ins v8.2d[1], x10
|
||||
ins v8.2d[1], x22
|
||||
sub v1.8h, v11.8h, v13.8h
|
||||
add v13.8h, v11.8h, v13.8h
|
||||
sub v5.8h, v9.8h, v15.8h
|
||||
@@ -966,15 +962,11 @@ asm_function jsimd_idct_ifast_neon
|
||||
add v14.8h, v5.8h, v3.8h
|
||||
sub v9.8h, v5.8h, v3.8h
|
||||
sub v13.8h, v10.8h, v2.8h
|
||||
/* vpop {v4.8h-v7.4h} */ /* restore NEON registers...not available */
|
||||
ld1 {v6.8h}, [sp], 16
|
||||
ld1 {v4.8h-v5.8h}, [sp], 32
|
||||
add v10.8h, v10.8h, v2.8h
|
||||
sub v11.8h, v12.8h, v1.8h
|
||||
add v12.8h, v12.8h, v1.8h
|
||||
/* Descale to 8-bit and range limit */
|
||||
movi v0.16b, #0x80
|
||||
#ifdef RTSM_SQSHRN_SIM_ISSUE
|
||||
sqshrn v8.8b, v8.8h, #5
|
||||
sqshrn2 v8.16b, v9.8h, #5
|
||||
sqshrn v9.8b, v10.8h, #5
|
||||
@@ -983,16 +975,6 @@ asm_function jsimd_idct_ifast_neon
|
||||
sqshrn2 v10.16b, v13.8h, #5
|
||||
sqshrn v11.8b, v14.8h, #5
|
||||
sqshrn2 v11.16b, v15.8h, #5
|
||||
#else
|
||||
sqshrn v8.4h, v8.4s, #5
|
||||
sqshrn2 v8.8h, v9.4s, #5
|
||||
sqshrn v9.4h, v10.4s, #5
|
||||
sqshrn2 v9.8h, v11.4s, #5
|
||||
sqshrn v10.4h, v12.4s, #5
|
||||
sqshrn2 v10.8h, v13.4s, #5
|
||||
sqshrn v11.4h, v14.4s, #5
|
||||
sqshrn2 v11.8h, v15.4s, #5
|
||||
#endif
|
||||
add v8.16b, v8.16b, v0.16b
|
||||
add v9.16b, v9.16b, v0.16b
|
||||
add v10.16b, v10.16b, v0.16b
|
||||
@@ -1036,26 +1018,33 @@ asm_function jsimd_idct_ifast_neon
|
||||
add TMP2, TMP2, OUTPUT_COL
|
||||
st1 {v9.8b}, [TMP1]
|
||||
/* make copy */
|
||||
ins v21.2d[0], v10.2d[1]
|
||||
ins v7.2d[0], v10.2d[1]
|
||||
mov v18.16b, v10.16b
|
||||
trn1 v10.8b, v10.8b, v21.8b
|
||||
trn2 v21.8b, v18.8b, v21.8b
|
||||
trn1 v10.8b, v10.8b, v7.8b
|
||||
trn2 v7.8b, v18.8b, v7.8b
|
||||
st1 {v19.8b}, [TMP2]
|
||||
ldp TMP1, TMP2, [OUTPUT_BUF], 16
|
||||
ldp TMP3, TMP4, [OUTPUT_BUF]
|
||||
ldp TMP4, TMP5, [OUTPUT_BUF], 16
|
||||
add TMP1, TMP1, OUTPUT_COL
|
||||
add TMP2, TMP2, OUTPUT_COL
|
||||
add TMP3, TMP3, OUTPUT_COL
|
||||
add TMP4, TMP4, OUTPUT_COL
|
||||
add TMP5, TMP5, OUTPUT_COL
|
||||
st1 {v10.8b}, [TMP1]
|
||||
/* make copy */
|
||||
ins v23.2d[0], v11.2d[1]
|
||||
ins v16.2d[0], v11.2d[1]
|
||||
mov v18.16b, v11.16b
|
||||
trn1 v11.8b, v11.8b, v23.8b
|
||||
trn2 v23.8b, v18.8b, v23.8b
|
||||
st1 {v21.8b}, [TMP2]
|
||||
st1 {v11.8b}, [TMP3]
|
||||
st1 {v23.8b}, [TMP4]
|
||||
trn1 v11.8b, v11.8b, v16.8b
|
||||
trn2 v16.8b, v18.8b, v16.8b
|
||||
st1 {v7.8b}, [TMP2]
|
||||
st1 {v11.8b}, [TMP4]
|
||||
st1 {v16.8b}, [TMP5]
|
||||
sub sp, sp, #176
|
||||
ldp x22, x23, [sp], 16
|
||||
ld1 {v0.8b - v3.8b}, [sp], 32
|
||||
ld1 {v4.8b - v7.8b}, [sp], 32
|
||||
ld1 {v8.8b - v11.8b}, [sp], 32
|
||||
ld1 {v12.8b - v15.8b}, [sp], 32
|
||||
ld1 {v16.8b - v19.8b}, [sp], 32
|
||||
blr x30
|
||||
|
||||
.unreq DCT_TABLE
|
||||
@@ -1066,7 +1055,6 @@ asm_function jsimd_idct_ifast_neon
|
||||
.unreq TMP2
|
||||
.unreq TMP3
|
||||
.unreq TMP4
|
||||
.endfunc
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
@@ -1179,14 +1167,19 @@ asm_function jsimd_idct_4x4_neon
|
||||
TMP3 .req x2
|
||||
TMP4 .req x15
|
||||
|
||||
/* vpush {v8.4h-v15.4h} */
|
||||
sub sp, sp, #32
|
||||
st1 {v8.4h-v11.4h}, [sp] /* save NEON registers */
|
||||
sub sp, sp, #32
|
||||
st1 {v12.4h-v15.4h}, [sp]
|
||||
|
||||
/* Save all used NEON registers */
|
||||
sub sp, sp, 272
|
||||
str x15, [sp], 16
|
||||
/* Load constants (v3.4h is just used for padding) */
|
||||
adr TMP4, jsimd_idct_4x4_neon_consts
|
||||
st1 {v0.8b - v3.8b}, [sp], 32
|
||||
st1 {v4.8b - v7.8b}, [sp], 32
|
||||
st1 {v8.8b - v11.8b}, [sp], 32
|
||||
st1 {v12.8b - v15.8b}, [sp], 32
|
||||
st1 {v16.8b - v19.8b}, [sp], 32
|
||||
st1 {v20.8b - v23.8b}, [sp], 32
|
||||
st1 {v24.8b - v27.8b}, [sp], 32
|
||||
st1 {v28.8b - v31.8b}, [sp], 32
|
||||
ld1 {v0.4h, v1.4h, v2.4h, v3.4h}, [TMP4]
|
||||
|
||||
/* Load all COEF_BLOCK into NEON registers with the following allocation:
|
||||
@@ -1226,7 +1219,7 @@ asm_function jsimd_idct_4x4_neon
|
||||
mul v12.4h, v12.4h, v26.4h
|
||||
mul v13.4h, v13.4h, v27.4h
|
||||
ins v12.2d[1], v13.2d[0] /* 128 bit q12 */
|
||||
ld1 {v30.8h}, [DCT_TABLE], 16
|
||||
ld1 {v30.4h, v31.4h}, [DCT_TABLE], 16
|
||||
mul v14.4h, v14.4h, v28.4h
|
||||
mul v15.4h, v15.4h, v29.4h
|
||||
ins v14.2d[1], v15.2d[0] /* 128 bit q14 */
|
||||
@@ -1291,9 +1284,16 @@ asm_function jsimd_idct_4x4_neon
|
||||
#endif
|
||||
|
||||
/* vpop {v8.4h - v15.4h} ;not available */
|
||||
ld1 {v12.4h-v15.4h}, [sp], 32
|
||||
ld1 {v8.4h-v11.4h}, [sp], 32
|
||||
|
||||
sub sp, sp, #272
|
||||
ldr x15, [sp], 16
|
||||
ld1 {v0.8b - v3.8b}, [sp], 32
|
||||
ld1 {v4.8b - v7.8b}, [sp], 32
|
||||
ld1 {v8.8b - v11.8b}, [sp], 32
|
||||
ld1 {v12.8b - v15.8b}, [sp], 32
|
||||
ld1 {v16.8b - v19.8b}, [sp], 32
|
||||
ld1 {v20.8b - v23.8b}, [sp], 32
|
||||
ld1 {v24.8b - v27.8b}, [sp], 32
|
||||
ld1 {v28.8b - v31.8b}, [sp], 32
|
||||
blr x30
|
||||
|
||||
.unreq DCT_TABLE
|
||||
@@ -1304,7 +1304,6 @@ asm_function jsimd_idct_4x4_neon
|
||||
.unreq TMP2
|
||||
.unreq TMP3
|
||||
.unreq TMP4
|
||||
.endfunc
|
||||
|
||||
.purgem idct_helper
|
||||
|
||||
@@ -1327,29 +1326,29 @@ asm_function jsimd_idct_4x4_neon
|
||||
|
||||
.balign 8
|
||||
jsimd_idct_2x2_neon_consts:
|
||||
.short -FIX_0_720959822 /* d0[0] */
|
||||
.short FIX_0_850430095 /* d0[1] */
|
||||
.short -FIX_1_272758580 /* d0[2] */
|
||||
.short FIX_3_624509785 /* d0[3] */
|
||||
.short -FIX_0_720959822 /* v14[0] */
|
||||
.short FIX_0_850430095 /* v14[1] */
|
||||
.short -FIX_1_272758580 /* v14[2] */
|
||||
.short FIX_3_624509785 /* v14[3] */
|
||||
|
||||
.macro idct_helper x4, x6, x10, x12, x16, shift, y26, y27
|
||||
sshll v28.4s, \x4, #15
|
||||
smull v26.4s, \x6, v0.4h[3]
|
||||
smlal v26.4s, \x10, v0.4h[2]
|
||||
smlal v26.4s, \x12, v0.4h[1]
|
||||
smlal v26.4s, \x16, v0.4h[0]
|
||||
sshll v15.4s, \x4, #15
|
||||
smull v26.4s, \x6, v14.4h[3]
|
||||
smlal v26.4s, \x10, v14.4h[2]
|
||||
smlal v26.4s, \x12, v14.4h[1]
|
||||
smlal v26.4s, \x16, v14.4h[0]
|
||||
|
||||
add v20.4s, v28.4s, v26.4s
|
||||
sub v28.4s, v28.4s, v26.4s
|
||||
add v20.4s, v15.4s, v26.4s
|
||||
sub v15.4s, v15.4s, v26.4s
|
||||
|
||||
.if \shift > 16
|
||||
srshr v20.4s, v20.4s, #\shift
|
||||
srshr v28.4s, v28.4s, #\shift
|
||||
srshr v15.4s, v15.4s, #\shift
|
||||
xtn \y26, v20.4s
|
||||
xtn \y27, v28.4s
|
||||
xtn \y27, v15.4s
|
||||
.else
|
||||
rshrn \y26, v20.4s, #\shift
|
||||
rshrn \y27, v28.4s, #\shift
|
||||
rshrn \y27, v15.4s, #\shift
|
||||
.endif
|
||||
|
||||
.endm
|
||||
@@ -1364,14 +1363,19 @@ asm_function jsimd_idct_2x2_neon
|
||||
TMP2 .req x15
|
||||
|
||||
/* vpush {v8.4h - v15.4h} ; not available */
|
||||
sub sp, sp, #32
|
||||
st1 {v8.4h-v11.4h}, [sp] /* save NEON registers */
|
||||
sub sp, sp, #32
|
||||
st1 {v12.4h-v15.4h}, [sp]
|
||||
sub sp, sp, 208
|
||||
str x15, [sp], 16
|
||||
|
||||
/* Load constants */
|
||||
adr TMP2, jsimd_idct_2x2_neon_consts
|
||||
ld1 {v0.4h}, [TMP2]
|
||||
st1 {v4.8b - v7.8b}, [sp], 32
|
||||
st1 {v8.8b - v11.8b}, [sp], 32
|
||||
st1 {v12.8b - v15.8b}, [sp], 32
|
||||
st1 {v16.8b - v19.8b}, [sp], 32
|
||||
st1 {v21.8b - v22.8b}, [sp], 16
|
||||
st1 {v24.8b - v27.8b}, [sp], 32
|
||||
st1 {v30.8b - v31.8b}, [sp], 16
|
||||
ld1 {v14.4h}, [TMP2]
|
||||
|
||||
/* Load all COEF_BLOCK into NEON registers with the following allocation:
|
||||
* 0 1 2 3 | 4 5 6 7
|
||||
@@ -1394,26 +1398,26 @@ asm_function jsimd_idct_2x2_neon
|
||||
ld1 {v16.4h, v17.4h}, [COEF_BLOCK], 16
|
||||
/* Dequantize */
|
||||
ld1 {v18.4h, v19.4h, v20.4h, v21.4h}, [DCT_TABLE], 32
|
||||
mul v4.8h, v4.8h, v18.8h
|
||||
mul v5.8h, v5.8h, v18.8h
|
||||
mul v4.4h, v4.4h, v18.4h
|
||||
mul v5.4h, v5.4h, v19.4h
|
||||
ins v4.2d[1], v5.2d[0]
|
||||
mul v6.8h, v6.8h, v20.8h
|
||||
mul v7.8h, v7.8h, v21.8h
|
||||
mul v6.4h, v6.4h, v20.4h
|
||||
mul v7.4h, v7.4h, v21.4h
|
||||
ins v6.2d[1], v7.2d[0]
|
||||
add DCT_TABLE, DCT_TABLE, #16
|
||||
ld1 {v24.4h, v25.4h}, [DCT_TABLE], 16
|
||||
mul v10.8h, v10.8h, v24.8h
|
||||
mul v11.8h, v11.8h, v25.8h
|
||||
mul v10.4h, v10.4h, v24.4h
|
||||
mul v11.4h, v11.4h, v25.4h
|
||||
ins v10.2d[1], v11.2d[0]
|
||||
add DCT_TABLE, DCT_TABLE, #16
|
||||
ld1 {v26.4h, v27.4h}, [DCT_TABLE], 16
|
||||
mul v12.8h, v12.8h, v26.8h
|
||||
mul v13.8h, v13.8h, v27.8h
|
||||
mul v12.4h, v12.4h, v26.4h
|
||||
mul v13.4h, v13.4h, v27.4h
|
||||
ins v12.2d[1], v13.2d[0]
|
||||
add DCT_TABLE, DCT_TABLE, #16
|
||||
ld1 {v30.4h, v31.4h}, [DCT_TABLE], 16
|
||||
mul v16.8h, v16.8h, v30.8h
|
||||
mul v17.8h, v17.8h, v31.8h
|
||||
mul v16.4h, v16.4h, v30.4h
|
||||
mul v17.4h, v17.4h, v31.4h
|
||||
ins v16.2d[1], v17.2d[0]
|
||||
|
||||
/* Pass 1 */
|
||||
@@ -1423,26 +1427,30 @@ asm_function jsimd_idct_2x2_neon
|
||||
idct_helper v5.4h, v7.4h, v11.4h, v13.4h, v17.4h, 13, v5.4h, v7.4h
|
||||
transpose_4x4 v5.4h, v7.4h, v9.4h, v11.4h
|
||||
#else
|
||||
smull v26.4s, v6.4h, v0.4h[3]
|
||||
smlal v26.4s, v10.4h, v0.4h[2]
|
||||
smlal v26.4s, v12.4h, v0.4h[1]
|
||||
smlal v26.4s, v16.4h, v0.4h[0]
|
||||
smull v24.4s, v7.4h, v0.4h[3]
|
||||
smlal v24.4s, v11.4h, v0.4h[2]
|
||||
smlal v24.4s, v13.4h, v0.4h[1]
|
||||
smlal v24.4s, v17.4h, v0.4h[0]
|
||||
sshll v28.4s, v4.4h, #15
|
||||
smull v26.4s, v6.4h, v14.4h[3]
|
||||
smlal v26.4s, v10.4h, v14.4h[2]
|
||||
smlal v26.4s, v12.4h, v14.4h[1]
|
||||
smlal v26.4s, v16.4h, v14.4h[0]
|
||||
smull v24.4s, v7.4h, v14.4h[3]
|
||||
smlal v24.4s, v11.4h, v14.4h[2]
|
||||
smlal v24.4s, v13.4h, v14.4h[1]
|
||||
smlal v24.4s, v17.4h, v14.4h[0]
|
||||
sshll v15.4s, v4.4h, #15
|
||||
sshll v30.4s, v5.4h, #15
|
||||
add v20.4s, v28.4s, v26.4s
|
||||
sub v28.4s, v28.4s, v26.4s
|
||||
add v20.4s, v15.4s, v26.4s
|
||||
sub v15.4s, v15.4s, v26.4s
|
||||
rshrn v4.4h, v20.4s, #13
|
||||
rshrn v6.4h, v28.4s, #13
|
||||
rshrn v6.4h, v15.4s, #13
|
||||
add v20.4s, v30.4s, v24.4s
|
||||
sub v28.4s, v30.4s, v24.4s
|
||||
sub v15.4s, v30.4s, v24.4s
|
||||
rshrn v5.4h, v20.4s, #13
|
||||
rshrn v7.4h, v28.4s, #13
|
||||
rshrn v7.4h, v15.4s, #13
|
||||
ins v4.2d[1], v5.2d[0]
|
||||
ins v6.2d[1], v7.2d[0]
|
||||
transpose v4, v6, v3, .16b, .8h
|
||||
transpose v6, v10, v3, .16b, .4s
|
||||
ins v11.2d[0], v10.2d[1]
|
||||
ins v7.2d[0], v6.2d[1]
|
||||
#endif
|
||||
|
||||
/* Pass 2 */
|
||||
@@ -1466,11 +1474,15 @@ asm_function jsimd_idct_2x2_neon
|
||||
st1 {v26.b}[1], [TMP2], 1
|
||||
st1 {v27.b}[5], [TMP2], 1
|
||||
|
||||
/* vpop {v8.4h-v15.4h} ;not available */
|
||||
|
||||
ld1 {v12.4h-v15.4h}, [sp], 32
|
||||
ld1 {v8.4h-v11.4h}, [sp], 32
|
||||
|
||||
sub sp, sp, #208
|
||||
ldr x15, [sp], 16
|
||||
ld1 {v4.8b - v7.8b}, [sp], 32
|
||||
ld1 {v8.8b - v11.8b}, [sp], 32
|
||||
ld1 {v12.8b - v15.8b}, [sp], 32
|
||||
ld1 {v16.8b - v19.8b}, [sp], 32
|
||||
ld1 {v21.8b - v22.8b}, [sp], 16
|
||||
ld1 {v24.8b - v27.8b}, [sp], 32
|
||||
ld1 {v30.8b - v31.8b}, [sp], 16
|
||||
blr x30
|
||||
|
||||
.unreq DCT_TABLE
|
||||
@@ -1479,7 +1491,6 @@ asm_function jsimd_idct_2x2_neon
|
||||
.unreq OUTPUT_COL
|
||||
.unreq TMP1
|
||||
.unreq TMP2
|
||||
.endfunc
|
||||
|
||||
.purgem idct_helper
|
||||
|
||||
@@ -1507,11 +1518,11 @@ asm_function jsimd_idct_2x2_neon
|
||||
prfm PLDL1KEEP, [V, #64]
|
||||
prfm PLDL1KEEP, [Y, #64]
|
||||
.elseif \size == 4
|
||||
ld1 {v4.b}[0], [U]
|
||||
ld1 {v4.b}[1], [U]
|
||||
ld1 {v4.b}[2], [U]
|
||||
ld1 {v4.b}[3], [U]
|
||||
ld1 {v5.b}[0], [V]
|
||||
ld1 {v4.b}[0], [U], 1
|
||||
ld1 {v4.b}[1], [U], 1
|
||||
ld1 {v4.b}[2], [U], 1
|
||||
ld1 {v4.b}[3], [U], 1
|
||||
ld1 {v5.b}[0], [V], 1
|
||||
ld1 {v5.b}[1], [V], 1
|
||||
ld1 {v5.b}[2], [V], 1
|
||||
ld1 {v5.b}[3], [V], 1
|
||||
@@ -1546,7 +1557,7 @@ asm_function jsimd_idct_2x2_neon
|
||||
st3 {v10.b, v11.b, v12.b}[3], [RGB], 3
|
||||
.elseif \size == 2
|
||||
st3 {v10.b, v11.b, v12.b}[4], [RGB], 3
|
||||
st3 {v10.b, v11.b, v12.b}[4], [RGB], 3
|
||||
st3 {v10.b, v11.b, v12.b}[5], [RGB], 3
|
||||
.elseif \size == 1
|
||||
st3 {v10.b, v11.b, v12.b}[6], [RGB], 3
|
||||
.else
|
||||
@@ -1568,17 +1579,28 @@ asm_function jsimd_idct_2x2_neon
|
||||
.else
|
||||
.error unsupported macroblock size
|
||||
.endif
|
||||
.elseif \bpp==16
|
||||
.if \size == 8
|
||||
st1 {v25.8h}, [RGB],16
|
||||
.elseif \size == 4
|
||||
st1 {v25.4h}, [RGB],8
|
||||
.elseif \size == 2
|
||||
st1 {v25.h}[4], [RGB],2
|
||||
st1 {v25.h}[5], [RGB],2
|
||||
.elseif \size == 1
|
||||
st1 {v25.h}[6], [RGB],2
|
||||
.else
|
||||
.error unsupported macroblock size
|
||||
.endif
|
||||
.else
|
||||
.error unsupported bpp
|
||||
.endif
|
||||
.endm
|
||||
#ifdef RTSM_SQSHRN_SIM_ISSUE
|
||||
|
||||
.macro generate_jsimd_ycc_rgb_convert_neon colorid, bpp, r_offs, rsize, g_offs, gsize, b_offs, bsize, defsize
|
||||
#else
|
||||
.macro generate_jsimd_ycc_rgb_convert_neon colorid, bpp, r_offs, rsize, g_offs, gsize, b_offs, bsize
|
||||
#endif
|
||||
|
||||
/*
|
||||
* 2 stage pipelined YCbCr->RGB conversion
|
||||
* 2-stage pipelined YCbCr->RGB conversion
|
||||
*/
|
||||
|
||||
.macro do_yuv_to_rgb_stage1
|
||||
@@ -1604,58 +1626,68 @@ asm_function jsimd_idct_2x2_neon
|
||||
uaddw v20.8h, v20.8h, v0.8b
|
||||
uaddw v24.8h, v24.8h, v0.8b
|
||||
uaddw v28.8h, v28.8h, v0.8b
|
||||
#ifdef RTSM_SQSHRN_SIM_ISSUE
|
||||
.if \bpp != 16
|
||||
sqxtun v1\g_offs\defsize, v20.8h
|
||||
sqxtun v1\r_offs\defsize, v24.8h
|
||||
sqxtun v1\b_offs\defsize, v28.8h
|
||||
.else
|
||||
sqshlu v21.8h, v20.8h, #8
|
||||
sqshlu v25.8h, v24.8h, #8
|
||||
sqshlu v29.8h, v28.8h, #8
|
||||
sri v25.8h, v21.8h, #5
|
||||
sri v25.8h, v29.8h, #11
|
||||
.endif
|
||||
|
||||
#else
|
||||
sqxtun v1\g_offs\gsize, v20.4s
|
||||
sqxtun v1\r_offs\rsize, v24.4s
|
||||
sqxtun v1\b_offs\bsize, v28.4s
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.macro do_yuv_to_rgb_stage2_store_load_stage1
|
||||
ld1 {v4.8b}, [U], 8
|
||||
rshrn v20.4h, v20.4s, #15
|
||||
rshrn2 v20.8h, v22.4s, #15
|
||||
rshrn v24.4h, v24.4s, #14
|
||||
rshrn2 v24.8h, v26.4s, #14
|
||||
rshrn v28.4h, v28.4s, #14
|
||||
ld1 {v5.8b}, [V], 8
|
||||
ld1 {v4.8b}, [U], 8
|
||||
rshrn2 v20.8h, v22.4s, #15
|
||||
rshrn2 v24.8h, v26.4s, #14
|
||||
rshrn2 v28.8h, v30.4s, #14
|
||||
ld1 {v5.8b}, [V], 8
|
||||
uaddw v20.8h, v20.8h, v0.8b
|
||||
uaddw v24.8h, v24.8h, v0.8b
|
||||
uaddw v28.8h, v28.8h, v0.8b
|
||||
#ifdef RTSM_SQSHRN_SIM_ISSUE
|
||||
.if \bpp != 16 /**************** rgb24/rgb32 *********************************/
|
||||
sqxtun v1\g_offs\defsize, v20.8h
|
||||
#else
|
||||
sqxtun v1\g_offs\gsize, v20.4s
|
||||
#endif
|
||||
ld1 {v0.8b}, [Y], 8
|
||||
#ifdef RTSM_SQSHRN_SIM_ISSUE
|
||||
sqxtun v1\r_offs\defsize, v24.8h
|
||||
#else
|
||||
sqxtun v1\r_offs\rsize, v24.4s
|
||||
#endif
|
||||
prfm PLDL1KEEP, [U, #64]
|
||||
prfm PLDL1KEEP, [V, #64]
|
||||
prfm PLDL1KEEP, [Y, #64]
|
||||
#ifdef RTSM_SQSHRN_SIM_ISSUE
|
||||
sqxtun v1\b_offs\defsize, v28.8h
|
||||
#else
|
||||
sqxtun v1\b_offs\gsize, v28.4s
|
||||
#endif
|
||||
uaddw v6.8h, v2.8h, v4.8b /* v6.16b = u - 128 */
|
||||
uaddw v8.8h, v2.8h, v5.8b /* q2 = v - 128 */
|
||||
do_store \bpp, 8
|
||||
smull v20.4s, v6.4h, v1.4h[1] /* multiply by -11277 */
|
||||
smlal v20.4s, v8.4h, v1.4h[2] /* multiply by -23401 */
|
||||
smull2 v22.4s, v6.8h, v1.4h[1] /* multiply by -11277 */
|
||||
smlal2 v22.4s, v8.8h, v1.4h[2] /* multiply by -23401 */
|
||||
smull v24.4s, v8.4h, v1.4h[0] /* multiply by 22971 */
|
||||
smull2 v26.4s, v8.8h, v1.4h[0] /* multiply by 22971 */
|
||||
.else /**************************** rgb565 ***********************************/
|
||||
sqshlu v21.8h, v20.8h, #8
|
||||
sqshlu v25.8h, v24.8h, #8
|
||||
sqshlu v29.8h, v28.8h, #8
|
||||
uaddw v6.8h, v2.8h, v4.8b /* v6.16b = u - 128 */
|
||||
uaddw v8.8h, v2.8h, v5.8b /* q2 = v - 128 */
|
||||
ld1 {v0.8b}, [Y], 8
|
||||
smull v20.4s, v6.4h, v1.4h[1] /* multiply by -11277 */
|
||||
smlal v20.4s, v8.4h, v1.4h[2] /* multiply by -23401 */
|
||||
smull2 v22.4s, v6.8h, v1.4h[1] /* multiply by -11277 */
|
||||
smlal2 v22.4s, v8.8h, v1.4h[2] /* multiply by -23401 */
|
||||
sri v25.8h, v21.8h, #5
|
||||
smull v24.4s, v8.4h, v1.4h[0] /* multiply by 22971 */
|
||||
smull2 v26.4s, v8.8h, v1.4h[0] /* multiply by 22971 */
|
||||
prfm PLDL1KEEP, [U, #64]
|
||||
prfm PLDL1KEEP, [V, #64]
|
||||
prfm PLDL1KEEP, [Y, #64]
|
||||
sri v25.8h, v29.8h, #11
|
||||
.endif
|
||||
do_store \bpp, 8
|
||||
smull v28.4s, v6.4h, v1.4h[3] /* multiply by 29033 */
|
||||
smull2 v30.4s, v6.8h, v1.4h[3] /* multiply by 29033 */
|
||||
.endm
|
||||
@@ -1693,32 +1725,36 @@ asm_function jsimd_ycc_\colorid\()_convert_neon
|
||||
V .req x10
|
||||
N .req x15
|
||||
|
||||
sub sp, sp, 336
|
||||
str x15, [sp], 16
|
||||
/* Load constants to d1, d2, d3 (v0.4h is just used for padding) */
|
||||
adr x15, jsimd_ycc_\colorid\()_neon_consts
|
||||
/* Save NEON registers */
|
||||
st1 {v0.8b - v3.8b}, [sp], 32
|
||||
st1 {v4.8b - v7.8b}, [sp], 32
|
||||
st1 {v8.8b - v11.8b}, [sp], 32
|
||||
st1 {v12.8b - v15.8b}, [sp], 32
|
||||
st1 {v16.8b - v19.8b}, [sp], 32
|
||||
st1 {v20.8b - v23.8b}, [sp], 32
|
||||
st1 {v24.8b - v27.8b}, [sp], 32
|
||||
st1 {v28.8b - v31.8b}, [sp], 32
|
||||
ld1 {v0.4h, v1.4h}, [x15], 16
|
||||
ld1 {v2.8h}, [x15]
|
||||
|
||||
/* Save ARM registers and handle input arguments */
|
||||
/* push {x4, x5, x6, x7, x8, x9, x10, x30} */
|
||||
stp x4, x5, [sp,-16]!
|
||||
stp x6, x7, [sp,-16]!
|
||||
stp x8, x9, [sp,-16]!
|
||||
stp x10, x30, [sp,-16]!
|
||||
stp x4, x5, [sp], 16
|
||||
stp x6, x7, [sp], 16
|
||||
stp x8, x9, [sp], 16
|
||||
stp x10, x30, [sp], 16
|
||||
ldr INPUT_BUF0, [INPUT_BUF]
|
||||
ldr INPUT_BUF1, [INPUT_BUF, 8]
|
||||
ldr INPUT_BUF2, [INPUT_BUF, 16]
|
||||
.unreq INPUT_BUF
|
||||
|
||||
/* Save NEON registers */
|
||||
/* vpush {v8.4h-v15.4h} */
|
||||
sub sp, sp, #32
|
||||
st1 {v8.4h-v11.4h}, [sp]
|
||||
sub sp, sp, #32
|
||||
st1 {v12.4h-v15.4h}, [sp]
|
||||
|
||||
/* Initially set v10, v11.4h, v12.8b, d13 to 0xFF */
|
||||
movi v10.16b, #255
|
||||
movi v12.16b, #255
|
||||
movi v13.16b, #255
|
||||
|
||||
/* Outer loop over scanlines */
|
||||
cmp NUM_ROWS, #1
|
||||
@@ -1778,14 +1814,21 @@ asm_function jsimd_ycc_\colorid\()_convert_neon
|
||||
bgt 0b
|
||||
9:
|
||||
/* Restore all registers and return */
|
||||
/* vpop {v8.4h-v15.4h} */
|
||||
ld1 {v12.4h-v15.4h}, [sp], #32
|
||||
ld1 {v8.4h-v11.4h}, [sp], #32
|
||||
sub sp, sp, #336
|
||||
ldr x15, [sp], 16
|
||||
ld1 {v0.8b - v3.8b}, [sp], 32
|
||||
ld1 {v4.8b - v7.8b}, [sp], 32
|
||||
ld1 {v8.8b - v11.8b}, [sp], 32
|
||||
ld1 {v12.8b - v15.8b}, [sp], 32
|
||||
ld1 {v16.8b - v19.8b}, [sp], 32
|
||||
ld1 {v20.8b - v23.8b}, [sp], 32
|
||||
ld1 {v24.8b - v27.8b}, [sp], 32
|
||||
ld1 {v28.8b - v31.8b}, [sp], 32
|
||||
/* pop {r4, r5, r6, r7, r8, r9, r10, pc} */
|
||||
ldp x10, x30, [sp], #16
|
||||
ldp x8, x9, [sp], #16
|
||||
ldp x6, x5, [sp], #16
|
||||
ldp x4, x5, [sp], #16
|
||||
ldp x4, x5, [sp], 16
|
||||
ldp x6, x7, [sp], 16
|
||||
ldp x8, x9, [sp], 16
|
||||
ldp x10, x30, [sp], 16
|
||||
br x30
|
||||
.unreq OUTPUT_WIDTH
|
||||
.unreq INPUT_ROW
|
||||
@@ -1799,7 +1842,6 @@ asm_function jsimd_ycc_\colorid\()_convert_neon
|
||||
.unreq U
|
||||
.unreq V
|
||||
.unreq N
|
||||
.endfunc
|
||||
|
||||
.purgem do_yuv_to_rgb
|
||||
.purgem do_yuv_to_rgb_stage1
|
||||
@@ -1807,10 +1849,6 @@ asm_function jsimd_ycc_\colorid\()_convert_neon
|
||||
.purgem do_yuv_to_rgb_stage2_store_load_stage1
|
||||
.endm
|
||||
|
||||
/* RTSM simulator fix integer saturation works on 8b boundry add a new parameter
|
||||
* as a workaround for the simulator fix
|
||||
*/
|
||||
#ifdef RTSM_SQSHRN_SIM_ISSUE
|
||||
/*--------------------------------- id ----- bpp R rsize G gsize B bsize defsize */
|
||||
generate_jsimd_ycc_rgb_convert_neon extrgb, 24, 0, .4h, 1, .4h, 2, .4h, .8b
|
||||
generate_jsimd_ycc_rgb_convert_neon extbgr, 24, 2, .4h, 1, .4h, 0, .4h, .8b
|
||||
@@ -1818,15 +1856,6 @@ generate_jsimd_ycc_rgb_convert_neon extrgbx, 32, 0, .4h, 1, .4h, 2, .4h, .
|
||||
generate_jsimd_ycc_rgb_convert_neon extbgrx, 32, 2, .4h, 1, .4h, 0, .4h, .8b
|
||||
generate_jsimd_ycc_rgb_convert_neon extxbgr, 32, 3, .4h, 2, .4h, 1, .4h, .8b
|
||||
generate_jsimd_ycc_rgb_convert_neon extxrgb, 32, 1, .4h, 2, .4h, 3, .4h, .8b
|
||||
#else
|
||||
/*--------------------------------- id ----- bpp R rsize G gsize B bsize */
|
||||
generate_jsimd_ycc_rgb_convert_neon extrgb, 24, 0, .4h, 1, .4h, 2, .4h
|
||||
generate_jsimd_ycc_rgb_convert_neon extbgr, 24, 2, .4h, 1, .4h, 0, .4h
|
||||
generate_jsimd_ycc_rgb_convert_neon extrgbx, 32, 0, .4h, 1, .4h, 2, .4h
|
||||
generate_jsimd_ycc_rgb_convert_neon extbgrx, 32, 2, .4h, 1, .4h, 0, .4h
|
||||
generate_jsimd_ycc_rgb_convert_neon extxbgr, 32, 3, .4h, 2, .4h, 1, .4h
|
||||
generate_jsimd_ycc_rgb_convert_neon extxrgb, 32, 1, .4h, 2, .4h, 3, .4h
|
||||
#endif
|
||||
|
||||
generate_jsimd_ycc_rgb_convert_neon rgb565, 16, 0, .4h, 0, .4h, 0, .4h, .8b
|
||||
.purgem do_load
|
||||
.purgem do_store
|
||||
@@ -4,6 +4,8 @@
|
||||
* Copyright (C) 2009-2011 Nokia Corporation and/or its subsidiary(-ies).
|
||||
* All rights reserved.
|
||||
* Author: Siarhei Siamashka <siarhei.siamashka@nokia.com>
|
||||
* Copyright (C) 2014 Siarhei Siamashka. All Rights Reserved.
|
||||
* Copyright (C) 2014 Linaro Limited. All Rights Reserved.
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
@@ -41,11 +43,9 @@
|
||||
/* Supplementary macro for setting function attributes */
|
||||
.macro asm_function fname
|
||||
#ifdef __APPLE__
|
||||
.func _\fname
|
||||
.globl _\fname
|
||||
_\fname:
|
||||
#else
|
||||
.func \fname
|
||||
.global \fname
|
||||
#ifdef __ELF__
|
||||
.hidden \fname
|
||||
@@ -670,7 +670,6 @@ asm_function jsimd_idct_islow_neon
|
||||
.unreq ROW6R
|
||||
.unreq ROW7L
|
||||
.unreq ROW7R
|
||||
.endfunc
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
@@ -895,7 +894,6 @@ asm_function jsimd_idct_ifast_neon
|
||||
.unreq TMP2
|
||||
.unreq TMP3
|
||||
.unreq TMP4
|
||||
.endfunc
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
@@ -1108,7 +1106,6 @@ asm_function jsimd_idct_4x4_neon
|
||||
.unreq TMP2
|
||||
.unreq TMP3
|
||||
.unreq TMP4
|
||||
.endfunc
|
||||
|
||||
.purgem idct_helper
|
||||
|
||||
@@ -1263,7 +1260,6 @@ asm_function jsimd_idct_2x2_neon
|
||||
.unreq OUTPUT_COL
|
||||
.unreq TMP1
|
||||
.unreq TMP2
|
||||
.endfunc
|
||||
|
||||
.purgem idct_helper
|
||||
|
||||
@@ -1352,6 +1348,19 @@ asm_function jsimd_idct_2x2_neon
|
||||
.else
|
||||
.error unsupported macroblock size
|
||||
.endif
|
||||
.elseif \bpp == 16
|
||||
.if \size == 8
|
||||
vst1.16 {q15}, [RGB]!
|
||||
.elseif \size == 4
|
||||
vst1.16 {d30}, [RGB]!
|
||||
.elseif \size == 2
|
||||
vst1.16 {d31[0]}, [RGB]!
|
||||
vst1.16 {d31[1]}, [RGB]!
|
||||
.elseif \size == 1
|
||||
vst1.16 {d31[2]}, [RGB]!
|
||||
.else
|
||||
.error unsupported macroblock size
|
||||
.endif
|
||||
.else
|
||||
.error unsupported bpp
|
||||
.endif
|
||||
@@ -1383,44 +1392,71 @@ asm_function jsimd_idct_2x2_neon
|
||||
vrshrn.s32 d25, q13, #14
|
||||
vrshrn.s32 d28, q14, #14
|
||||
vrshrn.s32 d29, q15, #14
|
||||
vaddw.u8 q10, q10, d0
|
||||
vaddw.u8 q11, q10, d0
|
||||
vaddw.u8 q12, q12, d0
|
||||
vaddw.u8 q14, q14, d0
|
||||
vqmovun.s16 d1\g_offs, q10
|
||||
.if \bpp != 16
|
||||
vqmovun.s16 d1\g_offs, q11
|
||||
vqmovun.s16 d1\r_offs, q12
|
||||
vqmovun.s16 d1\b_offs, q14
|
||||
.else /* rgb565 */
|
||||
vqshlu.s16 q13, q11, #8
|
||||
vqshlu.s16 q15, q12, #8
|
||||
vqshlu.s16 q14, q14, #8
|
||||
vsri.u16 q15, q13, #5
|
||||
vsri.u16 q15, q14, #11
|
||||
.endif
|
||||
.endm
|
||||
|
||||
.macro do_yuv_to_rgb_stage2_store_load_stage1
|
||||
vld1.8 {d4}, [U, :64]!
|
||||
/* "do_yuv_to_rgb_stage2" and "store" */
|
||||
vrshrn.s32 d20, q10, #15
|
||||
/* "load" and "do_yuv_to_rgb_stage1" */
|
||||
pld [U, #64]
|
||||
vrshrn.s32 d21, q11, #15
|
||||
pld [V, #64]
|
||||
vrshrn.s32 d24, q12, #14
|
||||
vrshrn.s32 d25, q13, #14
|
||||
vld1.8 {d4}, [U, :64]!
|
||||
vrshrn.s32 d28, q14, #14
|
||||
vld1.8 {d5}, [V, :64]!
|
||||
vrshrn.s32 d29, q15, #14
|
||||
vaddw.u8 q10, q10, d0
|
||||
vaddw.u8 q12, q12, d0
|
||||
vaddw.u8 q14, q14, d0
|
||||
vqmovun.s16 d1\g_offs, q10
|
||||
vld1.8 {d0}, [Y, :64]!
|
||||
vqmovun.s16 d1\r_offs, q12
|
||||
pld [U, #64]
|
||||
pld [V, #64]
|
||||
pld [Y, #64]
|
||||
vqmovun.s16 d1\b_offs, q14
|
||||
vaddw.u8 q3, q1, d4 /* q3 = u - 128 */
|
||||
vaddw.u8 q4, q1, d5 /* q2 = v - 128 */
|
||||
do_store \bpp, 8
|
||||
vaddw.u8 q11, q10, d0
|
||||
vmull.s16 q10, d6, d1[1] /* multiply by -11277 */
|
||||
vmlal.s16 q10, d8, d1[2] /* multiply by -23401 */
|
||||
vaddw.u8 q12, q12, d0
|
||||
vaddw.u8 q14, q14, d0
|
||||
.if \bpp != 16 /**************** rgb24/rgb32 *********************************/
|
||||
vqmovun.s16 d1\g_offs, q11
|
||||
pld [Y, #64]
|
||||
vqmovun.s16 d1\r_offs, q12
|
||||
vld1.8 {d0}, [Y, :64]!
|
||||
vqmovun.s16 d1\b_offs, q14
|
||||
vmull.s16 q11, d7, d1[1] /* multiply by -11277 */
|
||||
vmlal.s16 q11, d9, d1[2] /* multiply by -23401 */
|
||||
do_store \bpp, 8
|
||||
vmull.s16 q12, d8, d1[0] /* multiply by 22971 */
|
||||
vmull.s16 q13, d9, d1[0] /* multiply by 22971 */
|
||||
vmull.s16 q14, d6, d1[3] /* multiply by 29033 */
|
||||
vmull.s16 q15, d7, d1[3] /* multiply by 29033 */
|
||||
.else /**************************** rgb565 ***********************************/
|
||||
vqshlu.s16 q13, q11, #8
|
||||
pld [Y, #64]
|
||||
vqshlu.s16 q15, q12, #8
|
||||
vqshlu.s16 q14, q14, #8
|
||||
vld1.8 {d0}, [Y, :64]!
|
||||
vmull.s16 q11, d7, d1[1]
|
||||
vmlal.s16 q11, d9, d1[2]
|
||||
vsri.u16 q15, q13, #5
|
||||
vmull.s16 q12, d8, d1[0]
|
||||
vsri.u16 q15, q14, #11
|
||||
vmull.s16 q13, d9, d1[0]
|
||||
vmull.s16 q14, d6, d1[3]
|
||||
do_store \bpp, 8
|
||||
vmull.s16 q15, d7, d1[3]
|
||||
.endif
|
||||
.endm
|
||||
|
||||
.macro do_yuv_to_rgb
|
||||
@@ -1547,7 +1583,6 @@ asm_function jsimd_ycc_\colorid\()_convert_neon
|
||||
.unreq U
|
||||
.unreq V
|
||||
.unreq N
|
||||
.endfunc
|
||||
|
||||
.purgem do_yuv_to_rgb
|
||||
.purgem do_yuv_to_rgb_stage1
|
||||
@@ -1563,6 +1598,7 @@ generate_jsimd_ycc_rgb_convert_neon extrgbx, 32, 0, 1, 2
|
||||
generate_jsimd_ycc_rgb_convert_neon extbgrx, 32, 2, 1, 0
|
||||
generate_jsimd_ycc_rgb_convert_neon extxbgr, 32, 3, 2, 1
|
||||
generate_jsimd_ycc_rgb_convert_neon extxrgb, 32, 1, 2, 3
|
||||
generate_jsimd_ycc_rgb_convert_neon rgb565, 16, 0, 0, 0
|
||||
|
||||
.purgem do_load
|
||||
.purgem do_store
|
||||
@@ -1858,7 +1894,6 @@ asm_function jsimd_\colorid\()_ycc_convert_neon
|
||||
.unreq U
|
||||
.unreq V
|
||||
.unreq N
|
||||
.endfunc
|
||||
|
||||
.purgem do_rgb_to_yuv
|
||||
.purgem do_rgb_to_yuv_stage1
|
||||
@@ -1940,7 +1975,6 @@ asm_function jsimd_convsamp_neon
|
||||
.unreq TMP2
|
||||
.unreq TMP3
|
||||
.unreq TMP4
|
||||
.endfunc
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
@@ -2064,7 +2098,6 @@ asm_function jsimd_fdct_ifast_neon
|
||||
|
||||
.unreq DATA
|
||||
.unreq TMP
|
||||
.endfunc
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
@@ -2166,7 +2199,6 @@ asm_function jsimd_quantize_neon
|
||||
.unreq CORRECTION
|
||||
.unreq SHIFT
|
||||
.unreq LOOP_COUNT
|
||||
.endfunc
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
@@ -2401,7 +2433,6 @@ asm_function jsimd_h2v1_fancy_upsample_neon
|
||||
.unreq WIDTH
|
||||
.unreq TMP
|
||||
|
||||
.endfunc
|
||||
|
||||
.purgem upsample16
|
||||
.purgem upsample32
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* jsimd_i386.c
|
||||
*
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright 2009-2011, 2013 D. R. Commander
|
||||
* Copyright 2009-2011, 2013-2014 D. R. Commander
|
||||
*
|
||||
* Based on the x86 SIMD extension for IJG JPEG library,
|
||||
* Copyright (C) 1999-2006, MIYASAKA Masaru.
|
||||
@@ -130,6 +130,12 @@ jsimd_can_ycc_rgb (void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_ycc_rgb565 (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
|
||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
@@ -280,6 +286,13 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
|
||||
mmxfct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_ycc_rgb565_convert (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v2_downsample (void)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* jsimd_mips.c
|
||||
*
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright 2009-2011 D. R. Commander
|
||||
* Copyright 2009-2011, 2014 D. R. Commander
|
||||
* Copyright (C) 2013-2014, MIPS Technologies, Inc., California
|
||||
*
|
||||
* Based on the x86 SIMD extension for IJG JPEG library,
|
||||
@@ -161,6 +161,12 @@ jsimd_can_ycc_rgb (void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_ycc_rgb565 (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_c_can_null_convert (void)
|
||||
{
|
||||
@@ -299,6 +305,13 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
|
||||
num_rows);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_ycc_rgb565_convert (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_c_null_convert (j_compress_ptr cinfo,
|
||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* jsimd_x86_64.c
|
||||
*
|
||||
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
|
||||
* Copyright 2009-2011 D. R. Commander
|
||||
* Copyright 2009-2011, 2014 D. R. Commander
|
||||
*
|
||||
* Based on the x86 SIMD extension for IJG JPEG library,
|
||||
* Copyright (C) 1999-2006, MIYASAKA Masaru.
|
||||
@@ -80,6 +80,12 @@ jsimd_can_ycc_rgb (void)
|
||||
return 1;
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_ycc_rgb565 (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_rgb_ycc_convert (j_compress_ptr cinfo,
|
||||
JSAMPARRAY input_buf, JSAMPIMAGE output_buf,
|
||||
@@ -194,6 +200,13 @@ jsimd_ycc_rgb_convert (j_decompress_ptr cinfo,
|
||||
sse2fct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);
|
||||
}
|
||||
|
||||
GLOBAL(void)
|
||||
jsimd_ycc_rgb565_convert (j_decompress_ptr cinfo,
|
||||
JSAMPIMAGE input_buf, JDIMENSION input_row,
|
||||
JSAMPARRAY output_buf, int num_rows)
|
||||
{
|
||||
}
|
||||
|
||||
GLOBAL(int)
|
||||
jsimd_can_h2v2_downsample (void)
|
||||
{
|
||||
|
||||
@@ -65,8 +65,8 @@
|
||||
|
||||
; -- segment definition --
|
||||
;
|
||||
%define SEG_TEXT .text align=16 public use32 class=CODE
|
||||
%define SEG_CONST .data align=16 public use32 class=DATA
|
||||
%define SEG_TEXT _text align=16 public use32 class=CODE
|
||||
%define SEG_CONST _data align=16 public use32 class=DATA
|
||||
|
||||
%elifdef ELF ; ----(nasm -felf[64] -DELF ...)------------
|
||||
; * Linux
|
||||
|
||||
BIN
testimages/testorig12.jpg
Normal file
BIN
testimages/testorig12.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
21
tjbench.c
21
tjbench.c
@@ -388,7 +388,7 @@ int fullTest(unsigned char *srcbuf, int w, int h, int subsamp, int jpegqual,
|
||||
if((flags&TJFLAG_NOREALLOC)!=0)
|
||||
for(i=0; i<ntilesw*ntilesh; i++)
|
||||
{
|
||||
if((jpegbuf[i]=(unsigned char *)malloc(tjBufSize(tilew, tileh,
|
||||
if((jpegbuf[i]=(unsigned char *)tjAlloc(tjBufSize(tilew, tileh,
|
||||
subsamp)))==NULL)
|
||||
_throwunix("allocating JPEG tiles");
|
||||
}
|
||||
@@ -520,7 +520,7 @@ int fullTest(unsigned char *srcbuf, int w, int h, int subsamp, int jpegqual,
|
||||
|
||||
for(i=0; i<ntilesw*ntilesh; i++)
|
||||
{
|
||||
if(jpegbuf[i]) free(jpegbuf[i]); jpegbuf[i]=NULL;
|
||||
if(jpegbuf[i]) tjFree(jpegbuf[i]); jpegbuf[i]=NULL;
|
||||
}
|
||||
free(jpegbuf); jpegbuf=NULL;
|
||||
free(jpegsize); jpegsize=NULL;
|
||||
@@ -538,7 +538,7 @@ int fullTest(unsigned char *srcbuf, int w, int h, int subsamp, int jpegqual,
|
||||
{
|
||||
for(i=0; i<ntilesw*ntilesh; i++)
|
||||
{
|
||||
if(jpegbuf[i]) free(jpegbuf[i]); jpegbuf[i]=NULL;
|
||||
if(jpegbuf[i]) tjFree(jpegbuf[i]); jpegbuf[i]=NULL;
|
||||
}
|
||||
free(jpegbuf); jpegbuf=NULL;
|
||||
}
|
||||
@@ -616,7 +616,7 @@ int decompTest(char *filename)
|
||||
if((flags&TJFLAG_NOREALLOC)!=0 || !dotile)
|
||||
for(i=0; i<ntilesw*ntilesh; i++)
|
||||
{
|
||||
if((jpegbuf[i]=(unsigned char *)malloc(tjBufSize(tilew, tileh,
|
||||
if((jpegbuf[i]=(unsigned char *)tjAlloc(tjBufSize(tilew, tileh,
|
||||
subsamp)))==NULL)
|
||||
_throwunix("allocating JPEG tiles");
|
||||
}
|
||||
@@ -682,7 +682,7 @@ int decompTest(char *filename)
|
||||
t[tile].customFilter=customFilter;
|
||||
if(t[tile].options&TJXOPT_NOOUTPUT && jpegbuf[tile])
|
||||
{
|
||||
free(jpegbuf[tile]); jpegbuf[tile]=NULL;
|
||||
tjFree(jpegbuf[tile]); jpegbuf[tile]=NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -747,7 +747,7 @@ int decompTest(char *filename)
|
||||
|
||||
for(i=0; i<ntilesw*ntilesh; i++)
|
||||
{
|
||||
free(jpegbuf[i]); jpegbuf[i]=NULL;
|
||||
tjFree(jpegbuf[i]); jpegbuf[i]=NULL;
|
||||
}
|
||||
free(jpegbuf); jpegbuf=NULL;
|
||||
if(jpegsize) {free(jpegsize); jpegsize=NULL;}
|
||||
@@ -761,7 +761,7 @@ int decompTest(char *filename)
|
||||
{
|
||||
for(i=0; i<ntilesw*ntilesh; i++)
|
||||
{
|
||||
if(jpegbuf[i]) free(jpegbuf[i]); jpegbuf[i]=NULL;
|
||||
if(jpegbuf[i]) tjFree(jpegbuf[i]); jpegbuf[i]=NULL;
|
||||
}
|
||||
free(jpegbuf); jpegbuf=NULL;
|
||||
}
|
||||
@@ -984,6 +984,13 @@ int main(int argc, char *argv[])
|
||||
dotile=0;
|
||||
}
|
||||
|
||||
if((flags&TJFLAG_NOREALLOC)==0 && dotile)
|
||||
{
|
||||
printf("Disabling tiled compression/decompression tests, because those tests do not\n");
|
||||
printf("work when dynamic JPEG buffer allocation is enabled.\n\n");
|
||||
dotile=0;
|
||||
}
|
||||
|
||||
if(!decomponly)
|
||||
{
|
||||
if(loadbmp(argv[1], &srcbuf, &w, &h, pf, (flags&TJFLAG_BOTTOMUP)!=0)==-1)
|
||||
|
||||
@@ -22,11 +22,13 @@ runme()
|
||||
EXT=bmp
|
||||
IMAGES="vgl_5674_0098.${EXT} vgl_6434_0018a.${EXT} vgl_6548_0026a.${EXT} nightshot_iso_100.${EXT}"
|
||||
IMGDIR=@srcdir@/testimages
|
||||
OUTDIR=__tjbenchtest_output
|
||||
OUTDIR=`mktemp -d /tmp/__tjbenchtest_output.XXXXXX`
|
||||
EXEDIR=.
|
||||
BMPARG=
|
||||
NSARG=
|
||||
YUVARG=
|
||||
ALLOC=0
|
||||
ALLOCARG=
|
||||
if [ "$EXT" = "bmp" ]; then BMPARG=-bmp; fi
|
||||
|
||||
if [ -d $OUTDIR ]; then
|
||||
@@ -59,6 +61,10 @@ if [ $# -gt 0 ]; then
|
||||
# of round-off error.)
|
||||
IMAGES="vgl_6548_0026a.${EXT}"
|
||||
fi
|
||||
if [ "$1" = "-alloc" ]; then
|
||||
ALLOCARG=-alloc
|
||||
ALLOC=1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Standard tests
|
||||
@@ -87,7 +93,7 @@ for image in $IMAGES; do
|
||||
|
||||
# Compression
|
||||
for dct in accurate fast; do
|
||||
runme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -quiet -benchtime 0.01 -warmup 0 -${dct}dct $YUVARG
|
||||
runme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -quiet -benchtime 0.01 -warmup 0 -${dct}dct $YUVARG $ALLOCARG
|
||||
for samp in GRAY 420 422 444; do
|
||||
runme cmp $OUTDIR/${basename}_${samp}_Q95.jpg $OUTDIR/${basename}_${samp}_${dct}_cjpeg.jpg
|
||||
done
|
||||
@@ -100,39 +106,59 @@ for image in $IMAGES; do
|
||||
fi
|
||||
|
||||
# Tiled compression & decompression
|
||||
runme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 -warmup 0 ${dctarg} $YUVARG
|
||||
runme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 -warmup 0 ${dctarg} $YUVARG $ALLOCARG
|
||||
for samp in GRAY 444; do
|
||||
if [ $ALLOC = 1 ]; then
|
||||
runme cmp $OUTDIR/${basename}_${samp}_Q95_full.${EXT} $OUTDIR/${basename}_${samp}_${dct}_djpeg.${EXT}
|
||||
rm $OUTDIR/${basename}_${samp}_Q95_full.${EXT}
|
||||
else
|
||||
for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \
|
||||
$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do
|
||||
runme cmp $i $OUTDIR/${basename}_${samp}_${dct}_djpeg.${EXT}
|
||||
rm $i
|
||||
done
|
||||
fi
|
||||
done
|
||||
runme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 -warmup 0 -fastupsample ${dctarg} $YUVARG
|
||||
runme $EXEDIR/tjbench $OUTDIR/$image 95 -rgb -tile -quiet -benchtime 0.01 -warmup 0 -fastupsample ${dctarg} $YUVARG $ALLOCARG
|
||||
for samp in 420 422; do
|
||||
if [ $ALLOC = 1 ]; then
|
||||
runme cmp $OUTDIR/${basename}_${samp}_Q95_full.${EXT} $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.${EXT}
|
||||
rm $OUTDIR/${basename}_${samp}_Q95_full.${EXT}
|
||||
else
|
||||
for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \
|
||||
$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do
|
||||
runme cmp $i $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.${EXT}
|
||||
rm $i
|
||||
done
|
||||
fi
|
||||
done
|
||||
|
||||
# Tiled decompression
|
||||
for samp in GRAY 444; do
|
||||
runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -tile -quiet -benchtime 0.01 -warmup 0 ${dctarg} $YUVARG
|
||||
runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -tile -quiet -benchtime 0.01 -warmup 0 ${dctarg} $YUVARG $ALLOCARG
|
||||
if [ $ALLOC = 1 ]; then
|
||||
runme cmp $OUTDIR/${basename}_${samp}_Q95_full.${EXT} $OUTDIR/${basename}_${samp}_${dct}_djpeg.${EXT}
|
||||
rm $OUTDIR/${basename}_${samp}_Q95_full.${EXT}
|
||||
else
|
||||
for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \
|
||||
$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do
|
||||
runme cmp $i $OUTDIR/${basename}_${samp}_${dct}_djpeg.${EXT}
|
||||
rm $i
|
||||
done
|
||||
fi
|
||||
done
|
||||
for samp in 420 422; do
|
||||
runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -tile -quiet -benchtime 0.01 -warmup 0 -fastupsample ${dctarg} $YUVARG
|
||||
runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -tile -quiet -benchtime 0.01 -warmup 0 -fastupsample ${dctarg} $YUVARG $ALLOCARG
|
||||
if [ $ALLOC = 1 ]; then
|
||||
runme cmp $OUTDIR/${basename}_${samp}_Q95_full.${EXT} $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.${EXT}
|
||||
rm $OUTDIR/${basename}_${samp}_Q95_full.${EXT}
|
||||
else
|
||||
for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \
|
||||
$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do
|
||||
runme cmp $i $OUTDIR/${basename}_${samp}_${dct}_nosmooth_djpeg.${EXT}
|
||||
rm $i
|
||||
done
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
@@ -141,7 +167,7 @@ for image in $IMAGES; do
|
||||
scalearg=`echo $scale | sed s@_@/@g`
|
||||
for samp in GRAY 420 422 444; do
|
||||
runme $EXEDIR/djpeg -rgb -scale ${scalearg} $NSARG $BMPARG -outfile $OUTDIR/${basename}_${samp}_${scale}_djpeg.${EXT} $OUTDIR/${basename}_${samp}_fast_cjpeg.jpg
|
||||
runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -scale ${scalearg} -quiet -benchtime 0.01 -warmup 0 $YUVARG
|
||||
runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -scale ${scalearg} -quiet -benchtime 0.01 -warmup 0 $YUVARG $ALLOCARG
|
||||
runme cmp $OUTDIR/${basename}_${samp}_Q95_${scale}.${EXT} $OUTDIR/${basename}_${samp}_${scale}_djpeg.${EXT}
|
||||
rm $OUTDIR/${basename}_${samp}_Q95_${scale}.${EXT}
|
||||
done
|
||||
@@ -160,33 +186,48 @@ for image in $IMAGES; do
|
||||
for xform in hflip vflip transpose transverse rot90 rot180 rot270; do
|
||||
for samp in GRAY 444; do
|
||||
runme $EXEDIR/djpeg -rgb $BMPARG -outfile $OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT} $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg
|
||||
runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -tile -quiet -benchtime 0.01 -warmup 0 $YUVARG
|
||||
runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -tile -quiet -benchtime 0.01 -warmup 0 $YUVARG $ALLOCARG
|
||||
if [ $ALLOC = 1 ]; then
|
||||
runme cmp $OUTDIR/${basename}_${samp}_Q95_full.${EXT} $OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT}
|
||||
rm $OUTDIR/${basename}_${samp}_Q95_full.${EXT}
|
||||
else
|
||||
for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \
|
||||
$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do
|
||||
runme cmp $i $OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT}
|
||||
rm $i
|
||||
done
|
||||
fi
|
||||
done
|
||||
for samp in 420 422; do
|
||||
runme $EXEDIR/djpeg -nosmooth -rgb $BMPARG -outfile $OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT} $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg
|
||||
runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -tile -quiet -benchtime 0.01 -warmup 0 -fastupsample $YUVARG
|
||||
runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -tile -quiet -benchtime 0.01 -warmup 0 -fastupsample $YUVARG $ALLOCARG
|
||||
if [ $ALLOC = 1 ]; then
|
||||
runme cmp $OUTDIR/${basename}_${samp}_Q95_full.${EXT} $OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT}
|
||||
rm $OUTDIR/${basename}_${samp}_Q95_full.${EXT}
|
||||
else
|
||||
for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \
|
||||
$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do
|
||||
runme cmp $i $OUTDIR/${basename}_${samp}_${xform}_jpegtran.${EXT}
|
||||
rm $i
|
||||
done
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
# Grayscale transform
|
||||
for xform in hflip vflip transpose transverse rot90 rot180 rot270; do
|
||||
for samp in GRAY 444 422 420; do
|
||||
runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -tile -quiet -benchtime 0.01 -warmup 0 -grayscale $YUVARG
|
||||
runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -tile -quiet -benchtime 0.01 -warmup 0 -grayscale $YUVARG $ALLOCARG
|
||||
if [ $ALLOC = 1 ]; then
|
||||
runme cmp $OUTDIR/${basename}_${samp}_Q95_full.${EXT} $OUTDIR/${basename}_GRAY_${xform}_jpegtran.${EXT}
|
||||
rm $OUTDIR/${basename}_${samp}_Q95_full.${EXT}
|
||||
else
|
||||
for i in $OUTDIR/${basename}_${samp}_Q95_[0-9]*[0-9]x[0-9]*[0-9].${EXT} \
|
||||
$OUTDIR/${basename}_${samp}_Q95_full.${EXT}; do
|
||||
runme cmp $i $OUTDIR/${basename}_GRAY_${xform}_jpegtran.${EXT}
|
||||
rm $i
|
||||
done
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
@@ -196,7 +237,7 @@ for image in $IMAGES; do
|
||||
for scale in 2_1 15_8 7_4 13_8 3_2 11_8 5_4 9_8 7_8 3_4 5_8 1_2 3_8 1_4 1_8; do
|
||||
scalearg=`echo $scale | sed s@_@/@g`
|
||||
runme $EXEDIR/djpeg -rgb -scale ${scalearg} $NSARG $BMPARG -outfile $OUTDIR/${basename}_${samp}_${xform}_${scale}_jpegtran.${EXT} $OUTDIR/${basename}_${samp}_${xform}_jpegtran.jpg
|
||||
runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -scale ${scalearg} -quiet -benchtime 0.01 -warmup 0 $YUVARG
|
||||
runme $EXEDIR/tjbench $OUTDIR/${basename}_${samp}_Q95.jpg $BMPARG -$xform -scale ${scalearg} -quiet -benchtime 0.01 -warmup 0 $YUVARG $ALLOCARG
|
||||
runme cmp $OUTDIR/${basename}_${samp}_Q95_${scale}.${EXT} $OUTDIR/${basename}_${samp}_${xform}_${scale}_jpegtran.${EXT}
|
||||
rm $OUTDIR/${basename}_${samp}_Q95_${scale}.${EXT}
|
||||
done
|
||||
|
||||
@@ -21,7 +21,7 @@ runme()
|
||||
|
||||
IMAGES="vgl_5674_0098.bmp vgl_6434_0018a.bmp vgl_6548_0026a.bmp nightshot_iso_100.bmp"
|
||||
IMGDIR=@srcdir@/testimages
|
||||
OUTDIR=__tjbenchtest_java_output
|
||||
OUTDIR=`mktemp -d /tmp/__tjbenchtest_java_output.XXXXXX`
|
||||
EXEDIR=.
|
||||
JAVA="@JAVA@ -cp java/turbojpeg.jar -Djava.library.path=.libs"
|
||||
BMPARG=
|
||||
|
||||
@@ -638,7 +638,10 @@ void bufSizeTest(void)
|
||||
&dstSize, subsamp, 100, alloc? 0:TJFLAG_NOREALLOC));
|
||||
}
|
||||
free(srcBuf); srcBuf=NULL;
|
||||
if(!alloc)
|
||||
{
|
||||
tjFree(dstBuf); dstBuf=NULL;
|
||||
}
|
||||
|
||||
if((srcBuf=(unsigned char *)malloc(h*w*4))==NULL)
|
||||
_throw("Memory allocation failure");
|
||||
@@ -667,15 +670,18 @@ void bufSizeTest(void)
|
||||
&dstSize, subsamp, 100, alloc? 0:TJFLAG_NOREALLOC));
|
||||
}
|
||||
free(srcBuf); srcBuf=NULL;
|
||||
if(!alloc)
|
||||
{
|
||||
tjFree(dstBuf); dstBuf=NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("Done. \n");
|
||||
|
||||
bailout:
|
||||
if(srcBuf) free(srcBuf);
|
||||
if(dstBuf) free(dstBuf);
|
||||
if(dstBuf) tjFree(dstBuf);
|
||||
if(handle) tjDestroy(handle);
|
||||
}
|
||||
|
||||
|
||||
862
turbojpeg-jni.c
862
turbojpeg-jni.c
File diff suppressed because it is too large
Load Diff
@@ -42,8 +42,12 @@ TURBOJPEG_1.4
|
||||
global:
|
||||
tjBufSizeYUV2;
|
||||
tjCompressFromYUV;
|
||||
tjCompressFromYUVPlanes;
|
||||
tjDecodeYUV;
|
||||
tjDecodeYUVPlanes;
|
||||
tjDecompressHeader3;
|
||||
tjDecompressToYUV2;
|
||||
tjDecompressToYUVPlanes;
|
||||
tjEncodeYUV3;
|
||||
tjEncodeYUVPlanes;
|
||||
} TURBOJPEG_1.2;
|
||||
|
||||
@@ -68,15 +68,22 @@ TURBOJPEG_1.4
|
||||
global:
|
||||
tjBufSizeYUV2;
|
||||
tjCompressFromYUV;
|
||||
tjCompressFromYUVPlanes;
|
||||
tjDecodeYUV;
|
||||
tjDecodeYUVPlanes;
|
||||
tjDecompressHeader3;
|
||||
tjDecompressToYUV2;
|
||||
tjDecompressToYUVPlanes;
|
||||
tjEncodeYUV3;
|
||||
tjEncodeYUVPlanes;
|
||||
Java_org_libjpegturbo_turbojpeg_TJ_bufSizeYUV__IIII;
|
||||
Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3BIIII_3BII;
|
||||
Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIIIII_3BIII;
|
||||
Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIIIII_3BIII;
|
||||
Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3BIIII;
|
||||
Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3BII_3BIIIIIII;
|
||||
Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3BII_3IIIIIIII;
|
||||
Java_org_libjpegturbo_turbojpeg_TJCompressor_compressFromYUV___3_3B_3II_3III_3BII;
|
||||
Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3BIIIIII_3_3B_3I_3III;
|
||||
Java_org_libjpegturbo_turbojpeg_TJCompressor_encodeYUV___3IIIIIII_3_3B_3I_3III;
|
||||
Java_org_libjpegturbo_turbojpeg_TJDecompressor_decompressToYUV___3BI_3_3B_3II_3III;
|
||||
Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3_3B_3I_3II_3BIIIIIII;
|
||||
Java_org_libjpegturbo_turbojpeg_TJDecompressor_decodeYUV___3_3B_3I_3II_3IIIIIIII;
|
||||
Java_org_libjpegturbo_turbojpeg_TJ_planeHeight__III;
|
||||
Java_org_libjpegturbo_turbojpeg_TJ_planeSizeYUV__IIIII;
|
||||
Java_org_libjpegturbo_turbojpeg_TJ_planeWidth__III;
|
||||
} TURBOJPEG_1.3;
|
||||
|
||||
504
turbojpeg.c
504
turbojpeg.c
@@ -33,6 +33,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <jinclude.h>
|
||||
#define JPEG_INTERNALS
|
||||
#include <jpeglib.h>
|
||||
@@ -86,7 +87,7 @@ typedef struct _tjinstance
|
||||
struct jpeg_compress_struct cinfo;
|
||||
struct jpeg_decompress_struct dinfo;
|
||||
struct my_error_mgr jerr;
|
||||
int init;
|
||||
int init, headerRead;
|
||||
} tjinstance;
|
||||
|
||||
static const int pixelsize[TJ_NUMSAMP]={3, 3, 3, 1, 3, 3};
|
||||
@@ -163,6 +164,7 @@ static int setCompDefaults(struct jpeg_compress_struct *cinfo,
|
||||
int pixelFormat, int subsamp, int jpegQual, int flags)
|
||||
{
|
||||
int retval=0;
|
||||
char *env=NULL;
|
||||
|
||||
switch(pixelFormat)
|
||||
{
|
||||
@@ -206,6 +208,26 @@ static int setCompDefaults(struct jpeg_compress_struct *cinfo,
|
||||
cinfo->input_components=tjPixelSize[pixelFormat];
|
||||
cinfo->use_moz_defaults = TRUE;
|
||||
jpeg_set_defaults(cinfo);
|
||||
|
||||
if((env=getenv("TJ_OPTIMIZE"))!=NULL && strlen(env)>0 && !strcmp(env, "1"))
|
||||
cinfo->optimize_coding=TRUE;
|
||||
if((env=getenv("TJ_ARITHMETIC"))!=NULL && strlen(env)>0 && !strcmp(env, "1"))
|
||||
cinfo->arith_code=TRUE;
|
||||
if((env=getenv("TJ_RESTART"))!=NULL && strlen(env)>0)
|
||||
{
|
||||
int temp=-1; char tempc=0;
|
||||
if(sscanf(env, "%d%c", &temp, &tempc)>=1 && temp>=0 && temp<=65535)
|
||||
{
|
||||
if(toupper(tempc)=='B')
|
||||
{
|
||||
cinfo->restart_interval=temp;
|
||||
cinfo->restart_in_rows=0;
|
||||
}
|
||||
else
|
||||
cinfo->restart_in_rows=temp;
|
||||
}
|
||||
}
|
||||
|
||||
if(jpegQual>=0)
|
||||
{
|
||||
jpeg_set_quality(cinfo, jpegQual, TRUE);
|
||||
@@ -586,15 +608,19 @@ DLLEXPORT unsigned long DLLCALL TJBUFSIZE(int width, int height)
|
||||
DLLEXPORT unsigned long DLLCALL tjBufSizeYUV2(int width, int pad, int height,
|
||||
int subsamp)
|
||||
{
|
||||
unsigned long retval=0;
|
||||
int pw, ph, cw, ch;
|
||||
if(width<1 || height<1 || pad<1 || !isPow2(pad) || subsamp<0
|
||||
|| subsamp>=NUMSUBOPT)
|
||||
int retval=0, nc, i;
|
||||
|
||||
if(subsamp<0 || subsamp>=NUMSUBOPT)
|
||||
_throw("tjBufSizeYUV2(): Invalid argument");
|
||||
pw=PAD(width, tjMCUWidth[subsamp]/8);
|
||||
ph=PAD(height, tjMCUHeight[subsamp]/8);
|
||||
cw=pw*8/tjMCUWidth[subsamp]; ch=ph*8/tjMCUHeight[subsamp];
|
||||
retval=PAD(pw, pad)*ph + (subsamp==TJSAMP_GRAY? 0:PAD(cw, pad)*ch*2);
|
||||
|
||||
nc=(subsamp==TJSAMP_GRAY? 1:3);
|
||||
for(i=0; i<nc; i++)
|
||||
{
|
||||
int stride=PAD(tjPlaneWidth(i, width, subsamp), pad);
|
||||
int ph=tjPlaneHeight(i, height, subsamp);
|
||||
if(stride<0 || ph<0) return -1;
|
||||
else retval+=stride*ph;
|
||||
}
|
||||
|
||||
bailout:
|
||||
return retval;
|
||||
@@ -613,6 +639,70 @@ DLLEXPORT unsigned long DLLCALL TJBUFSIZEYUV(int width, int height,
|
||||
}
|
||||
|
||||
|
||||
DLLEXPORT int tjPlaneWidth(int componentID, int width, int subsamp)
|
||||
{
|
||||
int pw, nc, retval=0;
|
||||
|
||||
if(width<1 || subsamp<0 || subsamp>=TJ_NUMSAMP)
|
||||
_throw("tjPlaneWidth(): Invalid argument");
|
||||
nc=(subsamp==TJSAMP_GRAY? 1:3);
|
||||
if(componentID<0 || componentID>=nc)
|
||||
_throw("tjPlaneWidth(): Invalid argument");
|
||||
|
||||
pw=PAD(width, tjMCUWidth[subsamp]/8);
|
||||
if(componentID==0)
|
||||
retval=pw;
|
||||
else
|
||||
retval=pw*8/tjMCUWidth[subsamp];
|
||||
|
||||
bailout:
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
DLLEXPORT int tjPlaneHeight(int componentID, int height, int subsamp)
|
||||
{
|
||||
int ph, nc, retval=0;
|
||||
|
||||
if(height<1 || subsamp<0 || subsamp>=TJ_NUMSAMP)
|
||||
_throw("tjPlaneHeight(): Invalid argument");
|
||||
nc=(subsamp==TJSAMP_GRAY? 1:3);
|
||||
if(componentID<0 || componentID>=nc)
|
||||
_throw("tjPlaneHeight(): Invalid argument");
|
||||
|
||||
ph=PAD(height, tjMCUHeight[subsamp]/8);
|
||||
if(componentID==0)
|
||||
retval=ph;
|
||||
else
|
||||
retval=ph*8/tjMCUHeight[subsamp];
|
||||
|
||||
bailout:
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
DLLEXPORT unsigned long DLLCALL tjPlaneSizeYUV(int componentID, int width,
|
||||
int stride, int height, int subsamp)
|
||||
{
|
||||
unsigned long retval=0;
|
||||
int pw, ph;
|
||||
|
||||
if(width<1 || height<1 || subsamp<0 || subsamp>=NUMSUBOPT)
|
||||
_throw("tjPlaneSizeYUV(): Invalid argument");
|
||||
|
||||
pw=tjPlaneWidth(componentID, width, subsamp);
|
||||
ph=tjPlaneHeight(componentID, height, subsamp);
|
||||
|
||||
if(stride==0) stride=pw;
|
||||
else stride=abs(stride);
|
||||
|
||||
retval=stride*(ph-1)+pw;
|
||||
|
||||
bailout:
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
DLLEXPORT int DLLCALL tjCompress2(tjhandle handle, unsigned char *srcBuf,
|
||||
int width, int pitch, int height, int pixelFormat, unsigned char **jpegBuf,
|
||||
unsigned long *jpegSize, int jpegSubsamp, int jpegQual, int flags)
|
||||
@@ -711,17 +801,16 @@ DLLEXPORT int DLLCALL tjCompress(tjhandle handle, unsigned char *srcBuf,
|
||||
}
|
||||
|
||||
|
||||
DLLEXPORT int DLLCALL tjEncodeYUV3(tjhandle handle, unsigned char *srcBuf,
|
||||
int width, int pitch, int height, int pixelFormat, unsigned char *dstBuf,
|
||||
int pad, int subsamp, int flags)
|
||||
DLLEXPORT int DLLCALL tjEncodeYUVPlanes(tjhandle handle, unsigned char *srcBuf,
|
||||
int width, int pitch, int height, int pixelFormat, unsigned char **dstPlanes,
|
||||
int *strides, int subsamp, int flags)
|
||||
{
|
||||
int i, retval=0; JSAMPROW *row_pointer=NULL;
|
||||
JSAMPLE *_tmpbuf[MAX_COMPONENTS], *_tmpbuf2[MAX_COMPONENTS];
|
||||
JSAMPROW *tmpbuf[MAX_COMPONENTS], *tmpbuf2[MAX_COMPONENTS];
|
||||
JSAMPROW *outbuf[MAX_COMPONENTS];
|
||||
int row, pw, ph, cw[MAX_COMPONENTS], ch[MAX_COMPONENTS];
|
||||
JSAMPLE *ptr=dstBuf;
|
||||
unsigned long yuvsize=0;
|
||||
int row, pw0, ph0, pw[MAX_COMPONENTS], ph[MAX_COMPONENTS];
|
||||
JSAMPLE *ptr;
|
||||
jpeg_component_info *compptr;
|
||||
#ifndef JCS_EXTENSIONS
|
||||
unsigned char *rgbBuf=NULL;
|
||||
@@ -736,12 +825,14 @@ DLLEXPORT int DLLCALL tjEncodeYUV3(tjhandle handle, unsigned char *srcBuf,
|
||||
}
|
||||
|
||||
if((this->init&COMPRESS)==0)
|
||||
_throw("tjEncodeYUV3(): Instance has not been initialized for compression");
|
||||
_throw("tjEncodeYUVPlanes(): Instance has not been initialized for compression");
|
||||
|
||||
if(srcBuf==NULL || width<=0 || pitch<0 || height<=0 || pixelFormat<0
|
||||
|| pixelFormat>=TJ_NUMPF || dstBuf==NULL || pad<0 || !isPow2(pad)
|
||||
|| subsamp<0 || subsamp>=NUMSUBOPT)
|
||||
_throw("tjEncodeYUV3(): Invalid argument");
|
||||
|| pixelFormat>=TJ_NUMPF || !dstPlanes || !dstPlanes[0] || subsamp<0
|
||||
|| subsamp>=NUMSUBOPT)
|
||||
_throw("tjEncodeYUVPlanes(): Invalid argument");
|
||||
if(subsamp!=TJSAMP_GRAY && (!dstPlanes[1] || !dstPlanes[2]))
|
||||
_throw("tjEncodeYUVPlanes(): Invalid argument");
|
||||
|
||||
if(setjmp(this->jerr.setjmp_buffer))
|
||||
{
|
||||
@@ -751,7 +842,7 @@ DLLEXPORT int DLLCALL tjEncodeYUV3(tjhandle handle, unsigned char *srcBuf,
|
||||
}
|
||||
|
||||
if(pixelFormat==TJPF_CMYK)
|
||||
_throw("tjEncodeYUV3(): Cannot generate YUV images from CMYK pixels");
|
||||
_throw("tjEncodeYUVPlanes(): Cannot generate YUV images from CMYK pixels");
|
||||
|
||||
if(pitch==0) pitch=width*tjPixelSize[pixelFormat];
|
||||
|
||||
@@ -759,7 +850,7 @@ DLLEXPORT int DLLCALL tjEncodeYUV3(tjhandle handle, unsigned char *srcBuf,
|
||||
if(pixelFormat!=TJPF_GRAY && pixelFormat!=TJPF_CMYK)
|
||||
{
|
||||
rgbBuf=(unsigned char *)malloc(width*height*RGB_PIXELSIZE);
|
||||
if(!rgbBuf) _throw("tjEncodeYUV3(): Memory allocation failure");
|
||||
if(!rgbBuf) _throw("tjEncodeYUVPlanes(): Memory allocation failure");
|
||||
srcBuf=toRGB(srcBuf, width, pitch, height, pixelFormat, rgbBuf);
|
||||
pitch=width*RGB_PIXELSIZE;
|
||||
}
|
||||
@@ -772,7 +863,6 @@ DLLEXPORT int DLLCALL tjEncodeYUV3(tjhandle handle, unsigned char *srcBuf,
|
||||
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
|
||||
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
|
||||
|
||||
yuvsize=tjBufSizeYUV2(width, pad, height, subsamp);
|
||||
if(setCompDefaults(cinfo, pixelFormat, subsamp, -1, flags)==-1) return -1;
|
||||
|
||||
/* Execute only the parts of jpeg_start_compress() that we need. If we
|
||||
@@ -780,25 +870,25 @@ DLLEXPORT int DLLCALL tjEncodeYUV3(tjhandle handle, unsigned char *srcBuf,
|
||||
to write the file headers, which could overflow the output buffer if the
|
||||
YUV image were very small. */
|
||||
if(cinfo->global_state!=CSTATE_START)
|
||||
_throw("tjEncodeYUV3(): libjpeg API is in the wrong state");
|
||||
_throw("tjEncodeYUVPlanes(): libjpeg API is in the wrong state");
|
||||
(*cinfo->err->reset_error_mgr)((j_common_ptr)cinfo);
|
||||
jinit_c_master_control(cinfo, FALSE);
|
||||
jinit_color_converter(cinfo);
|
||||
jinit_downsampler(cinfo);
|
||||
(*cinfo->cconvert->start_pass)(cinfo);
|
||||
|
||||
pw=PAD(width, cinfo->max_h_samp_factor);
|
||||
ph=PAD(height, cinfo->max_v_samp_factor);
|
||||
pw0=PAD(width, cinfo->max_h_samp_factor);
|
||||
ph0=PAD(height, cinfo->max_v_samp_factor);
|
||||
|
||||
if((row_pointer=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ph))==NULL)
|
||||
_throw("tjEncodeYUV3(): Memory allocation failure");
|
||||
if((row_pointer=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ph0))==NULL)
|
||||
_throw("tjEncodeYUVPlanes(): Memory allocation failure");
|
||||
for(i=0; i<height; i++)
|
||||
{
|
||||
if(flags&TJFLAG_BOTTOMUP) row_pointer[i]=&srcBuf[(height-i-1)*pitch];
|
||||
else row_pointer[i]=&srcBuf[i*pitch];
|
||||
}
|
||||
if(height<ph)
|
||||
for(i=height; i<ph; i++) row_pointer[i]=row_pointer[height-1];
|
||||
if(height<ph0)
|
||||
for(i=height; i<ph0; i++) row_pointer[i]=row_pointer[height-1];
|
||||
|
||||
for(i=0; i<cinfo->num_components; i++)
|
||||
{
|
||||
@@ -806,9 +896,9 @@ DLLEXPORT int DLLCALL tjEncodeYUV3(tjhandle handle, unsigned char *srcBuf,
|
||||
_tmpbuf[i]=(JSAMPLE *)malloc(
|
||||
PAD((compptr->width_in_blocks*cinfo->max_h_samp_factor*DCTSIZE)
|
||||
/compptr->h_samp_factor, 16) * cinfo->max_v_samp_factor + 16);
|
||||
if(!_tmpbuf[i]) _throw("tjEncodeYUV3(): Memory allocation failure");
|
||||
if(!_tmpbuf[i]) _throw("tjEncodeYUVPlanes(): Memory allocation failure");
|
||||
tmpbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*cinfo->max_v_samp_factor);
|
||||
if(!tmpbuf[i]) _throw("tjEncodeYUV3(): Memory allocation failure");
|
||||
if(!tmpbuf[i]) _throw("tjEncodeYUVPlanes(): Memory allocation failure");
|
||||
for(row=0; row<cinfo->max_v_samp_factor; row++)
|
||||
{
|
||||
unsigned char *_tmpbuf_aligned=
|
||||
@@ -819,9 +909,9 @@ DLLEXPORT int DLLCALL tjEncodeYUV3(tjhandle handle, unsigned char *srcBuf,
|
||||
}
|
||||
_tmpbuf2[i]=(JSAMPLE *)malloc(PAD(compptr->width_in_blocks*DCTSIZE, 16)
|
||||
* compptr->v_samp_factor + 16);
|
||||
if(!_tmpbuf2[i]) _throw("tjEncodeYUV3(): Memory allocation failure");
|
||||
if(!_tmpbuf2[i]) _throw("tjEncodeYUVPlanes(): Memory allocation failure");
|
||||
tmpbuf2[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*compptr->v_samp_factor);
|
||||
if(!tmpbuf2[i]) _throw("tjEncodeYUV3(): Memory allocation failure");
|
||||
if(!tmpbuf2[i]) _throw("tjEncodeYUVPlanes(): Memory allocation failure");
|
||||
for(row=0; row<compptr->v_samp_factor; row++)
|
||||
{
|
||||
unsigned char *_tmpbuf2_aligned=
|
||||
@@ -829,20 +919,19 @@ DLLEXPORT int DLLCALL tjEncodeYUV3(tjhandle handle, unsigned char *srcBuf,
|
||||
tmpbuf2[i][row]=&_tmpbuf2_aligned[
|
||||
PAD(compptr->width_in_blocks*DCTSIZE, 16) * row];
|
||||
}
|
||||
cw[i]=pw*compptr->h_samp_factor/cinfo->max_h_samp_factor;
|
||||
ch[i]=ph*compptr->v_samp_factor/cinfo->max_v_samp_factor;
|
||||
outbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ch[i]);
|
||||
if(!outbuf[i]) _throw("tjEncodeYUV3(): Memory allocation failure");
|
||||
for(row=0; row<ch[i]; row++)
|
||||
pw[i]=pw0*compptr->h_samp_factor/cinfo->max_h_samp_factor;
|
||||
ph[i]=ph0*compptr->v_samp_factor/cinfo->max_v_samp_factor;
|
||||
outbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ph[i]);
|
||||
if(!outbuf[i]) _throw("tjEncodeYUVPlanes(): Memory allocation failure");
|
||||
ptr=dstPlanes[i];
|
||||
for(row=0; row<ph[i]; row++)
|
||||
{
|
||||
outbuf[i][row]=ptr;
|
||||
ptr+=PAD(cw[i], pad);
|
||||
ptr+=(strides && strides[i]!=0)? strides[i]:pw[i];
|
||||
}
|
||||
}
|
||||
if(yuvsize!=(unsigned long)(ptr-dstBuf))
|
||||
_throw("tjEncodeYUV3(): Generated image is not the correct size");
|
||||
|
||||
for(row=0; row<ph; row+=cinfo->max_v_samp_factor)
|
||||
for(row=0; row<ph0; row+=cinfo->max_v_samp_factor)
|
||||
{
|
||||
(*cinfo->cconvert->color_convert)(cinfo, &row_pointer[row], tmpbuf, 0,
|
||||
cinfo->max_v_samp_factor);
|
||||
@@ -850,7 +939,7 @@ DLLEXPORT int DLLCALL tjEncodeYUV3(tjhandle handle, unsigned char *srcBuf,
|
||||
for(i=0, compptr=cinfo->comp_info; i<cinfo->num_components; i++, compptr++)
|
||||
jcopy_sample_rows(tmpbuf2[i], 0, outbuf[i],
|
||||
row*compptr->v_samp_factor/cinfo->max_v_samp_factor,
|
||||
compptr->v_samp_factor, cw[i]);
|
||||
compptr->v_samp_factor, pw[i]);
|
||||
}
|
||||
cinfo->next_scanline+=height;
|
||||
jpeg_abort_compress(cinfo);
|
||||
@@ -872,6 +961,42 @@ DLLEXPORT int DLLCALL tjEncodeYUV3(tjhandle handle, unsigned char *srcBuf,
|
||||
return retval;
|
||||
}
|
||||
|
||||
DLLEXPORT int DLLCALL tjEncodeYUV3(tjhandle handle, unsigned char *srcBuf,
|
||||
int width, int pitch, int height, int pixelFormat, unsigned char *dstBuf,
|
||||
int pad, int subsamp, int flags)
|
||||
{
|
||||
unsigned char *dstPlanes[3];
|
||||
int pw0, ph0, strides[3], retval=-1;
|
||||
|
||||
if(width<=0 || height<=0 || dstBuf==NULL || pad<0 || !isPow2(pad)
|
||||
|| subsamp<0 || subsamp>=NUMSUBOPT)
|
||||
_throw("tjEncodeYUV3(): Invalid argument");
|
||||
|
||||
pw0=tjPlaneWidth(0, width, subsamp);
|
||||
ph0=tjPlaneHeight(0, height, subsamp);
|
||||
dstPlanes[0]=dstBuf;
|
||||
strides[0]=PAD(pw0, pad);
|
||||
if(subsamp==TJSAMP_GRAY)
|
||||
{
|
||||
strides[1]=strides[2]=0;
|
||||
dstPlanes[1]=dstPlanes[2]=NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
int pw1=tjPlaneWidth(1, width, subsamp);
|
||||
int ph1=tjPlaneHeight(1, height, subsamp);
|
||||
strides[1]=strides[2]=PAD(pw1, pad);
|
||||
dstPlanes[1]=dstPlanes[0]+strides[0]*ph0;
|
||||
dstPlanes[2]=dstPlanes[1]+strides[1]*ph1;
|
||||
}
|
||||
|
||||
return tjEncodeYUVPlanes(handle, srcBuf, width, pitch, height, pixelFormat,
|
||||
dstPlanes, strides, subsamp, flags);
|
||||
|
||||
bailout:
|
||||
return retval;
|
||||
}
|
||||
|
||||
DLLEXPORT int DLLCALL tjEncodeYUV2(tjhandle handle, unsigned char *srcBuf,
|
||||
int width, int pitch, int height, int pixelFormat, unsigned char *dstBuf,
|
||||
int subsamp, int flags)
|
||||
@@ -889,14 +1014,14 @@ DLLEXPORT int DLLCALL tjEncodeYUV(tjhandle handle, unsigned char *srcBuf,
|
||||
}
|
||||
|
||||
|
||||
DLLEXPORT int DLLCALL tjCompressFromYUV(tjhandle handle, unsigned char *srcBuf,
|
||||
int width, int pad, int height, int subsamp, unsigned char **jpegBuf,
|
||||
unsigned long *jpegSize, int jpegQual, int flags)
|
||||
DLLEXPORT int DLLCALL tjCompressFromYUVPlanes(tjhandle handle,
|
||||
unsigned char **srcPlanes, int width, int *strides, int height, int subsamp,
|
||||
unsigned char **jpegBuf, unsigned long *jpegSize, int jpegQual, int flags)
|
||||
{
|
||||
int i, row, retval=0, alloc=1; JSAMPROW *inbuf[MAX_COMPONENTS];
|
||||
int cw[MAX_COMPONENTS], ch[MAX_COMPONENTS], iw[MAX_COMPONENTS],
|
||||
int pw[MAX_COMPONENTS], ph[MAX_COMPONENTS], iw[MAX_COMPONENTS],
|
||||
tmpbufsize=0, usetmpbuf=0, th[MAX_COMPONENTS];
|
||||
JSAMPLE *_tmpbuf=NULL, *ptr=srcBuf; JSAMPROW *tmpbuf[MAX_COMPONENTS];
|
||||
JSAMPLE *_tmpbuf=NULL, *ptr; JSAMPROW *tmpbuf[MAX_COMPONENTS];
|
||||
|
||||
getcinstance(handle)
|
||||
|
||||
@@ -906,12 +1031,14 @@ DLLEXPORT int DLLCALL tjCompressFromYUV(tjhandle handle, unsigned char *srcBuf,
|
||||
}
|
||||
|
||||
if((this->init&COMPRESS)==0)
|
||||
_throw("tjCompressFromYUV(): Instance has not been initialized for compression");
|
||||
_throw("tjCompressFromYUVPlanes(): Instance has not been initialized for compression");
|
||||
|
||||
if(srcBuf==NULL || width<=0 || pad<1 || height<=0 || subsamp<0
|
||||
if(!srcPlanes || !srcPlanes[0] || width<=0 || height<=0 || subsamp<0
|
||||
|| subsamp>=NUMSUBOPT || jpegBuf==NULL || jpegSize==NULL || jpegQual<0
|
||||
|| jpegQual>100)
|
||||
_throw("tjCompressFromYUV(): Invalid argument");
|
||||
_throw("tjCompressFromYUVPlanes(): Invalid argument");
|
||||
if(subsamp!=TJSAMP_GRAY && (!srcPlanes[1] || !srcPlanes[2]))
|
||||
_throw("tjCompressFromYUVPlanes(): Invalid argument");
|
||||
|
||||
if(setjmp(this->jerr.setjmp_buffer))
|
||||
{
|
||||
@@ -943,30 +1070,31 @@ DLLEXPORT int DLLCALL tjCompressFromYUV(tjhandle handle, unsigned char *srcBuf,
|
||||
int ih;
|
||||
iw[i]=compptr->width_in_blocks*DCTSIZE;
|
||||
ih=compptr->height_in_blocks*DCTSIZE;
|
||||
cw[i]=PAD(cinfo->image_width, cinfo->max_h_samp_factor)
|
||||
pw[i]=PAD(cinfo->image_width, cinfo->max_h_samp_factor)
|
||||
*compptr->h_samp_factor/cinfo->max_h_samp_factor;
|
||||
ch[i]=PAD(cinfo->image_height, cinfo->max_v_samp_factor)
|
||||
ph[i]=PAD(cinfo->image_height, cinfo->max_v_samp_factor)
|
||||
*compptr->v_samp_factor/cinfo->max_v_samp_factor;
|
||||
if(iw[i]!=cw[i] || ih!=ch[i]) usetmpbuf=1;
|
||||
if(iw[i]!=pw[i] || ih!=ph[i]) usetmpbuf=1;
|
||||
th[i]=compptr->v_samp_factor*DCTSIZE;
|
||||
tmpbufsize+=iw[i]*th[i];
|
||||
if((inbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ch[i]))==NULL)
|
||||
_throw("tjCompressFromYUV(): Memory allocation failure");
|
||||
for(row=0; row<ch[i]; row++)
|
||||
if((inbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ph[i]))==NULL)
|
||||
_throw("tjCompressFromYUVPlanes(): Memory allocation failure");
|
||||
ptr=srcPlanes[i];
|
||||
for(row=0; row<ph[i]; row++)
|
||||
{
|
||||
inbuf[i][row]=ptr;
|
||||
ptr+=PAD(cw[i], pad);
|
||||
ptr+=(strides && strides[i]!=0)? strides[i]:pw[i];
|
||||
}
|
||||
}
|
||||
if(usetmpbuf)
|
||||
{
|
||||
if((_tmpbuf=(JSAMPLE *)malloc(sizeof(JSAMPLE)*tmpbufsize))==NULL)
|
||||
_throw("tjCompressFromYUV(): Memory allocation failure");
|
||||
_throw("tjCompressFromYUVPlanes(): Memory allocation failure");
|
||||
ptr=_tmpbuf;
|
||||
for(i=0; i<cinfo->num_components; i++)
|
||||
{
|
||||
if((tmpbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*th[i]))==NULL)
|
||||
_throw("tjCompressFromYUV(): Memory allocation failure");
|
||||
_throw("tjCompressFromYUVPlanes(): Memory allocation failure");
|
||||
for(row=0; row<th[i]; row++)
|
||||
{
|
||||
tmpbuf[i][row]=ptr;
|
||||
@@ -987,15 +1115,15 @@ DLLEXPORT int DLLCALL tjCompressFromYUV(tjhandle handle, unsigned char *srcBuf,
|
||||
if(usetmpbuf)
|
||||
{
|
||||
int j, k;
|
||||
for(j=0; j<min(th[i], ch[i]-crow[i]); j++)
|
||||
for(j=0; j<min(th[i], ph[i]-crow[i]); j++)
|
||||
{
|
||||
memcpy(tmpbuf[i][j], inbuf[i][crow[i]+j], cw[i]);
|
||||
memcpy(tmpbuf[i][j], inbuf[i][crow[i]+j], pw[i]);
|
||||
/* Duplicate last sample in row to fill out MCU */
|
||||
for(k=cw[i]; k<iw[i]; k++) tmpbuf[i][j][k]=tmpbuf[i][j][cw[i]-1];
|
||||
for(k=pw[i]; k<iw[i]; k++) tmpbuf[i][j][k]=tmpbuf[i][j][pw[i]-1];
|
||||
}
|
||||
/* Duplicate last row to fill out MCU */
|
||||
for(j=ch[i]-crow[i]; j<th[i]; j++)
|
||||
memcpy(tmpbuf[i][j], tmpbuf[i][ch[i]-crow[i]-1], iw[i]);
|
||||
for(j=ph[i]-crow[i]; j<th[i]; j++)
|
||||
memcpy(tmpbuf[i][j], tmpbuf[i][ph[i]-crow[i]-1], iw[i]);
|
||||
yuvptr[i]=tmpbuf[i];
|
||||
}
|
||||
else
|
||||
@@ -1016,6 +1144,42 @@ DLLEXPORT int DLLCALL tjCompressFromYUV(tjhandle handle, unsigned char *srcBuf,
|
||||
return retval;
|
||||
}
|
||||
|
||||
DLLEXPORT int DLLCALL tjCompressFromYUV(tjhandle handle, unsigned char *srcBuf,
|
||||
int width, int pad, int height, int subsamp, unsigned char **jpegBuf,
|
||||
unsigned long *jpegSize, int jpegQual, int flags)
|
||||
{
|
||||
unsigned char *srcPlanes[3];
|
||||
int pw0, ph0, strides[3], retval=-1;
|
||||
|
||||
if(srcBuf==NULL || width<=0 || pad<1 || height<=0 || subsamp<0
|
||||
|| subsamp>=NUMSUBOPT)
|
||||
_throw("tjCompressFromYUV(): Invalid argument");
|
||||
|
||||
pw0=tjPlaneWidth(0, width, subsamp);
|
||||
ph0=tjPlaneHeight(0, height, subsamp);
|
||||
srcPlanes[0]=srcBuf;
|
||||
strides[0]=PAD(pw0, pad);
|
||||
if(subsamp==TJSAMP_GRAY)
|
||||
{
|
||||
strides[1]=strides[2]=0;
|
||||
srcPlanes[1]=srcPlanes[2]=NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
int pw1=tjPlaneWidth(1, width, subsamp);
|
||||
int ph1=tjPlaneHeight(1, height, subsamp);
|
||||
strides[1]=strides[2]=PAD(pw1, pad);
|
||||
srcPlanes[1]=srcPlanes[0]+strides[0]*ph0;
|
||||
srcPlanes[2]=srcPlanes[1]+strides[1]*ph1;
|
||||
}
|
||||
|
||||
return tjCompressFromYUVPlanes(handle, srcPlanes, width, strides, height,
|
||||
subsamp, jpegBuf, jpegSize, jpegQual, flags);
|
||||
|
||||
bailout:
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
/* Decompressor */
|
||||
|
||||
@@ -1303,16 +1467,15 @@ void my_reset_marker_reader(j_decompress_ptr dinfo)
|
||||
{
|
||||
}
|
||||
|
||||
DLLEXPORT int DLLCALL tjDecodeYUV(tjhandle handle, unsigned char *srcBuf,
|
||||
int pad, int subsamp, unsigned char *dstBuf, int width, int pitch,
|
||||
int height, int pixelFormat, int flags)
|
||||
DLLEXPORT int DLLCALL tjDecodeYUVPlanes(tjhandle handle,
|
||||
unsigned char **srcPlanes, int *strides, int subsamp, unsigned char *dstBuf,
|
||||
int width, int pitch, int height, int pixelFormat, int flags)
|
||||
{
|
||||
int i, retval=0; JSAMPROW *row_pointer=NULL;
|
||||
JSAMPLE *_tmpbuf[MAX_COMPONENTS];
|
||||
JSAMPROW *tmpbuf[MAX_COMPONENTS], *inbuf[MAX_COMPONENTS];
|
||||
int row, pw, ph, cw[MAX_COMPONENTS], ch[MAX_COMPONENTS];
|
||||
JSAMPLE *ptr=srcBuf;
|
||||
unsigned long yuvsize=0;
|
||||
int row, pw0, ph0, pw[MAX_COMPONENTS], ph[MAX_COMPONENTS];
|
||||
JSAMPLE *ptr;
|
||||
jpeg_component_info *compptr;
|
||||
#ifndef JCS_EXTENSIONS
|
||||
unsigned char *rgbBuf=NULL;
|
||||
@@ -1329,12 +1492,14 @@ DLLEXPORT int DLLCALL tjDecodeYUV(tjhandle handle, unsigned char *srcBuf,
|
||||
}
|
||||
|
||||
if((this->init&DECOMPRESS)==0)
|
||||
_throw("tjDecodeYUV(): Instance has not been initialized for decompression");
|
||||
_throw("tjDecodeYUVPlanes(): Instance has not been initialized for decompression");
|
||||
|
||||
if(srcBuf==NULL || pad<0 || !isPow2(pad) || subsamp<0 || subsamp>=NUMSUBOPT
|
||||
if(!srcPlanes || !srcPlanes[0] || subsamp<0 || subsamp>=NUMSUBOPT
|
||||
|| dstBuf==NULL || width<=0 || pitch<0 || height<=0 || pixelFormat<0
|
||||
|| pixelFormat>=TJ_NUMPF)
|
||||
_throw("tjDecodeYUV(): Invalid argument");
|
||||
_throw("tjDecodeYUVPlanes(): Invalid argument");
|
||||
if(subsamp!=TJSAMP_GRAY && (!srcPlanes[1] || !srcPlanes[2]))
|
||||
_throw("tjDecodeYUVPlanes(): Invalid argument");
|
||||
|
||||
if(setjmp(this->jerr.setjmp_buffer))
|
||||
{
|
||||
@@ -1344,7 +1509,7 @@ DLLEXPORT int DLLCALL tjDecodeYUV(tjhandle handle, unsigned char *srcBuf,
|
||||
}
|
||||
|
||||
if(pixelFormat==TJPF_CMYK)
|
||||
_throw("tjDecodeYUV(): Cannot decode YUV images into CMYK pixels.");
|
||||
_throw("tjDecodeYUVPlanes(): Cannot decode YUV images into CMYK pixels.");
|
||||
|
||||
if(pitch==0) pitch=width*tjPixelSize[pixelFormat];
|
||||
dinfo->image_width=width;
|
||||
@@ -1354,7 +1519,6 @@ DLLEXPORT int DLLCALL tjDecodeYUV(tjhandle handle, unsigned char *srcBuf,
|
||||
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
|
||||
else if(flags&TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
|
||||
|
||||
yuvsize=tjBufSizeYUV2(width, pad, height, subsamp);
|
||||
if(setDecodeDefaults(dinfo, pixelFormat, subsamp, flags)==-1)
|
||||
{
|
||||
retval=-1; goto bailout;
|
||||
@@ -1375,8 +1539,8 @@ DLLEXPORT int DLLCALL tjDecodeYUV(tjhandle handle, unsigned char *srcBuf,
|
||||
jinit_master_decompress(dinfo);
|
||||
(*dinfo->upsample->start_pass)(dinfo);
|
||||
|
||||
pw=PAD(width, dinfo->max_h_samp_factor);
|
||||
ph=PAD(height, dinfo->max_v_samp_factor);
|
||||
pw0=PAD(width, dinfo->max_h_samp_factor);
|
||||
ph0=PAD(height, dinfo->max_v_samp_factor);
|
||||
|
||||
if(pitch==0) pitch=dinfo->output_width*tjPixelSize[pixelFormat];
|
||||
|
||||
@@ -1388,30 +1552,30 @@ DLLEXPORT int DLLCALL tjDecodeYUV(tjhandle handle, unsigned char *srcBuf,
|
||||
RGB_PIXELSIZE!=tjPixelSize[pixelFormat]))
|
||||
{
|
||||
rgbBuf=(unsigned char *)malloc(width*height*3);
|
||||
if(!rgbBuf) _throw("tjDecodeYUV(): Memory allocation failure");
|
||||
if(!rgbBuf) _throw("tjDecodeYUVPlanes(): Memory allocation failure");
|
||||
_pitch=pitch; pitch=width*3;
|
||||
_dstBuf=dstBuf; dstBuf=rgbBuf;
|
||||
}
|
||||
#endif
|
||||
|
||||
if((row_pointer=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ph))==NULL)
|
||||
_throw("tjDecodeYUV(): Memory allocation failure");
|
||||
if((row_pointer=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ph0))==NULL)
|
||||
_throw("tjDecodeYUVPlanes(): Memory allocation failure");
|
||||
for(i=0; i<height; i++)
|
||||
{
|
||||
if(flags&TJFLAG_BOTTOMUP) row_pointer[i]=&dstBuf[(height-i-1)*pitch];
|
||||
else row_pointer[i]=&dstBuf[i*pitch];
|
||||
}
|
||||
if(height<ph)
|
||||
for(i=height; i<ph; i++) row_pointer[i]=row_pointer[height-1];
|
||||
if(height<ph0)
|
||||
for(i=height; i<ph0; i++) row_pointer[i]=row_pointer[height-1];
|
||||
|
||||
for(i=0; i<dinfo->num_components; i++)
|
||||
{
|
||||
compptr=&dinfo->comp_info[i];
|
||||
_tmpbuf[i]=(JSAMPLE *)malloc(PAD(compptr->width_in_blocks*DCTSIZE, 16)
|
||||
* compptr->v_samp_factor + 16);
|
||||
if(!_tmpbuf[i]) _throw("tjDecodeYUV(): Memory allocation failure");
|
||||
if(!_tmpbuf[i]) _throw("tjDecodeYUVPlanes(): Memory allocation failure");
|
||||
tmpbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*compptr->v_samp_factor);
|
||||
if(!tmpbuf[i]) _throw("tjDecodeYUV(): Memory allocation failure");
|
||||
if(!tmpbuf[i]) _throw("tjDecodeYUVPlanes(): Memory allocation failure");
|
||||
for(row=0; row<compptr->v_samp_factor; row++)
|
||||
{
|
||||
unsigned char *_tmpbuf_aligned=
|
||||
@@ -1419,27 +1583,25 @@ DLLEXPORT int DLLCALL tjDecodeYUV(tjhandle handle, unsigned char *srcBuf,
|
||||
tmpbuf[i][row]=&_tmpbuf_aligned[
|
||||
PAD(compptr->width_in_blocks*DCTSIZE, 16) * row];
|
||||
}
|
||||
cw[i]=pw*compptr->h_samp_factor/dinfo->max_h_samp_factor;
|
||||
ch[i]=ph*compptr->v_samp_factor/dinfo->max_v_samp_factor;
|
||||
inbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ch[i]);
|
||||
if(!inbuf[i]) _throw("tjDecodeYUV(): Memory allocation failure");
|
||||
for(row=0; row<ch[i]; row++)
|
||||
pw[i]=pw0*compptr->h_samp_factor/dinfo->max_h_samp_factor;
|
||||
ph[i]=ph0*compptr->v_samp_factor/dinfo->max_v_samp_factor;
|
||||
inbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ph[i]);
|
||||
if(!inbuf[i]) _throw("tjDecodeYUVPlanes(): Memory allocation failure");
|
||||
ptr=srcPlanes[i];
|
||||
for(row=0; row<ph[i]; row++)
|
||||
{
|
||||
inbuf[i][row]=ptr;
|
||||
ptr+=PAD(cw[i], pad);
|
||||
ptr+=(strides && strides[i]!=0)? strides[i]:pw[i];
|
||||
}
|
||||
}
|
||||
|
||||
if(yuvsize!=(unsigned long)(ptr-srcBuf))
|
||||
_throw("tjDecodeYUV(): YUV image is not the correct size");
|
||||
|
||||
for(row=0; row<ph; row+=dinfo->max_v_samp_factor)
|
||||
for(row=0; row<ph0; row+=dinfo->max_v_samp_factor)
|
||||
{
|
||||
JDIMENSION inrow=0, outrow=0;
|
||||
for(i=0, compptr=dinfo->comp_info; i<dinfo->num_components; i++, compptr++)
|
||||
jcopy_sample_rows(inbuf[i],
|
||||
row*compptr->v_samp_factor/dinfo->max_v_samp_factor, tmpbuf[i], 0,
|
||||
compptr->v_samp_factor, cw[i]);
|
||||
compptr->v_samp_factor, pw[i]);
|
||||
(dinfo->upsample->upsample)(dinfo, tmpbuf, &inrow,
|
||||
dinfo->max_v_samp_factor, &row_pointer[row], &outrow,
|
||||
dinfo->max_v_samp_factor);
|
||||
@@ -1465,16 +1627,51 @@ DLLEXPORT int DLLCALL tjDecodeYUV(tjhandle handle, unsigned char *srcBuf,
|
||||
return retval;
|
||||
}
|
||||
|
||||
DLLEXPORT int DLLCALL tjDecodeYUV(tjhandle handle, unsigned char *srcBuf,
|
||||
int pad, int subsamp, unsigned char *dstBuf, int width, int pitch,
|
||||
int height, int pixelFormat, int flags)
|
||||
{
|
||||
unsigned char *srcPlanes[3];
|
||||
int pw0, ph0, strides[3], retval=-1;
|
||||
|
||||
DLLEXPORT int DLLCALL tjDecompressToYUV2(tjhandle handle,
|
||||
unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf,
|
||||
int width, int pad, int height, int flags)
|
||||
if(srcBuf==NULL || pad<0 || !isPow2(pad) || subsamp<0 || subsamp>=NUMSUBOPT
|
||||
|| width<=0 || height<=0)
|
||||
_throw("tjDecodeYUV(): Invalid argument");
|
||||
|
||||
pw0=tjPlaneWidth(0, width, subsamp);
|
||||
ph0=tjPlaneHeight(0, height, subsamp);
|
||||
srcPlanes[0]=srcBuf;
|
||||
strides[0]=PAD(pw0, pad);
|
||||
if(subsamp==TJSAMP_GRAY)
|
||||
{
|
||||
strides[1]=strides[2]=0;
|
||||
srcPlanes[1]=srcPlanes[2]=NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
int pw1=tjPlaneWidth(1, width, subsamp);
|
||||
int ph1=tjPlaneHeight(1, height, subsamp);
|
||||
strides[1]=strides[2]=PAD(pw1, pad);
|
||||
srcPlanes[1]=srcPlanes[0]+strides[0]*ph0;
|
||||
srcPlanes[2]=srcPlanes[1]+strides[1]*ph1;
|
||||
}
|
||||
|
||||
return tjDecodeYUVPlanes(handle, srcPlanes, strides, subsamp, dstBuf, width,
|
||||
pitch, height, pixelFormat, flags);
|
||||
|
||||
bailout:
|
||||
return retval;
|
||||
}
|
||||
|
||||
DLLEXPORT int DLLCALL tjDecompressToYUVPlanes(tjhandle handle,
|
||||
unsigned char *jpegBuf, unsigned long jpegSize, unsigned char **dstPlanes,
|
||||
int width, int *strides, int height, int flags)
|
||||
{
|
||||
int i, sfi, row, retval=0; JSAMPROW *outbuf[MAX_COMPONENTS];
|
||||
int jpegwidth, jpegheight, jpegSubsamp, scaledw, scaledh;
|
||||
int cw[MAX_COMPONENTS], ch[MAX_COMPONENTS], iw[MAX_COMPONENTS],
|
||||
int pw[MAX_COMPONENTS], ph[MAX_COMPONENTS], iw[MAX_COMPONENTS],
|
||||
tmpbufsize=0, usetmpbuf=0, th[MAX_COMPONENTS];
|
||||
JSAMPLE *_tmpbuf=NULL, *ptr=dstBuf; JSAMPROW *tmpbuf[MAX_COMPONENTS];
|
||||
JSAMPLE *_tmpbuf=NULL, *ptr; JSAMPROW *tmpbuf[MAX_COMPONENTS];
|
||||
int dctsize;
|
||||
|
||||
getdinstance(handle);
|
||||
@@ -1485,11 +1682,11 @@ DLLEXPORT int DLLCALL tjDecompressToYUV2(tjhandle handle,
|
||||
}
|
||||
|
||||
if((this->init&DECOMPRESS)==0)
|
||||
_throw("tjDecompressToYUV2(): Instance has not been initialized for decompression");
|
||||
_throw("tjDecompressToYUVPlanes(): Instance has not been initialized for decompression");
|
||||
|
||||
if(jpegBuf==NULL || jpegSize<=0 || dstBuf==NULL || width<0 || pad<1
|
||||
|| !isPow2(pad) || height<0)
|
||||
_throw("tjDecompressToYUV2(): Invalid argument");
|
||||
if(jpegBuf==NULL || jpegSize<=0 || !dstPlanes || !dstPlanes[0] || width<0
|
||||
|| height<0)
|
||||
_throw("tjDecompressToYUVPlanes(): Invalid argument");
|
||||
|
||||
if(flags&TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
|
||||
else if(flags&TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
|
||||
@@ -1502,11 +1699,18 @@ DLLEXPORT int DLLCALL tjDecompressToYUV2(tjhandle handle,
|
||||
goto bailout;
|
||||
}
|
||||
|
||||
if(!this->headerRead)
|
||||
{
|
||||
jpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);
|
||||
jpeg_read_header(dinfo, TRUE);
|
||||
}
|
||||
this->headerRead=0;
|
||||
jpegSubsamp=getSubsamp(dinfo);
|
||||
if(jpegSubsamp<0)
|
||||
_throw("tjDecompressToYUV2(): Could not determine subsampling type for JPEG image");
|
||||
_throw("tjDecompressToYUVPlanes(): Could not determine subsampling type for JPEG image");
|
||||
|
||||
if(jpegSubsamp!=TJSAMP_GRAY && (!dstPlanes[1] || !dstPlanes[2]))
|
||||
_throw("tjDecompressToYUVPlanes(): Invalid argument");
|
||||
|
||||
jpegwidth=dinfo->image_width; jpegheight=dinfo->image_height;
|
||||
if(width==0) width=jpegwidth;
|
||||
@@ -1519,9 +1723,9 @@ DLLEXPORT int DLLCALL tjDecompressToYUV2(tjhandle handle,
|
||||
break;
|
||||
}
|
||||
if(scaledw>width || scaledh>height)
|
||||
_throw("tjDecompressToYUV2(): Could not scale down to desired image dimensions");
|
||||
_throw("tjDecompressToYUVPlanes(): Could not scale down to desired image dimensions");
|
||||
if(dinfo->num_components>3)
|
||||
_throw("tjDecompressToYUV2(): JPEG image must have 3 or fewer components");
|
||||
_throw("tjDecompressToYUVPlanes(): JPEG image must have 3 or fewer components");
|
||||
|
||||
width=scaledw; height=scaledh;
|
||||
dinfo->scale_num=sf[i].num;
|
||||
@@ -1537,30 +1741,31 @@ DLLEXPORT int DLLCALL tjDecompressToYUV2(tjhandle handle,
|
||||
int ih;
|
||||
iw[i]=compptr->width_in_blocks*dctsize;
|
||||
ih=compptr->height_in_blocks*dctsize;
|
||||
cw[i]=PAD(dinfo->output_width, dinfo->max_h_samp_factor)
|
||||
pw[i]=PAD(dinfo->output_width, dinfo->max_h_samp_factor)
|
||||
*compptr->h_samp_factor/dinfo->max_h_samp_factor;
|
||||
ch[i]=PAD(dinfo->output_height, dinfo->max_v_samp_factor)
|
||||
ph[i]=PAD(dinfo->output_height, dinfo->max_v_samp_factor)
|
||||
*compptr->v_samp_factor/dinfo->max_v_samp_factor;
|
||||
if(iw[i]!=cw[i] || ih!=ch[i]) usetmpbuf=1;
|
||||
if(iw[i]!=pw[i] || ih!=ph[i]) usetmpbuf=1;
|
||||
th[i]=compptr->v_samp_factor*dctsize;
|
||||
tmpbufsize+=iw[i]*th[i];
|
||||
if((outbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ch[i]))==NULL)
|
||||
_throw("tjDecompressToYUV2(): Memory allocation failure");
|
||||
for(row=0; row<ch[i]; row++)
|
||||
if((outbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*ph[i]))==NULL)
|
||||
_throw("tjDecompressToYUVPlanes(): Memory allocation failure");
|
||||
ptr=dstPlanes[i];
|
||||
for(row=0; row<ph[i]; row++)
|
||||
{
|
||||
outbuf[i][row]=ptr;
|
||||
ptr+=PAD(cw[i], pad);
|
||||
ptr+=(strides && strides[i]!=0)? strides[i]:pw[i];
|
||||
}
|
||||
}
|
||||
if(usetmpbuf)
|
||||
{
|
||||
if((_tmpbuf=(JSAMPLE *)malloc(sizeof(JSAMPLE)*tmpbufsize))==NULL)
|
||||
_throw("tjDecompressToYUV2(): Memory allocation failure");
|
||||
_throw("tjDecompressToYUVPlanes(): Memory allocation failure");
|
||||
ptr=_tmpbuf;
|
||||
for(i=0; i<dinfo->num_components; i++)
|
||||
{
|
||||
if((tmpbuf[i]=(JSAMPROW *)malloc(sizeof(JSAMPROW)*th[i]))==NULL)
|
||||
_throw("tjDecompressToYUV2(): Memory allocation failure");
|
||||
_throw("tjDecompressToYUVPlanes(): Memory allocation failure");
|
||||
for(row=0; row<th[i]; row++)
|
||||
{
|
||||
tmpbuf[i][row]=ptr;
|
||||
@@ -1611,9 +1816,9 @@ DLLEXPORT int DLLCALL tjDecompressToYUV2(tjhandle handle,
|
||||
int j;
|
||||
for(i=0; i<dinfo->num_components; i++)
|
||||
{
|
||||
for(j=0; j<min(th[i], ch[i]-crow[i]); j++)
|
||||
for(j=0; j<min(th[i], ph[i]-crow[i]); j++)
|
||||
{
|
||||
memcpy(outbuf[i][crow[i]+j], tmpbuf[i][j], cw[i]);
|
||||
memcpy(outbuf[i][crow[i]+j], tmpbuf[i][j], pw[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1631,6 +1836,67 @@ DLLEXPORT int DLLCALL tjDecompressToYUV2(tjhandle handle,
|
||||
return retval;
|
||||
}
|
||||
|
||||
DLLEXPORT int DLLCALL tjDecompressToYUV2(tjhandle handle,
|
||||
unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf,
|
||||
int width, int pad, int height, int flags)
|
||||
{
|
||||
unsigned char *dstPlanes[3];
|
||||
int pw0, ph0, strides[3], retval=-1, jpegSubsamp=-1;
|
||||
int i, jpegwidth, jpegheight, scaledw, scaledh;
|
||||
|
||||
getdinstance(handle);
|
||||
|
||||
if(jpegBuf==NULL || jpegSize<=0 || dstBuf==NULL || width<0 || pad<1
|
||||
|| !isPow2(pad) || height<0)
|
||||
_throw("tjDecompressToYUV2(): Invalid argument");
|
||||
|
||||
jpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);
|
||||
jpeg_read_header(dinfo, TRUE);
|
||||
jpegSubsamp=getSubsamp(dinfo);
|
||||
if(jpegSubsamp<0)
|
||||
_throw("tjDecompressToYUV2(): Could not determine subsampling type for JPEG image");
|
||||
|
||||
jpegwidth=dinfo->image_width; jpegheight=dinfo->image_height;
|
||||
if(width==0) width=jpegwidth;
|
||||
if(height==0) height=jpegheight;
|
||||
|
||||
for(i=0; i<NUMSF; i++)
|
||||
{
|
||||
scaledw=TJSCALED(jpegwidth, sf[i]);
|
||||
scaledh=TJSCALED(jpegheight, sf[i]);
|
||||
if(scaledw<=width && scaledh<=height)
|
||||
break;
|
||||
}
|
||||
if(scaledw>width || scaledh>height)
|
||||
_throw("tjDecompressToYUV2(): Could not scale down to desired image dimensions");
|
||||
|
||||
pw0=tjPlaneWidth(0, width, jpegSubsamp);
|
||||
ph0=tjPlaneHeight(0, height, jpegSubsamp);
|
||||
dstPlanes[0]=dstBuf;
|
||||
strides[0]=PAD(pw0, pad);
|
||||
if(jpegSubsamp==TJSAMP_GRAY)
|
||||
{
|
||||
strides[1]=strides[2]=0;
|
||||
dstPlanes[1]=dstPlanes[2]=NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
int pw1=tjPlaneWidth(1, width, jpegSubsamp);
|
||||
int ph1=tjPlaneHeight(1, height, jpegSubsamp);
|
||||
strides[1]=strides[2]=PAD(pw1, pad);
|
||||
dstPlanes[1]=dstPlanes[0]+strides[0]*ph0;
|
||||
dstPlanes[2]=dstPlanes[1]+strides[1]*ph1;
|
||||
}
|
||||
|
||||
this->headerRead=1;
|
||||
return tjDecompressToYUVPlanes(handle, jpegBuf, jpegSize, dstPlanes, width,
|
||||
strides, height, flags);
|
||||
|
||||
bailout:
|
||||
return retval;
|
||||
|
||||
}
|
||||
|
||||
DLLEXPORT int DLLCALL tjDecompressToYUV(tjhandle handle,
|
||||
unsigned char *jpegBuf, unsigned long jpegSize, unsigned char *dstBuf,
|
||||
int flags)
|
||||
|
||||
827
turbojpeg.h
827
turbojpeg.h
File diff suppressed because it is too large
Load Diff
@@ -7,6 +7,17 @@
|
||||
#cmakedefine D_ARITH_CODING_SUPPORTED
|
||||
#cmakedefine MEM_SRCDST_SUPPORTED
|
||||
|
||||
/*
|
||||
* Define BITS_IN_JSAMPLE as either
|
||||
* 8 for 8-bit sample values (the usual setting)
|
||||
* 12 for 12-bit sample values
|
||||
* Only 8 and 12 are legal data precisions for lossy JPEG according to the
|
||||
* JPEG standard, and the IJG code does not support anything else!
|
||||
* We do not support run-time selection of data precision, sorry.
|
||||
*/
|
||||
|
||||
#define BITS_IN_JSAMPLE @BITS_IN_JSAMPLE@ /* use 8 or 12 */
|
||||
|
||||
#define HAVE_UNSIGNED_CHAR
|
||||
#define HAVE_UNSIGNED_SHORT
|
||||
/* #define void char */
|
||||
|
||||
10
yuvjpeg.c
10
yuvjpeg.c
@@ -179,6 +179,11 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
yuv_buffer = malloc(yuv_size);
|
||||
if (!yuv_buffer) {
|
||||
fprintf(stderr, "Memory allocation failure!\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (fread(yuv_buffer, yuv_size, 1, yuv_fd) != 1) {
|
||||
fprintf(stderr, "Error reading yuv file\n");
|
||||
};
|
||||
@@ -190,6 +195,10 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
image_buffer =
|
||||
malloc(frame_width*frame_height + 2*(frame_width/2)*(frame_height/2));
|
||||
if (!image_buffer) {
|
||||
fprintf(stderr, "Memory allocation failure!\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
extend_edge(image_buffer, frame_width, frame_height,
|
||||
yuv_buffer, luma_width, luma_height, chroma_width, chroma_height);
|
||||
@@ -202,6 +211,7 @@ int main(int argc, char *argv[]) {
|
||||
jpg_fd = fopen(jpg_path, "wb");
|
||||
if (!jpg_fd) {
|
||||
fprintf(stderr, "Invalid path to JPEG file!\n");
|
||||
free(image_buffer);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user