[FFmpeg-devel] [PATCH 10/39] lavc/ffv1dec: move the bitreader to stack
Anton Khirnov
anton at khirnov.net
Thu Jul 18 12:08:59 EEST 2024
Quoting Michael Niedermayer (2024-07-18 00:42:05)
> all the stuff should be put together close so its efficiently
> using CPU caches
Which is why it shares its cacheline with PutBitContext, because the
code benefits from having the both in the cache, right? And the 4-byte
hole in PutBitContext is there presumably to aerate the cache for
smoother data streaming.
More seriously, this is not how caches work. Being close together
matters mainly so long as your data fits in a cacheline, beyond that
physical proximity matters little. On stack, the bitreader is likely to
share the cacheline with other data that is currently needed, thus
improving cache utilization.
Another factor that matters in efficient cache use is e.g. not having
multiple copies of the same constant data scattered around, which you're
objecting to in my other patches.
--
Anton Khirnov
More information about the ffmpeg-devel
mailing list