File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -90,12 +90,17 @@ static UniqueCUvideodecoder createDecoder(CUVIDEOFORMAT* videoFormat) {
9090 " x" ,
9191 caps.nMaxHeight );
9292
93+ // See nMaxMBCount in cuviddec.h
94+ constexpr unsigned int macroblockConstant = 256 ;
9395 TORCH_CHECK (
94- videoFormat->coded_width * videoFormat->coded_height / 256 <=
96+ videoFormat->coded_width * videoFormat->coded_height /
97+ macroblockConstant <=
9598 caps.nMaxMBCount ,
9699 " Video is too large (too many macroblocks). "
97- " Provided (width * height / 256): " ,
98- videoFormat->coded_width * videoFormat->coded_height / 256 ,
100+ " Provided (width * height / " ,
101+ macroblockConstant,
102+ " ): " ,
103+ videoFormat->coded_width * videoFormat->coded_height / macroblockConstant,
99104 " vs supported:" ,
100105 caps.nMaxMBCount );
101106
@@ -440,6 +445,9 @@ UniqueAVFrame BetaCudaDeviceInterface::convertCudaFrameToAVFrame(
440445 avFrame->format = AV_PIX_FMT_CUDA;
441446 avFrame->pts = dispInfo.timestamp ; // == guessedPts
442447
448+ // TODONVDEC P0: Zero division error!!!
449+ // TODONVDEC P0: Move AVRational arithmetic to FFMPEGCommon, and put the
450+ // similar SingleStreamDecoder stuff there too.
443451 unsigned int frameRateNum = videoFormat_.frame_rate .numerator ;
444452 unsigned int frameRateDen = videoFormat_.frame_rate .denominator ;
445453 int64_t duration = static_cast <int64_t >((frameRateDen * timeBase_.den )) /
You can’t perform that action at this time.
0 commit comments