@@ -39,7 +39,7 @@ double ptsToSeconds(int64_t pts, const AVRational& timeBase) {
3939// or 4D.
4040// Calling permute() is guaranteed to return a view as per the docs:
4141// https://pytorch.org/docs/stable/generated/torch.permute.html
42- torch::Tensor MaybeHWC2CHW (
42+ torch::Tensor MaybePermuteHWC2CHW (
4343 const VideoDecoder::VideoStreamDecoderOptions& options,
4444 torch::Tensor& hwcTensor) {
4545 if (options.dimensionOrder == " NHWC" ) {
@@ -937,7 +937,7 @@ void VideoDecoder::convertAVFrameToDecodedOutputOnCPU(
937937 // batch API) to do the conversion. This is more efficient as it allows
938938 // batch NHWC tensors to be permuted only once, instead of permuting HWC
939939 // tensors N times.
940- output.frame = MaybeHWC2CHW (streamInfo.options , output.frame );
940+ output.frame = MaybePermuteHWC2CHW (streamInfo.options , output.frame );
941941 }
942942
943943 } else if (output.streamType == AVMEDIA_TYPE_AUDIO) {
@@ -1053,7 +1053,7 @@ VideoDecoder::BatchDecodedOutput VideoDecoder::getFramesAtIndices(
10531053 // Note that for now we ignore the pts and duration parts of the output,
10541054 // because they're never used in any caller.
10551055 }
1056- output.frames = MaybeHWC2CHW (options, output.frames );
1056+ output.frames = MaybePermuteHWC2CHW (options, output.frames );
10571057 return output;
10581058}
10591059
@@ -1089,7 +1089,7 @@ VideoDecoder::BatchDecodedOutput VideoDecoder::getFramesInRange(
10891089 output.ptsSeconds [f] = singleOut.ptsSeconds ;
10901090 output.durationSeconds [f] = singleOut.durationSeconds ;
10911091 }
1092- output.frames = MaybeHWC2CHW (options, output.frames );
1092+ output.frames = MaybePermuteHWC2CHW (options, output.frames );
10931093 return output;
10941094}
10951095
@@ -1142,7 +1142,7 @@ VideoDecoder::getFramesDisplayedByTimestampInRange(
11421142 // need this special case below.
11431143 if (startSeconds == stopSeconds) {
11441144 BatchDecodedOutput output (0 , options, streamMetadata);
1145- output.frames = MaybeHWC2CHW (options, output.frames );
1145+ output.frames = MaybePermuteHWC2CHW (options, output.frames );
11461146 return output;
11471147 }
11481148
@@ -1185,7 +1185,7 @@ VideoDecoder::getFramesDisplayedByTimestampInRange(
11851185 output.ptsSeconds [f] = singleOut.ptsSeconds ;
11861186 output.durationSeconds [f] = singleOut.durationSeconds ;
11871187 }
1188- output.frames = MaybeHWC2CHW (options, output.frames );
1188+ output.frames = MaybePermuteHWC2CHW (options, output.frames );
11891189
11901190 return output;
11911191}
0 commit comments