mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-05 16:14:38 +00:00
With the addition of this struct, both the bool to determine if coefs should be parsed and the token parse itself can take specific parameters. This is the last step in parameterizing all the tree parsing, so the old functions in TreeParser are now unused. This patch is very satisfying :^) There's still more work to be done to clean up how the parameters are passed from Parser, but that's work for another day.
42 lines
722 B
C++
42 lines
722 B
C++
/*
|
|
* 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 "Enums.h"
|
|
#include "MotionVector.h"
|
|
|
|
namespace Video::VP9 {
|
|
|
|
template<typename T>
|
|
struct Pair {
|
|
T a;
|
|
T b;
|
|
|
|
T& operator[](size_t index)
|
|
{
|
|
if (index == 0)
|
|
return a;
|
|
if (index == 1)
|
|
return b;
|
|
VERIFY_NOT_REACHED();
|
|
}
|
|
};
|
|
|
|
typedef Pair<ReferenceFrameType> ReferenceFramePair;
|
|
typedef Pair<MotionVector> MotionVectorPair;
|
|
|
|
struct TokensContext {
|
|
TXSize m_tx_size;
|
|
bool m_is_uv_plane;
|
|
bool m_is_inter;
|
|
u8 m_band;
|
|
u8 m_context_index;
|
|
};
|
|
|
|
}
|