Use cuda filters to support 10-bit videos #853
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes:
DeviceInterface::initializeFiltersContext()
API which returns device specific FilterGraph initialization settingsSingleStreamDecoder
levelscale_cuda
scale_cuda
does not currently support conversion of YUV to RGB) and then cuda device interface converts NV12 to RGB (via existing NPP path)Basically idea behind this change is the following. Let device interface to perform trivial and performance optimized conversions in the
convertAVFrameToFrameOutput()
method. If device interface can not handle conversion in theconvertAVFrameToFrameOutput()
, it can setup ffmpeg filters pipeline by returning valid description ininitializeFiltersContext()
.I tested the pipeline on 10-bit videos, h264 and h265. However, this setup should be valid for 12-bit videos which I did not try.
Note:
scale_cuda
does not support format conversion in this ffmpeg version (was added from n5.0)scale_cuda
converted outputs with CPU implementation. I do see the difference in the outputs likely due to different handling of color standards. This is something I was not able to overcome at the moment.CC: @scotts @NicolasHug @eromomon