Skip IST/STX cascade for intra-luma zero-quant primary#5103
Merged
Conversation
Contributor
Author
|
Hello all, Could you please review this PR? Thanks |
77ddaec to
883693a
Compare
jingninghan
approved these changes
Jul 16, 2026
leolzhao
reviewed
Jul 16, 2026
leolzhao
reviewed
Jul 16, 2026
Extend the intra-luma IST/STX pre-skip and post-trellis gates to cover eob == 0 in addition to the existing eob == 1 (DC-only) case. The eob == 0 branch kills candidates only when stx > 0, so a non-DCT primary with stx == 0 that quantizes to all-zero can still win via skip coding. Add a pre-quant L-infinity gate that predicts primary FP-quant eob = 0 directly from the post-primary coefficients (max |coeff| below the FP quantizer kill threshold min(dq0, dq1) >> (4 + log_scale)). When fired, av2_quant + av2_optimize_b + cost_coeffs are skipped and the same eob_found / DCT_DCT propagation as the post-quant gate is applied. Scoped to intra Y, stx == 0, non-DC-only, IST-enabled, non-QM blocks. Gated behind a new tx_sf.prune_intra_ist_stx_by_zero_eob flag, off by default and enabled at speed >= 1. Encoding at speed 0 is unchanged from the baseline. STATS_CHANGED Anchor: commit dd84ac9 Speed 1 (cpu-used=1): FG16 CTC (33 frames, RA) ``` +------------+-------+-------+-------+-------+------+------+ | Class | Y | Cb | Cr | wAvg | Enc% | Dec% | +------------+-------+-------+-------+-------+------+------+ | A1 | 0.06 | -0.20 | -0.34 | 0.02 | 98 | 100 | | A2 | 0.09 | -0.18 | -0.12 | 0.07 | 97 | 100 | | A3 | 0.05 | 0.58 | 0.48 | 0.07 | 96 | 99 | | A4 | 0.09 | 0.22 | -3.02 | -0.01 | 97 | 99 | | A5 | -0.12 | -2.35 | 2.22 | -0.12 | 97 | 101 | | B1 | 0.14 | -0.94 | -0.28 | 0.09 | 97 | 101 | | B2 | -0.48 | -0.71 | 0.30 | -0.46 | 97 | 97 | | Avg w/o B2 | 0.07 | -0.32 | -0.24 | 0.04 | 97 | 100 | +------------+-------+-------+-------+-------+------+------+ ```
883693a to
deb476d
Compare
leolzhao
approved these changes
Jul 16, 2026
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.
Extend the intra-luma IST/STX pre-skip and post-trellis gates to cover eob == 0 in addition to the existing eob == 1 (DC-only) case. The eob == 0 branch kills candidates only when stx > 0, so a non-DCT primary with stx == 0 that quantizes to all-zero can still win via skip coding.
Add a pre-quant L-infinity gate that predicts primary FP-quant eob = 0 directly from the post-primary coefficients (max |coeff| below the FP quantizer kill threshold min(dq0, dq1) >> (4 + log_scale)). When fired, av2_quant + av2_optimize_b + cost_coeffs are skipped and the same eob_found / DCT_DCT propagation as the post-quant gate is applied. Scoped to intra Y, stx == 0, non-DC-only, IST-enabled, non-QM blocks.
Gated behind a new tx_sf.prune_intra_ist_stx_by_zero_eob flag, off by default and enabled at speed >= 1. Encoding at speed 0 is unchanged from the baseline.
STATS_CHANGED
Anchor: commit dd84ac9
Speed 1 (cpu-used=1): FG16 CTC (33 frames, RA)