diff options
author | FalseHonesty <thefalsehonesty@gmail.com> | 2021-06-20 10:37:33 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-30 11:03:51 +0200 |
commit | 988e17ed052621cd2cfb16eeea65fdc293b8b55c (patch) | |
tree | 681b045973c6f06af7c79f43e2e9859582e410de /Userland/Libraries/LibVideo/VP9 | |
parent | 7d4053dde19b57fdce096dc139100e80c48fd89b (diff) | |
download | serenity-988e17ed052621cd2cfb16eeea65fdc293b8b55c.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibVideo/VP9')
-rw-r--r-- | Userland/Libraries/LibVideo/VP9/BitStream.h | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibVideo/VP9/Decoder.cpp | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibVideo/VP9/Decoder.h | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibVideo/VP9/ProbabilityTables.cpp | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibVideo/VP9/ProbabilityTables.h | 8 | ||||
-rw-r--r-- | Userland/Libraries/LibVideo/VP9/TreeParser.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibVideo/VP9/TreeParser.h | 6 |
7 files changed, 18 insertions, 20 deletions
diff --git a/Userland/Libraries/LibVideo/VP9/BitStream.h b/Userland/Libraries/LibVideo/VP9/BitStream.h index 2cfc1e52d8..3331d4e23c 100644 --- a/Userland/Libraries/LibVideo/VP9/BitStream.h +++ b/Userland/Libraries/LibVideo/VP9/BitStream.h @@ -13,7 +13,7 @@ namespace Video::VP9 { class BitStream { public: - BitStream(const u8* data, size_t size) + BitStream(u8 const* data, size_t size) : m_data_ptr(data) , m_bytes_remaining(size) { @@ -36,7 +36,7 @@ public: bool exit_bool(); private: - const u8* m_data_ptr { nullptr }; + u8 const* m_data_ptr { nullptr }; size_t m_bytes_remaining { 0 }; Optional<u8> m_current_byte; i8 m_current_bit_position { 0 }; diff --git a/Userland/Libraries/LibVideo/VP9/Decoder.cpp b/Userland/Libraries/LibVideo/VP9/Decoder.cpp index 706a36bd76..1fa332733c 100644 --- a/Userland/Libraries/LibVideo/VP9/Decoder.cpp +++ b/Userland/Libraries/LibVideo/VP9/Decoder.cpp @@ -22,7 +22,7 @@ Decoder::Decoder() { } -bool Decoder::parse_frame(const ByteBuffer& frame_data) +bool Decoder::parse_frame(ByteBuffer const& frame_data) { m_bit_stream = make<BitStream>(frame_data.data(), frame_data.size()); m_syntax_element_counter = make<SyntaxElementCounter>(); @@ -301,13 +301,11 @@ bool Decoder::segmentation_params() m_segmentation_update_map = m_bit_stream->read_bit(); if (m_segmentation_update_map) { - for (auto i = 0; i < 7; i++) { + for (auto i = 0; i < 7; i++) m_segmentation_tree_probs[i] = read_prob(); - } m_segmentation_temporal_update = m_bit_stream->read_bit(); - for (auto i = 0; i < 3; i++) { + for (auto i = 0; i < 3; i++) m_segmentation_pred_prob[i] = m_segmentation_temporal_update ? read_prob() : 255; - } } SAFE_CALL(m_bit_stream->read_bit()); diff --git a/Userland/Libraries/LibVideo/VP9/Decoder.h b/Userland/Libraries/LibVideo/VP9/Decoder.h index 5eac6e173e..1ddf4730d0 100644 --- a/Userland/Libraries/LibVideo/VP9/Decoder.h +++ b/Userland/Libraries/LibVideo/VP9/Decoder.h @@ -22,7 +22,7 @@ class Decoder { public: Decoder(); ~Decoder(); - bool parse_frame(const ByteBuffer&); + bool parse_frame(ByteBuffer const&); void dump_info(); private: diff --git a/Userland/Libraries/LibVideo/VP9/ProbabilityTables.cpp b/Userland/Libraries/LibVideo/VP9/ProbabilityTables.cpp index 6dae387282..365f285ab9 100644 --- a/Userland/Libraries/LibVideo/VP9/ProbabilityTables.cpp +++ b/Userland/Libraries/LibVideo/VP9/ProbabilityTables.cpp @@ -1150,22 +1150,22 @@ static constexpr CoefProbs default_coef_probs = { { 1, 16, 6 } } } } } }; -const ParetoTable& ProbabilityTables::pareto_table() const +ParetoTable const& ProbabilityTables::pareto_table() const { return constant_pareto_table; } -const KfPartitionProbs& ProbabilityTables::kf_partition_probs() const +KfPartitionProbs const& ProbabilityTables::kf_partition_probs() const { return constant_kf_partition_probs; } -const KfYModeProbs& ProbabilityTables::kf_y_mode_probs() const +KfYModeProbs const& ProbabilityTables::kf_y_mode_probs() const { return constant_kf_y_mode_probs; } -const KfUVModeProbs& ProbabilityTables::kf_uv_mode_prob() const +KfUVModeProbs const& ProbabilityTables::kf_uv_mode_prob() const { return constant_kf_uv_mode_prob; } diff --git a/Userland/Libraries/LibVideo/VP9/ProbabilityTables.h b/Userland/Libraries/LibVideo/VP9/ProbabilityTables.h index 78953c079d..ea75018f93 100644 --- a/Userland/Libraries/LibVideo/VP9/ProbabilityTables.h +++ b/Userland/Libraries/LibVideo/VP9/ProbabilityTables.h @@ -45,10 +45,10 @@ public: void load_probs(size_t index); void load_probs2(size_t index); - const ParetoTable& pareto_table() const; - const KfPartitionProbs& kf_partition_probs() const; - const KfYModeProbs& kf_y_mode_probs() const; - const KfUVModeProbs& kf_uv_mode_prob() const; + ParetoTable const& pareto_table() const; + KfPartitionProbs const& kf_partition_probs() const; + KfYModeProbs const& kf_y_mode_probs() const; + KfUVModeProbs const& kf_uv_mode_prob() const; PartitionProbs& partition_probs() { return m_current_probability_table.partition_probs; }; YModeProbs& y_mode_probs() { return m_current_probability_table.y_mode_probs; }; diff --git a/Userland/Libraries/LibVideo/VP9/TreeParser.cpp b/Userland/Libraries/LibVideo/VP9/TreeParser.cpp index 47718c66c4..44d64539a2 100644 --- a/Userland/Libraries/LibVideo/VP9/TreeParser.cpp +++ b/Userland/Libraries/LibVideo/VP9/TreeParser.cpp @@ -265,7 +265,7 @@ void TreeParser::count_syntax_element(SyntaxElementType type, int value) } } -TreeParser::TreeSelection::TreeSelection(const int* values) +TreeParser::TreeSelection::TreeSelection(int const* values) : m_is_single_value(false) , m_value { .m_tree = values } { diff --git a/Userland/Libraries/LibVideo/VP9/TreeParser.h b/Userland/Libraries/LibVideo/VP9/TreeParser.h index e22ac08ee7..8f076597f8 100644 --- a/Userland/Libraries/LibVideo/VP9/TreeParser.h +++ b/Userland/Libraries/LibVideo/VP9/TreeParser.h @@ -25,16 +25,16 @@ public: class TreeSelection { public: union TreeSelectionValue { - const int* m_tree; + int const* m_tree; int m_value; }; - TreeSelection(const int* values); + TreeSelection(int const* values); TreeSelection(int value); bool is_single_value() const { return m_is_single_value; } int get_single_value() const { return m_value.m_value; } - const int* get_tree_value() const { return m_value.m_tree; } + int const* get_tree_value() const { return m_value.m_tree; } private: bool m_is_single_value; |