File tree Expand file tree Collapse file tree 4 files changed +4
-24
lines changed
Expand file tree Collapse file tree 4 files changed +4
-24
lines changed Original file line number Diff line number Diff line change @@ -379,14 +379,6 @@ std::string CudaDeviceInterface::getDetails() {
379379 (usingCPUFallback_ ? " CPU fallback." : " NVDEC." );
380380}
381381
382- UniqueAVFrame CudaDeviceInterface::convertTensorToAVFrameForEncoding (
383- const torch::Tensor& tensor,
384- int frameIndex,
385- AVCodecContext* codecContext) {
386- return convertCUDATensorToAVFrameForEncoding (
387- tensor, frameIndex, codecContext);
388- }
389-
390382// --------------------------------------------------------------------------
391383// Below are methods exclusive to video encoding:
392384// --------------------------------------------------------------------------
@@ -507,7 +499,7 @@ const Npp32f (*getConversionMatrix(AVCodecContext* codecContext))[4] {
507499}
508500} // namespace
509501
510- UniqueAVFrame CudaDeviceInterface::convertCUDATensorToAVFrameForEncoding (
502+ UniqueAVFrame CudaDeviceInterface::convertTensorToAVFrameForEncoding (
511503 const torch::Tensor& tensor,
512504 int frameIndex,
513505 AVCodecContext* codecContext) {
Original file line number Diff line number Diff line change @@ -48,11 +48,6 @@ class CudaDeviceInterface : public DeviceInterface {
4848 int frameIndex,
4949 AVCodecContext* codecContext) override ;
5050
51- UniqueAVFrame convertCUDATensorToAVFrameForEncoding (
52- const torch::Tensor& tensor,
53- int frameIndex,
54- AVCodecContext* codecContext) override ;
55-
5651 void setupHardwareFrameContextForEncoding (
5752 AVCodecContext* codecContext) override ;
5853
Original file line number Diff line number Diff line change @@ -142,18 +142,11 @@ class DeviceInterface {
142142 // Pixel format used for encoding on CUDA devices
143143 static constexpr AVPixelFormat CUDA_ENCODING_PIXEL_FORMAT = AV_PIX_FMT_NV12;
144144
145- virtual UniqueAVFrame convertTensorToAVFrameForEncoding (
146- [[maybe_unused]] const torch::Tensor& tensor,
147- [[maybe_unused]] int frameIndex,
148- [[maybe_unused]] AVCodecContext* codecContext) {
149- TORCH_CHECK (false );
150- }
151-
152145 // Function used for video encoding, only implemented in CudaDeviceInterface.
153146 // It is here to isolate CUDA dependencies from CPU builds
154147 // TODO Video-Encoder: Reconsider using video encoding functions in device
155148 // interface
156- virtual UniqueAVFrame convertCUDATensorToAVFrameForEncoding (
149+ virtual UniqueAVFrame convertTensorToAVFrameForEncoding (
157150 [[maybe_unused]] const torch::Tensor& tensor,
158151 [[maybe_unused]] int frameIndex,
159152 [[maybe_unused]] AVCodecContext* codecContext) {
Original file line number Diff line number Diff line change @@ -743,8 +743,8 @@ void VideoEncoder::initializeEncoder(
743743 TORCH_CHECK (
744744 avFormatContext_->oformat != nullptr ,
745745 " Output format is null, unable to find default codec." );
746- // Try to find hardware codec. This will return std::nullopt when device is
747- // CPU.
746+ // Try to substitute the default codec with its hardware equivalent
747+ // This will return std::nullopt when device is CPU.
748748 auto hwCodec = deviceInterface_->findCodec (
749749 avFormatContext_->oformat ->video_codec , /* isDecoder=*/ false );
750750 if (hwCodec.has_value ()) {
You can’t perform that action at this time.
0 commit comments