[xiph-commits] r14197 - experimental/ribamar/etheora/examples
ribamar at svn.xiph.org
ribamar at svn.xiph.org
Mon Nov 19 18:15:05 PST 2007
Author: ribamar
Date: 2007-11-19 18:15:05 -0800 (Mon, 19 Nov 2007)
New Revision: 14197
Modified:
experimental/ribamar/etheora/examples/decoder-example-opencv.c
Log:
etheora decoder-example-opencv using alternative method for decoding pixel
Modified: experimental/ribamar/etheora/examples/decoder-example-opencv.c
===================================================================
--- experimental/ribamar/etheora/examples/decoder-example-opencv.c 2007-11-20 02:13:47 UTC (rev 14196)
+++ experimental/ribamar/etheora/examples/decoder-example-opencv.c 2007-11-20 02:15:05 UTC (rev 14197)
@@ -23,12 +23,16 @@
#include <opencv/cv.h>
#include <opencv/highgui.h>
+#define YUV_DECODING 1
int main(int argc, char **args){
int i, j;
etheora_ctx ec;
FILE *finfo, *fin;
+#ifdef YUV_DECODING
+ unsigned char y, u, v;
+#endif
float r, g, b;
IplImage *image;
@@ -70,11 +74,18 @@
/*now we can read the frame buffer data. */
for( i = 0; i < etheora_get_width(&ec); i++)
for( j = 0; j < etheora_get_height(&ec); j++){
- /* or use etheora_dec_yuv draw() to
- read in yuv colorspace.*/
+#ifdef YUV_DECODING
+ etheora_dec_yuv_read(&ec, i, j,
+ &y, &u, &v);
+
+ etheora_pixel_yuv2rgb(y, u, v, &r, &g, &b);
+ etheora_pixel_rgb_reescale(&r, &g, &b);
+#else
etheora_dec_rgb_read(&ec, i, j,
&r, &g, &b);
+#endif
+
/* opencv stuff - drawing the pixel in the
opencv image. */
CV_IMAGE_ELEM( image, uchar, j,
More information about the commits
mailing list