mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:07:34 +00:00
LibVideo: Make probability tables save to the specified index
Previously, saved probability tables were being inserted, causing the Vector to increase in size when it should say fixed at a size of 4. This changes the Vector to an Array<T, 4> which will default-initalize and allow assigning to any index without previously setting size.
This commit is contained in:
parent
7d27273dc7
commit
7dcd5ed206
2 changed files with 7 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Hunter Salyer <thefalsehonesty@gmail.com>
|
||||
* Copyright (c) 2022, Gregory Bertilson <zaggy1024@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -1172,7 +1173,7 @@ KfUVModeProbs const& ProbabilityTables::kf_uv_mode_prob() const
|
|||
|
||||
void ProbabilityTables::save_probs(size_t index)
|
||||
{
|
||||
m_saved_probability_tables.insert(index, m_current_probability_table);
|
||||
m_saved_probability_tables[index] = m_current_probability_table;
|
||||
}
|
||||
|
||||
void ProbabilityTables::reset_probs()
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Hunter Salyer <thefalsehonesty@gmail.com>
|
||||
* Copyright (c) 2022, Gregory Bertilson <zaggy1024@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Symbols.h"
|
||||
#include <AK/Array.h>
|
||||
#include <AK/Types.h>
|
||||
#include <AK/Vector.h>
|
||||
|
||||
#include "Symbols.h"
|
||||
|
||||
namespace Video::VP9 {
|
||||
|
||||
|
@ -97,7 +99,7 @@ private:
|
|||
CoefProbs coef_probs;
|
||||
};
|
||||
|
||||
Vector<ProbabilityTable, 4> m_saved_probability_tables;
|
||||
Array<ProbabilityTable, 4> m_saved_probability_tables;
|
||||
ProbabilityTable m_current_probability_table;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue