Skip to content
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

Make frames decoder to build index without file decoding #5809

Merged
merged 3 commits into from
Feb 8, 2025

Conversation

JanuszL
Copy link
Contributor

@JanuszL JanuszL commented Feb 4, 2025

  • use only data embedded into packets to build video file index in the frames decoder

Category:

Other (e.g. Documentation, Tests, Configuration)

Description:

  • use only data embedded into packets to build video file index in the frames decoder

Additional information:

Affected modules and functionalities:

  • frames decoder

Key points relevant for the review:

  • if the logic makes sens

Tests:

  • Existing tests apply
    • FramesDecoder*
  • New tests added
    • Python tests
    • GTests
    • Benchmark
    • Other
  • N/A

Checklist

Documentation

  • Existing documentation applies
  • Documentation updated
    • Docstring
    • Doxygen
    • RST
    • Jupyter
    • Other
  • N/A

DALI team only

Requirements

  • Implements new requirements
  • Affects existing requirements
  • N/A

REQ IDs: N/A

JIRA TASK: N/A

@JanuszL JanuszL marked this pull request as draft February 4, 2025 23:17
@JanuszL
Copy link
Contributor Author

JanuszL commented Feb 4, 2025

!build

@JanuszL JanuszL force-pushed the optimize_index_buidling branch from 7093bd2 to 522b1dd Compare February 4, 2025 23:19
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [23456338]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [23456338]: BUILD PASSED

@JanuszL JanuszL marked this pull request as ready for review February 5, 2025 06:17
// Further check if it's an IDR frame for H.265
if (packet->size >= 6) { // Ensure there's enough data to inspect
// NAL unit type is in the sixth byte for H.265
uint8_t nal_unit_type = (packet->data[4] >> 1) & 0x3F;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment suggests that it should be:

Suggested change
uint8_t nal_unit_type = (packet->data[4] >> 1) & 0x3F;
uint8_t nal_unit_type = (packet->data[5] >> 1) & 0x3F;

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good spot, I need to check if the source I get this from has a misleading comment or the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

index_->push_back(entry);
}
av_packet_unref(av_state_->packet_);
index_->back().is_flush_frame = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have more flush frames? Possibly mapping to more packets?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, flush frame is the last one, so we now there it no more.

@klecki
Copy link
Contributor

klecki commented Feb 5, 2025

If you want to be cautious about whether this implementation is correct, I would migrate the old implementation to a baseline implementation in some test and compare whether both return the same index on our DALI_extra samples.

@JanuszL
Copy link
Contributor Author

JanuszL commented Feb 5, 2025

If you want to be cautious about whether this implementation is correct, I would migrate the old implementation to a baseline implementation in some test and compare whether both return the same index on our DALI_extra samples.

dali/operators/reader/loader/video/frames_decoder_test.cc should cover this to some extend. My ask was rather about all those strange edge cases we don't have in DALI_Extra but real cameras can produce and people reports issues from time to time with DALI.

@JanuszL JanuszL force-pushed the optimize_index_buidling branch from 8aad640 to e44a9d1 Compare February 5, 2025 22:01
@JanuszL
Copy link
Contributor Author

JanuszL commented Feb 5, 2025

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [23508831]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [23508831]: BUILD PASSED

@JanuszL
Copy link
Contributor Author

JanuszL commented Feb 6, 2025

!build

1 similar comment
@JanuszL
Copy link
Contributor Author

JanuszL commented Feb 6, 2025

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [23539941]: BUILD STARTED

@jantonguirao jantonguirao assigned jantonguirao and unassigned szalpal Feb 6, 2025
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [23539941]: BUILD FAILED

- use only data embedded into packets to build video file index
  in the frames decoder

Signed-off-by: Janusz Lisiecki <[email protected]>
Signed-off-by: Janusz Lisiecki <[email protected]>
Signed-off-by: Janusz Lisiecki <[email protected]>
@JanuszL JanuszL force-pushed the optimize_index_buidling branch from 52b100c to 4bc1f14 Compare February 7, 2025 20:27
@JanuszL
Copy link
Contributor Author

JanuszL commented Feb 7, 2025

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [23604606]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [23604606]: BUILD PASSED

@JanuszL JanuszL merged commit e2f2125 into NVIDIA:main Feb 8, 2025
7 checks passed
@JanuszL JanuszL deleted the optimize_index_buidling branch February 8, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants