From 816fbef394f799b53e3ae6ea3ea0f6b4314bddcc Mon Sep 17 00:00:00 2001 From: Alberto Griggio Date: Wed, 13 Dec 2017 14:37:15 +0100 Subject: [PATCH] use the "correct" order for loading frames in sony_arq_load_raw instead of reordering in pixelshift This is cleaner (avoids having to add special cases for camera maker/model in pixelshift) --- rtengine/dcraw.cc | 8 +++++--- rtengine/pixelshift.cc | 41 ----------------------------------------- 2 files changed, 5 insertions(+), 44 deletions(-) diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index b843404e5..75891c589 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -2353,19 +2353,21 @@ void CLASS unpacked_load_raw() // RT void CLASS sony_arq_load_raw() { + static unsigned frame2pos[] = { 0, 1, 3, 2 }; int row, col, bits=0; ushort samples[4]; + unsigned frame = frame2pos[shot_select]; while (1 << ++bits < maximum); - for (row=0; row < ((shot_select < 2) ? 1 : raw_height); row++) { + for (row=0; row < ((frame < 2) ? 1 : raw_height); row++) { for (col=0; col < ((row == 0) ? raw_width : 1); col++) { RAW(row,col) = 0; } } for (row=0; row < raw_height; row++) { - int r = row + (shot_select & 1); + int r = row + (frame & 1); for (col=0; col < raw_width; col++) { - int c = col + ((shot_select >> 1) & 1); + int c = col + ((frame >> 1) & 1); read_shorts(samples, 4); if (r < raw_height && c < raw_width) { RAW(r,c) = samples[(2 * (r & 1)) + (c & 1)]; diff --git a/rtengine/pixelshift.cc b/rtengine/pixelshift.cc index 875f87a2f..821983190 100644 --- a/rtengine/pixelshift.cc +++ b/rtengine/pixelshift.cc @@ -294,44 +294,6 @@ void calcFrameBrightnessFactor(unsigned int frame, uint32_t datalen, LUT *array2D_ptr; - RawDataFrameReorder(const std::string &model, array2D_ptr *rawDataFrames): - model_(model), - frames_(rawDataFrames) - { - if (model_ == "ILCE-7RM3") { - std::swap(frames_[2], frames_[3]); - } - } - - ~RawDataFrameReorder() - { - if (model_ == "ILCE-7RM3") { - std::swap(frames_[2], frames_[3]); - } - } - - unsigned int getframe(unsigned int frame) - { - if (model_ == "ILCE-7RM3") { - if (frame == 2) { - return 3; - } else if (frame == 3) { - return 2; - } - } - return frame; - } - -private: - std::string model_; - array2D_ptr *frames_; -}; - - } using namespace std; @@ -344,9 +306,6 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA return; } - RawDataFrameReorder reorder_frames(model, rawDataFrames); - frame = reorder_frames.getframe(frame); - RAWParams::BayerSensor bayerParams = bayerParamsIn; bayerParams.pixelShiftAutomatic = true;