From b96edc2ef749c94c8eb59ae4dc200dd8545269a3 Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nwpope@utu.fi>
Date: Mon, 8 Jun 2020 11:05:58 +0300
Subject: [PATCH] Fix for lossy encoding bug

---
 components/codecs/src/depth_convert.cu | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/components/codecs/src/depth_convert.cu b/components/codecs/src/depth_convert.cu
index 8b6bef8b5..81dc7d3bb 100644
--- a/components/codecs/src/depth_convert.cu
+++ b/components/codecs/src/depth_convert.cu
@@ -80,8 +80,8 @@ __global__ void depth_to_nv12_10_kernel(cv::cuda::PtrStepSz<float> depth, ushort
 		luminance[(y+1)*pitch+x] = ushort(yuv3.x*255.0f) << 8;
 		luminance[(y+1)*pitch+x+1] = ushort(yuv4.x*255.0f) << 8;
 
-		chroma[(y/2)*pitch+x] = ushort(Hb) << 8;
-		chroma[(y/2)*pitch+x+1] = ushort(Ha) << 8;
+		chroma[(y/2)*pitch+x] = ushort(Ha) << 8;
+		chroma[(y/2)*pitch+x+1] = ushort(Hb) << 8;
 	}
 }
 
-- 
GitLab