Skip to content

Commit

Permalink
fix kernel:
Browse files Browse the repository at this point in the history
* match new param names
* we read one pixel at a time (remove "*2")

git-svn-id: https://xpra.org/svn/Xpra/trunk@4745 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Nov 12, 2013
1 parent a6c5bff commit 3753d72
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/xpra/codecs/nvenc/CUDA_rgb2yuv444p.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
gx = blockIdx.x * blockDim.x + threadIdx.x;
gy = blockIdx.y * blockDim.y + threadIdx.y;
uint32_t src_y = gy*2 * src_h / dst_h;
uint32_t src_x = gx*2 * src_w / dst_w;
uint32_t src_y = gy * src_h / dst_h;
uint32_t src_x = gx * src_w / dst_w;
if ((src_x < w) & (src_y < h)) {
uint8_t R;
Expand All @@ -30,11 +30,11 @@
uint32_t di;
di = (gy * dstPitch) + gx;
yuvImage[di] = __float2int_rn(0.257 * R + 0.504 * G + 0.098 * B + 16);
di += dstPitch*dstHeight;
yuvImage[di] = __float2int_rn(-0.148 * R - 0.291 * G + 0.439 * B + 128);
di += dstPitch*dstHeight;
yuvImage[di] = __float2int_rn(0.439 * R - 0.368 * G - 0.071 * B + 128);
dstImage[di] = __float2int_rn(0.257 * R + 0.504 * G + 0.098 * B + 16);
di += dstPitch*dst_h;
dstImage[di] = __float2int_rn(-0.148 * R - 0.291 * G + 0.439 * B + 128);
di += dstPitch*dst_h;
dstImage[di] = __float2int_rn(0.439 * R - 0.368 * G - 0.071 * B + 128);
}
}
"""

0 comments on commit 3753d72

Please sign in to comment.