This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch master in repository ffmpeg.
commit 5c1b2947a480957204ddf64c8353189ea2363ff6 Author: Lynne <[email protected]> AuthorDate: Wed Feb 11 21:21:58 2026 +0100 Commit: Lynne <[email protected]> CommitDate: Thu Feb 19 19:42:33 2026 +0100 ffv1enc_vulkan: only return the encoded size, not its offset The encoded offset is just a multiple of the index by the max slice size. --- libavcodec/ffv1enc_vulkan.c | 18 ++++++++---------- libavcodec/vulkan/ffv1_enc.comp.glsl | 5 ++--- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/libavcodec/ffv1enc_vulkan.c b/libavcodec/ffv1enc_vulkan.c index eaf437279e..ef3c9fa7be 100644 --- a/libavcodec/ffv1enc_vulkan.c +++ b/libavcodec/ffv1enc_vulkan.c @@ -243,7 +243,7 @@ static int vulkan_encode_ffv1_submit_frame(AVCodecContext *avctx, RET(ff_vk_get_pooled_buffer(&fv->s, &fv->results_data_pool, &fd->results_data_ref, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, - NULL, 2*f->slice_count*sizeof(uint64_t), + NULL, f->slice_count*sizeof(uint32_t), VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)); results_data_buf = (FFVkBuffer *)fd->results_data_ref->data; @@ -486,7 +486,7 @@ static int vulkan_encode_ffv1_submit_frame(AVCodecContext *avctx, ff_vk_shader_update_desc_buffer(&fv->s, exec, &fv->enc, 1, 1, 0, results_data_buf, - 0, results_data_buf->size, + 0, VK_WHOLE_SIZE, VK_FORMAT_UNDEFINED); ff_vk_shader_update_desc_buffer(&fv->s, exec, &fv->enc, 1, 2, 0, @@ -607,7 +607,7 @@ static int get_packet(AVCodecContext *avctx, FFVkExecContext *exec, FFVkBuffer *out_data_buf = (FFVkBuffer *)fd->out_data_ref->data; FFVkBuffer *results_data_buf = (FFVkBuffer *)fd->results_data_ref->data; - uint64_t *sc; + uint32_t slice_size_max = out_data_buf->size / f->slice_count; /* Make sure encoding's done */ ff_vk_exec_wait(&fv->s, exec); @@ -627,17 +627,15 @@ static int get_packet(AVCodecContext *avctx, FFVkExecContext *exec, /* Calculate final size */ pkt->size = 0; for (int i = 0; i < f->slice_count; i++) { - sc = &((uint64_t *)results_data_buf->mapped_mem)[i*2]; - av_log(avctx, AV_LOG_DEBUG, "Slice %i size = %"PRIu64", " - "src offset = %"PRIu64"\n", - i, sc[0], sc[1]); + uint32_t sl_len = AV_RN32(results_data_buf->mapped_mem + i*4); + av_log(avctx, AV_LOG_DEBUG, "Slice %i size = %u\n", i, sl_len); fv->buf_regions[i] = (VkBufferCopy) { - .srcOffset = sc[1], + .srcOffset = i*slice_size_max, .dstOffset = pkt->size, - .size = sc[0], + .size = sl_len, }; - pkt->size += sc[0]; + pkt->size += sl_len; } av_log(avctx, AV_LOG_VERBOSE, "Encoded data: %iMiB\n", pkt->size / (1024*1024)); av_buffer_unref(&fd->results_data_ref); /* No need for this buffer anymore */ diff --git a/libavcodec/vulkan/ffv1_enc.comp.glsl b/libavcodec/vulkan/ffv1_enc.comp.glsl index c6a0564315..b3399e3e5f 100644 --- a/libavcodec/vulkan/ffv1_enc.comp.glsl +++ b/libavcodec/vulkan/ffv1_enc.comp.glsl @@ -32,7 +32,7 @@ layout (set = 0, binding = 2, scalar) uniform crc_ieee_buf { }; layout (set = 1, binding = 1, scalar) writeonly buffer slice_results_buf { - uint64_t slice_results[]; + uint32_t slice_results[]; }; layout (set = 1, binding = 3) uniform uimage2D src[]; @@ -361,8 +361,7 @@ void finalize_slice(const uint slice_idx) enc_len += 4; } - slice_results[slice_idx*2 + 0] = enc_len; - slice_results[slice_idx*2 + 1] = uint64_t(bs) - uint64_t(slice_data); + slice_results[slice_idx] = enc_len; } void main(void) _______________________________________________ ffmpeg-cvslog mailing list -- [email protected] To unsubscribe send an email to [email protected]
