From patchwork Sun Nov 18 07:19:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: hwrenx X-Patchwork-Id: 11063 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id AC51244E079 for ; Sun, 18 Nov 2018 09:27:39 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 38A8B689ADD; Sun, 18 Nov 2018 09:27:40 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from qq.com (smtpbg401.qq.com [113.96.223.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D218B680CAE for ; Sun, 18 Nov 2018 09:27:32 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1542526049; bh=RPKeKWNNPM2cn9TI2ktrpS8Zg2ppOLFvCeH446OLWtg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=JL1NgJj2RrpOlJxIqxBCKrTq+67Cl1Bd5pLp22U4nl+v9HWx7QQwVTA5HHz3TEfoU wEhY7S7pXiZ67EaHxwjJPESMmOvap3g1bwofAOR1MdsSqiQlmSY8M3dG9sycKHJkXQ jXnoLuOthOWwqr+GzxtGMKP9TFrS6DzIofJb7F9Q= X-QQ-Spam: true X-QQ-mid: esmtp6t1542525548tzpgmfe5m Received: from localhost.localdomain (unknown [124.205.77.56]) by esmtp4.qq.com (ESMTP) with id ; Sun, 18 Nov 2018 15:19:08 +0800 (CST) X-QQ-SSF: 010000000000000092620F000000000 From: hwrenx To: ffmpeg-devel@ffmpeg.org Date: Sun, 18 Nov 2018 15:19:04 +0800 Message-Id: <1542525544-8034-3-git-send-email-hwrenx@qq.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1542525544-8034-1-git-send-email-hwrenx@qq.com> References: <1542525544-8034-1-git-send-email-hwrenx@qq.com> X-QQ-SENDSIZE: 520 Feedback-ID: esmtp:qq.com:bgweb:bgweb15 Subject: [FFmpeg-devel] [PATCH v2 3/3] lavc/libdavs2: add disable_avx into decoder parameter X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: hwrenx MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: hwrenx Signed-off-by: hwrenx --- libavcodec/libdavs2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/libdavs2.c b/libavcodec/libdavs2.c index cadf995..8cef49d 100644 --- a/libavcodec/libdavs2.c +++ b/libavcodec/libdavs2.c @@ -42,11 +42,14 @@ typedef struct DAVS2Context { static av_cold int davs2_init(AVCodecContext *avctx) { DAVS2Context *cad = avctx->priv_data; + int cpu_flags = av_get_cpu_flags(); /* init the decoder */ cad->param.threads = avctx->thread_count; cad->param.info_level = 0; cad->decoder = davs2_decoder_open(&cad->param); + cad->param.disable_avx = !(cpu_flags & AV_CPU_FLAG_AVX && + cpu_flags & AV_CPU_FLAG_AVX2); if (!cad->decoder) { av_log(avctx, AV_LOG_ERROR, "decoder created error.");