mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
frontends/va: Move mjpeg sampling_factor to pipe_mjpeg_picture_desc
Reviewed-by: David (Ming Qiang) Wu <David.Wu3@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32504>
This commit is contained in:
parent
7a9f14d3c2
commit
5f3a93dacf
4 changed files with 6 additions and 9 deletions
|
|
@ -129,7 +129,6 @@ vlVaBeginPicture(VADriverContextP ctx, VAContextID context_id, VASurfaceID rende
|
|||
|
||||
context->target_id = render_target;
|
||||
context->target = surf->buffer;
|
||||
context->mjpeg.sampling_factor = 0;
|
||||
|
||||
if (context->templat.entrypoint != PIPE_VIDEO_ENTRYPOINT_ENCODE)
|
||||
context->needs_begin_frame = true;
|
||||
|
|
|
|||
|
|
@ -40,6 +40,9 @@ void vlVaHandlePictureParameterBufferMJPEG(vlVaDriver *drv, vlVaContext *context
|
|||
|
||||
STATIC_ASSERT(sizeof(mjpeg->components) ==
|
||||
sizeof(context->desc.mjpeg.picture_parameter.components));
|
||||
|
||||
context->desc.mjpeg.picture_parameter.sampling_factor = 0;
|
||||
|
||||
for (i = 0; i < MIN2(mjpeg->num_components, ARRAY_SIZE(mjpeg->components)); ++i) {
|
||||
context->desc.mjpeg.picture_parameter.components[i].component_id =
|
||||
mjpeg->components[i].component_id;
|
||||
|
|
@ -51,8 +54,8 @@ void vlVaHandlePictureParameterBufferMJPEG(vlVaDriver *drv, vlVaContext *context
|
|||
mjpeg->components[i].quantiser_table_selector;
|
||||
|
||||
sf = mjpeg->components[i].h_sampling_factor << 4 | mjpeg->components[i].v_sampling_factor;
|
||||
context->mjpeg.sampling_factor <<= 8;
|
||||
context->mjpeg.sampling_factor |= sf;
|
||||
context->desc.mjpeg.picture_parameter.sampling_factor <<= 8;
|
||||
context->desc.mjpeg.picture_parameter.sampling_factor |= sf;
|
||||
}
|
||||
|
||||
context->desc.mjpeg.picture_parameter.num_components = mjpeg->num_components;
|
||||
|
|
|
|||
|
|
@ -412,12 +412,6 @@ typedef struct vlVaContext {
|
|||
} mpeg4;
|
||||
|
||||
struct {
|
||||
unsigned sampling_factor;
|
||||
#define MJPEG_SAMPLING_FACTOR_NV12 (0x221111)
|
||||
#define MJPEG_SAMPLING_FACTOR_YUY2 (0x221212)
|
||||
#define MJPEG_SAMPLING_FACTOR_YUV422 (0x211111)
|
||||
#define MJPEG_SAMPLING_FACTOR_YUV444 (0x111111)
|
||||
#define MJPEG_SAMPLING_FACTOR_YUV400 (0x11)
|
||||
uint8_t slice_header[MAX_MJPEG_SLICE_HEADER_SIZE];
|
||||
unsigned int slice_header_size;
|
||||
} mjpeg;
|
||||
|
|
|
|||
|
|
@ -1626,6 +1626,7 @@ struct pipe_mjpeg_picture_desc
|
|||
uint16_t crop_y;
|
||||
uint16_t crop_width;
|
||||
uint16_t crop_height;
|
||||
uint32_t sampling_factor;
|
||||
} picture_parameter;
|
||||
|
||||
struct
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue