25 VkSpecializationInfo *sl,
35 for (
int i = 0;
i <
f->quant_table_count;
i++) {
36 if (
f->quant_tables[
i][3][127] ||
f->quant_tables[
i][4][127]) {
50 bits =
f->bits_per_raw_sample ?
f->bits_per_raw_sample
51 :
f->avctx->bits_per_raw_sample;
68 for (uint32_t
i = 0;
i < 256;
i++) {
70 for (
int j = 0; j < 8; j++)
71 c = (
c << 1) ^ (0x04C11DB7 & (((
int32_t)
c) >> 31));
78 for (
int i = 1;
i < 256;
i++) {
79 buf[256 +
i] =
f->state_transition[
i];
80 buf[256 -
i] = 256 - (int)
f->state_transition[
i];
86 const VkPhysicalDeviceSubgroupSizeControlProperties *p = &
s->subgroup_props;
87 uint32_t
min = p->minSubgroupSize ? p->minSubgroupSize :
s->props_11.subgroupSize;
88 uint32_t
max = p->maxSubgroupSize ? p->maxSubgroupSize :
s->props_11.subgroupSize;
91 if ((p->requiredSubgroupSizeStages & VK_SHADER_STAGE_COMPUTE_BIT) &&
108 for (
int k = 0; k < 32; k++)
112 for (
int i = 0;
i <
f->quant_table_count;
i++) {
113 for (
int j = 0; j < 2; j++) {
114 const int16_t *qt =
f->quant_tables[
i][3*j];
115 int n = 0,
scale = 0;
117 for (
int d = -127; d < 128; d++) {
118 int step = qt[d & 255] - qt[(d - 1) & 255];
123 if (step !=
scale || n == 32 || (!j && step != 1)) {
145 size_t buf_len = 256*
sizeof(uint32_t) +
146 512*
sizeof(uint8_t) +
155 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT |
156 VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT,
157 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT |
158 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT));
165 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 av_always_inline void scale(vec_s32 res[4], vec_s16 res_packed[2], 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)