25 VkSpecializationInfo *sl,
36 for (
int i = 0;
i <
f->quant_table_count;
i++) {
37 if (
f->quant_tables[
i][3][127] ||
f->quant_tables[
i][4][127]) {
51 bits =
f->bits_per_raw_sample ?
f->bits_per_raw_sample
52 :
f->avctx->bits_per_raw_sample;
69 for (uint32_t
i = 0;
i < 256;
i++) {
71 for (
int j = 0; j < 8; j++)
72 c = (
c << 1) ^ (0x04C11DB7 & (((
int32_t)
c) >> 31));
79 for (
int i = 1;
i < 256;
i++) {
80 buf[256 +
i] =
f->state_transition[
i];
81 buf[256 -
i] = 256 - (int)
f->state_transition[
i];
87 const VkPhysicalDeviceSubgroupSizeControlProperties *p = &
s->subgroup_props;
88 uint32_t
min = p->minSubgroupSize ? p->minSubgroupSize :
s->props_11.subgroupSize;
89 uint32_t
max = p->maxSubgroupSize ? p->maxSubgroupSize :
s->props_11.subgroupSize;
92 if ((p->requiredSubgroupSizeStages & VK_SHADER_STAGE_COMPUTE_BIT) &&
109 for (
int k = 0; k < 32; k++)
113 for (
int i = 0;
i <
f->quant_table_count;
i++) {
114 for (
int j = 0; j < 2; j++) {
115 const int16_t *qt =
f->quant_tables[
i][3*j];
116 int n = 0,
scale = 0;
118 for (
int d = -127; d < 128; d++) {
119 int step = qt[d & 255] - qt[(d - 1) & 255];
124 if (step !=
scale || n == 32 || (!j && step != 1)) {
146 size_t buf_len = 256*
sizeof(uint32_t) +
147 512*
sizeof(uint8_t) +
156 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT |
157 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT,
158 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT |
159 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT));
166 quant_tables = (
void *)(buf_mapped + 256*
sizeof(uint32_t) + 512*
sizeof(uint8_t));
#define i(width, name, range_min, range_max)
Public header for CRC hash function implementation.
static const uint8_t bits[8]
#define MAX_QUANT_TABLE_SIZE
#define MAX_CONTEXT_INPUTS
int ff_ffv1_vk_quant_ballot(const FFV1Context *f, FFv1QuantBallot *qb)
Fill in the ballot quantizers of all quant tables.
int ff_ffv1_vk_init_consts(FFVulkanContext *s, FFVkBuffer *vkb, FFV1Context *f)
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.
static void set_crc_tab(uint32_t *buf)
void ff_ffv1_vk_set_common_sl(AVCodecContext *avctx, FFV1Context *f, VkSpecializationInfo *sl, enum AVPixelFormat sw_format)
static void set_rc_state_tab(FFV1Context *f, uint8_t *buf)
static void scale(int *out, const int *in, const int w, const int h, const int shift)
int ff_vk_create_buf(FFVulkanContext *s, FFVkBuffer *buf, size_t size, void *pNext, void *alloc_pNext, VkBufferUsageFlags usage, VkMemoryPropertyFlagBits flags)
int ff_vk_mt_is_np_rgb(enum AVPixelFormat pix_fmt)
Returns 1 if pixfmt is a usable RGB format.
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
#define AV_PIX_FMT_FLAG_PLANAR
At least one pixel component is not in the first data plane.
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_YA8
8 bits gray, 8 bits alpha
main external API structure.
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
uint8_t nb_components
The number of components each pixel has, (1-4)
int32_t scale_off[MAX_QUANT_TABLES][2]
int32_t thresh[MAX_QUANT_TABLES][32][2]
static const uint8_t quant_tables[]
#define SPEC_LIST_ADD(name, idx, val_bits, val)
static int ff_vk_unmap_buffer(FFVulkanContext *s, FFVkBuffer *buf, int flush)
static int ff_vk_map_buffer(FFVulkanContext *s, FFVkBuffer *buf, uint8_t **mem, int invalidate)