Skip to content

feat(pdu,graphics): add RemoteFX Progressive codec primitives#1196

Merged
Benoît Cortier (CBenoit) merged 2 commits intoDevolutions:masterfrom
lamco-admin:feat/progressive-rfx-pdu
Apr 2, 2026
Merged

feat(pdu,graphics): add RemoteFX Progressive codec primitives#1196
Benoît Cortier (CBenoit) merged 2 commits intoDevolutions:masterfrom
lamco-admin:feat/progressive-rfx-pdu

Conversation

@glamberson
Copy link
Copy Markdown
Contributor

Part of the multi-codec EGFX implementation described in #1158 (Section 4).

Summary

Add wire-format types for RemoteFX Progressive Codec (MS-RDPRFX Progressive Extension) and the computational primitives required for progressive refinement.

ironrdp-pdu: Progressive codec block types (SYNC, CONTEXT, REGION, TILE_SIMPLE, TILE_FIRST, TILE_UPGRADE, FRAME_BEGIN, FRAME_END), quantization values with band-level accessors, tile header parsing.

ironrdp-graphics: Reduce-extrapolate discrete wavelet transform (DWT) for 64x64 tile decomposition into 10 subbands. SRL (Subband Reconstruction Layer) entropy codec for progressive coefficient transmission with zero-run encoding and sign-magnitude packing.

Changes

5 files, 2,326 lines. No changes to existing code.

Test plan

  • All 5 xtask gates pass
  • DWT and SRL have inline unit tests

Add wire-format types for RemoteFX Progressive Codec (MS-RDPRFX
Progressive Extension) and the computational primitives required
for progressive refinement:

ironrdp-pdu: Progressive codec block types (SYNC, CONTEXT, REGION,
TILE_SIMPLE, TILE_FIRST, TILE_UPGRADE, FRAME_BEGIN, FRAME_END),
quantization values with band-level accessors, tile header parsing.

ironrdp-graphics: Reduce-extrapolate discrete wavelet transform
(DWT) for 64x64 tile decomposition into 10 subbands. SRL (Subband
Reconstruction Layer) entropy codec for progressive coefficient
transmission with zero-run encoding and sign-magnitude packing.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds foundational RemoteFX Progressive codec support across ironrdp-pdu (wire-format block/types + stream parsing) and ironrdp-graphics (reduce-extrapolate DWT + SRL entropy codec), as part of the multi-codec EGFX initiative (#1158 §4).

Changes:

  • Introduce progressive RFX wire block types (SYNC/CONTEXT/REGION/TILE_* / FRAME_*) plus stream encode/decode helpers.
  • Add reduce-extrapolate 3-level DWT implementation for 64×64 tiles and expose it via ironrdp-graphics.
  • Add an SRL entropy codec module intended for progressive upgrade passes.

Reviewed changes

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

Show a summary per file
File Description
crates/ironrdp-pdu/src/codecs/rfx/progressive.rs New progressive wire types + region/tile parsing and stream (en/de)code helpers
crates/ironrdp-pdu/src/codecs/rfx/mod.rs Exposes the new progressive module
crates/ironrdp-graphics/src/srl.rs New SRL entropy codec implementation + unit tests
crates/ironrdp-graphics/src/lib.rs Exposes new dwt_extrapolate and srl modules
crates/ironrdp-graphics/src/dwt_extrapolate.rs New reduce-extrapolate DWT implementation + layout helpers/tests

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

SRL codec: fix encode/decode asymmetry for zero-run handling at k=0
and unary magnitude coding. Encoder now processes zero runs at all k
values and recomputes k after each kp update to stay in sync with the
decoder. Aligned magnitude coding to standard quotient/remainder scheme.
Strengthened round-trip tests to check exact values including mixed
zero/non-zero inputs.

Progressive PDU: replace num_derive/num_traits with manual from_u16
match. Replace expect() panics with cast_length! in encode paths. Add
numRects >= 1 and numQuant <= 7 guards, tile quant index bounds check,
and fixed-size block blockLen validation per MS-RDPEGFX spec. Correct
band index doc comment in dwt_extrapolate.
Copy link
Copy Markdown
Member

@CBenoit Benoît Cortier (CBenoit) left a comment

Choose a reason for hiding this comment

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

LGTM

@CBenoit Benoît Cortier (CBenoit) merged commit 49099f0 into Devolutions:master Apr 2, 2026
10 checks passed
Greg Lamberson (glamberson) pushed a commit to lamco-admin/IronRDP that referenced this pull request Apr 6, 2026
The merged progressive primitives PR (Devolutions#1196) added validation that
a ProgressiveRegion must contain at least one rectangle. The test
used an empty rects vec which now fails decoding.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants