Report the bitstream location of each tile from oapvd_info_tile - #260
Merged
Conversation
kpchoi
force-pushed
the
add_tile_bs_info
branch
2 times, most recently
from
August 8, 2026 02:50
8a9ff1d to
0e062ec
Compare
Signed-off-by: KP Choi <kp5.choi@samsung.com>
kpchoi
force-pushed
the
add_tile_bs_info
branch
from
August 8, 2026 02:55
0e062ec to
94c09f0
Compare
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.
Requested in #228: seeking directly to a tile requires knowing where it is in the bitstream, which the API did not expose. The frame header already carries the tile sizes when
tile_size_present_in_fh_flagis set (written by default since #238), but the decoder parsed them for validation only and discarded them.oapv_tile_pos_tgains two fields, filled byoapvd_info_tile():offset— byte offset of the tile unit from the start of the PBUsize— byte size of the tile dataA tile unit spans
4 + sizebytes: the 4-byte size field followed by the tile data. Both fields are zero when the frame header does not carry the tile sizes, so a zerosizemeans the location is unknown and the PBU has to be walked sequentially. The sizes are reported into the caller-supplied array, so nothing is allocated and the existing capacity-check contract ofoapvd_info_tile()is unchanged; the frame header parser gained an internal variant that reports the sizes, with the existing entry point delegating to it.This is what makes the memory-mapped input path in the programmers guide practical for partial decoding: only the pages of the tiles actually decoded are touched, instead of paging in the whole PBU.
The guide documents the assumptions an application has to make about these values, since they are optional and relative:
tile_size_present_in_fh_flag, on by default here, switchable withOAPV_CFG_SET_TILE_SIZE_IN_FH), and a stream from another encoder may not carry the sizes at all, sosizehas to be checked and the sequential path keptau_size, theaPv1signature and that PBU'spbu_size)Malformed tile sizes are rejected with
OAPV_ERR_MALFORMED_BITSTREAM: the accumulated tile extent is validated againstpbu_sizewhile the offsets are computed.Verified against the real bitstream layout with a harness that re-reads the 4-byte size field at every reported offset and checks it equals the reported size and stays inside the PBU: 2-tile, 135-tile (4K), 255-tile, 400-tile and 32,400-tile (UNCONST 16x16) streams, plus a non-uniform tile grid; in every case the end of the last tile lands exactly on the PBU size. Streams encoded with
--disable-tile-size-in-fhand the conformance streams without tile sizes report zeros. All 18 ctest cases pass.