Skip to content

Commit d7db262

Browse files
committed
Improve color accuracy of BT709 frames on CUDA
1 parent f51d283 commit d7db262

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

test/decoders/test_video_decoder_ops.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,10 @@ def test_get_frame_at_pts(self, device):
118118
# return the next frame since the right boundary of the interval is
119119
# open.
120120
next_frame, _, _ = get_frame_at_pts(decoder, 6.039367)
121-
with pytest.raises(AssertionError):
122-
frame_compare_function(next_frame, reference_frame6.to(device))
121+
if device == "cpu":
122+
# We can only compare exact equality on CPU.
123+
with pytest.raises(AssertionError):
124+
frame_compare_function(next_frame, reference_frame6.to(device))
123125

124126
@pytest.mark.parametrize("device", cpu_and_cuda())
125127
def test_get_frame_at_index(self, device):

test/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def assert_tensor_equal(*args, **kwargs):
4444

4545
# Asserts that at least `percentage`% of the values are within the absolute tolerance.
4646
def assert_tensor_close_on_at_least(
47-
actual_tensor, ref_tensor, percentage=90, abs_tolerance=20
47+
actual_tensor, ref_tensor, percentage=90, abs_tolerance=19
4848
):
4949
assert (
5050
actual_tensor.device == ref_tensor.device

0 commit comments

Comments
 (0)