st/va: create decoder for MJPEG format
Mjpeg doesn't need reference Signed-off-by: Leo Liu <leo.liu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com>
This commit is contained in:
parent
0a59477372
commit
38b9686df0
|
@ -170,14 +170,17 @@ handlePictureParameterBuffer(vlVaDriver *drv, vlVaContext *context, vlVaBuffer *
|
||||||
|
|
||||||
/* Create the decoder once max_references is known. */
|
/* Create the decoder once max_references is known. */
|
||||||
if (!context->decoder) {
|
if (!context->decoder) {
|
||||||
|
enum pipe_video_format format =
|
||||||
|
u_reduce_video_profile(context->templat.profile);
|
||||||
|
|
||||||
if (!context->target)
|
if (!context->target)
|
||||||
return VA_STATUS_ERROR_INVALID_CONTEXT;
|
return VA_STATUS_ERROR_INVALID_CONTEXT;
|
||||||
|
|
||||||
if (context->templat.max_references == 0)
|
if (context->templat.max_references == 0 &&
|
||||||
|
format != PIPE_VIDEO_FORMAT_JPEG)
|
||||||
return VA_STATUS_ERROR_INVALID_BUFFER;
|
return VA_STATUS_ERROR_INVALID_BUFFER;
|
||||||
|
|
||||||
if (u_reduce_video_profile(context->templat.profile) ==
|
if (format == PIPE_VIDEO_FORMAT_MPEG4_AVC)
|
||||||
PIPE_VIDEO_FORMAT_MPEG4_AVC)
|
|
||||||
context->templat.level = u_get_h264_level(context->templat.width,
|
context->templat.level = u_get_h264_level(context->templat.width,
|
||||||
context->templat.height, &context->templat.max_references);
|
context->templat.height, &context->templat.max_references);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue