summaryrefslogtreecommitdiff
path: root/v4l2-apps/libv4l/libv4lconvert/bayer.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-03-18 12:17:14 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-03-18 12:17:14 -0300
commit976a91082e499203f3700aa589a54aefedc3c22a (patch)
tree311541d0a78d789d3f59dbba22637ce262227f51 /v4l2-apps/libv4l/libv4lconvert/bayer.c
parentd42d95e43ed8a60e001ff0a8a4f323380098be7d (diff)
parent70bbc9f369222fa300c1fcb727eefd22da4db452 (diff)
downloadmediapointer-dvb-s2-976a91082e499203f3700aa589a54aefedc3c22a.tar.gz
mediapointer-dvb-s2-976a91082e499203f3700aa589a54aefedc3c22a.tar.bz2
merge: http://linuxtv.org/hg/~dheitmueller/hvr950q-analog2
From: Mauro Carvalho Chehab <mchehab@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'v4l2-apps/libv4l/libv4lconvert/bayer.c')
-rw-r--r--v4l2-apps/libv4l/libv4lconvert/bayer.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/v4l2-apps/libv4l/libv4lconvert/bayer.c b/v4l2-apps/libv4l/libv4lconvert/bayer.c
index ca7bb486f..033ee2724 100644
--- a/v4l2-apps/libv4l/libv4lconvert/bayer.c
+++ b/v4l2-apps/libv4l/libv4lconvert/bayer.c
@@ -433,16 +433,23 @@ static void v4lconvert_border_bayer_line_to_y(
}
}
-void v4lconvert_bayer_to_yuv420(const unsigned char *bayer,
- unsigned char *yuv, int width, int height, unsigned int pixfmt)
+void v4lconvert_bayer_to_yuv420(const unsigned char *bayer, unsigned char *yuv,
+ int width, int height, unsigned int src_pixfmt, int yvu)
{
int blue_line = 0, start_with_green = 0, x, y;
unsigned char *ydst = yuv;
- unsigned char *udst = yuv + width * height;
- unsigned char *vdst = udst + width * height / 4;
+ unsigned char *udst, *vdst;
+
+ if (yvu) {
+ vdst = yuv + width * height;
+ udst = vdst + width * height / 4;
+ } else {
+ udst = yuv + width * height;
+ vdst = udst + width * height / 4;
+ }
/* First calculate the u and v planes 2x2 pixels at a time */
- switch (pixfmt) {
+ switch (src_pixfmt) {
case V4L2_PIX_FMT_SBGGR8:
for (y = 0; y < height; y += 2) {
for (x = 0; x < width; x += 2) {