summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Liu <leo.liu@amd.com>2016-10-24 14:03:11 -0400
committerEmil Velikov <emil.l.velikov@gmail.com>2016-11-01 12:55:49 +0000
commit8daa9b33c02ad76ecbdcc96796ae1786b6b8047f (patch)
tree40a718bd5a60287ddb08bf6302e5f50532fc202c
parent16a4d76374d8d8a0f3bf8e6c1642c37c555da53e (diff)
downloadexternal_mesa3d-8daa9b33c02ad76ecbdcc96796ae1786b6b8047f.zip
external_mesa3d-8daa9b33c02ad76ecbdcc96796ae1786b6b8047f.tar.gz
external_mesa3d-8daa9b33c02ad76ecbdcc96796ae1786b6b8047f.tar.bz2
st/omx/dec: disable tunnel for size different case
When the video coded size is different from frame size, we need the result buffers are same as coded size, which are not size compatible with encode required size, so that simply use no tunnel for this case instead of frame by frame converting. Signed-off-by: Leo Liu <leo.liu@amd.com> Cc: 13.0 <mesa-stable@lists.freedesktop.org> (cherry picked from commit 06e3cd6a45ae2ad19f77e0f283c46d5f85112847)
-rw-r--r--src/gallium/state_trackers/omx/vid_dec.c2
-rw-r--r--src/gallium/state_trackers/omx/vid_dec.h1
-rw-r--r--src/gallium/state_trackers/omx/vid_dec_h265.c9
3 files changed, 11 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/omx/vid_dec.c b/src/gallium/state_trackers/omx/vid_dec.c
index e51a747..9a6efb8 100644
--- a/src/gallium/state_trackers/omx/vid_dec.c
+++ b/src/gallium/state_trackers/omx/vid_dec.c
@@ -621,7 +621,7 @@ static void vid_dec_FrameDecoded(OMX_COMPONENTTYPE *comp, OMX_BUFFERHEADERTYPE*
}
if (input->pInputPortPrivate) {
- if (output->pInputPortPrivate) {
+ if (output->pInputPortPrivate && !priv->disable_tunnel) {
struct pipe_video_buffer *tmp, *vbuf, *new_vbuf;
tmp = output->pOutputPortPrivate;
diff --git a/src/gallium/state_trackers/omx/vid_dec.h b/src/gallium/state_trackers/omx/vid_dec.h
index 35a5758..90acf7b 100644
--- a/src/gallium/state_trackers/omx/vid_dec.h
+++ b/src/gallium/state_trackers/omx/vid_dec.h
@@ -129,6 +129,7 @@ DERIVEDCLASS(vid_dec_PrivateType, omx_base_filter_PrivateType)
bool frame_started; \
unsigned bytes_left; \
const void *slice; \
+ bool disable_tunnel; \
struct vl_compositor compositor; \
struct vl_compositor_state cstate;
ENDCLASS(vid_dec_PrivateType)
diff --git a/src/gallium/state_trackers/omx/vid_dec_h265.c b/src/gallium/state_trackers/omx/vid_dec_h265.c
index b9ac654..3242dbe 100644
--- a/src/gallium/state_trackers/omx/vid_dec_h265.c
+++ b/src/gallium/state_trackers/omx/vid_dec_h265.c
@@ -614,6 +614,8 @@ static void vid_dec_h265_BeginFrame(vid_dec_PrivateType *priv)
if (!priv->codec) {
struct pipe_video_codec templat = {};
+ omx_base_video_PortType *port = (omx_base_video_PortType *)
+ priv->ports[OMX_BASE_FILTER_INPUTPORT_INDEX];
templat.profile = priv->profile;
templat.entrypoint = PIPE_VIDEO_ENTRYPOINT_BITSTREAM;
@@ -623,6 +625,13 @@ static void vid_dec_h265_BeginFrame(vid_dec_PrivateType *priv)
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);
+
+ /* disable transcode tunnel if video size is different from coded size */
+ if (priv->codec_data.h265.pic_width_in_luma_samples !=
+ port->sPortParam.format.video.nFrameWidth ||
+ priv->codec_data.h265.pic_height_in_luma_samples !=
+ port->sPortParam.format.video.nFrameHeight)
+ priv->disable_tunnel = true;
}
vid_dec_NeedTarget(priv);