diff --git a/CMakeLists.txt b/CMakeLists.txt index f73cf77be..8dcf6793d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,6 +103,9 @@ if(HAVE_X86_SSE_MATH) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2 -mfpmath=sse") endif() +# On i386 Linux we can fix unaligned SSE malloc (see GitHub issue #4432) +include(FindUnalignedMalloc) + if(WIN32) # Add additional paths. Look in the MinGW path first, then in the Gtkmm path. # If you wish to build some dependent libraries, you have to install them in MinGW to use them: @@ -339,8 +342,13 @@ if(WITH_LTO) execute_process(COMMAND ar --version OUTPUT_VARIABLE BINUTILS_VERSION_DETECTED) string(REGEX REPLACE ".* ([0-9.]+)\n.*" "\\1" BINUTILS_VERSION_DETECTED "${BINUTILS_VERSION_DETECTED}") if("${BINUTILS_VERSION_DETECTED}" VERSION_LESS "${BINUTILS_VERSION_MININUM}") - SET(CMAKE_AR "/usr/bin/gcc-ar") - SET(CMAKE_RANLIB "/usr/bin/gcc-ranlib") + if(APPLE) + SET(CMAKE_AR "/opt/local/bin/ar") + SET(CMAKE_RANLIB "/opt/local/bin/ranlib") + else() + SET(CMAKE_AR "/usr/bin/gcc-ar") + SET(CMAKE_RANLIB "/usr/bin/gcc-ranlib") + endif() message(STATUS "Binutils version detected as less than " ${BINUTILS_VERSION_MININUM} " - setting CMake parameters to enable LTO linking:\n CMAKE_AR=\"" ${CMAKE_AR} "\"\n CMAKE_RANLIB=\"" ${CMAKE_RANLIB} "\"") endif() diff --git a/cmake/modules/FindUnalignedMalloc.cmake b/cmake/modules/FindUnalignedMalloc.cmake new file mode 100644 index 000000000..4ddfb2afc --- /dev/null +++ b/cmake/modules/FindUnalignedMalloc.cmake @@ -0,0 +1,49 @@ +# This file is part of RawTherapee. +# +# Copyright (C) 2018 Flössie +# +# RawTherapee is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# RawTherapee is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with RawTherapee. If not, see . + +include(CheckCXXSourceCompiles) + +set(CMAKE_REQUIRED_QUIET_COPY "${CMAKE_REQUIRED_QUIET}") +set(CMAKE_REQUIRED_QUIET ON) + +set(TEST_SOURCE +" +#include +#include + +int main() +{ +#if defined(__SSE2__) && (defined(__i386) || defined(_M_IX86)) && defined(__linux) + static_assert(std::alignment_of::value >= 16, \"Unaligned heap objects possible\"); +#endif + + return 0; +} +") + +CHECK_CXX_SOURCE_COMPILES("${TEST_SOURCE}" HAVE_ALIGNED_MALLOC) + +if(NOT HAVE_ALIGNED_MALLOC) + set(HAVE_UNALIGNED_MALLOC 1) +else() + unset(HAVE_ALIGNED_MALLOC) +endif() + +unset(TEST_SOURCE) + +set(CMAKE_REQUIRED_QUIET "${CMAKE_REQUIRED_QUIET_COPY}") +unset(CMAKE_REQUIRED_QUIET_COPY) diff --git a/rtdata/dcpprofiles/NIKON D700.dcp b/rtdata/dcpprofiles/NIKON D700.dcp index 1ae994439..9e8d013ab 100644 Binary files a/rtdata/dcpprofiles/NIKON D700.dcp and b/rtdata/dcpprofiles/NIKON D700.dcp differ diff --git a/rtdata/dcpprofiles/NIKON D750.dcp b/rtdata/dcpprofiles/NIKON D750.dcp new file mode 100644 index 000000000..86a676b3e Binary files /dev/null and b/rtdata/dcpprofiles/NIKON D750.dcp differ diff --git a/rtdata/dcpprofiles/PENTAX K10D.dcp b/rtdata/dcpprofiles/PENTAX K10D.dcp index cda2456d0..1e688e2aa 100644 Binary files a/rtdata/dcpprofiles/PENTAX K10D.dcp and b/rtdata/dcpprofiles/PENTAX K10D.dcp differ diff --git a/rtdata/dcpprofiles/RICOH PENTAX K-1.dcp b/rtdata/dcpprofiles/RICOH PENTAX K-1.dcp index 87028cba6..278c86d5a 100644 Binary files a/rtdata/dcpprofiles/RICOH PENTAX K-1.dcp and b/rtdata/dcpprofiles/RICOH PENTAX K-1.dcp differ diff --git a/rtengine/camconst.json b/rtengine/camconst.json index 8709c16c7..4a294fe03 100644 --- a/rtengine/camconst.json +++ b/rtengine/camconst.json @@ -2245,12 +2245,6 @@ Camera constants: "ranges": { "black": 512, "white": 16300 } }, - { // Quality A - "make_model": "Sony ILCE-7M2", - "dcraw_matrix": [ 5271,-712,-347,-6153,13653,2763,-1601,2366,7242 ], // DNGv8.7.1 - "ranges": { "black": 512, "white": 16300 } - }, - { // Quality A, correction for frame width "make_model": "Sony ILCE-7R", "dcraw_matrix": [ 4913,-541,-202,-6130,13513,2906,-1564,2151,7183 ], @@ -2258,6 +2252,12 @@ Camera constants: "ranges": { "black": 512, "white": 16300 } }, + { // Quality A + "make_model": "Sony ILCE-7M2", + "dcraw_matrix": [ 5271,-712,-347,-6153,13653,2763,-1601,2366,7242 ], // DNGv8.7.1 + "ranges": { "black": 512, "white": 16300 } + }, + { // Quality B, correction for frame width, crop modes covered "make_model": [ "Sony ILCE-7RM2", "Sony DSC-RX1RM2" ], "dcraw_matrix": [ 6629,-1900,-483,-4618,12349,2550,-622,1381,6514 ], // DNG_v9.1.1 D65 @@ -2265,6 +2265,35 @@ Camera constants: "ranges": { "black": 512, "white": 16300 } }, + { // Quality C, color matrix copied from ILCE-9, LongExposures 2-3sec only + "make_model": "Sony ILCE-7M3", + "dcraw_matrix": [ 6389,-1703,-378,-4562,12265,2587,-670,1489,6550 ], // ILCE-9, DNG_v9.12 D65 + // "raw_crop": [ 8, 8, 6008, 4008 ], // full raw frame 6048x4024 Dcraw auto identify 6024x4024, jpeg 12,12,6000x4000 + // "ranges": { "black": 512, "white": 16300 } + "ranges": { + "black": 512, + "white": [ + { "iso": [ 50, 64 ], "levels": 16100 }, // typical compressed 16372, non compressed 16383, LongEx iso50,16150 , 16275 + { "iso": [ 80, 100, 125, 160 ], "levels": 16200 }, // typical compressed 16372, non compressed 16383, LongEx iso50,16150 , 16275 + { "iso": [ 200, 250, 320, 400, 500, 640, 800, 1000, 1250 ], "levels": 16200 }, // compressed 16372, non compressed 16383, LongExp 16275 + { "iso": [ 1600, 2000, 2500, 3200, 4000, 5000 ], "levels": 16200 }, // compressed 16372, non compressed 16383, LongExp 16275 + { "iso": [ 6400, 8000, 10000, 12800 ], "levels": 16200 }, // compressed 16372, non compressed 16365-16375-16383, LongExp 16275 + { "iso": [ 16000, 20000, 25600 ], "levels": 16100 }, // 16275-16340-16372, nc 16375-16325-16280, LongExp 16210 + { "iso": [ 32000, 40000, 51200 ], "levels": 16100 }, // 16210-16340-16372, nc 16330, LongExp 16210 + { "iso": [ 64000, 80000, 102400 ], "levels": 16100 }, // g16340 , nc 16330, LongExp 16210 + { "iso": [ 128000, 160000, 204800 ], "levels": 16000 } // r16275, g16340, nc 16330, LongExp 16330-16370 + ] + } + + }, + + { // Quality C, + "make_model": "Sony ILCE-7RM3", + "dcraw_matrix": [ 6640,-1847,-503,-5238,13010,2474,-993,1673,6527 ], // DNG_v10.1 D65 + "raw_crop": [ 0, 0, -36, 0 ], // full raw frame 8000x5320 - 36 rightmost columns are garbage + "ranges": { "black": 512, "white": 16300 } + }, + { // Quality B, color matrix copied from a7rm2 "make_model": "Sony ILCE-9", "dcraw_matrix": [ 6389,-1703,-378,-4562,12265,2587,-670,1489,6550 ], // DNG_v9.12 D65 @@ -2291,13 +2320,6 @@ Camera constants: "ranges": { "black": 800, "white": 16300 } }, - { // Quality C, - "make_model": "Sony ILCE-7RM3", - "dcraw_matrix": [ 6640,-1847,-503,-5238,13010,2474,-993,1673,6527 ], // DNG_v10.1 D65 - "raw_crop": [ 0, 0, -36, 0 ], // full raw frame 8000x5320 - 36 rightmost columns are garbage - "ranges": { "black": 512, "white": 16300 } - }, - { // Quality C, No proper color data, beta samples, frame set to official jpeg, "make_model": [ "XIAOYI M1", "YI TECHNOLOGY M1" ], "dcraw_matrix": [ 7158,-1911,-606,-3603,10669,2530,-659,1236,5530 ], // XIAO YI DNG D65 diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index dfde78785..871fcf7c5 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -8302,13 +8302,13 @@ void CLASS adobe_coeff (const char *make, const char *model) { 6038,-1484,-579,-9145,16746,2512,-875,746,7218 } }, { "Sony DSLR-A390", 0, 0, { 6038,-1484,-579,-9145,16746,2512,-875,746,7218 } }, - { "Sony DSLR-A450", 0, 0xfeb, + { "Sony DSLR-A450", 0, 0, { 4950,-580,-103,-5228,12542,3029,-709,1435,7371 } }, - { "Sony DSLR-A580", 0, 0xfeb, + { "Sony DSLR-A580", 0, 0, { 5932,-1492,-411,-4813,12285,2856,-741,1524,6739 } }, - { "Sony DSLR-A500", 0, 0xfeb, + { "Sony DSLR-A500", 0, 0, { 6046,-1127,-278,-5574,13076,2786,-691,1419,7625 } }, - { "Sony DSLR-A5", 0, 0xfeb, + { "Sony DSLR-A5", 0, 0, { 4950,-580,-103,-5228,12542,3029,-709,1435,7371 } }, { "Sony DSLR-A700", 0, 0, { 5775,-805,-359,-8574,16295,2391,-1943,2341,7249 } }, diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index b5f0ad4d6..0593c5650 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -5358,6 +5358,10 @@ void RawImageSource::init() void RawImageSource::getRawValues(int x, int y, int rotate, int &R, int &G, int &B) { + if(d1x) { // Nikon D1x has special sensor. We just skip it + R = G = B = 0; + return; + } int xnew = x + border; int ynew = y + border; rotate += ri->get_rotateDegree(); diff --git a/rtgui/CMakeLists.txt b/rtgui/CMakeLists.txt index baba236c2..753fd1e41 100644 --- a/rtgui/CMakeLists.txt +++ b/rtgui/CMakeLists.txt @@ -1,5 +1,6 @@ # Common source files for both CLI and non-CLI execautables set(CLISOURCEFILES + alignedmalloc.cc edit.cc main-cli.cc multilangmgr.cc @@ -11,6 +12,7 @@ set(CLISOURCEFILES set(NONCLISOURCEFILES adjuster.cc + alignedmalloc.cc batchqueue.cc batchqueuebuttonset.cc batchqueueentry.cc diff --git a/rtgui/alignedmalloc.cc b/rtgui/alignedmalloc.cc new file mode 100644 index 000000000..91fe15a85 --- /dev/null +++ b/rtgui/alignedmalloc.cc @@ -0,0 +1,31 @@ +/* + * This file is part of RawTherapee. + * + * Copyright (C) 2018 Flössie + * + * RawTherapee is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * RawTherapee is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with RawTherapee. If not, see . + */ + +#include "config.h" + +#ifdef HAVE_UNALIGNED_MALLOC + +#include + +void* malloc(size_t size) +{ + return memalign(16, size); +} + +#endif diff --git a/rtgui/config.h.in b/rtgui/config.h.in index fdf64b73c..2d1f41dbc 100644 --- a/rtgui/config.h.in +++ b/rtgui/config.h.in @@ -21,6 +21,7 @@ #define __CONFIG_H__ #cmakedefine BUILD_BUNDLE +#cmakedefine HAVE_UNALIGNED_MALLOC #define DATA_SEARCH_PATH "${DATADIR}" #define DOC_SEARCH_PATH "${DOCDIR}" #define CREDITS_SEARCH_PATH "${CREDITSDIR}" diff --git a/rtgui/tonecurve.cc b/rtgui/tonecurve.cc index b0bd8334d..4b50c97cc 100644 --- a/rtgui/tonecurve.cc +++ b/rtgui/tonecurve.cc @@ -943,7 +943,6 @@ bool ToneCurve::histmatchingComputed() brightness->setValue(0); contrast->setValue(0); black->setValue(0); - hlcompr->setValue(0); if (!black->getAddMode()) { shcompr->set_sensitive(!((int)black->getValue() == 0));