Add grouped GOP multi-frame decode API - #47
Conversation
5f06af1 to
c14ca1a
Compare
Add grouped GOP extraction and decoding so multiple requested frames from one source GOP share a serialized payload and NVDEC traversal. Preserve source, order, and duplicate mappings; split cross-GOP requests; validate grouped payloads; and pool decoders by native stream configuration. Signed-off-by: hongyizhang <29877338+KazukiKomon@users.noreply.github.com>
c14ca1a to
c86e617
Compare
| assert group["first_frame_id"] == 0 | ||
| assert group["gop_len"] == 20 | ||
|
|
||
| native_demuxer = nvc.PyNvGopDecoder(maxfiles=1, iGpu=0) |
There was a problem hiding this comment.
Please use this API nvc.CreateGopDecoder(...). Direct construction of a decoder via its constructor is currently not supported.
| ): | ||
| assert native_groups[0][key] == group[key] | ||
|
|
||
| legacy_data, _, _ = demuxer.GetGOP([OPEN_GOP_SAMPLE] * len(expected_ids), expected_ids) |
There was a problem hiding this comment.
The GetGOP API has been deprecated. Please use GetGOPList instead.
|
Fixes #45 |
| R"pbdoc( | ||
| Extract one serialized payload for each unique source/GOP. | ||
|
|
There was a problem hiding this comment.
I suggest explicitly mentioning in the API documentation that each group may contain a different number of frame_ids; the lengths do not need to be aligned. This is the key distinction from conventional batch-style APIs in the ACCV-Lab.
|
1cd6132 to
bda1b71
Compare
Signed-off-by: hongyizhang <hongyizhang02@deeproute.ai>
bda1b71 to
4edff94
Compare
|
/build |
|
/build |
xupinjie
left a comment
There was a problem hiding this comment.
Thanks for your contribution.
Description
UniVerse requests several frames from one camera with repeated GOP bundles. The existing list path serializes the same GOP once per output frame and creates one NVDEC task per frame.
This change adds
GetGOPGroups(requests)andDecodeFromGOPGroupsRGB(groups)so one serialized payload and one decoder task cover all requested frames in a source/GOP. Cross-GOP requests are split automatically, while source indices, original order, and duplicate positions are preserved. Grouped payloads are validated and decoder slots are pooled by native stream configuration.The port is based on the current upstream
main: it preserves the newerskip_final_syncpath and does not restore legacy APIs removed upstream.Affected component:
accvlab.on_demand_video_decoder.Type of Change
Testing
scripts/run_tests.shValidation performed for this upstream port:
accvlab-build:py3.14-cu130.git diff --checkpassed.Validation of the original change before porting:
[45, 6, 25, 6]split across three GOPs and matched the legacy output byte-for-byte.cuvidDecodePicturecalls decreased from 2,672 to 674.Documentation, Examples, Tutorials, Demos
Code Quality
git diff --checkpassedRelated Issues / Context
This is a clean single-commit port of the previously reviewed grouped GOP implementation onto the latest upstream
main.DCO / Sign-Off
The commit includes
Signed-off-by: hongyizhang <hongyizhang02@deeproute.ai>.