#include "pipe/p_video_codec.h"
#include "util/u_memory.h"
+#include "util/u_video.h"
#include "vl/vl_rbsp.h"
#include "entrypoint.h"
templat.profile = priv->profile;
templat.entrypoint = PIPE_VIDEO_ENTRYPOINT_BITSTREAM;
templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420;
- templat.max_references = 2;
+ templat.max_references = priv->picture.h264.num_ref_frames;
templat.expect_chunked_decode = true;
templat.width = port->sPortParam.format.video.nFrameWidth;
templat.height = port->sPortParam.format.video.nFrameHeight;
+ templat.level = priv->picture.h264.pps->sps->level_idc;
priv->codec = priv->pipe->create_video_codec(priv->pipe, &templat);
}
static void seq_parameter_set(vid_dec_PrivateType *priv, struct vl_rbsp *rbsp)
{
struct pipe_h264_sps *sps;
- unsigned profile_idc;
+ unsigned profile_idc, level_idc;
unsigned i;
/* Sequence parameter set */
vl_rbsp_u(rbsp, 2);
/* level_idc */
- vl_rbsp_u(rbsp, 8);
+ level_idc = vl_rbsp_u(rbsp, 8);
sps = seq_parameter_set_id(priv, rbsp);
if (!sps)
memset(sps->ScalingList4x4, 16, sizeof(sps->ScalingList4x4));
memset(sps->ScalingList8x8, 16, sizeof(sps->ScalingList8x8));
+ sps->level_idc = level_idc;
+
if (profile_idc == 100 || profile_idc == 110 || profile_idc == 122 || profile_idc == 244 ||
profile_idc == 44 || profile_idc == 83 || profile_idc == 86 || profile_idc == 118 ||
profile_idc == 128 || profile_idc == 138) {