Video encoder previously reuses the associated_data variable to output
encoding statistics, but it ended up breaking when transcoding. This
commit adds a new variable just for statistics.
Fixes:
2d1bd619dfd ("frontends/va: add ability for encoder to output statistics")
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20190>
return;
}
- if (vid_buf->base.associated_data) {
- enc->get_buffer(vid_buf->base.associated_data, &enc->stats, NULL);
+ if (vid_buf->base.statistics_data) {
+ enc->get_buffer(vid_buf->base.statistics_data, &enc->stats, NULL);
if (enc->stats->size < sizeof(rvcn_encode_stats_type_0_t)) {
RVID_ERR("Encoder statistics output buffer is too small.\n");
enc->stats = NULL;
}
- vid_buf->base.associated_data = NULL;
+ vid_buf->base.statistics_data = NULL;
}
else
enc->stats = NULL;
buf->derived_surface.resource = pipe_buffer_create(drv->pipe->screen, PIPE_BIND_VERTEX_BUFFER,
PIPE_USAGE_STREAM, buf->size);
- context->target->associated_data = buf->derived_surface.resource;
+ context->target->statistics_data = buf->derived_surface.resource;
return VA_STATUS_SUCCESS;
}
* destroy the associated data
*/
void (*destroy_associated_data)(void *associated_data);
+
+ /*
+ * encoded frame statistics for this particular picture
+ */
+ void *statistics_data;
};
#ifdef __cplusplus