From patchwork Fri Oct 21 22:06:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Zern X-Patchwork-Id: 1107 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.133 with SMTP id o127csp1246815vsd; Fri, 21 Oct 2016 15:06:26 -0700 (PDT) X-Received: by 10.28.11.18 with SMTP id 18mr5433462wml.125.1477087586244; Fri, 21 Oct 2016 15:06:26 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id hd9si4445230wjc.88.2016.10.21.15.06.25; Fri, 21 Oct 2016 15:06:26 -0700 (PDT) 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=@google.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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EBD02689BA6; Sat, 22 Oct 2016 01:06:20 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf0-f176.google.com (mail-pf0-f176.google.com [209.85.192.176]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 21FB26898B3 for ; Sat, 22 Oct 2016 01:06:14 +0300 (EEST) Received: by mail-pf0-f176.google.com with SMTP id e6so63604354pfk.3 for ; Fri, 21 Oct 2016 15:06:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:subject:date:message-id:in-reply-to:references; bh=xm/7nJ5uW43G3at1eiATEz3p6fayjIzXetOLJIXYb6E=; b=h0tm9yD/KKjCynbvkVT32MQXjHigqKAE2Xt0seALJWAabjK3tIn0lUnwjRv1PXWZSv lUx5g1wbP+zYMTiqq5S643P9vjKyaGbLGEjqy0MIPhLw2qIJkxgbmGw9HU/ZbqR9g3Du z8E/Mu8K9yHPMpOiHLnpE942Ld4kpxzw4LTBj9OozmRw2rwrDXdYNRyyMXjjc+KyVj54 81IXpaZC0ZENIEoa9azFZWX0SqC5ZHGLgGYcMy5mOPwdSkRiRpITh2rx5smneFU6wMrZ dSSpxbFPdhLMi5ZjAzuQCHRL8PUPBYFYpqiurPGznzeYC7BjNz+NZISaSK9QvTLHerPU XFtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=xm/7nJ5uW43G3at1eiATEz3p6fayjIzXetOLJIXYb6E=; b=f1sEK73G+EgoxLJAoUNU5yMFpfrqPLED3XcNMTJ5fArH8Z8ofnfUPj2NN+ycKoAKRo LCCUk85g7SUrG85UijbVnQWspgIBlMTceatArWCgGb6vr5OGWZBUd55ZUzNJnUDr69oQ WEtXaOXmtepdv/mQyqDMi4QmanFSxZcPwG0dpFepXdwo8QBg6OB0PiYZLa7+G2DVo0/h czfl8H/vHL2WtEqr47ZVooRwnenzBuzWeoslM8RR+DJAsWM1Kh3jOr+eHCgTNna7Zf0/ d5WFpwZS+DljxpmNttYWq9IcT9olBH2bJmecme9h7ew/eXqs7HIUajy6OIQy3J07W/GC qXjA== X-Gm-Message-State: ABUngvfo3a7lLHW467rxaadJuZ7cRKUmZ0lHKjaVYUt4239iQWZqNK/Up+BO/FCFytaKnnZG X-Received: by 10.98.129.130 with SMTP id t124mr5389462pfd.5.1477087575265; Fri, 21 Oct 2016 15:06:15 -0700 (PDT) Received: from jzern.mtv.corp.google.com ([2620:0:1000:1600:91d2:d0c8:5038:5227]) by smtp.gmail.com with ESMTPSA id ah5sm7364326pad.30.2016.10.21.15.06.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Oct 2016 15:06:14 -0700 (PDT) Received: by jzern.mtv.corp.google.com (Postfix, from userid 105886) id 9531D80740; Fri, 21 Oct 2016 15:06:13 -0700 (PDT) From: James Zern To: ffmpeg-devel@ffmpeg.org Date: Fri, 21 Oct 2016 15:06:13 -0700 Message-Id: <1477087573-6466-1-git-send-email-jzern@google.com> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 In-Reply-To: References: Subject: [FFmpeg-devel] [PATCH] lavc/libvpxenc: fix -auto-alt-ref option type 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Kagami Hiiragi vp9_cx_iface actually allows values in range [0..2]. This fixes ticket #5894. Signed-off-by: Kagami Hiiragi --- libavcodec/libvpxenc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index 2db87f7..68f25a4 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -621,7 +621,8 @@ FF_ENABLE_DEPRECATION_WARNINGS if (ctx->flags & VP8F_AUTO_ALT_REF) ctx->auto_alt_ref = 1; if (ctx->auto_alt_ref >= 0) - codecctl_int(avctx, VP8E_SET_ENABLEAUTOALTREF, ctx->auto_alt_ref); + codecctl_int(avctx, VP8E_SET_ENABLEAUTOALTREF, + avctx->codec_id == AV_CODEC_ID_VP8 ? !!ctx->auto_alt_ref : ctx->auto_alt_ref); if (ctx->arnr_max_frames >= 0) codecctl_int(avctx, VP8E_SET_ARNR_MAXFRAMES, ctx->arnr_max_frames); if (ctx->arnr_strength >= 0) @@ -1025,7 +1026,7 @@ static int vpx_encode(AVCodecContext *avctx, AVPacket *pkt, #define COMMON_OPTIONS \ { "auto-alt-ref", "Enable use of alternate reference " \ - "frames (2-pass only)", OFFSET(auto_alt_ref), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, VE}, \ + "frames (2-pass only)", OFFSET(auto_alt_ref), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 2, VE}, \ { "lag-in-frames", "Number of frames to look ahead for " \ "alternate reference frame selection", OFFSET(lag_in_frames), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, VE}, \ { "arnr-maxframes", "altref noise reduction max frame count", OFFSET(arnr_max_frames), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, VE}, \