Commit Graph

277 Commits

Author SHA1 Message Date
FalseHonesty
d79c9c262f LibVideo/VP9: Implement sections 6.1.2 and 8.4.1-8.4.4
These section implement the behavior to refresh the probability
tables after parsing a frame.
2021-07-10 21:28:56 +02:00
FalseHonesty
cf6b3d0ce9 LibVideo/VP9: Begin reference frame update process (8.10)
This was required for correctly parsing more than one frame's
height/width data properly. Additionally, start handling failure
a little more gracefully. Since we don't fully parse a tile before
starting to parse the next tile, we will now no longer make it past
the first tile mark, meaning we should not handle that scenario well.
2021-07-10 21:28:56 +02:00
FalseHonesty
514559f074 LibVideo/VP9: Rename Decoder -> Parser & create an actual Decoder class
The class that was previously named Decoder handled section 6.X.X of
the spec, which actually deals with parsing out the syntax of the data,
not the actual decoding logic which is specified in section 8.X.X.
The new Decoder class will be in charge of owning and running the
Parser, as well as implementing all of the decoding behavior.
2021-07-10 21:28:56 +02:00
FalseHonesty
66628053d4 LibVideo/VP9: Start parsing residuals (6.4.21-6.4.23)
Additionally, this uncovered a couple bugs with existing code,
so those have been fixed. Currently, parsing a whole video does
fail because we are now using a new calculation for frame width,
but it hasn't been fully implemented yet.
2021-07-10 21:28:56 +02:00
FalseHonesty
cbff7c386a LibVideo/VP9: Refactor how above & left contexts are stored & cleared
These make more sense as Vectors, and it makes it much easier to manage
their sizing.
2021-07-10 21:28:56 +02:00
FalseHonesty
91572a49c4 LibVideo/VP9: Specify which spec section defines certain behaviors 2021-07-10 21:28:56 +02:00
FalseHonesty
ce524214c9 LibVideo/VP9: Clean up formatting & use range-based for loops 2021-07-10 21:28:56 +02:00
FalseHonesty
559f5a087d LibVideo/VP9: Implement simple FIXMEs that use now supported data 2021-07-10 21:28:56 +02:00
FalseHonesty
e4f015ce3d LibVideo/VP9: Implement more TreeParser probability calculations
Now TreeParser has mostly complete probability calculation
implementations for all currently used syntax elements. Some of these
calculation methods aren't actually finished because they use data
we have yet to parse in the Decoder, but they're close to finished.
2021-07-10 21:28:56 +02:00
FalseHonesty
f85f557a1f LibVideo/VP9: Implement syntax element counting for supported elements
With the progress made in the Decoder thus far, we have the ability
to support most of the syntax element counters in the tree parser.

Additionally, it will now crash when trying to count unsupported
elements.
2021-07-10 21:28:56 +02:00
FalseHonesty
988e17ed05 LibVideo: Migrate to east-const style & apply other minor fixes
This patch brings all of LibVideo up to the east-const style in the
project. Additionally, it applies a few fixes from the reviews in #8170
that referred to older LibVideo code.
2021-06-30 11:03:51 +02:00
FalseHonesty
7d4053dde1 LibVideo/VP9: Implement most of block_mode_info methods (6.4.15-6.4.18) 2021-06-30 11:03:51 +02:00
FalseHonesty
42fdaa7f60 LibVideo/VP9: Implement most of inter_frame_mode_info (6.4.11-6.4.14) 2021-06-30 11:03:51 +02:00
FalseHonesty
e687f05b42 LibVideo/VP9: Implement intra_frame_mode_info procedure (6.4.6) 2021-06-30 11:03:51 +02:00
FalseHonesty
cc1a9e3d1c LibVideo/VP9: Add SAFE_CALL macro to help propagate failure state 2021-06-30 11:03:51 +02:00
FalseHonesty
741677b992 LibVideo/VP9: Refactor how TreeParser accesses decoder data
The TreeParser requires information about a lot of the decoder's
current state in order to parse syntax tree elements correctly, so
there has to be some communication between the Decoder and the
TreeParser. Previously, the Decoder would copy its state to the
TreeParser when it changed, however, this was a poor choice. Now,
the TreeParser simply has a reference to its owning Decoder, and
accesses its state directly.
2021-06-30 11:03:51 +02:00
FalseHonesty
375dbad144 LibVideo/VP9: Begin decoding VP9 blocks 2021-06-30 11:03:51 +02:00
FalseHonesty
2ce4155b42 LibVideo/VP9: Successfully parse partition syntax element 2021-06-30 11:03:51 +02:00
FalseHonesty
7ff6315246 LibVideo/VP9: Begin creating a tree parser to parse syntax elements 2021-06-30 11:03:51 +02:00
FalseHonesty
cfd65eafa9 LibVideo/VP9: Begin decoding tiles 2021-06-30 11:03:51 +02:00
FalseHonesty
f9899fc17f LibVideo/VP9: Parse compressed header data
This patch adds compressed header parsing to the VP9 decoder (section
6.4 of the spec). This is the final decoder step before we can start to
decode tiles.
2021-06-30 11:03:51 +02:00
FalseHonesty
baff94e44d LibVideo/VP9: Add Decoder and begin parsing uncompressed header data
This patch brings all of the previous work together and starts to
actually parse and decode frame information. Currently it only parses
the uncompressed header data (section 6.2 of the spec).
2021-06-12 22:48:28 +04:30
FalseHonesty
2e31b9cf7c LibVideo/VP9: Implement a bit stream to decode VP9 data
The VP9 specification requires a special decoding process to parse a
lot of the data read from a frame, so this BitStream wrapper implements
that behavior. These processes are defined in section 9 of the
VP9 spec.
2021-06-12 22:48:28 +04:30
FalseHonesty
18759ff56d LibVideo/VP9: Implement syntax element counter 2021-06-12 22:48:28 +04:30
FalseHonesty
8dd9d1bbdb LibVideo/VP9: Add probability table constants
This patch adds VP9's probability tables and the functions needed
to load/clear them.
2021-06-12 22:48:28 +04:30
FalseHonesty
ff3a2a703f LibVideo/VP9: Define all VP9 symbols and enum constants 2021-06-12 22:48:28 +04:30
FalseHonesty
403bb07443 LibVideo: Scaffold LibVideo and implement simplistic Matroska parser
This commit initializes the LibVideo library and implements parsing
basic Matroska container files. Currently, it will only parse audio
and video tracks.
2021-06-06 17:47:00 +02:00