From patchwork Fri Dec 16 02:21:25 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jun Zhao X-Patchwork-Id: 1820 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.86 with SMTP id o83csp1089553vsa; Thu, 15 Dec 2016 18:21:39 -0800 (PST) X-Received: by 10.28.49.3 with SMTP id x3mr950511wmx.121.1481854899625; Thu, 15 Dec 2016 18:21:39 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id g67si1182632wmc.161.2016.12.15.18.21.39; Thu, 15 Dec 2016 18:21:39 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6C4F4689A67; Fri, 16 Dec 2016 04:21:30 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pg0-f44.google.com (mail-pg0-f44.google.com [74.125.83.44]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D9447680CC1 for ; Fri, 16 Dec 2016 04:21:23 +0200 (EET) Received: by mail-pg0-f44.google.com with SMTP id a1so3478852pgf.1 for ; Thu, 15 Dec 2016 18:21:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version; bh=v0PK3Magu8EZoFQFJkZyBpR1NFhVA1KVgHMNMykQNQQ=; b=bY9SZKEcU0hX15BqR3vgp5SffUn5XB0Gd0+SpdZu0xWrM+BuIa6dzObHaItnYnbxoF PUZft+Gur+JyfqZ+Y8Gq1cj3MeCWEstNiBebzRwdG6FgVB2LM2LrxVFD7QL3U00cF2ha qhj/8dF9ifh1e05s+TZkf12FxvJGBRgcaOtrcGkd3tBgKirNWcs34sgu7/+ManuLubqE bPx19cJTdQjikbI/sGoYgWiVy6wWYZ9NSfi7QFCiohRhuvMxEh8rbjCZpZKjdUWOazDu XhdlWcT2C5dEgpuT6e3eBZDKpflWNlgApvvUGuC5p5w1eYguJ1UShygtqF43ZoVzZDcS Q0jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version; bh=v0PK3Magu8EZoFQFJkZyBpR1NFhVA1KVgHMNMykQNQQ=; b=suEC/AW89RkDWmQH+EyG5aXnP/a33/MTX6njqGEZCgvL+V4iiiKE0xTf9Hp2wtCnIe QeJeOYpLsdnaQCpWYlhb5Ax6F312ALspCHTRt3orYZmAMMAkkaEuxF6Dw+OHfZcVN6B4 4JALJu0Fv9ud6v5MEbLmT1oKjn7JeaAXaOg18q7C4zH4IgeQHLvbZh9A0UNCxNdmbZXQ ILiw7uEYeb5yhm8sRyblSdjhMKceYx9t8N1ScMa82DMf1xucZUav44UD8pCzwRiNM3D4 a5L/m4me98GO5UwfYLyaJ0XPYtO7sCt9Thcrt5jBCE3OyssL8cWvfesJQDmPp665kbzR wEdA== X-Gm-Message-State: AKaTC02fFiQSlRsg2ppkc9O8znnjHHe672ysFppJI7qXO32tOfN8tHjqgR3vfPQ6D9FtIA== X-Received: by 10.84.168.129 with SMTP id f1mr1512452plb.42.1481854888457; Thu, 15 Dec 2016 18:21:28 -0800 (PST) Received: from [10.239.205.110] ([192.55.55.41]) by smtp.gmail.com with ESMTPSA id t184sm7299202pgt.36.2016.12.15.18.21.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Dec 2016 18:21:27 -0800 (PST) To: FFmpeg development discussions and patches , Mark Thompson , Yi Wang From: Jun Zhao Message-ID: Date: Fri, 16 Dec 2016 10:21:25 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 Content-Disposition: attachment; filename*0="0001-lavc-vaapi_encode_h264-disable-B-frame-in-baseline-p.pa"; filename*1="tch" X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: [FFmpeg-devel] [PATCH] lavc/vaapi_encode_h264: disable B frame in baseline profile 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From a4b410e02ac4864c7d82b15474a65ed42a84da6a Mon Sep 17 00:00:00 2001 From: Jun Zhao Date: Fri, 16 Dec 2016 09:49:57 +0800 Subject: [PATCH] lavc/vaapi_encode_h264: disable B frame in baseline profile. disable B frames when usd baseline/constrined baseline profile, it's base on H.264 spec Annex A.2.1. Signed-off-by: Jun Zhao Signed-off-by: Yi A Wang --- libavcodec/vaapi_encode_h264.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c index 69cc483..075f800 100644 --- a/libavcodec/vaapi_encode_h264.c +++ b/libavcodec/vaapi_encode_h264.c @@ -1190,9 +1190,19 @@ static av_cold int vaapi_encode_h264_init(AVCodecContext *avctx) switch (avctx->profile) { case FF_PROFILE_H264_CONSTRAINED_BASELINE: ctx->va_profile = VAProfileH264ConstrainedBaseline; + if (avctx->max_b_frames != 0) { + avctx->max_b_frames = 0; + av_log(avctx, AV_LOG_WARNING, "H.264 constrained baseline " + "profile don't support encode B frame.\n"); + } break; case FF_PROFILE_H264_BASELINE: ctx->va_profile = VAProfileH264Baseline; + if (avctx->max_b_frames != 0) { + avctx->max_b_frames = 0; + av_log(avctx, AV_LOG_WARNING, "H.264 baseline " + "profile don't support encode B frame.\n"); + } break; case FF_PROFILE_H264_MAIN: ctx->va_profile = VAProfileH264Main;