@@ -216,8 +216,6 @@ void CudaDeviceInterface::convertAVFrameToFrameOutput(
216216 // codepath, and send it back to the GPU at the very end.
217217 // TODO: A possibly better solution would be to send the frame to the GPU
218218 // first, and do the color conversion there.
219- printf (" A\n " );
220- fflush (stdout);
221219 auto cpuDevice = torch::Device (torch::kCPU );
222220 auto cpuInterface = createDeviceInterface (cpuDevice);
223221
@@ -232,8 +230,6 @@ void CudaDeviceInterface::convertAVFrameToFrameOutput(
232230 frameOutput.data = cpuFrameOutput.data .to (device_);
233231 return ;
234232 }
235- printf (" B\n " );
236- fflush (stdout);
237233
238234 // TODONVDEC: We're currently calling this function from within the CNI
239235 // (Custome NVDEC Interface). But the AVFrame's hw_frames_ctx doesn't exist,
@@ -286,38 +282,24 @@ void CudaDeviceInterface::convertAVFrameToFrameOutput(
286282 dst = allocateEmptyHWCTensor (height, width, device_);
287283 }
288284
289- printf (" C\n " );
290- fflush (stdout);
291285 torch::DeviceIndex deviceIndex = getNonNegativeDeviceIndex (device_);
292- printf (" Ca %d\n " , deviceIndex);
293- fflush (stdout);
294286 nppCtx_->hStream = at::cuda::getCurrentCUDAStream (deviceIndex).stream ();
295- printf (" Cb\n " );
296- fflush (stdout);
297287 cudaError_t err =
298288 cudaStreamGetFlags (nppCtx_->hStream , &nppCtx_->nStreamFlags );
299- printf (" Cc\n " );
300- fflush (stdout);
301289 TORCH_CHECK (
302290 err == cudaSuccess,
303291 " cudaStreamGetFlags failed: " ,
304292 cudaGetErrorString (err));
305- printf (" Cd\n " );
306- fflush (stdout);
307293
308294 NppiSize oSizeROI = {width, height};
309295 Npp8u* yuvData[2 ] = {avFrame->data [0 ], avFrame->data [1 ]};
310296
311297 NppStatus status;
312298
313- printf (" D\n " );
314- fflush (stdout);
315299 // For background, see
316300 // Note [YUV -> RGB Color Conversion, color space and color range]
317301 if (avFrame->colorspace == AVColorSpace::AVCOL_SPC_BT709) {
318302
319- printf (" E\n " );
320- fflush (stdout);
321303 if (avFrame->color_range == AVColorRange::AVCOL_RANGE_JPEG) {
322304 // NPP provides a pre-defined color conversion function for BT.709 full
323305 // range: nppiNV12ToRGB_709HDTV_8u_P2C3R_Ctx. But it's not closely
@@ -355,8 +337,6 @@ void CudaDeviceInterface::convertAVFrameToFrameOutput(
355337 }
356338 } else {
357339
358- printf (" F\n " );
359- fflush (stdout);
360340 // TODO we're assuming BT.601 color space (and probably limited range) by
361341 // calling nppiNV12ToRGB_8u_P2C3R_Ctx. We should handle BT.601 full range,
362342 // and other color-spaces like 2020.
0 commit comments