1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:37:35 +00:00

LibVideo/VP9: Increase the size of summed boolean counts in merge_probs

This fixes an issue where probabilities that sum to greater than 255
would wrap and cause the maximum probability adaption to take effect.
This commit is contained in:
Zaggy1024 2023-02-01 18:57:23 -06:00 committed by Jelle Raaijmakers
parent 7c1fe32af3
commit 4224f253af
2 changed files with 8 additions and 5 deletions

View file

@ -48,8 +48,8 @@ private:
Vector<u16>& get_output_buffer(u8 plane);
/* (8.4) Probability Adaptation Process */
u8 merge_prob(u8 pre_prob, u8 count_0, u8 count_1, u8 count_sat, u8 max_update_factor);
u8 merge_probs(int const* tree, int index, u8* probs, u8* counts, u8 count_sat, u8 max_update_factor);
u8 merge_prob(u8 pre_prob, u32 count_0, u32 count_1, u8 count_sat, u8 max_update_factor);
u32 merge_probs(int const* tree, int index, u8* probs, u8* counts, u8 count_sat, u8 max_update_factor);
DecoderErrorOr<void> adapt_coef_probs(bool is_inter_predicted_frame);
DecoderErrorOr<void> adapt_non_coef_probs(FrameContext const&);
void adapt_probs(int const* tree, u8* probs, u8* counts);