-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathpyrowave_decoder.hpp
More file actions
47 lines (38 loc) · 1.23 KB
/
Copy pathpyrowave_decoder.hpp
File metadata and controls
47 lines (38 loc) · 1.23 KB
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
// Copyright (c) 2025 Hans-Kristian Arntzen
// SPDX-License-Identifier: MIT
#pragma once
#include <memory>
#include <stddef.h>
#include <stdint.h>
#include "pyrowave_config.hpp"
namespace Vulkan
{
class Device;
class ImageView;
class CommandBuffer;
}
namespace PyroWave
{
class Decoder
{
public:
Decoder();
~Decoder();
// Fragment path is optimized for typical mobile GPUs which have weak compute support.
// iDWT is instead computed entirely in traditional render passes and fragment shaders.
// This path is *not* recommended for desktop-class chips.
bool init(Vulkan::Device *device, int width, int height,
ChromaSubsampling chroma, bool fragment_path = false);
static bool device_prefers_fragment_path(Vulkan::Device &device);
void clear();
bool push_packet(const void *data, size_t size);
// If fragment path is enabled, the command buffer must support graphics operations.
// To synchronize, synchronize with COLOR_OUTPUT / COLOR_ATTACHMENT_WRITE / COLOR_ATTACHMENT_OPTIMAL.
// Views must be created with VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT.
bool decode(Vulkan::CommandBuffer &cmd, const ViewBuffers &views);
bool decode_is_ready(bool allow_partial_frame) const;
private:
struct Impl;
std::unique_ptr<Impl> impl;
};
}