aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/host1x/codecs/vp8.h
blob: 8dae74f0582c3b108f8950e306f26166d02c7125 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later

// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#include <array>
#include <span>

#include "common/common_funcs.h"
#include "common/common_types.h"
#include "common/scratch_buffer.h"
#include "video_core/host1x/codecs/decoder.h"
#include "video_core/host1x/nvdec_common.h"
#include "video_core/host1x/codec_types.h"

namespace Tegra {

namespace Host1x {
class Host1x;
} // namespace Host1x

namespace Decoders {
enum class Vp8SurfaceIndex : u32 {
    Last = 0,
    Golden = 1,
    AltRef = 2,
    Current = 3,
};

class VP8 final : public Decoder {
public:
    explicit VP8(Host1x::Host1x& host1x, const Host1x::NvdecCommon::NvdecRegisters& regs, s32 id);
    ~VP8() override;

    VP8(const VP8&) = delete;
    VP8& operator=(const VP8&) = delete;

    VP8(VP8&&) = delete;
    VP8& operator=(VP8&&) = delete;

    [[nodiscard]] std::span<const u8> ComposeFrame() override;

    std::tuple<u64, u64> GetProgressiveOffsets() override;
    std::tuple<u64, u64, u64, u64> GetInterlacedOffsets() override;

    bool IsInterlaced() override {
        return false;
    }

    std::string_view GetCurrentCodecName() const override {
        return "VP8";
    }

private:
    VP8PictureInfo current_context{};
    Common::ScratchBuffer<u8> frame_scratch;
};

} // namespace Decoders
} // namespace Tegra