Enable files >2GB on 32bit systems; some fix for simple debayering

master
Stefan Jahn 3 years ago
parent 294723388d
commit e1f9d581c4

@ -16,8 +16,8 @@ void debayer_grbg16_simple (uint16_t * src, int src_w, int src_h,
for (ys = 0, yd = 0; ys < src_h && yd < dst_h; ys++, yd++) { for (ys = 0, yd = 0; ys < src_h && yd < dst_h; ys++, yd++) {
for (xs = 0, xd = 0; xs < src_w; xs++) { for (xs = 0, xd = 0; xs < src_w; xs++) {
/* read the pixel but only the lower 8bit */ /* read the pixel but only the higher 8bit, assuming data is little endian */
t = *(src++) & 0x00FF; t = *(src++) >> 8;
if (xs & 1) { if (xs & 1) {
if (ys & 1) { if (ys & 1) {
@ -40,9 +40,9 @@ void debayer_grbg16_simple (uint16_t * src, int src_w, int src_h,
/* only paint the image if the source is within the destination */ /* only paint the image if the source is within the destination */
if (xd < dst_w) { if (xd < dst_w) {
/* set the pixel */ /* set the pixel */
*(dst++) = b;
*(dst++) = g;
*(dst++) = r; *(dst++) = r;
*(dst++) = g;
*(dst++) = b;
xd++; xd++;
} }
} }

@ -7,6 +7,10 @@
* This is needed only for debugging. * This is needed only for debugging.
************************************************************************************/ ************************************************************************************/
/* enable files > 2GB on 32 bit systems */
#define _LARGEFILE64_SOURCE 1
#define _FILE_OFFSET_BITS 64
#include <sys/types.h> #include <sys/types.h>
#include <dirent.h> #include <dirent.h>
#include <ctype.h> #include <ctype.h>

Loading…
Cancel
Save