| 121 | } |
| 122 | |
| 123 | static int vk_prores_decode_slice(AVCodecContext *avctx, |
| 124 | const uint8_t *data, |
| 125 | uint32_t size) |
| 126 | { |
| 127 | ProresContext *pr = avctx->priv_data; |
| 128 | ProresVulkanDecodePicture *pp = pr->hwaccel_picture_private; |
| 129 | FFVulkanDecodePicture *vp = &pp->vp; |
| 130 | |
| 131 | FFVkBuffer *slice_offset = (FFVkBuffer *)pp->metadata_buf->data; |
| 132 | FFVkBuffer *slices_buf = vp->slices_buf ? (FFVkBuffer *)vp->slices_buf->data : NULL; |
| 133 | |
| 134 | /* Skip picture header */ |
| 135 | if (slices_buf && slices_buf->host_ref && !pp->slice_num) |
| 136 | pp->bitstream_size = data - slices_buf->mapped_mem; |
| 137 | |
| 138 | AV_WN32(slice_offset->mapped_mem + (pp->slice_num + 0) * sizeof(uint32_t), |
| 139 | pp->bitstream_size); |
| 140 | AV_WN32(slice_offset->mapped_mem + (pp->slice_num + 1) * sizeof(uint32_t), |
| 141 | pp->bitstream_size += size); |
| 142 | |
| 143 | if (!slices_buf || !slices_buf->host_ref) { |
| 144 | int err = ff_vk_decode_add_slice(avctx, vp, data, size, 0, |
| 145 | &pp->slice_num, NULL); |
| 146 | if (err < 0) |
| 147 | return err; |
| 148 | } else { |
| 149 | pp->slice_num++; |
| 150 | } |
| 151 | |
| 152 | return 0; |
| 153 | } |
| 154 | |
| 155 | static int vk_prores_end_frame(AVCodecContext *avctx) |
| 156 | { |
nothing calls this directly
no test coverage detected