mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:37:35 +00:00
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.
This commit is contained in:
parent
7d4053dde1
commit
988e17ed05
12 changed files with 48 additions and 50 deletions
|
@ -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 };
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -22,7 +22,7 @@ class Decoder {
|
|||
public:
|
||||
Decoder();
|
||||
~Decoder();
|
||||
bool parse_frame(const ByteBuffer&);
|
||||
bool parse_frame(ByteBuffer const&);
|
||||
void dump_info();
|
||||
|
||||
private:
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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; };
|
||||
|
|
|
@ -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 }
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue