From 365209eb71ac662f40c7cf025fd4b0be8ffc3dba Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Thu, 28 Nov 2024 10:06:29 +0000 Subject: [PATCH] Call nppiNV12ToRGB_709CSC_8u_P2C3R --- src/torchcodec/decoders/_core/CudaDevice.cpp | 3 ++- test/utils.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/torchcodec/decoders/_core/CudaDevice.cpp b/src/torchcodec/decoders/_core/CudaDevice.cpp index 75dea7d8..ae327297 100644 --- a/src/torchcodec/decoders/_core/CudaDevice.cpp +++ b/src/torchcodec/decoders/_core/CudaDevice.cpp @@ -225,7 +225,8 @@ void convertAVFrameToDecodedOutputOnCuda( auto start = std::chrono::high_resolution_clock::now(); NppStatus status; if (src->colorspace == AVColorSpace::AVCOL_SPC_BT709) { - status = nppiNV12ToRGB_709HDTV_8u_P2C3R( + // status = nppiNV12ToRGB_709HDTV_8u_P2C3R( + status = nppiNV12ToRGB_709CSC_8u_P2C3R( input, src->linesize[0], static_cast(dst.data_ptr()), diff --git a/test/utils.py b/test/utils.py index 0fa84385..3bb5bc44 100644 --- a/test/utils.py +++ b/test/utils.py @@ -44,7 +44,7 @@ def assert_tensor_equal(*args, **kwargs): # Asserts that at least `percentage`% of the values are within the absolute tolerance. def assert_tensor_close_on_at_least( - actual_tensor, ref_tensor, percentage=90, abs_tolerance=19 + actual_tensor, ref_tensor, percentage=90, abs_tolerance=5 ): assert ( actual_tensor.device == ref_tensor.device