mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 23:27:35 +00:00
LibVideo/VP9: Implement MV reading & rectify MV storage issues
With this patch we are finally done with section 6.4.X of the spec :^) The only parsing left to be done is 6.5.X, motion vector prediction. Additionally, this patch fixes how MVs were being stored in the parser. Originally, due to the spec naming two very different values very similarly, these properties had totally wrong data types, but this has now been rectified.
This commit is contained in:
parent
27fdf8361c
commit
d60bd42972
6 changed files with 129 additions and 14 deletions
38
Userland/Libraries/LibVideo/VP9/MV.cpp
Normal file
38
Userland/Libraries/LibVideo/VP9/MV.cpp
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Hunter Salyer <thefalsehonesty@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "MV.h"
|
||||
|
||||
namespace Video::VP9 {
|
||||
|
||||
MV::MV(u32 row, u32 col)
|
||||
: m_row(row)
|
||||
, m_col(col)
|
||||
{
|
||||
}
|
||||
|
||||
MV& MV::operator=(MV const& other)
|
||||
{
|
||||
if (this == &other)
|
||||
return *this;
|
||||
m_row = other.row();
|
||||
m_col = other.col();
|
||||
return *this;
|
||||
}
|
||||
|
||||
MV& MV::operator=(i32 value)
|
||||
{
|
||||
m_row = value;
|
||||
m_col = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
MV MV::operator+(MV const& other) const
|
||||
{
|
||||
return MV(this->row() + other.row(), this->col() + other.col());
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue