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) {
90
90
" x" ,
91
91
caps.nMaxHeight );
92
92
93
+ // See nMaxMBCount in cuviddec.h
94
+ constexpr unsigned int macroblockConstant = 256 ;
93
95
TORCH_CHECK (
94
- videoFormat->coded_width * videoFormat->coded_height / 256 <=
96
+ videoFormat->coded_width * videoFormat->coded_height /
97
+ macroblockConstant <=
95
98
caps.nMaxMBCount ,
96
99
" 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,
99
104
" vs supported:" ,
100
105
caps.nMaxMBCount );
101
106
@@ -440,6 +445,9 @@ UniqueAVFrame BetaCudaDeviceInterface::convertCudaFrameToAVFrame(
440
445
avFrame->format = AV_PIX_FMT_CUDA;
441
446
avFrame->pts = dispInfo.timestamp ; // == guessedPts
442
447
448
+ // TODONVDEC P0: Zero division error!!!
449
+ // TODONVDEC P0: Move AVRational arithmetic to FFMPEGCommon, and put the
450
+ // similar SingleStreamDecoder stuff there too.
443
451
unsigned int frameRateNum = videoFormat_.frame_rate .numerator ;
444
452
unsigned int frameRateDen = videoFormat_.frame_rate .denominator ;
445
453
int64_t duration = static_cast <int64_t >((frameRateDen * timeBase_.den )) /
You can’t perform that action at this time.
0 commit comments