Module: Mesa
Branch: master
Commit: 3642ee846a0eadd8c0554c66dc8d9114307f9d34
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3642ee846a0eadd8c0554c66dc8d9114307f9d34

Author: Leo Liu <[email protected]>
Date:   Fri May 30 15:57:29 2014 -0400

st/omx/enc: enable b frames

Signed-off-by: Leo Liu <[email protected]>
Reviewed-by: Christian König <[email protected]>

---

 src/gallium/state_trackers/omx/vid_enc.c |    6 ++++--
 src/gallium/state_trackers/omx/vid_enc.h |    2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/gallium/state_trackers/omx/vid_enc.c 
b/src/gallium/state_trackers/omx/vid_enc.c
index f828d05..d16fa01 100644
--- a/src/gallium/state_trackers/omx/vid_enc.c
+++ b/src/gallium/state_trackers/omx/vid_enc.c
@@ -664,7 +664,8 @@ static OMX_ERRORTYPE 
vid_enc_MessageHandler(OMX_COMPONENTTYPE* comp, internalReq
                             priv->scale.xWidth : 
port->sPortParam.format.video.nFrameWidth;
          templat.height = priv->scale_buffer[priv->current_scale_buffer] ?
                             priv->scale.xHeight : 
port->sPortParam.format.video.nFrameHeight;
-         templat.max_references = OMX_VID_ENC_P_PERIOD_DEFAULT;
+         templat.max_references = (templat.profile == 
PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE) ?
+                            1 : OMX_VID_ENC_P_PERIOD_DEFAULT;
 
          priv->codec = priv->s_pipe->create_video_codec(priv->s_pipe, 
&templat);
 
@@ -1120,7 +1121,8 @@ static OMX_ERRORTYPE 
vid_enc_EncodeFrame(omx_base_PortType *port, OMX_BUFFERHEAD
       picture_type = PIPE_H264_ENC_PICTURE_TYPE_IDR;
       priv->force_pic_type.IntraRefreshVOP = OMX_FALSE; 
       priv->frame_num = 0;
-   } else if (!(priv->pic_order_cnt % OMX_VID_ENC_P_PERIOD_DEFAULT) ||
+   } else if (priv->codec->profile == PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE ||
+              !(priv->pic_order_cnt % OMX_VID_ENC_P_PERIOD_DEFAULT) ||
               (buf->nFlags & OMX_BUFFERFLAG_EOS)) {
       picture_type = PIPE_H264_ENC_PICTURE_TYPE_P;
    } else {
diff --git a/src/gallium/state_trackers/omx/vid_enc.h 
b/src/gallium/state_trackers/omx/vid_enc.h
index a49f249..47e4b96 100644
--- a/src/gallium/state_trackers/omx/vid_enc.h
+++ b/src/gallium/state_trackers/omx/vid_enc.h
@@ -60,7 +60,7 @@
 #define OMX_VID_ENC_SCALING_WIDTH_DEFAULT 0xffffffff
 #define OMX_VID_ENC_SCALING_HEIGHT_DEFAULT 0xffffffff
 #define OMX_VID_ENC_IDR_PERIOD_DEFAULT 1000
-#define OMX_VID_ENC_P_PERIOD_DEFAULT 1
+#define OMX_VID_ENC_P_PERIOD_DEFAULT 3
 
 #define OMX_VID_ENC_NUM_SCALING_BUFFERS 4
 

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to