mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
pipe: Add sliced encoding API and caps
Reviewed-By: Pohsiang Hsu <pohhsu@microsoft.com> Reviewed-by: Ruijing Dong <ruijing.dong@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34844>
This commit is contained in:
parent
c5f5ee41c8
commit
555a13661a
3 changed files with 68 additions and 0 deletions
|
|
@ -95,6 +95,45 @@ struct pipe_video_codec
|
|||
struct pipe_resource *destination,
|
||||
void **feedback);
|
||||
|
||||
/**
|
||||
* encode an entire frame texture to a bitstream, but get notified asynchronously
|
||||
* in slice_fences[] as the slices are ready (can be of out order if multi engine encoder)
|
||||
* for frontend consumption before the full frame is finished.
|
||||
*
|
||||
* The different slices are written in each slice_destinations[] buffer
|
||||
*
|
||||
* num_slice_objects indicates the number of elements in the input
|
||||
* array slice_destinations and indicates the number of outputs expected
|
||||
* in slice_fences
|
||||
*
|
||||
* The frame NALs are attached to the first slice buffer
|
||||
* Any packed slice header (e.g SVC NAL prefix) is attached to each slice buffer
|
||||
*
|
||||
* get_feedback information/stats is still only available after full frame
|
||||
* completion is signaled (e.g pipe_picture_desc::fence)
|
||||
*
|
||||
* Driver reports support for this function used with different codecs/profiles
|
||||
* in PIPE_VIDEO_CAP_ENC_SLICED_NOTIFICATIONS, frontend must check before using it.
|
||||
*/
|
||||
void (*encode_bitstream_sliced)(struct pipe_video_codec *codec,
|
||||
struct pipe_video_buffer *source,
|
||||
unsigned num_slice_objects,
|
||||
struct pipe_resource **slice_destinations,
|
||||
struct pipe_fence_handle **slice_fences,
|
||||
void **feedback);
|
||||
|
||||
|
||||
/**
|
||||
* Once encode_bitstream_sliced::slice_fences[slice_idx] is signaled, use this function
|
||||
* to retrieve the slice size and offset for readback from encode_bitstream_sliced::slice_destinations[slice_idx]
|
||||
* As the slice may include other packed headers, a list of codec_unit_location_t elements is returned
|
||||
*/
|
||||
void (*get_slice_bitstream_data)(struct pipe_video_codec *codec,
|
||||
void *feedback, /* corresponding to the encode_bitstream_sliced frame call */
|
||||
unsigned slice_idx, /* [0..max_slices_expected] */
|
||||
struct codec_unit_location_t *codec_unit_metadata,
|
||||
unsigned *codec_unit_metadata_count);
|
||||
|
||||
/**
|
||||
* Perform post-process effect
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -220,6 +220,13 @@ enum pipe_video_cap
|
|||
* The returned value is pipe_enc_cap_gpu_stats_map
|
||||
*/
|
||||
PIPE_VIDEO_CAP_ENC_GPU_STATS_RATE_CONTROL_BITS_MAP = 61,
|
||||
/*
|
||||
* Support for encoding an entire frame with pipe_video_codec::encode_bitstream_sliced
|
||||
for a given profile/codec
|
||||
*
|
||||
* The returned value is pipe_enc_cap_sliced_notifications
|
||||
*/
|
||||
PIPE_VIDEO_CAP_ENC_SLICED_NOTIFICATIONS = 62,
|
||||
};
|
||||
|
||||
enum pipe_video_h264_enc_dbk_filter_mode_flags
|
||||
|
|
|
|||
|
|
@ -2669,6 +2669,28 @@ union pipe_enc_cap_gpu_stats_map {
|
|||
uint32_t value;
|
||||
};
|
||||
|
||||
/* Used with PIPE_VIDEO_CAP_ENC_SLICED_NOTIFICATIONS */
|
||||
union pipe_enc_cap_sliced_notifications {
|
||||
struct {
|
||||
/*
|
||||
* Driver Output. Indicates support for sliced notifications
|
||||
*/
|
||||
uint32_t supported: 1;
|
||||
/*
|
||||
* Driver Output. When reported indicates that encode_bitstream_sliced
|
||||
* parameter slice_destinations[i] must contain different pipe_resource
|
||||
* allocations for each slice i.
|
||||
*
|
||||
* When NOT reported, indicates that encode_bitstream_sliced
|
||||
* parameter slice_destinations[i] must contain the same pipe_resource
|
||||
* allocation for each slice i. In this case the driver will take care
|
||||
* of suballocating and calculating offsets within the single allocation
|
||||
*/
|
||||
uint32_t multiple_buffers_required: 1;
|
||||
} bits;
|
||||
uint32_t value;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue