Add AV1 bitstream support (extract-rpu, inject-rpu, remove, convert)#389
Open
sven-pke wants to merge 3 commits intoquietvoid:mainfrom
Open
Add AV1 bitstream support (extract-rpu, inject-rpu, remove, convert)#389sven-pke wants to merge 3 commits intoquietvoid:mainfrom
sven-pke wants to merge 3 commits intoquietvoid:mainfrom
Conversation
Introduces an 'av1_parser' workspace crate that owns all generic AV1 OBU parsing and I/O (ObuReader, IvfWriter, ObuWriter, LEB128, IVF container handling). All existing HEVC functionality is preserved. Commands that process bitstreams (extract-rpu, inject-rpu, convert, remove) now auto-detect the input format: .av1 / .ivf -> new AV1 code path everything else -> existing HEVC code path (unchanged) DoVi-specific AV1 helpers (is_dovi_rpu_obu, extract_dovi_t35_payload, build_dovi_obu) live in src/dovi/av1.rs and use the dolby_vision crate's existing AV1/EMDF API.
The simplified OBU-by-OBU replacement only worked when the input already contained existing DoVi OBUs. Replace it with the proven temporal-unit-aware approach: - IVF path: build_output_frame_av1 inserts RPU right after the OBU_TEMPORAL_DELIMITER and strips any pre-existing DoVi OBUs - Raw AV1 path: accumulate OBUs per temporal unit, inject one RPU per unit regardless of whether an existing OBU is present
…remover Switch inject_ivf_av1 to accept &mut IvfWriter<W> and call write_frame() instead of raw write_ivf_frame_header + write_all, making the IVF injection path consistent with how remover.rs uses IvfWriter throughout.
Owner
|
I'll need to take some time to create a separate crate so that I can maintain it properly. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR adds AV1 bitstream support to
dovi_toolalongside the existing HEVC pipeline — no HEVC code is removed or modified.av1_parserworkspace crate owns all AV1 I/O:ObuReader,IvfWriter,ObuWriter, and frame-level read/write helpersis_dovi_rpu_obu,extract_dovi_t35_payload,build_dovi_obu) live insrc/dovi/av1.rs.av1/.ivf); IVF vs. raw OBU stream is auto-detected at runtime via magic headerCommands extended
extract-rpu.bininject-rpuOBU_TEMPORAL_DELIMITER), replaces existing DoVi OBUsremoveconvertDesign
av1_parsercrate is responsible for all AV1 I/ORelates to #387