diff mbox

libv4lconvert: Fix support for Y16 pixel format

Message ID 1427386654-31906-1-git-send-email-ricardo.ribalda@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ricardo Ribalda Delgado March 26, 2015, 4:17 p.m. UTC
Y16 is a little-endian format. The original implementation assumed that
it was big-endian.

Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
---
 lib/libv4lconvert/rgbyuv.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Hans de Goede March 27, 2015, 1:42 p.m. UTC | #1
Hi,

On 26-03-15 17:17, Ricardo Ribalda Delgado wrote:
> Y16 is a little-endian format. The original implementation assumed that
> it was big-endian.
>
> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>

Thanks merged upstream, both into master and stable-1.6 branches.

Regards,

Hans

> ---
>   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++){
>
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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++){