@@ -537,7 +537,6 @@ TensorFormat analyzeTensorFormat(const torch::Tensor& frames) {
537537 sizes.size () == 4 , " Expected 4D tensor (N, C, H, W) or (N, H, W, C)" );
538538
539539 bool isNCHW = sizes[1 ] == 3 || sizes[1 ] == 4 ;
540-
541540 int numChannels = isNCHW ? sizes[1 ] : sizes[3 ];
542541 int height = isNCHW ? sizes[2 ] : sizes[1 ];
543542 int width = isNCHW ? sizes[3 ] : sizes[2 ];
@@ -767,8 +766,8 @@ void VideoEncoder::encode() {
767766 AutoAVPacket autoAVPacket;
768767 int numFrames = frames_.sizes ()[0 ];
769768 for (int i = 0 ; i < numFrames; ++i) {
770- torch::Tensor singleFrame = frames_. select ( 0 , i) ;
771- UniqueAVFrame avFrame = convertTensorToAVFrame (singleFrame , i);
769+ torch::Tensor currFrame = frames_[i] ;
770+ UniqueAVFrame avFrame = convertTensorToAVFrame (currFrame , i);
772771 encodeFrame (autoAVPacket, avFrame);
773772 }
774773
@@ -827,7 +826,7 @@ void VideoEncoder::encodeFrame(
827826
828827void VideoEncoder::flushBuffers () {
829828 AutoAVPacket autoAVPacket;
830- // Send NULL frame to signal end of input
829+ // Send null frame to signal end of input
831830 encodeFrame (autoAVPacket, UniqueAVFrame (nullptr ));
832831}
833832
0 commit comments