forked from opencv/opencv
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request opencv#11497 from alalek:libjpeg-turbo
- Loading branch information
Showing
86 changed files
with
37,674 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
project(${JPEG_LIBRARY} C) | ||
|
||
ocv_warnings_disable(CMAKE_C_FLAGS -Wunused-parameter -Wsign-compare -Wshorten-64-to-32 -Wimplicit-fallthrough) | ||
|
||
set(VERSION_MAJOR 1) | ||
set(VERSION_MINOR 5) | ||
set(VERSION_REVISION 3) | ||
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION}) | ||
set(LIBJPEG_TURBO_VERSION_NUMBER 1005003) | ||
|
||
string(TIMESTAMP BUILD "opencv-${OPENCV_VERSION}-libjpeg-turbo") | ||
if(CMAKE_BUILD_TYPE STREQUAL "Debug") | ||
set(BUILD "${BUILD}-debug") | ||
endif() | ||
|
||
message(STATUS "libjpeg-turbo: VERSION = ${VERSION}, BUILD = ${BUILD}") | ||
|
||
option(WITH_ARITH_ENC "Include arithmetic encoding support when emulating the libjpeg v6b API/ABI" TRUE) | ||
option(WITH_ARITH_DEC "Include arithmetic decoding support when emulating the libjpeg v6b API/ABI" TRUE) | ||
|
||
if(NOT DEFINED SIZEOF_SIZE_T) | ||
if(IOS) # Workaround iOS issues | ||
set(SIZEOF_SIZE_T "${CMAKE_SIZEOF_VOID_P}") | ||
message(STATUS "SIZEOF_SIZE_T = ${SIZEOF_SIZE_T}") | ||
else() | ||
include(CheckTypeSize) | ||
CHECK_TYPE_SIZE("size_t" SIZEOF_SIZE_T) | ||
endif() | ||
endif() | ||
|
||
set(BITS_IN_JSAMPLE 8) | ||
|
||
if(WITH_ARITH_ENC) | ||
set(C_ARITH_CODING_SUPPORTED 1) | ||
endif() | ||
|
||
if(WITH_ARITH_DEC) | ||
set(D_ARITH_CODING_SUPPORTED 1) | ||
endif() | ||
|
||
set(JPEG_LIB_VERSION 62) | ||
|
||
# OpenCV | ||
set(JPEG_LIB_VERSION "${VERSION}-${JPEG_LIB_VERSION}" PARENT_SCOPE) | ||
|
||
if(MSVC) | ||
add_definitions(-W3 -wd4996 -wd4018) | ||
endif() | ||
|
||
configure_file(jconfig.h.in jconfig.h) | ||
configure_file(jconfigint.h.in jconfigint.h) | ||
|
||
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src) | ||
|
||
set(JPEG_SOURCES jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c | ||
jcinit.c jcmainct.c jcmarker.c jcmaster.c jcomapi.c jcparam.c jcphuff.c | ||
jcprepct.c jcsample.c jctrans.c jdapimin.c jdapistd.c jdatadst.c jdatasrc.c | ||
jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c | ||
jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.c | ||
jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c | ||
jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c) | ||
|
||
if(WITH_ARITH_ENC OR WITH_ARITH_DEC) | ||
set(JPEG_SOURCES ${JPEG_SOURCES} jaricom.c) | ||
endif() | ||
|
||
if(WITH_ARITH_ENC) | ||
set(JPEG_SOURCES ${JPEG_SOURCES} jcarith.c) | ||
endif() | ||
|
||
if(WITH_ARITH_DEC) | ||
set(JPEG_SOURCES ${JPEG_SOURCES} jdarith.c) | ||
endif() | ||
|
||
# No SIMD | ||
set(JPEG_SOURCES ${JPEG_SOURCES} jsimd_none.c) | ||
|
||
ocv_list_add_prefix(JPEG_SOURCES src/) | ||
|
||
add_library(${JPEG_LIBRARY} STATIC ${JPEG_SOURCES} ${SIMD_OBJS}) | ||
|
||
set_target_properties(${JPEG_LIBRARY} | ||
PROPERTIES OUTPUT_NAME ${JPEG_LIBRARY} | ||
DEBUG_POSTFIX "${OPENCV_DEBUG_POSTFIX}" | ||
COMPILE_PDB_NAME ${JPEG_LIBRARY} | ||
COMPILE_PDB_NAME_DEBUG "${JPEG_LIBRARY}${OPENCV_DEBUG_POSTFIX}" | ||
ARCHIVE_OUTPUT_DIRECTORY ${3P_LIBRARY_OUTPUT_PATH} | ||
) | ||
|
||
if(ENABLE_SOLUTION_FOLDERS) | ||
set_target_properties(${JPEG_LIBRARY} PROPERTIES FOLDER "3rdparty") | ||
endif() | ||
|
||
if(NOT BUILD_SHARED_LIBS) | ||
ocv_install_target(${JPEG_LIBRARY} EXPORT OpenCVModules ARCHIVE DESTINATION ${OPENCV_3P_LIB_INSTALL_PATH} COMPONENT dev) | ||
endif() | ||
|
||
ocv_install_3rdparty_licenses(libjpeg-turbo README.md LICENSE.md README.ijg) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
libjpeg-turbo Licenses | ||
====================== | ||
|
||
libjpeg-turbo is covered by three compatible BSD-style open source licenses: | ||
|
||
- The IJG (Independent JPEG Group) License, which is listed in | ||
[README.ijg](README.ijg) | ||
|
||
This license applies to the libjpeg API library and associated programs | ||
(any code inherited from libjpeg, and any modifications to that code.) | ||
|
||
- The Modified (3-clause) BSD License, which is listed below | ||
|
||
This license covers the TurboJPEG API library and associated programs. | ||
|
||
- The zlib License, which is listed below | ||
|
||
This license is a subset of the other two, and it covers the libjpeg-turbo | ||
SIMD extensions. | ||
|
||
|
||
Complying with the libjpeg-turbo Licenses | ||
========================================= | ||
|
||
This section provides a roll-up of the libjpeg-turbo licensing terms, to the | ||
best of our understanding. | ||
|
||
1. If you are distributing a modified version of the libjpeg-turbo source, | ||
then: | ||
|
||
1. You cannot alter or remove any existing copyright or license notices | ||
from the source. | ||
|
||
**Origin** | ||
- Clause 1 of the IJG License | ||
- Clause 1 of the Modified BSD License | ||
- Clauses 1 and 3 of the zlib License | ||
|
||
2. You must add your own copyright notice to the header of each source | ||
file you modified, so others can tell that you modified that file (if | ||
there is not an existing copyright header in that file, then you can | ||
simply add a notice stating that you modified the file.) | ||
|
||
**Origin** | ||
- Clause 1 of the IJG License | ||
- Clause 2 of the zlib License | ||
|
||
3. You must include the IJG README file, and you must not alter any of the | ||
copyright or license text in that file. | ||
|
||
**Origin** | ||
- Clause 1 of the IJG License | ||
|
||
2. If you are distributing only libjpeg-turbo binaries without the source, or | ||
if you are distributing an application that statically links with | ||
libjpeg-turbo, then: | ||
|
||
1. Your product documentation must include a message stating: | ||
|
||
This software is based in part on the work of the Independent JPEG | ||
Group. | ||
|
||
**Origin** | ||
- Clause 2 of the IJG license | ||
|
||
2. If your binary distribution includes or uses the TurboJPEG API, then | ||
your product documentation must include the text of the Modified BSD | ||
License. | ||
|
||
**Origin** | ||
- Clause 2 of the Modified BSD License | ||
|
||
3. You cannot use the name of the IJG or The libjpeg-turbo Project or the | ||
contributors thereof in advertising, publicity, etc. | ||
|
||
**Origin** | ||
- IJG License | ||
- Clause 3 of the Modified BSD License | ||
|
||
4. The IJG and The libjpeg-turbo Project do not warrant libjpeg-turbo to be | ||
free of defects, nor do we accept any liability for undesirable | ||
consequences resulting from your use of the software. | ||
|
||
**Origin** | ||
- IJG License | ||
- Modified BSD License | ||
- zlib License | ||
|
||
|
||
The Modified (3-clause) BSD License | ||
=================================== | ||
|
||
Copyright (C)\<YEAR\> \<AUTHOR\>. All Rights Reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
- Redistributions of source code must retain the above copyright notice, | ||
this list of conditions and the following disclaimer. | ||
- Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
- Neither the name of the libjpeg-turbo Project nor the names of its | ||
contributors may be used to endorse or promote products derived from this | ||
software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE | ||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
POSSIBILITY OF SUCH DAMAGE. | ||
|
||
|
||
The zlib License | ||
================ | ||
|
||
Copyright (C) \<YEAR\>, \<AUTHOR\>. | ||
|
||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
arising from the use of this software. | ||
|
||
Permission is granted to anyone to use this software for any purpose, | ||
including commercial applications, and to alter it and redistribute it | ||
freely, subject to the following restrictions: | ||
|
||
1. The origin of this software must not be misrepresented; you must not | ||
claim that you wrote the original software. If you use this software | ||
in a product, an acknowledgment in the product documentation would be | ||
appreciated but is not required. | ||
2. Altered source versions must be plainly marked as such, and must not be | ||
misrepresented as being the original software. | ||
3. This notice may not be removed or altered from any source distribution. |
Oops, something went wrong.