summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Liu <[email protected]>2016-09-23 11:33:31 -0400
committerLeo Liu <[email protected]>2016-10-04 11:09:59 -0400
commit091aae0265caa82bc975e18946fd091e91b72602 (patch)
tree244ad1198b559de92e912dda7a20b9877a4f22ec
parent2371119db99a4513024430723f421f15f934c656 (diff)
st/omx/dec/h265: decoder size should follow from sps
The video size from format container is not always compatible with the size from codec bitstream, the HW decoder should take the size information from bitstream, otherwise the corruption appears with clip that has different size info between bitstream and format container So we are passing width(height)_in_samples from sequence parameter set to video decoder. Signed-off-by: Leo Liu <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
-rw-r--r--src/gallium/state_trackers/omx/vid_dec.h2
-rw-r--r--src/gallium/state_trackers/omx/vid_dec_h265.c13
2 files changed, 8 insertions, 7 deletions
diff --git a/src/gallium/state_trackers/omx/vid_dec.h b/src/gallium/state_trackers/omx/vid_dec.h
index ebb35a353af..35a575899c6 100644
--- a/src/gallium/state_trackers/omx/vid_dec.h
+++ b/src/gallium/state_trackers/omx/vid_dec.h
@@ -100,6 +100,8 @@ DERIVEDCLASS(vid_dec_PrivateType, omx_base_filter_PrivateType)
struct { \
unsigned temporal_id; \
unsigned level_idc; \
+ unsigned pic_width_in_luma_samples; \
+ unsigned pic_height_in_luma_samples; \
bool IdrPicFlag; \
int slice_prev_poc; \
void *ref_pic_set_list; \
diff --git a/src/gallium/state_trackers/omx/vid_dec_h265.c b/src/gallium/state_trackers/omx/vid_dec_h265.c
index eae476a96ee..f3bf66f783c 100644
--- a/src/gallium/state_trackers/omx/vid_dec_h265.c
+++ b/src/gallium/state_trackers/omx/vid_dec_h265.c
@@ -342,9 +342,11 @@ static void seq_parameter_set(vid_dec_PrivateType *priv, struct vl_rbsp *rbsp)
if (sps->chroma_format_idc == 3)
sps->separate_colour_plane_flag = vl_rbsp_u(rbsp, 1);
- sps->pic_width_in_luma_samples = vl_rbsp_ue(rbsp);
+ priv->codec_data.h265.pic_width_in_luma_samples =
+ sps->pic_width_in_luma_samples = vl_rbsp_ue(rbsp);
- sps->pic_height_in_luma_samples = vl_rbsp_ue(rbsp);
+ priv->codec_data.h265.pic_height_in_luma_samples =
+ sps->pic_height_in_luma_samples = vl_rbsp_ue(rbsp);
/* conformance_window_flag */
if (vl_rbsp_u(rbsp, 1)) {
@@ -525,16 +527,13 @@ static void vid_dec_h265_BeginFrame(vid_dec_PrivateType *priv)
if (!priv->codec) {
struct pipe_video_codec templat = {};
- omx_base_video_PortType *port;
- port = (omx_base_video_PortType *)
- priv->ports[OMX_BASE_FILTER_INPUTPORT_INDEX];
templat.profile = priv->profile;
templat.entrypoint = PIPE_VIDEO_ENTRYPOINT_BITSTREAM;
templat.chroma_format = PIPE_VIDEO_CHROMA_FORMAT_420;
templat.expect_chunked_decode = true;
- templat.width = align(port->sPortParam.format.video.nFrameWidth, 4);
- templat.height = align(port->sPortParam.format.video.nFrameHeight, 4);
+ templat.width = priv->codec_data.h265.pic_width_in_luma_samples;
+ templat.height = priv->codec_data.h265.pic_height_in_luma_samples;
templat.level = priv->codec_data.h265.level_idc;
priv->codec = priv->pipe->create_video_codec(priv->pipe, &templat);
}