mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 08:58:02 +02:00
frontends/va: change getEncParamPreset location
why: getEncParamPreset functions overwrite the incoming messages. how: To change a location after the decoder is created, so that if no incoming message the default ones will be used otherwise the new messages will overwrite the default values. Signed-off-by: Ruijing Dong <ruijing.dong@amd.com> Reviewed-by: Sil Vilerino <sivileri@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18534>
This commit is contained in:
parent
72fffa62d5
commit
6646ae2576
4 changed files with 17 additions and 4 deletions
|
|
@ -859,12 +859,21 @@ vlVaEndPicture(VADriverContextP ctx, VAContextID context_id)
|
|||
}
|
||||
|
||||
if (context->decoder->entrypoint == PIPE_VIDEO_ENTRYPOINT_ENCODE) {
|
||||
struct pipe_screen *screen = context->decoder->context->screen;
|
||||
coded_buf = context->coded_buf;
|
||||
if (u_reduce_video_profile(context->templat.profile) == PIPE_VIDEO_FORMAT_MPEG4_AVC) {
|
||||
getEncParamPresetH264(context);
|
||||
if (u_reduce_video_profile(context->templat.profile) == PIPE_VIDEO_FORMAT_MPEG4_AVC)
|
||||
context->desc.h264enc.frame_num_cnt++;
|
||||
} else if (u_reduce_video_profile(context->templat.profile) == PIPE_VIDEO_FORMAT_HEVC)
|
||||
getEncParamPresetH265(context);
|
||||
|
||||
/* keep other path the same way */
|
||||
if (!screen->get_video_param(screen, PIPE_VIDEO_PROFILE_UNKNOWN,
|
||||
context->decoder->entrypoint,
|
||||
PIPE_VIDEO_CAP_ENC_QUALITY_LEVEL)) {
|
||||
|
||||
if (u_reduce_video_profile(context->templat.profile) == PIPE_VIDEO_FORMAT_MPEG4_AVC)
|
||||
getEncParamPresetH264(context);
|
||||
else if (u_reduce_video_profile(context->templat.profile) == PIPE_VIDEO_FORMAT_HEVC)
|
||||
getEncParamPresetH265(context);
|
||||
}
|
||||
|
||||
context->desc.base.input_format = surf->buffer->buffer_format;
|
||||
context->desc.base.output_format = surf->encoder_format;
|
||||
|
|
|
|||
|
|
@ -157,6 +157,8 @@ vlVaHandleVAEncSequenceParameterBufferTypeH264(vlVaDriver *drv, vlVaContext *con
|
|||
context->decoder = drv->pipe->create_video_codec(drv->pipe, &context->templat);
|
||||
if (!context->decoder)
|
||||
return VA_STATUS_ERROR_ALLOCATION_FAILED;
|
||||
|
||||
getEncParamPresetH264(context);
|
||||
}
|
||||
|
||||
context->gop_coeff = ((1024 + h264->intra_idr_period - 1) / h264->intra_idr_period + 1) / 2 * 2;
|
||||
|
|
|
|||
|
|
@ -134,6 +134,8 @@ vlVaHandleVAEncSequenceParameterBufferTypeHEVC(vlVaDriver *drv, vlVaContext *con
|
|||
|
||||
if (!context->decoder)
|
||||
return VA_STATUS_ERROR_ALLOCATION_FAILED;
|
||||
|
||||
getEncParamPresetH265(context);
|
||||
}
|
||||
|
||||
context->desc.h265enc.seq.general_profile_idc = h265->general_profile_idc;
|
||||
|
|
|
|||
0
src/gallium/include/pipe/p_video_state.h
Executable file → Normal file
0
src/gallium/include/pipe/p_video_state.h
Executable file → Normal file
Loading…
Add table
Reference in a new issue