A richer residual coder
The transform modes separate more when the residual coder is richer, so the rate-distortion choice between them stops being a tie and the predictor has something to find.
Twelve CIF sequences, ten frames each, four quantization parameters, and the inferred mode comes out 0.236% smaller than the explicit mode on the luma plane, and 0.149% smaller on the whole frame. It is smaller on eleven sequences of the twelve on the luma plane and ten on the whole frame.
The margin sweep below is the whole trade: the rate the encoder gives up in distortion, against the rate it saves in signalling.
GIRC runs in both signalling modes over a four-point QP sweep, and the Bjontegaard delta rate is computed by cubic polynomial interpolation over the overlapping PSNR range, as the JVET common test conditions define it. The two GIRC modes differ in exactly one thing: how the transform mode reaches the decoder.
The transform mode is VVC's, not an invention of this repository's: the plain DCT-II, or
one of the four per-axis combinations of DCT-VIII and DST-VII that ITU-T H.266 defines as
multiple transform selection. The explicit mode codes the mode the way the standard's
mts_idx syntax does, which is what the decoder of a real codec would have to
read.
The anchors are the real encoders: x265 for HEVC, SVT-AV1 for AV1 and VVenC 1.14.0 for
VVC, each coding the same ten frames of the same file, all three planes, and measured by
the same PSNR code. Every figure on this page is generated by
tools/generate_figures.py from the committed benchmark report, so a figure
cannot exist without the run behind it.
The margin is the amount of rate-distortion cost the encoder is willing to give up to avoid signalling the transform type. It is the mechanism's only free parameter, and sweeping it shows the whole trade.
| Margin | Mean BD-rate, luma | Prediction mismatch | Better on | Reading |
|---|---|---|---|---|
| 0 | −0.056 | 46.4% | 12 of 12 | No margin: the encoder always takes the optimal transform |
| 25 | −0.119 | 44.6% | 10 of 12 | The margin starts to pay |
| 50 | −0.236 | 42.6% | 11 of 12 | The optimum on this content |
| 100 | +0.002 | 37.9% | 10 of 12 | Past the optimum |
| 200 | +0.515 | 30.6% | 6 of 12 | Distortion dominates |
Mean Bjontegaard delta rate of the inferred mode against the explicit mode, over twelve CIF sequences at four QP points, on the luma plane. Negative means the inferred mode is smaller. The whole-frame figure, which includes the chroma planes, is −0.149% at the margin of 50, and the inferred mode is smaller on ten sequences of the twelve.
| Sequence | BD-rate | Content |
|---|---|---|
| deadline_cif | −0.902 | Motion, texture and noise |
| foreman_cif | −0.639 | Fine texture, strong edges |
| stefan_cif | −0.565 | Motion, texture and noise |
| coastguard_cif | −0.478 | Water texture, fine detail |
| container_cif | −0.374 | Sharp edges, flat panels |
| bus_cif | −0.334 | Moving subject, uniform background |
| flower_cif | −0.330 | Fine foliage texture |
| city_cif | −0.284 | Dense detail, little large-scale structure |
| mobile_cif | −0.275 | Moving subject, detailed background |
| crew_cif | −0.214 | Motion and texture |
| highway_cif | +0.129 | Fast panning, strong horizontal structure |
| akiyo_cif | +1.403 | Flat, high detail, little motion |
Margin of 50, QP 22 to 37, luma plane, 8×8 blocks, ten frames per sequence. The mean over the twelve is −0.236% and the median −0.322%. The two sequences where the mechanism loses are the two with the least motion: a flat, high-detail picture gives the predictor nothing directional to work with.
A claim about a trained predictor has to beat the alternative that needs no training and no model: always predict the plain DCT-II. The benchmark runs both over the same content, the same quantization parameters and the same margin, and reports them in the same file.
| Predictor | Mean BD-rate, luma | Better on |
|---|---|---|
| Constant, always the plain DCT-II | −0.120% | 10 of 12 |
| The shipped learned model | −0.236% | 11 of 12 |
The learned model is ahead on six of the twelve sequences, and the gap between the two is 0.116 percentage points of BD-rate, which is about half the mechanism's own effect. The model is one multinomial logistic regression over the joint mode, fitted on 570,240 real block records from the twelve sequences.
The joint mode is barely predictable: the ceiling of 50.65% is barely above the 50.10% majority class. The transform choice is driven by the block's own residual, which the decoder has not seen, and the geometry of the neighbourhood constrains it only weakly. The rate-distortion choice between the modes is close to a tie, so there is little for a predictor to predict.
These figures are lower than an earlier revision reported, and the reason is worth stating rather than hiding. An inter block carries a motion vector instead of an intra mode, so the decoder cannot know the mode the encoder would have chosen for it. A feature built from that mode let the encoder predict from information the decoder does not have, and the model trained on it looked better than it could ever be. The shipped code leaves the feature empty for an inter block, and the benchmark decodes every stream it encodes and refuses a result if the decoded picture differs from the encoder's own reconstruction.
Even so, the saving is 0.236%, not a headline number. The explicit signalling is already cheap for a context-adaptive coder to code, and the mechanism removes an overhead that is close to the distortion it costs to remove it. The margin sweep is the honest account of where that balance sits.
Inter prediction is implemented and measured. The inter blocks' mismatch rate is consistently lower than the intra blocks', so the hypothesis holds, but the gain over the majority baseline is smaller for the inter blocks than for the intra ones, because the inter blocks' transform distribution is more concentrated: there is less to gain when one mode already dominates.
GIRC is a research codec with a small mode set and integer-sample motion. It is not a VVC competitor, and this table is context rather than a claim. What the table does show is that the measurement apparatus is real: the same content, the same rate and distortion code, the same frames, and all three planes coded on both sides.
| Codec | QP 22 | QP 27 | QP 32 | QP 37 |
|---|---|---|---|---|
| girc-explicit | 301264 b / 44.38 dB | 247920 b / 41.57 dB | 202224 b / 38.60 dB | 177904 b / 35.73 dB |
| girc-inferred | 313744 b / 44.24 dB | 251984 b / 41.55 dB | 204144 b / 38.58 dB | 184016 b / 35.70 dB |
| x265 | 119224 b / 45.01 dB | 78128 b / 42.66 dB | 56176 b / 40.03 dB | 42600 b / 37.05 dB |
| svt-av1 | 166672 b / 47.52 dB | 130752 b / 46.42 dB | 97144 b / 45.20 dB | 77032 b / 44.16 dB |
| vvenc | 219288 b / 48.90 dB | 122224 b / 46.64 dB | 67520 b / 44.29 dB | 48136 b / 42.53 dB |
akiyo_cif, ten frames, whole frame on both sides: the luma plane and the two 4:2:0 chroma planes, coded by every codec. The BD-rate of each against the GIRC-explicit baseline is −73.34% for x265, −73.72% for SVT-AV1 and −79.98% for VVenC: the anchors are better codecs, as expected, and the figure is the scale of the gap. The gap between the two GIRC lines is the mechanism.
No chroma transform type is signalled: H.266 clause 7.3.9 codes a transform type for the
luma plane, and the chroma transform type is inferred, and in 4:2:0 it is always the plain
DCT-II. The reference encoder agrees — chroma transform selection is gated on
m_useChromaTS, which is off by default and only enabled for 4:4:4. So the
mechanism is a luma mechanism, exactly where the standard signals a transform type at all.
The chroma quantization parameter is mapped, not equal, through H.266's chroma quantization parameter mapping, checked against the reference implementation for every quantization parameter. The chroma grid is four by four chroma samples, one chroma block per luma block, and the chroma motion is derived from the luma motion as H.266 does.
The transform modes separate more when the residual coder is richer, so the rate-distortion choice between them stops being a tie and the predictor has something to find.
The overhead the mechanism removes grows with the number of choices to signal and with how evenly they are distributed, so a codec with more transform types has more to save.
Signalling the transform once per region rather than once per block would make the prediction problem much easier and the overhead much larger.