Repository navigation
[IMPROVEMENT] Port sequencing.c to Rust - #2523
Neo-matrix-coder wants to merge 4 commits into
Conversation
6ba5ec0 to
60d323d
Compare
CCExtractor CI platform finished running the test files on linux. 171/238 tests matched the approved output:
67 tests do not match the approved output. That is the pass/fail verdict. Whether this branch caused it is a separate question, answered below.
Compared with the tip of master — test 10180, commit 2c1c1c6:
Compared with the commit this branch was cut from: the same run as the tip of master (test 10180), so the comparison above already covers it. No test changes behaviour relative to the tip of master: every failure above fails there too, byte for byte. The approved output for those tests is out of date, which is a baseline to review rather than a regression in this branch. |
CCExtractor CI platform finished running the test files on windows. 171/238 tests matched the approved output:
67 tests do not match the approved output. That is the pass/fail verdict. Whether this branch caused it is a separate question, answered below.
Compared with the tip of master — test 10179, commit f56427e:
Compared with the commit this branch was cut from — test 10181, commit 2c1c1c6:
No test changes behaviour relative to the tip of master: every failure above fails there too, byte for byte. The approved output for those tests is out of date, which is a baseline to review rather than a regression in this branch. |
Summary
Ports
src/lib_ccx/sequencing.c(HDCC B-frame caption reordering) to Rust. The four public C functions preserve their exact names and C ABI, delegating to the Rust implementation when Rust is enabled (#ifndef DISABLE_RUST).What was ported
init_hdcc()ccxr_init_hdcc()store_hdcc()ccxr_store_hdcc()anchor_hdcc()ccxr_anchor_hdcc()process_hdcc()ccxr_process_hdcc()The reordering behavior is preserved: captions are buffered in
SORTBUFslots indexed by sequence number relative to the current anchor frame, andprocess_hdcc()flushes them in display order while restoringtiming->fts_now.FFI boundary & build changes
src/rust/src/sequencing.rs: Exposes four#[no_mangle] pub unsafe extern "C"entry points (ccxr_*) alongsidepub unsafe fnwrappers (init_hdcc,store_hdcc,anchor_hdcc,process_hdcc) for Rust callers.src/lib_ccx/sequencing.c: Delegates toccxr_*under#ifndef DISABLE_RUSTand retains the verbatim original C implementation under#else. No C call sites were modified.bindgentypes (lib_cc_decode,encoder_ctx,cc_subtitle, andccx_common_timing_ctx, added to the bindgen type allowlist insrc/rust/build.rs).SORTBUFand per-slot capacities are derived from the generated bindings rather than hardcoded.avc/nal.rs,avc/core.rs,es/userdata.rs,es/pic.rs, andes/gop.rsfromextern "C"C calls tocrate::sequencing::*, removed the obsoleteextern "C"declarations fromsrc/rust/src/lib.rs, removed those functions fromsrc/rust/build.rs, and dropped-Wl,--undefined=store_hdccfromsrc/CMakeLists.txt.Behavior & defensive checks
ctx/dec_ctxanddec_ctx->timinginprocess_hdccto prevent null dereferences on malformed states.Tests & verification
#[cfg(test)]unit tests insrc/rust/src/sequencing.rscovering buffer initialization, anchor assignment/out-of-range replacement, slot mapping, overwrite-vs-append semantics, flush-on-ftschange, display-order flushing,fts_nowrestoration, empty-slot skipping, null-timing safety, and C ABI entry points.cargo testverification.