Skip to content

Add ATLAS_SEGMENT_OBU support#3

Merged
podborski merged 2 commits into
mainfrom
feature/atlas
Jun 16, 2026
Merged

Add ATLAS_SEGMENT_OBU support#3
podborski merged 2 commits into
mainfrom
feature/atlas

Conversation

@joelsole

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds full parsing + JSON serialization support for the ATLAS_SEGMENT OBU, enabling the toolchain to interpret atlas segment layouts across multiple atlas modes.

Changes:

  • Implemented ATLAS_SEGMENT payload parsing across ENHANCED/BASIC/SINGLE/MULTISTREAM (+ alpha) modes using BitstreamReader.
  • Added in-memory structures for segment and enhanced-atlas region/mapping data.
  • Extended to_json() to emit mode-specific fields and label segment info.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/obus/atlas_segment_obu.cpp Implements bitstream parsing helpers, mode-specific parsing logic, and JSON output for ATLAS_SEGMENT.
include/av2_obu/obus/atlas_segment_obu.h Adds enums/structs and storage fields needed to represent parsed ATLAS_SEGMENT state.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

try {
BitstreamReader br(raw_payload_);

atlas_segment_id_ = br.read_bits(3);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

atlas_segment_id in atlas_segment_info_obu( ) is a 3-bit field, unlike lcr_layer_atlas_segment_id, which is 8-bit.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

funny how AI might lead one into wrong direction :)

info.region_width_minus1 = br.read_uvlc();
info.region_height_minus1 = br.read_uvlc();
}
return (info.num_region_columns_minus1 + 1) * (info.num_region_rows_minus1 + 1);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

MAX_ATLAS_COLS = MAX_ATLAS_ROWS = 64

So for a conformant stream, (cols+1) * (rows+1) maxes at 4096. Not even close to uint16 overflow, let alone uint32.

@asegallamz

Copy link
Copy Markdown

Thanks Joel. This looks like a good first implementation.

We may find issues through additional testing, but I'd support incorporating this as a first step.

@podborski
podborski merged commit c270e1a into main Jun 16, 2026
2 checks passed
@podborski
podborski deleted the feature/atlas branch June 16, 2026 18:14
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.

4 participants