Skip to content

Commit 4ff25f6

Browse files
committed
increase atol to 3 for webm
1 parent d75f0eb commit 4ff25f6

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/torchcodec/_core/Encoder.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,8 +648,7 @@ void VideoEncoder::initializeEncoder(
648648
videoStreamOptions.pixelFormat.value());
649649
} else {
650650
const AVPixelFormat* formats = getSupportedPixelFormats(*avCodec);
651-
// If pixel formats are undefined for some reason, try a broadly supported
652-
// default.
651+
// If pixel formats are undefined for some reason, try yuv420p
653652
outPixelFormat_ = (formats && formats[0] != AV_PIX_FMT_NONE)
654653
? formats[0]
655654
: AV_PIX_FMT_YUV420P;

test/test_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ def test_video_encoder_round_trip(self, tmp_path, format, method):
12051205
atol = 15
12061206
else:
12071207
assert_close = torch.testing.assert_close
1208-
atol = 2
1208+
atol = 3 if format == "webm" else 2
12091209
for s_frame, rt_frame in zip(source_frames, round_trip_frames):
12101210
assert psnr(s_frame, rt_frame) > 30
12111211
assert_close(s_frame, rt_frame, atol=atol, rtol=0)

0 commit comments

Comments
 (0)