serenity/Userland
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
..
Applets Applets/Keymap: Repaint applet on keymap change 2023-03-09 21:42:23 +01:00
Applications Userland: Remove "Inspector" program and related utilities 2023-04-25 14:48:40 +02:00
BuggieBox Everywhere: Use LibFileSystem where trivial 2023-03-21 19:03:21 +00:00
Demos Userland: Remove "Inspector" program and related utilities 2023-04-25 14:48:40 +02:00
DevTools Userland: Remove "Inspector" program and related utilities 2023-04-25 14:48:40 +02:00
DynamicLoader DynamicLoader: Ensure that backtrace computation stops at _start 2023-04-23 14:30:59 +02:00
Games LibChess: Return ErrorOr<String> from to-algebraic/fen methods 2023-04-24 20:58:35 +02:00
Libraries LibVideo/VP9: Implement unscaled fast paths in inter prediction 2023-04-25 17:44:36 -04:00
Services WindowServer: Draw stretched wallpapers with bilinear blending 2023-04-25 22:37:57 +02:00
Shell Userland: Remove serialize-to-JSON functions only used for Inspector 2023-04-25 14:48:40 +02:00
Utilities cal: Add the -y option to show the current year 2023-04-25 01:54:53 -06:00
CMakeLists.txt Userland: Add the BuggieBox program 2022-11-26 12:41:47 -07:00