summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoi Cohen <roico@roico-desktop.(none)>2007-05-28 19:03:57 +0300
committerRoi Cohen <roico@roico-desktop.(none)>2007-05-28 19:03:57 +0300
commitd4f6f3ba0cd57900dd8218d1815342dfa1528d14 (patch)
tree555f730843bd4871e599507dd76cb32f3bcfe952
parent81f0a3271cd1896ab6472681ff0f4ba8683fa1ea (diff)
downloadscreencasting-d4f6f3ba0cd57900dd8218d1815342dfa1528d14.tar.gz
screencasting-d4f6f3ba0cd57900dd8218d1815342dfa1528d14.tar.bz2
remove commented function
-rw-r--r--plugin/rsc2raw.c80
1 files changed, 2 insertions, 78 deletions
diff --git a/plugin/rsc2raw.c b/plugin/rsc2raw.c
index a993f4e..67dc4f6 100644
--- a/plugin/rsc2raw.c
+++ b/plugin/rsc2raw.c
@@ -104,12 +104,12 @@ void applyInputFrame(RawFrame* raw_frame, Frame* frame, u_int32_t width, u_int32
raw_frame->u_output[y * width / 2 + x] = (raw_frame->u_raw[pixel1] +
raw_frame->u_raw[pixel2] +
- raw_frame->u_raw[pixel3] +
+ raw_frame->u_raw[pixel3] +
raw_frame->u_raw[pixel4]) / 4;
raw_frame->v_output[y * width / 2 + x] = (raw_frame->v_raw[pixel1] +
raw_frame->v_raw[pixel2] +
- raw_frame->v_raw[pixel3] +
+ raw_frame->v_raw[pixel3] +
raw_frame->v_raw[pixel4]) / 4;
}
}
@@ -124,79 +124,3 @@ void writeOutputFrame(FILE *output, RawFrame* raw_frame, u_int32_t width, u_int3
fwrite(raw_frame->v_output, sizeof(u_int8_t), height * width / 4, output);
}
-/*
-void writeOutputFrame(FILE *output, u_int8_t *data, u_int32_t width, u_int32_t height)
-{
- // TODO: Error checking
- // YUV format conversion
- u_int8_t *Ys;
- u_int8_t *Us;
- u_int8_t *Vs;
- unsigned long x, y, z = 0;
-
- Ys = malloc(sizeof(u_int8_t) * width * height);
- Us = malloc((sizeof(u_int8_t) * width * height) / 4);
- Vs = malloc((sizeof(u_int8_t) * width * height) / 4);
-
- for (y = 0; y < height; y++) // Don't forget, our data are bottom-to-top
- for(x = 0; x < width; x++)
- {
- int pixel1 = (y*width*3) + (x*3);
-
- // Magic conversion factors - Wikipedia knows what they mean.
- Ys[(y*width)+x] = ((66 * data[pixel1 + 0] + // R
- 129 * data[pixel1 + 1] + // G
- 25 * data[pixel1 + 2] + 128) >> 8) + 16; // B
-
- if (y % 2 == 0 && x % 2 == 0)
- {
- int pixel2 = (y*width*3) + ((x+1)*3);
- int pixel3 = ((y+1)*width*3) + (x*3);
- int pixel4 = ((y+1)*width*3) + ((x+1)*3);
-
- Us[z] = ((-38 * data[pixel1 + 0] + // R
- -74 * data[pixel1 + 1] + // G
- 112 * data[pixel1 + 2] + 128 + // B
-
- -38 * data[pixel2 + 0] + // R
- -74 * data[pixel2 + 1] + // G
- 112 * data[pixel2 + 2] + 128 + // B
-
- -38 * data[pixel3 + 0] + // R
- -74 * data[pixel3 + 1] + // G
- 112 * data[pixel3 + 2] + 128 + // B
-
- -38 * data[pixel4 + 0] + // R
- -74 * data[pixel4 + 1] + // G
- 112 * data[pixel4 + 2] + 128) >> 8) / 4 + 128; // B
-
-
- Vs[z] = ((112 * data[pixel1 + 0] + // R
- -94 * data[pixel1 + 1] + // G
- -18 * data[pixel1 + 2] + 128 + // B
-
- 112 * data[pixel2 + 0] + // R
- -94 * data[pixel2 + 1] + // G
- -18 * data[pixel2 + 2] + 128 + // B
-
- 112 * data[pixel3 + 0] + // R
- -94 * data[pixel3 + 1] + // G
- -18 * data[pixel3 + 2] + 128 + // B
-
- 112 * data[pixel4 + 0] + // R
- -94 * data[pixel4 + 1] + // G
- -18 * data[pixel4 + 2] + 128) >> 8) / 4 + 128; // B
-
- z++;
- }
- }
-
- fwrite(Ys, sizeof(u_int8_t), height * width, output);
-
- fwrite(Us, sizeof(u_int8_t), (height * width)/4, output);
- fwrite(Vs, sizeof(u_int8_t), (height * width)/4, output);
-
- free(Ys);
- free(Us);
- free(Vs);
-}*/