memorysafety / rav1d

An AV1 decoder in Rust.
BSD 2-Clause "Simplified" License
346 stars 22 forks source link

`fn decode_b`: Performance improvements #1320

Closed rinon closed 4 months ago

rinon commented 4 months ago

Inlines backup2x8 which is inlined in C and improves performance slightly.

The f.a[t.a] block context reference is constant throughout decode_b, but it appears that the function is too complex for the optimizer to not recompute this reference. Making it a local improves performance measurably (~1% on a Ryzen 7700X for 8-bit Chimera).