From patchwork Mon Jul 18 12:42:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda Delgado X-Patchwork-Id: 9234541 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0D6936075D for ; Mon, 18 Jul 2016 12:45:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F3C1A1FFC7 for ; Mon, 18 Jul 2016 12:44:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8CBB26538; Mon, 18 Jul 2016 12:44:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 04C6E1FFC7 for ; Mon, 18 Jul 2016 12:44:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751642AbcGRMoX (ORCPT ); Mon, 18 Jul 2016 08:44:23 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:35189 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751898AbcGRMma (ORCPT ); Mon, 18 Jul 2016 08:42:30 -0400 Received: by mail-lf0-f68.google.com with SMTP id l89so11230587lfi.2; Mon, 18 Jul 2016 05:42:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6+QVunY8PxyC1xW1h5dNMvSLJ++TaPAFw+5lozmAPtU=; b=I3NjET3lxWa2bExlpmnhy8WDFntvLp9PE4YDDC+PbmoeymPfJXyVVKv87n2OVzSOnj goauG6z63ry+nX4dSzApeITQ/eZOjXH7s/5ftpAOhZi2SE2f6rM5ugoi7Iv0yfvtCWqT 6LOy3JvQNAAI9ChLr0DVaPXcVqynpoFCQLRhlUWAm1AYeAkv/9Y/5kLIZNUxH2kLBZTW i2MBxQOdPpVr2b9y13yg+Yq2yz4Vyq6dnXxoKW9ae97LN2sVURbii0CVUBsKqNomMYy/ ucqW2GpllzhgI74M3HYegDCqw4JfzdEOCq+eC6ktZ6GCsspQzDmxF1nxMZ/JmQGHBI6G T2ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6+QVunY8PxyC1xW1h5dNMvSLJ++TaPAFw+5lozmAPtU=; b=lQRuNMawARfnmaMTu56v9hiT0uPys/QdtVTrnNc/f2Zs32ExZCflR0ykcAm4/jdnrp Q2ntme8pv6hU7OhJ6yRWv64Np1xPb3gAhN8R8hDvIVvyIyYne2NKptSrbhEJXMfXBZm4 p2tIi0qihYKdfVS1l1yhfujZQblX0IGzalC15S3NiY8IYd2D6us1QZn9iEUKjmFTTUJt B00XRqZ2hbV2rB6Il8moEJNZf9ViXVf8ixhc+RDBzJUXoJhn9uSWA6XeinNCHSCcdubD BCailfwIJ+GkINwytAXZ8Gfhea6gsNpCDWCfXDPOdFFp1X5V5GcvmIwmJ0iEh3yMnmCn DPPQ== X-Gm-Message-State: ALyK8tIwBnAP5zhDB3h46A31EzSomwtW7ppfGclF2wkfFkWTsvwZ67qi3HxKWbRRojN1hA== X-Received: by 10.46.32.77 with SMTP id g74mr1145011ljg.34.1468845748607; Mon, 18 Jul 2016 05:42:28 -0700 (PDT) Received: from neopili.qtec.com (cpe.xe-3-0-1-778.vbrnqe10.dk.customer.tdc.net. [80.197.57.18]) by smtp.gmail.com with ESMTPSA id 205sm4571672ljj.47.2016.07.18.05.42.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jul 2016 05:42:27 -0700 (PDT) From: Ricardo Ribalda Delgado To: Jonathan Corbet , Mauro Carvalho Chehab , Hans Verkuil , Markus Heiser , Laurent Pinchart , Helen Mae Koike Fornazier , Antti Palosaari , Philipp Zabel , Shuah Khan , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Ricardo Ribalda Delgado Subject: [PATCH v4 06/12] [media] vivid: Rename variable Date: Mon, 18 Jul 2016 14:42:10 +0200 Message-Id: <1468845736-19651-7-git-send-email-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1468845736-19651-1-git-send-email-ricardo.ribalda@gmail.com> References: <1468845736-19651-1-git-send-email-ricardo.ribalda@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP r_y and g_u now also contain the H and V components on the HSV formats. Rename the variables to reflect this. Signed-off-by: Ricardo Ribalda Delgado --- drivers/media/common/v4l2-tpg/v4l2-tpg-core.c | 209 +++++++++++++------------- 1 file changed, 105 insertions(+), 104 deletions(-) diff --git a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c index ec8f887a84e5..da77cdd4f2e5 100644 --- a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c +++ b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c @@ -1014,7 +1014,7 @@ static void gen_twopix(struct tpg_data *tpg, { unsigned offset = odd * tpg->twopixelsize[0] / 2; u8 alpha = tpg->alpha_component; - u8 r_y, g_u, b_v; + u8 r_y_h, g_u_s, b_v; if (tpg->alpha_red_only && color != TPG_COLOR_CSC_RED && color != TPG_COLOR_100_RED && @@ -1022,161 +1022,161 @@ static void gen_twopix(struct tpg_data *tpg, alpha = 0; if (color == TPG_COLOR_RANDOM) precalculate_color(tpg, color); - r_y = tpg->colors[color][0]; /* R or precalculated Y, H */ - g_u = tpg->colors[color][1]; /* G or precalculated U, V */ + r_y_h = tpg->colors[color][0]; /* R or precalculated Y, H */ + g_u_s = tpg->colors[color][1]; /* G or precalculated U, V */ b_v = tpg->colors[color][2]; /* B or precalculated V */ switch (tpg->fourcc) { case V4L2_PIX_FMT_GREY: - buf[0][offset] = r_y; + buf[0][offset] = r_y_h; break; case V4L2_PIX_FMT_Y16: /* - * Ideally both bytes should be set to r_y, but then you won't + * Ideally both bytes should be set to r_y_h, but then you won't * be able to detect endian problems. So keep it 0 except for - * the corner case where r_y is 0xff so white really will be + * the corner case where r_y_h is 0xff so white really will be * white (0xffff). */ - buf[0][offset] = r_y == 0xff ? r_y : 0; - buf[0][offset+1] = r_y; + buf[0][offset] = r_y_h == 0xff ? r_y_h : 0; + buf[0][offset+1] = r_y_h; break; case V4L2_PIX_FMT_Y16_BE: /* See comment for V4L2_PIX_FMT_Y16 above */ - buf[0][offset] = r_y; - buf[0][offset+1] = r_y == 0xff ? r_y : 0; + buf[0][offset] = r_y_h; + buf[0][offset+1] = r_y_h == 0xff ? r_y_h : 0; break; case V4L2_PIX_FMT_YUV422M: case V4L2_PIX_FMT_YUV422P: case V4L2_PIX_FMT_YUV420: case V4L2_PIX_FMT_YUV420M: - buf[0][offset] = r_y; + buf[0][offset] = r_y_h; if (odd) { - buf[1][0] = (buf[1][0] + g_u) / 2; + buf[1][0] = (buf[1][0] + g_u_s) / 2; buf[2][0] = (buf[2][0] + b_v) / 2; buf[1][1] = buf[1][0]; buf[2][1] = buf[2][0]; break; } - buf[1][0] = g_u; + buf[1][0] = g_u_s; buf[2][0] = b_v; break; case V4L2_PIX_FMT_YVU422M: case V4L2_PIX_FMT_YVU420: case V4L2_PIX_FMT_YVU420M: - buf[0][offset] = r_y; + buf[0][offset] = r_y_h; if (odd) { buf[1][0] = (buf[1][0] + b_v) / 2; - buf[2][0] = (buf[2][0] + g_u) / 2; + buf[2][0] = (buf[2][0] + g_u_s) / 2; buf[1][1] = buf[1][0]; buf[2][1] = buf[2][0]; break; } buf[1][0] = b_v; - buf[2][0] = g_u; + buf[2][0] = g_u_s; break; case V4L2_PIX_FMT_NV12: case V4L2_PIX_FMT_NV12M: case V4L2_PIX_FMT_NV16: case V4L2_PIX_FMT_NV16M: - buf[0][offset] = r_y; + buf[0][offset] = r_y_h; if (odd) { - buf[1][0] = (buf[1][0] + g_u) / 2; + buf[1][0] = (buf[1][0] + g_u_s) / 2; buf[1][1] = (buf[1][1] + b_v) / 2; break; } - buf[1][0] = g_u; + buf[1][0] = g_u_s; buf[1][1] = b_v; break; case V4L2_PIX_FMT_NV21: case V4L2_PIX_FMT_NV21M: case V4L2_PIX_FMT_NV61: case V4L2_PIX_FMT_NV61M: - buf[0][offset] = r_y; + buf[0][offset] = r_y_h; if (odd) { buf[1][0] = (buf[1][0] + b_v) / 2; - buf[1][1] = (buf[1][1] + g_u) / 2; + buf[1][1] = (buf[1][1] + g_u_s) / 2; break; } buf[1][0] = b_v; - buf[1][1] = g_u; + buf[1][1] = g_u_s; break; case V4L2_PIX_FMT_YUV444M: - buf[0][offset] = r_y; - buf[1][offset] = g_u; + buf[0][offset] = r_y_h; + buf[1][offset] = g_u_s; buf[2][offset] = b_v; break; case V4L2_PIX_FMT_YVU444M: - buf[0][offset] = r_y; + buf[0][offset] = r_y_h; buf[1][offset] = b_v; - buf[2][offset] = g_u; + buf[2][offset] = g_u_s; break; case V4L2_PIX_FMT_NV24: - buf[0][offset] = r_y; - buf[1][2 * offset] = g_u; + buf[0][offset] = r_y_h; + buf[1][2 * offset] = g_u_s; buf[1][2 * offset + 1] = b_v; break; case V4L2_PIX_FMT_NV42: - buf[0][offset] = r_y; + buf[0][offset] = r_y_h; buf[1][2 * offset] = b_v; - buf[1][2 * offset + 1] = g_u; + buf[1][2 * offset + 1] = g_u_s; break; case V4L2_PIX_FMT_YUYV: - buf[0][offset] = r_y; + buf[0][offset] = r_y_h; if (odd) { - buf[0][1] = (buf[0][1] + g_u) / 2; + buf[0][1] = (buf[0][1] + g_u_s) / 2; buf[0][3] = (buf[0][3] + b_v) / 2; break; } - buf[0][1] = g_u; + buf[0][1] = g_u_s; buf[0][3] = b_v; break; case V4L2_PIX_FMT_UYVY: - buf[0][offset + 1] = r_y; + buf[0][offset + 1] = r_y_h; if (odd) { - buf[0][0] = (buf[0][0] + g_u) / 2; + buf[0][0] = (buf[0][0] + g_u_s) / 2; buf[0][2] = (buf[0][2] + b_v) / 2; break; } - buf[0][0] = g_u; + buf[0][0] = g_u_s; buf[0][2] = b_v; break; case V4L2_PIX_FMT_YVYU: - buf[0][offset] = r_y; + buf[0][offset] = r_y_h; if (odd) { buf[0][1] = (buf[0][1] + b_v) / 2; - buf[0][3] = (buf[0][3] + g_u) / 2; + buf[0][3] = (buf[0][3] + g_u_s) / 2; break; } buf[0][1] = b_v; - buf[0][3] = g_u; + buf[0][3] = g_u_s; break; case V4L2_PIX_FMT_VYUY: - buf[0][offset + 1] = r_y; + buf[0][offset + 1] = r_y_h; if (odd) { buf[0][0] = (buf[0][0] + b_v) / 2; - buf[0][2] = (buf[0][2] + g_u) / 2; + buf[0][2] = (buf[0][2] + g_u_s) / 2; break; } buf[0][0] = b_v; - buf[0][2] = g_u; + buf[0][2] = g_u_s; break; case V4L2_PIX_FMT_RGB332: - buf[0][offset] = (r_y << 5) | (g_u << 2) | b_v; + buf[0][offset] = (r_y_h << 5) | (g_u_s << 2) | b_v; break; case V4L2_PIX_FMT_YUV565: case V4L2_PIX_FMT_RGB565: - buf[0][offset] = (g_u << 5) | b_v; - buf[0][offset + 1] = (r_y << 3) | (g_u >> 3); + buf[0][offset] = (g_u_s << 5) | b_v; + buf[0][offset + 1] = (r_y_h << 3) | (g_u_s >> 3); break; case V4L2_PIX_FMT_RGB565X: - buf[0][offset] = (r_y << 3) | (g_u >> 3); - buf[0][offset + 1] = (g_u << 5) | b_v; + buf[0][offset] = (r_y_h << 3) | (g_u_s >> 3); + buf[0][offset + 1] = (g_u_s << 5) | b_v; break; case V4L2_PIX_FMT_RGB444: case V4L2_PIX_FMT_XRGB444: @@ -1184,8 +1184,8 @@ static void gen_twopix(struct tpg_data *tpg, /* fall through */ case V4L2_PIX_FMT_YUV444: case V4L2_PIX_FMT_ARGB444: - buf[0][offset] = (g_u << 4) | b_v; - buf[0][offset + 1] = (alpha & 0xf0) | r_y; + buf[0][offset] = (g_u_s << 4) | b_v; + buf[0][offset + 1] = (alpha & 0xf0) | r_y_h; break; case V4L2_PIX_FMT_RGB555: case V4L2_PIX_FMT_XRGB555: @@ -1193,32 +1193,33 @@ static void gen_twopix(struct tpg_data *tpg, /* fall through */ case V4L2_PIX_FMT_YUV555: case V4L2_PIX_FMT_ARGB555: - buf[0][offset] = (g_u << 5) | b_v; - buf[0][offset + 1] = (alpha & 0x80) | (r_y << 2) | (g_u >> 3); + buf[0][offset] = (g_u_s << 5) | b_v; + buf[0][offset + 1] = (alpha & 0x80) | (r_y_h << 2) + | (g_u_s >> 3); break; case V4L2_PIX_FMT_RGB555X: case V4L2_PIX_FMT_XRGB555X: alpha = 0; /* fall through */ case V4L2_PIX_FMT_ARGB555X: - buf[0][offset] = (alpha & 0x80) | (r_y << 2) | (g_u >> 3); - buf[0][offset + 1] = (g_u << 5) | b_v; + buf[0][offset] = (alpha & 0x80) | (r_y_h << 2) | (g_u_s >> 3); + buf[0][offset + 1] = (g_u_s << 5) | b_v; break; case V4L2_PIX_FMT_RGB24: case V4L2_PIX_FMT_HSV24: - buf[0][offset] = r_y; - buf[0][offset + 1] = g_u; + buf[0][offset] = r_y_h; + buf[0][offset + 1] = g_u_s; buf[0][offset + 2] = b_v; break; case V4L2_PIX_FMT_BGR24: buf[0][offset] = b_v; - buf[0][offset + 1] = g_u; - buf[0][offset + 2] = r_y; + buf[0][offset + 1] = g_u_s; + buf[0][offset + 2] = r_y_h; break; case V4L2_PIX_FMT_BGR666: - buf[0][offset] = (b_v << 2) | (g_u >> 4); - buf[0][offset + 1] = (g_u << 4) | (r_y >> 2); - buf[0][offset + 2] = r_y << 6; + buf[0][offset] = (b_v << 2) | (g_u_s >> 4); + buf[0][offset + 1] = (g_u_s << 4) | (r_y_h >> 2); + buf[0][offset + 2] = r_y_h << 6; buf[0][offset + 3] = 0; break; case V4L2_PIX_FMT_RGB32: @@ -1229,8 +1230,8 @@ static void gen_twopix(struct tpg_data *tpg, case V4L2_PIX_FMT_YUV32: case V4L2_PIX_FMT_ARGB32: buf[0][offset] = alpha; - buf[0][offset + 1] = r_y; - buf[0][offset + 2] = g_u; + buf[0][offset + 1] = r_y_h; + buf[0][offset + 2] = g_u_s; buf[0][offset + 3] = b_v; break; case V4L2_PIX_FMT_BGR32: @@ -1239,87 +1240,87 @@ static void gen_twopix(struct tpg_data *tpg, /* fall through */ case V4L2_PIX_FMT_ABGR32: buf[0][offset] = b_v; - buf[0][offset + 1] = g_u; - buf[0][offset + 2] = r_y; + buf[0][offset + 1] = g_u_s; + buf[0][offset + 2] = r_y_h; buf[0][offset + 3] = alpha; break; case V4L2_PIX_FMT_SBGGR8: - buf[0][offset] = odd ? g_u : b_v; - buf[1][offset] = odd ? r_y : g_u; + buf[0][offset] = odd ? g_u_s : b_v; + buf[1][offset] = odd ? r_y_h : g_u_s; break; case V4L2_PIX_FMT_SGBRG8: - buf[0][offset] = odd ? b_v : g_u; - buf[1][offset] = odd ? g_u : r_y; + buf[0][offset] = odd ? b_v : g_u_s; + buf[1][offset] = odd ? g_u_s : r_y_h; break; case V4L2_PIX_FMT_SGRBG8: - buf[0][offset] = odd ? r_y : g_u; - buf[1][offset] = odd ? g_u : b_v; + buf[0][offset] = odd ? r_y_h : g_u_s; + buf[1][offset] = odd ? g_u_s : b_v; break; case V4L2_PIX_FMT_SRGGB8: - buf[0][offset] = odd ? g_u : r_y; - buf[1][offset] = odd ? b_v : g_u; + buf[0][offset] = odd ? g_u_s : r_y_h; + buf[1][offset] = odd ? b_v : g_u_s; break; case V4L2_PIX_FMT_SBGGR10: - buf[0][offset] = odd ? g_u << 2 : b_v << 2; - buf[0][offset + 1] = odd ? g_u >> 6 : b_v >> 6; - buf[1][offset] = odd ? r_y << 2 : g_u << 2; - buf[1][offset + 1] = odd ? r_y >> 6 : g_u >> 6; + buf[0][offset] = odd ? g_u_s << 2 : b_v << 2; + buf[0][offset + 1] = odd ? g_u_s >> 6 : b_v >> 6; + buf[1][offset] = odd ? r_y_h << 2 : g_u_s << 2; + buf[1][offset + 1] = odd ? r_y_h >> 6 : g_u_s >> 6; buf[0][offset] |= (buf[0][offset] >> 2) & 3; buf[1][offset] |= (buf[1][offset] >> 2) & 3; break; case V4L2_PIX_FMT_SGBRG10: - buf[0][offset] = odd ? b_v << 2 : g_u << 2; - buf[0][offset + 1] = odd ? b_v >> 6 : g_u >> 6; - buf[1][offset] = odd ? g_u << 2 : r_y << 2; - buf[1][offset + 1] = odd ? g_u >> 6 : r_y >> 6; + buf[0][offset] = odd ? b_v << 2 : g_u_s << 2; + buf[0][offset + 1] = odd ? b_v >> 6 : g_u_s >> 6; + buf[1][offset] = odd ? g_u_s << 2 : r_y_h << 2; + buf[1][offset + 1] = odd ? g_u_s >> 6 : r_y_h >> 6; buf[0][offset] |= (buf[0][offset] >> 2) & 3; buf[1][offset] |= (buf[1][offset] >> 2) & 3; break; case V4L2_PIX_FMT_SGRBG10: - buf[0][offset] = odd ? r_y << 2 : g_u << 2; - buf[0][offset + 1] = odd ? r_y >> 6 : g_u >> 6; - buf[1][offset] = odd ? g_u << 2 : b_v << 2; - buf[1][offset + 1] = odd ? g_u >> 6 : b_v >> 6; + buf[0][offset] = odd ? r_y_h << 2 : g_u_s << 2; + buf[0][offset + 1] = odd ? r_y_h >> 6 : g_u_s >> 6; + buf[1][offset] = odd ? g_u_s << 2 : b_v << 2; + buf[1][offset + 1] = odd ? g_u_s >> 6 : b_v >> 6; buf[0][offset] |= (buf[0][offset] >> 2) & 3; buf[1][offset] |= (buf[1][offset] >> 2) & 3; break; case V4L2_PIX_FMT_SRGGB10: - buf[0][offset] = odd ? g_u << 2 : r_y << 2; - buf[0][offset + 1] = odd ? g_u >> 6 : r_y >> 6; - buf[1][offset] = odd ? b_v << 2 : g_u << 2; - buf[1][offset + 1] = odd ? b_v >> 6 : g_u >> 6; + buf[0][offset] = odd ? g_u_s << 2 : r_y_h << 2; + buf[0][offset + 1] = odd ? g_u_s >> 6 : r_y_h >> 6; + buf[1][offset] = odd ? b_v << 2 : g_u_s << 2; + buf[1][offset + 1] = odd ? b_v >> 6 : g_u_s >> 6; buf[0][offset] |= (buf[0][offset] >> 2) & 3; buf[1][offset] |= (buf[1][offset] >> 2) & 3; break; case V4L2_PIX_FMT_SBGGR12: - buf[0][offset] = odd ? g_u << 4 : b_v << 4; - buf[0][offset + 1] = odd ? g_u >> 4 : b_v >> 4; - buf[1][offset] = odd ? r_y << 4 : g_u << 4; - buf[1][offset + 1] = odd ? r_y >> 4 : g_u >> 4; + buf[0][offset] = odd ? g_u_s << 4 : b_v << 4; + buf[0][offset + 1] = odd ? g_u_s >> 4 : b_v >> 4; + buf[1][offset] = odd ? r_y_h << 4 : g_u_s << 4; + buf[1][offset + 1] = odd ? r_y_h >> 4 : g_u_s >> 4; buf[0][offset] |= (buf[0][offset] >> 4) & 0xf; buf[1][offset] |= (buf[1][offset] >> 4) & 0xf; break; case V4L2_PIX_FMT_SGBRG12: - buf[0][offset] = odd ? b_v << 4 : g_u << 4; - buf[0][offset + 1] = odd ? b_v >> 4 : g_u >> 4; - buf[1][offset] = odd ? g_u << 4 : r_y << 4; - buf[1][offset + 1] = odd ? g_u >> 4 : r_y >> 4; + buf[0][offset] = odd ? b_v << 4 : g_u_s << 4; + buf[0][offset + 1] = odd ? b_v >> 4 : g_u_s >> 4; + buf[1][offset] = odd ? g_u_s << 4 : r_y_h << 4; + buf[1][offset + 1] = odd ? g_u_s >> 4 : r_y_h >> 4; buf[0][offset] |= (buf[0][offset] >> 4) & 0xf; buf[1][offset] |= (buf[1][offset] >> 4) & 0xf; break; case V4L2_PIX_FMT_SGRBG12: - buf[0][offset] = odd ? r_y << 4 : g_u << 4; - buf[0][offset + 1] = odd ? r_y >> 4 : g_u >> 4; - buf[1][offset] = odd ? g_u << 4 : b_v << 4; - buf[1][offset + 1] = odd ? g_u >> 4 : b_v >> 4; + buf[0][offset] = odd ? r_y_h << 4 : g_u_s << 4; + buf[0][offset + 1] = odd ? r_y_h >> 4 : g_u_s >> 4; + buf[1][offset] = odd ? g_u_s << 4 : b_v << 4; + buf[1][offset + 1] = odd ? g_u_s >> 4 : b_v >> 4; buf[0][offset] |= (buf[0][offset] >> 4) & 0xf; buf[1][offset] |= (buf[1][offset] >> 4) & 0xf; break; case V4L2_PIX_FMT_SRGGB12: - buf[0][offset] = odd ? g_u << 4 : r_y << 4; - buf[0][offset + 1] = odd ? g_u >> 4 : r_y >> 4; - buf[1][offset] = odd ? b_v << 4 : g_u << 4; - buf[1][offset + 1] = odd ? b_v >> 4 : g_u >> 4; + buf[0][offset] = odd ? g_u_s << 4 : r_y_h << 4; + buf[0][offset + 1] = odd ? g_u_s >> 4 : r_y_h >> 4; + buf[1][offset] = odd ? b_v << 4 : g_u_s << 4; + buf[1][offset + 1] = odd ? b_v >> 4 : g_u_s >> 4; buf[0][offset] |= (buf[0][offset] >> 4) & 0xf; buf[1][offset] |= (buf[1][offset] >> 4) & 0xf; break;