From patchwork Thu Mar 26 16:17:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda Delgado X-Patchwork-Id: 6100761 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5B1E4BF90F for ; Thu, 26 Mar 2015 16:17:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9F72D2041F for ; Thu, 26 Mar 2015 16:17:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B84E420411 for ; Thu, 26 Mar 2015 16:17:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752266AbbCZQRj (ORCPT ); Thu, 26 Mar 2015 12:17:39 -0400 Received: from mail-la0-f46.google.com ([209.85.215.46]:33957 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751018AbbCZQRj (ORCPT ); Thu, 26 Mar 2015 12:17:39 -0400 Received: by lagg8 with SMTP id g8so49643541lag.1 for ; Thu, 26 Mar 2015 09:17:37 -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; bh=uvvEIk74gohfSn9mig1Al7AAfUrSndsgZ4j5QkmKYXE=; b=bovHY//cwYw9qb+F0qmR4t9zJccJS/WbkgBsHzZdwuubPN8BCSx24Y7kiqcDT5XzuT HXpbBbOiyt+8n5PzqNcDg46ltAobT/ftKWVIw3mxRHO9OHZIec9/BvwPQgkamf68iJdT wHUyUhZFqVeq5q6De4jMHKWeApjiWwP92gJPOQOmO0lYvkFaP9ZoDPYh+uFN5dDSKXmB NyYtzVzxyGeglczAbbih8id9bru+TpeZQbUGfdq3EDG2UyXPNnDjgeUmNgbQnIUoGWtr +pzP/psLdpL1qDmbCRFWizshonoWCaNroKoDjq4BR12Fp0OFX/mAi30ybYgPgkgjCcgj rSBQ== X-Received: by 10.152.179.139 with SMTP id dg11mr14097637lac.28.1427386657581; Thu, 26 Mar 2015 09:17:37 -0700 (PDT) Received: from neopili.fritz.box (cpe.xe-3-0-1-778.vbrnqe10.dk.customer.tdc.net. [80.197.57.18]) by mx.google.com with ESMTPSA id a4sm1348786lbm.32.2015.03.26.09.17.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 26 Mar 2015 09:17:36 -0700 (PDT) From: Ricardo Ribalda Delgado To: Hans de Goede , Gregor Jasny , linux-media@vger.kernel.org Cc: Ricardo Ribalda Delgado Subject: [PATCH] libv4lconvert: Fix support for Y16 pixel format Date: Thu, 26 Mar 2015 17:17:34 +0100 Message-Id: <1427386654-31906-1-git-send-email-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.1.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Y16 is a little-endian format. The original implementation assumed that it was big-endian. Signed-off-by: Ricardo Ribalda Delgado --- lib/libv4lconvert/rgbyuv.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/libv4lconvert/rgbyuv.c b/lib/libv4lconvert/rgbyuv.c index 0f30192..75c42aa 100644 --- a/lib/libv4lconvert/rgbyuv.c +++ b/lib/libv4lconvert/rgbyuv.c @@ -591,6 +591,9 @@ void v4lconvert_y16_to_rgb24(const unsigned char *src, unsigned char *dest, int width, int height) { int j; + + src++; /*Y16 is little endian*/ + while (--height >= 0) { for (j = 0; j < width; j++) { *dest++ = *src; @@ -606,6 +609,8 @@ void v4lconvert_y16_to_yuv420(const unsigned char *src, unsigned char *dest, { int x, y; + src++; /*Y16 is little endian*/ + /* Y */ for (y = 0; y < src_fmt->fmt.pix.height; y++) for (x = 0; x < src_fmt->fmt.pix.width; x++){