ladybird/Userland/Libraries/LibVideo
Zaggy1024 8ad0dff5c2 LibVideo/VP9: Implement unscaled fast paths in inter prediction
Inter-prediction convolution filters are selected based on the
subpixel position determined for the motion vector relative to the
block being predicted. The subpixel position 0 only uses one single
sample in the center of the convolution, not averaging any other
samples. Let's call this a copy.

Reference frames can also be a different size relative to the frame
being predicted, but in almost every case, that scale will be 1:1
for every single frame in a video.

Taking into account these facts, we can create multiple fast paths for
inter prediction. These fast paths are only active when scaling is 1:1.

If we are doing a copy in both dimensions, then we can do a straight
memcpy from the reference frame to the output block buffer. In videos
where there is no motion, this is a dramatic speedup.

If we are doing a copy in one dimension, we can just do one convolution
and average directly into the output block buffer.

If we aren't doing a copy in either dimension, we can still cut out a
few operations from the convolution loops, since we only need to
advance our samples by whole pixels instead of subpixels.

These fast paths result in about a 34% improvement (~31.2s -> ~20.6s)
in a video which relies heavily on intra-predicted blocks due to high
motion. In videos with less motion, the improvement will be even
greater.

Also, note that the accumulators in these faster loops are only 16-bit.
High bit-depth videos will overflow those, so for now the fast path is
only used for 8-bit videos.
2023-04-25 17:44:36 -04:00
..
Color LibVideo: Convert subsampled frames in a vectorization-friendly way 2023-04-25 17:44:36 -04:00
Containers LibVideo/Matroska: Remove assertion that cue seeks find earlier samples 2023-04-14 12:05:52 +01:00
VP9 LibVideo/VP9: Implement unscaled fast paths in inter prediction 2023-04-25 17:44:36 -04:00
CMakeLists.txt LibVideo/VP9: Implement threaded tile column decoding 2023-04-23 23:14:30 +02:00
DecoderError.h LibVideo: Add a forwarding header 2023-04-09 23:55:05 +02:00
Forward.h LibVideo: Add a forwarding header 2023-04-09 23:55:05 +02:00
PlaybackManager.cpp LibVideo: Remove hook to override LibVideo's playback timers 2023-04-25 18:02:22 +02:00
PlaybackManager.h LibVideo: Remove hook to override LibVideo's playback timers 2023-04-25 18:02:22 +02:00
Sample.h LibVideo: Read Matroska lazily so that large files can start quickly 2022-11-25 23:28:39 +01:00
Track.h LibVideo: Add a forwarding header 2023-04-09 23:55:05 +02:00
VideoDecoder.h LibVideo: Change all Span<u8 const> to ReadonlyBytes 2022-11-12 10:17:27 -07:00
VideoFrame.cpp LibVideo: Convert subsampled frames in a vectorization-friendly way 2023-04-25 17:44:36 -04:00
VideoFrame.h LibVideo: Convert subsampled frames in a vectorization-friendly way 2023-04-25 17:44:36 -04:00