mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibVideo: Rename MV to MotionVector for clarity
This commit is contained in:
parent
85fd56cf48
commit
1dc4652683
Notes:
sideshowbarker
2024-07-17 06:07:59 +09:00
Author: https://github.com/Zaggy1024 Commit: https://github.com/SerenityOS/serenity/commit/1dc4652683 Pull-request: https://github.com/SerenityOS/serenity/pull/15363 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/FireFox317 Reviewed-by: https://github.com/MacDue Reviewed-by: https://github.com/davidot
6 changed files with 46 additions and 46 deletions
|
@ -2,7 +2,7 @@ set(SOURCES
|
|||
MatroskaReader.cpp
|
||||
VP9/BitStream.cpp
|
||||
VP9/Decoder.cpp
|
||||
VP9/MV.cpp
|
||||
VP9/MotionVector.cpp
|
||||
VP9/Parser.cpp
|
||||
VP9/ProbabilityTables.cpp
|
||||
VP9/SyntaxElementCounter.cpp
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
/*
|
||||
* 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=(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());
|
||||
}
|
||||
|
||||
}
|
29
Userland/Libraries/LibVideo/VP9/MotionVector.cpp
Normal file
29
Userland/Libraries/LibVideo/VP9/MotionVector.cpp
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Hunter Salyer <thefalsehonesty@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include "MotionVector.h"
|
||||
|
||||
namespace Video::VP9 {
|
||||
|
||||
MotionVector::MotionVector(u32 row, u32 col)
|
||||
: m_row(row)
|
||||
, m_col(col)
|
||||
{
|
||||
}
|
||||
|
||||
MotionVector& MotionVector::operator=(i32 value)
|
||||
{
|
||||
m_row = value;
|
||||
m_col = value;
|
||||
return *this;
|
||||
}
|
||||
|
||||
MotionVector MotionVector::operator+(MotionVector const& other) const
|
||||
{
|
||||
return MotionVector(this->row() + other.row(), this->col() + other.col());
|
||||
}
|
||||
|
||||
}
|
|
@ -10,18 +10,18 @@
|
|||
|
||||
namespace Video::VP9 {
|
||||
|
||||
class MV {
|
||||
class MotionVector {
|
||||
public:
|
||||
MV() = default;
|
||||
MV(u32 row, u32 col);
|
||||
MotionVector() = default;
|
||||
MotionVector(u32 row, u32 col);
|
||||
|
||||
u32 row() const { return m_row; }
|
||||
void set_row(u32 row) { m_row = row; }
|
||||
u32 col() const { return m_col; }
|
||||
void set_col(u32 col) { m_col = col; }
|
||||
|
||||
MV& operator=(i32 value);
|
||||
MV operator+(MV const& other) const;
|
||||
MotionVector& operator=(i32 value);
|
||||
MotionVector operator+(MotionVector const& other) const;
|
||||
|
||||
private:
|
||||
u32 m_row { 0 };
|
|
@ -1208,7 +1208,7 @@ DecoderErrorOr<void> Parser::assign_mv(bool is_compound)
|
|||
DecoderErrorOr<void> Parser::read_mv(u8 ref)
|
||||
{
|
||||
m_use_hp = m_allow_high_precision_mv && TRY(use_mv_hp(m_best_mv[ref]));
|
||||
MV diff_mv;
|
||||
MotionVector diff_mv;
|
||||
auto mv_joint = TRY_READ(m_tree_parser->parse_tree<MvJoint>(SyntaxElementType::MVJoint));
|
||||
if (mv_joint == MvJointHzvnz || mv_joint == MvJointHnzvnz)
|
||||
diff_mv.set_row(TRY(read_mv_component(0)));
|
||||
|
@ -1429,7 +1429,7 @@ DecoderErrorOr<void> Parser::append_sub8x8_mvs(u8, u8)
|
|||
return DecoderError::not_implemented();
|
||||
}
|
||||
|
||||
DecoderErrorOr<bool> Parser::use_mv_hp(const MV&)
|
||||
DecoderErrorOr<bool> Parser::use_mv_hp(const MotionVector&)
|
||||
{
|
||||
// TODO: Implement
|
||||
return DecoderError::not_implemented();
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include "BitStream.h"
|
||||
#include "LookupTables.h"
|
||||
#include "MV.h"
|
||||
#include "MotionVector.h"
|
||||
#include "ProbabilityTables.h"
|
||||
#include "SyntaxElementCounter.h"
|
||||
#include "TreeParser.h"
|
||||
|
@ -122,7 +122,7 @@ private:
|
|||
DecoderErrorOr<void> find_mv_refs(ReferenceFrame, int block);
|
||||
DecoderErrorOr<void> find_best_ref_mvs(int ref_list);
|
||||
DecoderErrorOr<void> append_sub8x8_mvs(u8 block, u8 ref_list);
|
||||
DecoderErrorOr<bool> use_mv_hp(MV const& delta_mv);
|
||||
DecoderErrorOr<bool> use_mv_hp(MotionVector const& delta_mv);
|
||||
size_t get_image_index(u32 row, u32 column);
|
||||
|
||||
Gfx::Point<size_t> get_decoded_point_for_plane(u8 row, u8 column, u8 plane);
|
||||
|
@ -227,10 +227,10 @@ private:
|
|||
bool m_left_single { false };
|
||||
bool m_above_single { false };
|
||||
InterpolationFilter m_interp_filter { EightTap };
|
||||
MV m_mv[2];
|
||||
MV m_near_mv[2];
|
||||
MV m_nearest_mv[2];
|
||||
MV m_best_mv[2];
|
||||
MotionVector m_mv[2];
|
||||
MotionVector m_near_mv[2];
|
||||
MotionVector m_nearest_mv[2];
|
||||
MotionVector m_best_mv[2];
|
||||
u32 m_ref_frame_width[NUM_REF_FRAMES];
|
||||
u32 m_ref_frame_height[NUM_REF_FRAMES];
|
||||
u32 m_eob_total { 0 };
|
||||
|
@ -242,7 +242,7 @@ private:
|
|||
ReferenceMode m_reference_mode;
|
||||
ReferenceFrame m_comp_fixed_ref;
|
||||
ReferenceFrame m_comp_var_ref[2];
|
||||
MV m_block_mvs[2][4];
|
||||
MotionVector m_block_mvs[2][4];
|
||||
Vector<u8> m_prev_segment_ids;
|
||||
|
||||
Vector<bool> m_skips;
|
||||
|
@ -252,8 +252,8 @@ private:
|
|||
Vector<u8> m_segment_ids;
|
||||
Vector<Array<ReferenceFrame, 2>> m_ref_frames;
|
||||
Vector<InterpolationFilter> m_interp_filters;
|
||||
Vector<Array<MV, 2>> m_mvs;
|
||||
Vector<Array<Array<MV, 4>, 2>> m_sub_mvs;
|
||||
Vector<Array<MotionVector, 2>> m_mvs;
|
||||
Vector<Array<Array<MotionVector, 4>, 2>> m_sub_mvs;
|
||||
Vector<Array<IntraMode, 4>> m_sub_modes;
|
||||
|
||||
OwnPtr<BitStream> m_bit_stream;
|
||||
|
|
Loading…
Reference in a new issue