 			r += v & 0xff;
 			g += (v >> 8) & 0xff;
 			b += (v >> 16) & 0xff;
-			// lastv = v;
 		}
 		r /= i;
 		g /= i;

				threadsPerBlock>>>(dctx, dout, h, w, perThread);
			break;
		case ADAPTIVE_TEMPORAL_AVG:
			denoiseKernelAdaptiveTemporalAvg<<<blocksPerGrid,
				threadsPerBlock>>>(dctx, dout, h, w, perThread);
			break;
		}
		cudaFree(dctx);

	}
}

__global__ void denoiseKernelTemporalAvg(
		KernelContext *ctx, uint32_t *out,
		int h, int w, int perThread) {
