OSDN Git Service

intel_mfc_brc_prepare() only works for H.264 or H.264 MVC
authorXiang, Haihao <haihao.xiang@intel.com>
Tue, 13 Sep 2016 08:02:30 +0000 (16:02 +0800)
committerXiang, Haihao <haihao.xiang@intel.com>
Mon, 31 Oct 2016 01:58:57 +0000 (09:58 +0800)
v2: rebased

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Tested-by: Luo, Focus <focus.luo@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
(cherry picked from commit 6fdf1905eb13597767c65e9f5839edf3986b6a1c)

src/gen6_mfc_common.c

index faabbe7..9522c4f 100644 (file)
@@ -422,9 +422,12 @@ void intel_mfc_brc_prepare(struct encode_state *encode_state,
     unsigned int rate_control_mode = encoder_context->rate_control_mode;
     struct gen6_mfc_context *mfc_context = encoder_context->mfc_context;
 
+    if (encoder_context->codec != CODEC_H264 &&
+        encoder_context->codec != CODEC_H264_MVC)
+        return;
+
     if (rate_control_mode == VA_RC_CBR) {
         bool brc_updated;
-        assert(encoder_context->codec != CODEC_MPEG2);
 
         brc_updated = intel_mfc_brc_updated_check(encode_state, encoder_context);