Skip to content

Commit 15e23f6

Browse files
committed
nits
1 parent ffbdf4e commit 15e23f6

File tree

4 files changed

+3
-17
lines changed

4 files changed

+3
-17
lines changed

src/torchcodec/_core/Encoder.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -917,17 +917,6 @@ UniqueAVFrame VideoEncoder::convertTensorToAVFrame(
917917
"Expected 3D RGB tensor (CHW format), got shape: ",
918918
frame.sizes());
919919

920-
// These are all already set in initializeEncoder?
921-
// inHeight_ = static_cast<int>(tensor.sizes()[1]);
922-
// inWidth_ = static_cast<int>(tensor.sizes()[2]);
923-
924-
// // For now, reuse input dimensions as output dimensions
925-
// outWidth_ = inWidth_;
926-
// outHeight_ = inHeight_;
927-
928-
// // Input format is RGB planar (AV_PIX_FMT_GBRP after channel reordering)
929-
// inPixelFormat_ = AV_PIX_FMT_GBRP;
930-
931920
// Initialize and cache scaling context if it does not exist
932921
if (!swsContext_) {
933922
swsContext_.reset(sws_getContext(

src/torchcodec/_core/custom_ops.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,7 @@ void _add_video_stream(
415415
}
416416

417417
validateDeviceInterface(std::string(device), std::string(device_variant));
418+
418419
videoStreamOptions.device = torch::Device(std::string(device));
419420
videoStreamOptions.deviceVariant = device_variant;
420421

src/torchcodec/encoders/_video_encoder.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,7 @@ class VideoEncoder:
1919
frame_rate (float): The frame rate of the **input** ``frames``. Also defines the encoded **output** frame rate.
2020
"""
2121

22-
def __init__(
23-
self,
24-
frames: Tensor,
25-
*,
26-
frame_rate: float,
27-
):
22+
def __init__(self, frames: Tensor, *, frame_rate: float):
2823
torch._C._log_api_usage_once("torchcodec.encoders.VideoEncoder")
2924
if not isinstance(frames, Tensor):
3025
raise ValueError(f"Expected frames to be a Tensor, got {type(frames) = }.")

test/test_encoders.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import pytest
1111
import torch
1212
from torchcodec.decoders import AudioDecoder, VideoDecoder
13+
1314
from torchcodec.encoders import AudioEncoder, VideoEncoder
1415

1516
from .utils import (

0 commit comments

Comments
 (0)