-
Notifications
You must be signed in to change notification settings - Fork 515
Closed
Description
Description:
Found a TODO in the AVC slice header parsing that suggests incomplete handling of IDR picture IDs:
Location:src/lib_ccx/avc_functions.c:998
Current code:
if (nal_unit_type == 5)
{
tmp = read_exp_golomb_unsigned(&q1);
dvprint("idr_pic_id= % 4lld (%#llX)\n", tmp, tmp);
// TODO
}Issue:
The IDR (Instantaneous Decoder Refresh) picture ID is:
- ✅ Successfully read from the bitstream
- ✅ Printed for debugging (
dvprint) - ❌ Not stored in any context structure
- ❌ Not used for any further processing
Potential improvements:
- Store the value in an appropriate context structure (e.g.,
dec_ctx->avc_ctx->idr_pic_id) - Use the value for frame identification or ordering if needed
- Document why it's read but not used (if intentional)
Questions for maintainers:
- Should
idr_pic_idbe stored in the AVC context? - Is this value needed for caption extraction, or is reading it sufficient?
- Are there cases where this ID would be useful for timing or frame ordering?
Research:
According to H.264 spec, idr_pic_id identifies IDR pictures and can range from 0-65535. It's used to identify different IDR pictures when multiple occur in sequence.
Proposed solution:
- Add
idr_pic_idfield to the appropriate context structure - Store the value when read
- Add comment explaining its purpose
- (Optional) Expose it in debug output or logging
Background:
Working toward GSoC 2026 with CCExtractor. First PR (#1889) merged. Focusing on core video processing and subtitle extraction for the CCExtractor 1.00 release.
Would love to implement this if you can guide me on whether/how the ID should be used!
Metadata
Metadata
Assignees
Labels
No labels