-
Notifications
You must be signed in to change notification settings - Fork 62
BETA CUDA interface: H265 support #919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
78ab058
Let's just commit 3k loc in a single commit
NicolasHug b45decc
Fixes
NicolasHug 316f218
Merge branch 'main' of github.com:pytorch/torchcodec into aeaenjfjanef
NicolasHug d0192ec
GetCache -> getCache
NicolasHug 515deb5
Make UniqueCUvideodecoder a pointer on CUvideodecoder, not void
NicolasHug 13fad10
Make device and device_variant have a default instead of being std::o…
NicolasHug eb8de72
Remove old registerDeviceInterface
NicolasHug 4f7a4fb
Call std::memset
NicolasHug dcf3124
remove unnecessary cuda_runtime.h include, update cmake accordingly
NicolasHug 0ad7370
abstract frameBuffer_ into a FrameBuffer class
NicolasHug aad142e
Cleanup BSF logic
NicolasHug 2592888
Return int in callback instead of unsigned char
NicolasHug b5fe9bc
define width and height as unsigned int
NicolasHug 5605c90
Rework frame ordering and pts matching
NicolasHug 7494259
Merge branch 'main' of github.com:pytorch/torchcodec into aeaenjfjanef
NicolasHug 560b376
Fix cuda context initialization
NicolasHug 88196c5
Merge branch 'aeaenjfjanef' into nvdec-rework-frame-ordering
NicolasHug 2a78b84
Renaming
NicolasHug 5d194e5
Comment
NicolasHug d1e51b3
Merge branch 'main' of github.com:pytorch/torchcodec into aeaenjfjanef
NicolasHug f9c7297
Skip equality check on ffmepg 4
NicolasHug b7bbfb2
Merge branch 'aeaenjfjanef' into nvdec-rework-frame-ordering
NicolasHug 390fd7c
Refac, simplify
NicolasHug f55dcc0
Update comment
NicolasHug 7e4dd10
Define constant, add TODO for AVRational
NicolasHug f614846
Use uint32_t types
NicolasHug aa6e253
Create packet.reset() and add P0 TODO
NicolasHug 186eaa4
Add TODO
NicolasHug 1cb4890
Merge branch 'aeaenjfjanef' into nvdec-rework-frame-ordering
NicolasHug c5b32a4
Merge branch 'main' of github.com:pytorch/torchcodec into nvdec-rewor…
NicolasHug 70873bf
lint
NicolasHug 8e73bcf
Add TODOs and more explicit initialization
NicolasHug 12c75e7
Add h265 support
NicolasHug 9b63504
Merge branch 'main' of github.com:pytorch/torchcodec into nvdec-param…
NicolasHug 718a3e3
Merge branch 'nvdec-params-and-todos' into nvdec-h265
NicolasHug c42388f
put initializeBSF below
NicolasHug File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,9 @@ class BetaCudaDeviceInterface : public DeviceInterface { | |
explicit BetaCudaDeviceInterface(const torch::Device& device); | ||
virtual ~BetaCudaDeviceInterface(); | ||
|
||
void initialize(const AVStream* avStream) override; | ||
void initialize( | ||
const AVStream* avStream, | ||
const UniqueDecodingAVFormatContext& avFormatCtx) override; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just merged #902, so there's going to be merge conflicts. It should be easy to solve: we just rename |
||
|
||
void convertAVFrameToFrameOutput( | ||
UniqueAVFrame& avFrame, | ||
|
@@ -61,6 +63,9 @@ class BetaCudaDeviceInterface : public DeviceInterface { | |
private: | ||
// Apply bitstream filter, modifies packet in-place | ||
void applyBSF(ReferenceAVPacket& packet); | ||
void initializeBSF( | ||
const AVCodecParameters* codecPar, | ||
const UniqueDecodingAVFormatContext& avFormatCtx); | ||
|
||
UniqueAVFrame convertCudaFrameToAVFrame( | ||
CUdeviceptr framePtr, | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I would prefer putting this switching logic into a function - I know we have a style difference there. :) My rationale is that I find it useful to think in terms of pure functions when I can, and this can definitely be a pure function, and then we can simply say in this scope:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC we'd need
toFilterName
to return""
when no match exist, and it would be up to the caller to check against that?