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)
This commit is contained in:
Alberto Griggio 2017-12-13 14:37:15 +01:00
parent 2c8349887b
commit 816fbef394
2 changed files with 5 additions and 44 deletions

View File

@ -2353,19 +2353,21 @@ void CLASS unpacked_load_raw()
// RT // RT
void CLASS sony_arq_load_raw() void CLASS sony_arq_load_raw()
{ {
static unsigned frame2pos[] = { 0, 1, 3, 2 };
int row, col, bits=0; int row, col, bits=0;
ushort samples[4]; ushort samples[4];
unsigned frame = frame2pos[shot_select];
while (1 << ++bits < maximum); 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++) { for (col=0; col < ((row == 0) ? raw_width : 1); col++) {
RAW(row,col) = 0; RAW(row,col) = 0;
} }
} }
for (row=0; row < raw_height; row++) { 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++) { for (col=0; col < raw_width; col++) {
int c = col + ((shot_select >> 1) & 1); int c = col + ((frame >> 1) & 1);
read_shorts(samples, 4); read_shorts(samples, 4);
if (r < raw_height && c < raw_width) { if (r < raw_height && c < raw_width) {
RAW(r,c) = samples[(2 * (r & 1)) + (c & 1)]; RAW(r,c) = samples[(2 * (r & 1)) + (c & 1)];

View File

@ -294,44 +294,6 @@ void calcFrameBrightnessFactor(unsigned int frame, uint32_t datalen, LUT<uint32_
} }
class RawDataFrameReorder {
public:
typedef array2D<float> *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; using namespace std;
@ -344,9 +306,6 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA
return; return;
} }
RawDataFrameReorder reorder_frames(model, rawDataFrames);
frame = reorder_frames.getframe(frame);
RAWParams::BayerSensor bayerParams = bayerParamsIn; RAWParams::BayerSensor bayerParams = bayerParamsIn;
bayerParams.pixelShiftAutomatic = true; bayerParams.pixelShiftAutomatic = true;