FFmpeg
Loading...
Searching...
No Matches
libavcodec
ffv1_vulkan.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2024 Lynne <dev@lynne.ee>
3
*
4
* This file is part of FFmpeg.
5
*
6
* FFmpeg is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
10
*
11
* FFmpeg is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with FFmpeg; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20
21
#ifndef AVCODEC_FFV1_VULKAN_H
22
#define AVCODEC_FFV1_VULKAN_H
23
24
#include "
libavutil/vulkan.h
"
25
#include "
ffv1.h
"
26
27
void
ff_ffv1_vk_set_common_sl
(
AVCodecContext
*avctx,
FFV1Context
*
f
,
28
VkSpecializationInfo *sl,
29
enum
AVPixelFormat
sw_format);
30
31
int
ff_ffv1_vk_init_consts
(
FFVulkanContext
*
s
,
FFVkBuffer
*vkb,
FFV1Context
*
f
);
32
33
/* Context inputs 0 and 3 of the quant tables as a function of the signed
34
* 8-bit difference d, with one threshold per subgroup invocation:
35
* q(d) = q(-128) + scale*#{k : thresh[k] <= d}, where scale is 1 for input 0.
36
* scale_off holds the scale of input 3 and the sum of both q(-128). */
37
typedef
struct
FFv1QuantBallot
{
38
int32_t
thresh
[
MAX_QUANT_TABLES
][32][2];
39
int32_t
scale_off
[
MAX_QUANT_TABLES
][2];
40
}
FFv1QuantBallot
;
41
42
/**
43
* Number of invocations that range code a slice together, as a single
44
* subgroup. Each of them holds CONTEXT_SIZE/lanes of the states of a
45
* context. This is CONTEXT_SIZE if the subgroup size can be set to it, or
46
* the largest subgroup size below it otherwise. required is set to the
47
* subgroup size the shader must be created with, or 0.
48
*/
49
uint32_t
ff_ffv1_vk_rc_lanes
(
const
FFVulkanContext
*
s
, uint32_t *required);
50
51
/**
52
* Fill in the ballot quantizers of all quant tables.
53
* Returns 1 if all of them can be evaluated with a ballot.
54
*/
55
int
ff_ffv1_vk_quant_ballot
(
const
FFV1Context
*
f
,
FFv1QuantBallot
*qb);
56
57
typedef
struct
FFv1ShaderParams
{
58
VkDeviceAddress
slice_data
;
59
60
uint32_t
extend_lookup
[8];
61
uint16_t
context_count
[8];
62
63
int
fmt_lut
[4];
64
uint16_t
img_size
[2];
65
66
uint32_t
plane_state_size
;
67
uint32_t
key_frame
;
68
uint32_t
crcref
;
69
int
micro_version
;
70
71
/* Encoder-only */
72
int
sar
[2];
73
int
pic_mode
;
74
uint32_t
slice_size_max
;
75
uint32_t
max_pixels_per_slice
;
76
77
/* Decoder-only */
78
uint32_t
remap_allowed
;
79
}
FFv1ShaderParams
;
80
81
#endif
/* AVCODEC_FFV1_VULKAN_H */
int32_t
int32_t
Definition
audioconvert.c:58
f
#define f(width, name)
Definition
cbs_vp8.c:236
s
#define s(width, name)
Definition
cbs_vp9.c:198
ffv1.h
FF Video Codec 1 (a lossless codec)
MAX_QUANT_TABLES
#define MAX_QUANT_TABLES
Definition
ffv1.h:47
ff_ffv1_vk_quant_ballot
int ff_ffv1_vk_quant_ballot(const FFV1Context *f, FFv1QuantBallot *qb)
Fill in the ballot quantizers of all quant tables.
Definition
ffv1_vulkan.c:104
ff_ffv1_vk_init_consts
int ff_ffv1_vk_init_consts(FFVulkanContext *s, FFVkBuffer *vkb, FFV1Context *f)
Definition
ffv1_vulkan.c:140
ff_ffv1_vk_rc_lanes
uint32_t ff_ffv1_vk_rc_lanes(const FFVulkanContext *s, uint32_t *required)
Number of invocations that range code a slice together, as a single subgroup.
Definition
ffv1_vulkan.c:85
ff_ffv1_vk_set_common_sl
void ff_ffv1_vk_set_common_sl(AVCodecContext *avctx, FFV1Context *f, VkSpecializationInfo *sl, enum AVPixelFormat sw_format)
Definition
ffv1_vulkan.c:24
AVPixelFormat
AVPixelFormat
Pixel format.
Definition
pixfmt.h:71
AVCodecContext
main external API structure.
Definition
avcodec.h:443
FFV1Context
Definition
ffv1.h:122
FFVkBuffer
Definition
vulkan.h:94
FFVulkanContext
Definition
vulkan.h:292
FFv1QuantBallot
Definition
ffv1_vulkan.h:37
FFv1QuantBallot::scale_off
int32_t scale_off[MAX_QUANT_TABLES][2]
Definition
ffv1_vulkan.h:39
FFv1QuantBallot::thresh
int32_t thresh[MAX_QUANT_TABLES][32][2]
Definition
ffv1_vulkan.h:38
FFv1ShaderParams
Definition
ffv1_vulkan.h:57
FFv1ShaderParams::plane_state_size
uint32_t plane_state_size
Definition
ffv1_vulkan.h:66
FFv1ShaderParams::sar
int sar[2]
Definition
ffv1_vulkan.h:72
FFv1ShaderParams::img_size
uint16_t img_size[2]
Definition
ffv1_vulkan.h:64
FFv1ShaderParams::max_pixels_per_slice
uint32_t max_pixels_per_slice
Definition
ffv1_vulkan.h:75
FFv1ShaderParams::crcref
uint32_t crcref
Definition
ffv1_vulkan.h:68
FFv1ShaderParams::key_frame
uint32_t key_frame
Definition
ffv1_vulkan.h:67
FFv1ShaderParams::fmt_lut
int fmt_lut[4]
Definition
ffv1_vulkan.h:63
FFv1ShaderParams::context_count
uint16_t context_count[8]
Definition
ffv1_vulkan.h:61
FFv1ShaderParams::remap_allowed
uint32_t remap_allowed
Definition
ffv1_vulkan.h:78
FFv1ShaderParams::pic_mode
int pic_mode
Definition
ffv1_vulkan.h:73
FFv1ShaderParams::micro_version
int micro_version
Definition
ffv1_vulkan.h:69
FFv1ShaderParams::slice_size_max
uint32_t slice_size_max
Definition
ffv1_vulkan.h:74
FFv1ShaderParams::extend_lookup
uint32_t extend_lookup[8]
Definition
ffv1_vulkan.h:60
FFv1ShaderParams::slice_data
VkDeviceAddress slice_data
Definition
ffv1_vulkan.h:58
vulkan.h
Generated on Thu Oct 8 2026 19:20:54 for FFmpeg by
1.13.2