forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on f1f296e27c82692e48e39651317dc030b6f5b2d4

2026-08-26

feat(image): decode BMP, including the shapes ImageMagick will not writeAhmet Kaan Gümüş · f1f296e
feat(image): decode BMP, including the shapes ImageMagick will not write

gpui names ImageFormat::Bmp, so the shim needed a decoder behind it. This
reads every shape the format defines: 1/2/4/8/16/24/32-bit samples, palettes
with three- or four-byte entries, BI_RLE4 and BI_RLE8, arbitrary BI_BITFIELDS
masks, bottom-up and top-down rows, and headers of every defined length from
the 12-byte OS/2 v1 to the 124-byte BITMAPV5HEADER.

Two shapes that started as refusals are decoded instead. BI_PNG and BI_JPEG
files are a BMP header wrapped around a whole file of another format, so they
are handed to this crate's own PNG and JPEG decoders. The 16-byte OS/2 v2
header is the Windows layout truncated where the two stop agreeing, so it is
read through those 16 bytes -- which is what ffmpeg does, and what the
incumbent image crate refuses.

Gate: fourteen fixtures pixel-exact against image 0.25.10, the two wrapper
files exact against the incumbent decoding their payloads directly, and the
OS/2 v2 file exact against the same picture in a header the incumbent reads.
Twenty thousand fuzz mutations across the plain and run-length paths, no
panics. Full report in lanes/image-bmp-r1.report.md.
feat(image-shim): the gpui-only surface, behind a cargo featureAhmet Kaan Gümüş · c6f0f87
feat(image-shim): the gpui-only surface, behind a cargo feature

gpui consumes half an image crate this shim never needed: Frame, Delay,
AnimationDecoder, GifDecoder, WebPDecoder, guess_format,
load_from_memory_with_format, ImageBuffer, and the Gif/Bmp/Tiff format
names. None of it belongs to still-image decoding, so it lives behind a
`gpui` feature the way chrono keeps its serde impls behind one -- a build
that does not draw windows compiles none of it, and the default surface is
unchanged.

Served by ec_image: the animation paths go through decode_animation, and
WebPDecoder::has_animation answers from webp::is_animated.
set_background_color accepts only a fully transparent colour, which is
what gpui asks for and what the frames are composited onto.
feat(image): animated WebP, composited frame by frameAhmet Kaan Gümüş · 275d306
feat(image): animated WebP, composited frame by frame

decode_frames walks the ANMF chunks and composites them onto the canvas:
frame rectangles, both blending methods, and dispose-to-background applied
before the next frame is drawn. is_animated answers from the container
alone. The still and animated paths now share one payload decoder.

The incumbent decoder ignores the dispose-to-background flag, so it cannot
be the oracle for the frame after a disposal: that fixture is gated
against libwebp's own composited frames instead, pixel-exact, and the
incumbent remains the oracle for the opaque fixture. ffmpeg refuses
animated WebP outright and cannot arbitrate.

Adds a lossless fixture whose three frames carry alpha and exercise both
blending methods and the disposal rectangle -- the existing animation is
opaque and disposes nothing.
feat(image): GIF decoding and a format-agnostic animation surfaceAhmet Kaan Gümüş · 166bcc8
feat(image): GIF decoding and a format-agnostic animation surface

A GIF87a/GIF89a decoder written to the spec: LSB-first LZW with the
one-code-early width bump and the cScSc case, sub-block chains, the
four-pass interlace, graphic control extensions, local and global colour
tables, and frame compositing with all four disposal methods.

Adds decode_animation(), which every format answers -- a still is one
frame with a zero delay -- so a caller that wants to play something never
branches on the format. One colour form is chosen for the whole
animation, so the pixel layout cannot change under a caller mid-walk.

Gated pixel-exact against the incumbent decoder: 6/6 fixtures, and 7/7
real GIFs on this machine over 454 frames, frame count and per-frame
delays included. Two 10 000-round mutation sweeps cover the still and
the animation path.
feat(h265): in-loop deblocking filter, on by defaultAhmet Kaan Gümüş · 96b7b12
feat(h265): in-loop deblocking filter, on by default

Spec 8.7.2, written from the text. An intra-only stream simplifies it
twice over: intra prediction reads unfiltered reconstruction, so the
filter is a post-pass over the finished picture and the picture-hash SEI
stays honest; and every edge has bS = 2, so the whole strength
derivation reduces to finding the transform-block boundaries.

TuMap carries one byte per 4x4 unit -- log2 of the transform covering
it. Transform blocks of side S are aligned to multiples of S, so an edge
at x is a boundary exactly when x % S == 0, and no edge list is needed.
Each wavefront worker publishes its band; the encoder stitches them,
filters every vertical edge, then every horizontal one over the result.

Writing the filter exposed an encoder bug: the RQT split trial marks
four child transform blocks, and when the nosplit trial won nothing
rewrote those cells, so the map reported a boundary inside a 32x32
transform. Reconstruction and coefficients were restored between trials;
the side map was not. The nosplit branch now marks its own transform,
and tu_log2 rides the CU-depth meta snapshot.

ffmpeg decodes every shape bit-exactly with the filter on. BD-PSNR
against a deblocking x265, our filter off then on: film -0.197 ->
+0.063 dB, screen capture +0.606 -> +0.693, web clip +0.567 -> +0.686,
phone clip +0.113 -> +0.162, synthetic +8.781 -> +8.796. Every clip
improves, so it defaults on.
feat(av1): 32x32 quadrants split into 16x16 blocks when RD says soAhmet Kaan Gümüş · 7d10ec2
feat(av1): 32x32 quadrants split into 16x16 blocks when RD says so

Each quadrant is now coded twice -- whole, and as four 16x16 sub-blocks --
and the cheaper of the two is kept, with the partition symbol's own rate in
both costs. The reconstruction is snapshotted and restored between trials so
prediction always reads the winner, and mode bookkeeping moved to the 16x16
grid the spec's mode context is defined on.

Measured over a three-point ladder against the whole-only encoder: -9.15%
BD-rate on 1080p film, -27.20% on screen capture, -9.05% on a phone clip,
-22.45% on the synthetic diagonal, and +0.00% on stripes, which never splits.

Mixing block sizes exposed a real conformance defect: the chroma txb_skip and
DC-sign contexts were read from a single neighbour cell, while the decoder
gathers over every 4x4 unit the block spans (spec 5.11.39, 8.3.2). Under a
uniform 32x32 encoder the one cell is the whole span, so the bug could not
show; with a 16x16 beside a 32x32 the arithmetic decoder desynchronised as
+-1 sample drift. Neighbours::around now gathers both edges. Two gates added:
a 16x16 inverse-transform comparison against ffmpeg, and a direct test that
the gathered read sees a cell the single-cell read misses.
feat(av1): the tile adapts its CDFs as it writesAhmet Kaan Gümüş · 8a54f53
feat(av1): the tile adapts its CDFs as it writes

AV1's symbol decoder updates every non-literal CDF it reads, so an encoder
that leaves `disable_cdf_update` off has to keep the same state and update it
in the same order. This adds that state and writes the key frame's tile
through it.

Tables the decoder keeps one copy of are one copy here too: a 64x64 luma
transform reads the 32x32 base-range rows, both luma sets share one DC sign
and one 1024-position end-of-block table, and both chroma sets share their own
sign table. The gathered partition CDF an edge superblock reads is built for
the read and thrown away, so nothing adapts there.

The coefficient rate term still prices against the defaults: the mode search
runs before the tile is written, so the adapted state does not exist yet.

BD-rate against the same encoder with adaptation off, over a three-point
ladder: -3.52% on a 1080p film frame, -5.63% on a screen capture, -11.25% on
the test card. The ffmpeg/dav1d roundtrips are the gate -- a decoder adapting
its own tables desyncs the moment the order or the sharing differs.

2026-08-25

feat(h265): a 64x64 coding tree block may stay one coding unitAhmet Kaan Gümüş · 826a8f8
feat(h265): a 64x64 coding tree block may stay one coding unit

HEVC's largest transform is 32x32, so a 64x64 intra coding unit splits its
transform tree without a split_transform_flag -- the split is inferred from
log2TrafoSize > MaxTbLog2SizeY -- and predicts per 32x32 transform block in
z-order, each quadrant marked coded before the next reads its neighbours.
What the coding unit buys is three split flags and three mode signallings,
against one luma direction for the whole 64x64.

On by default; only reachable with ctb_size 64, which is not the default.
Against always splitting a 64x64 tree block it is worth +0.002 dB BD-PSNR on
a film frame and +0.098 dB on a screen capture.
feat(av1): the mode search prices its coefficients through the writer's CDFsAhmet Kaan Gümüş · 870ed18
feat(av1): the mode search prices its coefficients through the writer's CDFs

The mode search costed the mode symbol exactly and the levels with a
magnitude estimate. Now the levels go through write_coeffs on a throwaway
encoder, so a trial is ranked by the bits the tile writer will really spend
on it: end-of-block position, base levels, base range, signs and the Golomb
tail, under the block's own contexts.

The bit account prices the interval narrowing each symbol performs rather
than its table entry, because the coder's eight-bit range multiply and its
EC_MIN_PROB floor put the table entry 8% off the bytes actually written.

Worth -1.19% BD-rate on a 1080p film frame and -0.20% on a screen capture
against the estimate; LAMBDA_SCALE stays 0.1, re-swept.
feat(av1): the six directional intra modes, and a mode-rate termAhmet Kaan Gümüş · 223aa7c
feat(av1): the six directional intra modes, and a mode-rate term

Adds D45, D67, D113, D135, D157 and D203 per spec 7.11.2.4, with the
edge construction of 7.11.2.2 and the availability the decoder derives
from clear_block_decoded_flags: for the 32x32 quadrants of a superblock
the above row reaches past the superblock's right edge (sbWidth4 is
measured to the tile's end column) for all but the last quadrant, and
the left column continues below only for the first.

The mode search now also pays for naming a mode, scored through the tile
writer's own CDFs -- the KF_Y_MODE symbol under the neighbours' context,
the ANGLE_DELTA zero symbol, and the chroma mode symbol the luma mode
indexes. Without it a directional mode looked free and cost 1.1% rate on
a picture that did not want one. With it, and with LAMBDA_SCALE re-swept
to 0.1, the same picture costs 0.41% and the clips that do want a
direction gain up to 0.35%.

ffmpeg decodes all thirteen modes bit-exactly at 128x96 and 160x96.
feat(av1): seven intra modes, picked per block by rate-distortionAhmet Kaan Gümüş · 4331d17
feat(av1): seven intra modes, picked per block by rate-distortion

The predictors of spec 7.11.2 that read no further than the row above and the
column left of a block -- DC, V, H, SMOOTH, SMOOTH_V, SMOOTH_H and PAETH -- with
the edge construction that fills a missing side from the side that exists. Each
32x32 luma block now codes under all seven and keeps the one whose squared error
and estimated rate come out cheapest; chroma stays DC, which is the mode the tile
writer codes for it.

The weight on rate was swept over three real clips and two synthetic pictures at
six values; 0.05 step-squared per bit is the best point on every one. Against DC
alone it saves 11.5% of the rate on screen capture, 7.8% on the test card and
59.5% on a picture that runs one way. Against libaom the gap at matched size on a
film frame narrows from 2.4 dB to 2.0 dB.

Every mode is gated forced over a whole picture, with ffmpeg's reconstruction
equal sample for sample, and striped pictures gate the search on picking the
direction the picture runs -- a transposed predictor passes every symmetric test.
feat(h265): residual quadtree, one split level, on by defaultAhmet Kaan Gümüş · 11904c0
feat(h265): residual quadtree, one split level, on by default

A 2Nx2N intra coding unit may now split its luma transform once into four
half-size children, chosen against the unsplit block by J = SSD + lambda*bits.
Chroma splits with the tree while its own blocks stay 4x4 or larger; at an 8x8
luma tree chroma stays at the parent size and is coded with the last child
(7.3.8.8). The parent luma cbf is the OR of the children's.

Measured against x265 over the four-point ladder it is worth +0.010 dB BD-PSNR
on film and +0.080 dB on screen capture, so it is on by default.

Flipping the default surfaced a transform-skip desync: transform_skip_flag is
read for every 4x4 residual block once the picture parameter set enables skip,
and the encoder decided it from the coding unit's size, so the 4x4 chroma
children of a 16x16 unit were coded with a real transform and no flag. The
decision now travels by the transform block's own size.
feat(av1): encode a key-frame pictureAhmet Kaan Gümüş · a4fb030
feat(av1): encode a key-frame picture

DC intra prediction over the reconstruction, the forward transform and
quantizer, and the tile writer, joined into an encoder that takes a planar
4:2:0 picture and produces a stream. Blocks are 32x32 luma and 16x16
chroma, coded in the order a decoder walks a superblock's quadrants.

The gate is an equality: ffmpeg's decode of the stream matches the
encoder's own reconstruction sample for sample, on every plane, for test
cards at three sizes and for a frame of real video. Prediction reads the
reconstruction, so a single sample of drift would spread through every
block below and to the right of it.

At q_idx 100 a 640x352 film frame costs 32 366 bytes at 39.26 dB, which is
about 2.4 dB behind libaom at the same rate -- the size of what is not
implemented yet: one block size, one transform type, DC prediction only,
no rate-distortion decision, no CDF adaptation.
feat(av1): forward transform and quantizer, gated end to end through ffmpegAhmet Kaan Gümüş · 5f0963e
feat(av1): forward transform and quantizer, gated end to end through ffmpeg

AV1 specifies only the inverse transform, so the encoder half is written
against a measurement of it: one dequantized coefficient at a time comes
back out as its orthonormal basis function scaled by dq_denom(side)/8, at
every size and position. The dequantizer's own denominator cancels that,
leaving a size-independent level = 8 * orthonormal(residual) / q.

The gates are the roundtrip error (must be the quantizer and nothing else),
the 64x64 band limit (only the top-left 32x32 is coded), and an end-to-end
picture that ffmpeg decodes sample-exactly into what the encoder
reconstructed. A transposed column pass and the previous, coarser gain
constant are both killed.
feat(av1): dequantization and the inverse DCTAhmet Kaan Gümüş · 6a83833
feat(av1): dequantization and the inverse DCT

An encoder that cannot say what the decoder will show cannot choose
coefficients by what they cost against what they are worth. This adds the
decode-side arithmetic to ec-av1: the dequantizer of spec 7.12.3 and the
inverse DCT of 7.13, written from the specification's own butterfly stage
list so that one network serves every size from 4 to 64.

The gate is agreement with a real decoder, sample for sample: two key frames
whose first block carries coefficients from DC to the far corner decode
under ffmpeg to exactly 128 plus the residual this code computes, over all
1024 and 4096 samples. Beneath that sit the two tables of decoder-pinned
DC residuals the tile tests already carried, all 28 levels of each, plus
structural gates for the transpose, the sign rounding, and the row shifts of
the four sizes the frame syntax cannot reach.

Mutation-checked: a cosine table entry off by one, and an 8x8 row shift off
by one, each fail a named test.
fix(probe): skip the AVI test when the AVI files have left the libraryAhmet Kaan Gümüş · 283d445
fix(probe): skip the AVI test when the AVI files have left the library

`avi_audio_chunks_end_cleanly_on_real_files` asserted that at least one
of the two hard-coded AVI paths was present, so deleting that download
failed the workspace run. Its two siblings already skip; sweeping the
five test files that name paths under Downloads or Videos found this to
be the only one that asserted presence rather than skipping.
feat(h264): 8x8 transform on by defaultAhmet Kaan Gümüş · e6fcc5c
feat(h264): 8x8 transform on by default

x264 codes the 8x8 transform by default at every preset that reaches
High profile, and measured on the library clips the flag is worth
+0.716 dB BD-PSNR on a 3840x1608 film clip (18.1% of macroblocks take
the 8x8 path) and +0.183 dB on a 2560x1440 screen capture (8.8%).

With it on, the encoder's whole-picture comparison against x264 over
q22/26/30/34 moves from -0.186 dB to +0.513 dB on the film clip and
from -0.482 dB to -0.315 dB on the screen capture.

Every default stream now carries profile_idc 100 and the High-profile
SPS tail. `production_lambda_tracks_transform_mode` asked the default
config for the 4x4 lambda, so it now clears the flag itself first.
Merge branch 'lane-h265-tskip': transform skip, measured and left offAhmet Kaan Gümüş · d563e2c
Merge branch 'lane-h265-tskip': transform skip, measured and left off

Transform skip is a content-dependent win: on a 2560x1440 screen capture
it is worth +0.243 dB BD-PSNR (+0.030 to +0.273) and +0.158 BD-PSNR-YUV,
while on a 3840x1608 film clip it costs -0.008 dB. It stays opt-in until
the encoder picks it per clip.
test(h265): take the clip's dimensions by positionAhmet Kaan Gümüş · d04b63e
test(h265): take the clip's dimensions by position

ffprobe prints one comma-separated line per stream and recent builds end
it with a trailing separator, so splitting the line in two handed the
parse a field with a comma still on it and every clip-driven gate
panicked before it measured anything.
feat(av1): a superblock can stay wholeAhmet Kaan Gümüş · da2c24a
feat(av1): a superblock can stay whole

The tile writer coded every superblock as four 32x32 blocks. It now takes
a `Superblock` that is either `Whole` — one 64x64 block with a TX_64X64
luma transform and one 32x32 transform per chroma plane — or `Split` into
the four blocks it coded before, and the two paths share the mode and
plane writers.

Two contexts had to be corrected for the whole path to decode:

  * the superblock partition symbol reads bit three of its neighbours'
    partition context, which only a 32x32 neighbour sets, so the context
    is which neighbours were split rather than which ones exist;
  * the base-range tail of a 64x64 transform is coded with the 32x32
    table, because the size index into that CDF is clamped there.

Both are covered: a 128x64 frame whose left superblock is whole and whose
right one is split decodes to a gradient that runs the full sixty-four
samples beside four quadrants that fall on their own, and reverting
either context fails it.
feat(av1): the Golomb tail carries levels the base range cannot reachAhmet Kaan Gümüş · 0eba770
feat(av1): the Golomb tail carries levels the base range cannot reach

The base and base-range syntax reach level fourteen between them, and
until now the writer refused anything above it. The spec carries the
rest as a Golomb tail — the remainder plus one, as its bit length in
unary followed by its own bits — written after the coefficient's sign
rather than beside its level, which is where `write_golomb` now puts it.
The refusal moves up to the largest level the spec's twenty-bit reader
can read back.

Two gates. The spec's own `read_golomb`, written from the pseudocode,
must hand back the level that was asked for over the whole range, which
fails the moment the tail is a bit long, a bit short, or written against
the wrong base. And ffmpeg must decode a run of DC levels either side of
the threshold into a run of steadily brighter blocks, with the negatives
of the same levels steadily darker, which fails if the tail lands in the
wrong place in the syntax.
feat(av1): frames that are not a whole number of superblocksAhmet Kaan Gümüş · 7f9b390
feat(av1): frames that are not a whole number of superblocks

A superblock at the right-hand or bottom edge of a frame may be half
outside it. The spec codes that case as a gathered two-symbol flag —
split_or_horz when the right half is missing, split_or_vert when the
bottom half is — rather than the full partition symbol, and infers the
split with no symbol at all when both halves are outside. The gather
sums the probability of every partition type the flag stands for, which
is what `gather` builds from the partition CDF.

The coefficient writer now sizes its block grid from the frame rather
than from whole superblocks, refuses only frames that are not a whole
number of 32x32 blocks, and skips the quadrants that fall outside.

The gate decodes a 96x64 frame — a superblock and a half across — whose
six blocks alternate between a basis function flat down the block and
one flat across it, so a block written into the wrong place or a flag
read as a different number of bits shows up as the other block's shape.
Three mutations fail it: writing the full partition symbol at the
partial superblock, coding the out-of-frame quadrants, and (already)
sizing the grid off superblocks.
feat(av1): code a real intra mode per blockAhmet Kaan Gümüş · 6cacc2b
feat(av1): code a real intra mode per block

The tile writer coded DC_PRED for every block. It now takes the luma
intra mode with the block's coefficients and codes it against the
key-frame CDF the block's neighbours select, with the angle delta a
directional mode carries.

The chroma mode stays DC_PRED, but the table it is coded with is
indexed by the luma mode — holding the DC row while the luma mode moved
desynchronised every stream, which is what the new decode test caught
first.

A dav1d decode gates the result on what the modes promise rather than on
pinned bytes: the top-left block carries a basis function that is flat
across it and falls down it, the block to its right is H_PRED and must
repeat its left neighbour's column, and the block below is V_PRED and
must repeat the row above it. Dropping the angle delta, pinning the mode
context or pinning the chroma table each fail it.
feat(h265): transform skip on 4x4 transform unitsAhmet Kaan Gümüş · f5dbd0b
feat(h265): transform skip on 4x4 transform units

A 4x4 transform unit may now code its residual samples directly instead
of transforming them (transform_skip_flag, 7.3.8.11), which is what
screen content wants: sharp edges spread over every basis function, and
the transform costs bits to undo them.

The PPS carries transform_skip_enabled_flag, the flag itself is coded
per 4x4 TU on its own pair of contexts (luma and chroma, init value 139
in Table 9-25), and the residual path swaps the integer transform for a
pair of shifts. Those shifts are the whole feature: the decoder scales
what it reads by tsShift = 5 + Log2(nTbS) and takes the bit-depth shift
of 12 back off, so a coefficient carries the sample scaled by the
difference. Writing the encoder's own shift as tsShift instead was
caught by the decode: 3117 samples of a 64x64 picture differed.

Off by default, so every existing stream stays byte-identical; the BD
gate reaches it through EC_H265_TSKIP.

Gated by ffmpeg decoding three picture shapes sample for sample against
the encoder's reconstruction, and by a unit round trip over every 8-bit
residual value. Three mutations were checked to fail those: tsShift one
short, the flag never written, and one wrong context init value.
feat(av1): code chroma coefficients beside the luma onesAhmet Kaan Gümüş · b99ade1
feat(av1): code chroma coefficients beside the luma ones

The coefficient writer took a luma coefficient list per 32x32 block and
wrote both chroma transform blocks as all-zero. It now takes a
BlockCoeffs per block — luma, U and V — and codes each plane's own
16x16 chroma transform.

The coefficient layer is generalised over the plane rather than
duplicated: a TxbCoding carries the transform's side and the six default
CDF sets that are indexed by plane type and transform size, plus the
end-of-block alphabet, which is a quarter the size at 16x16. The chroma
all-zero flag reads the context its coded neighbours above and to the
left select, so the writer now tracks per plane what each block left
behind rather than only the sign of its luma DC.

Gated by dav1d decodes of derived structure, not pinned bytes: a chroma
basis function must be flat down the block and fall across it, the plane
turned a quarter turn must do the reverse, neither may reach the other
plane or luma, and a block with no DC must average to its prediction.
Three mutations were checked to fail those tests: chroma reading the
luma base table, the chroma all-zero context pinned at 7, and the chroma
end-of-block alphabet taken from luma.
feat(av1): code coefficients anywhere in a 32x32 transformAhmet Kaan Gümüş · 0dac984
feat(av1): code coefficients anywhere in a 32x32 transform

The tile writer could put one DC coefficient in a block. This adds the
rest of the coefficient syntax: an end-of-block position with its group
offset, the base levels of every coefficient down the scan with the
contexts its neighbours and its position give, the base-range tail with
its own contexts, and the signs — the DC's from a CDF and the rest as
raw bits.

The default scan is written as the rule that generates it rather than a
thousand pinned numbers: it walks the anti-diagonals outwards, and the
test checks the rule against what a scan must be — every position once,
the origin first, and every context neighbour of a position scanned
before it, which is what lets a decoder read a context off coefficients
it already has.

The gates decode through ffmpeg and assert structure rather than pinned
samples: a coefficient off the origin decodes to its own basis function
(rows identical, samples falling across the block), a block with no DC
averages to its prediction, and a coefficient in the far corner reaches
the last end-of-block group, whose offset is nine bits wide.
feat(av1): split superblocks into 32x32 DC blocksAhmet Kaan Gümüş · a25e4a3
feat(av1): split superblocks into 32x32 DC blocks

The tile writer coded one 64x64 block per superblock, which left the
partition syntax with one value it ever wrote and the coefficient path
with one transform size it ever used.

A superblock can now be split into four 32x32 blocks, each carrying its
own DC level: the split partition itself with the context its neighbours'
block sizes set, the 32x32 partition below it, the chroma mode from the
table a CFL-capable block reads, and the coefficients on the 32x32 CDFs.
The coefficient body the two writers share is factored out with its
tables passed in, since only the tables differ.

The gate decodes a four-by-four grid of 32x32 blocks over two by two
superblocks, with alternating signs so the walk crosses superblock
boundaries in both directions and the DC sign context lands on all three
of its values. Every sample is checked against the DC prediction from the
block's reconstructed neighbours plus its own pinned residual.