mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:47:34 +00:00
LibVideo/VP9: Use proper indices for updating inter_mode probabilities
I previously changed it to use the absolute inter-prediction mode values instead of the ones relative to NearestMv. That caused the probability adaption to take invalid indices from the counts and broke certain videos. Now it will just convert to the PredictionMode enum when returning from parse_inter_mode, which allows us to still use it the same as before.
This commit is contained in:
parent
7b92eff4a6
commit
0f45153bbb
2 changed files with 10 additions and 6 deletions
|
@ -215,9 +215,9 @@ ErrorOr<PredictionMode> TreeParser::parse_inter_mode(BitStream& bit_stream, Prob
|
|||
// Probabilities
|
||||
u8 const* probabilities = probability_table.inter_mode_probs()[mode_context_for_ref_frame_0];
|
||||
|
||||
auto value = TRY(parse_tree<PredictionMode>(bit_stream, tree, [&](u8 node) { return probabilities[node]; }));
|
||||
counter.m_counts_inter_mode[mode_context_for_ref_frame_0][to_underlying(value) - to_underlying(PredictionMode::NearestMv)]++;
|
||||
return value;
|
||||
auto value = TRY(parse_tree<u8>(bit_stream, tree, [&](u8 node) { return probabilities[node]; }));
|
||||
counter.m_counts_inter_mode[mode_context_for_ref_frame_0][value]++;
|
||||
return static_cast<PredictionMode>(value + to_underlying(PredictionMode::NearestMv));
|
||||
}
|
||||
|
||||
ErrorOr<InterpolationFilter> TreeParser::parse_interpolation_filter(BitStream& bit_stream, ProbabilityTables const& probability_table, SyntaxElementCounter& counter, FrameBlockContext above, FrameBlockContext left)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue