From patchwork Tue Jun 22 01:36:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 28597 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6602:2042:0:0:0:0 with SMTP id z2csp2505150iod; Mon, 21 Jun 2021 18:36:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzO+bhVjEipaMFelVeNI7Ag6JTz+QKtIqqJt6Gqm7fN6zo7fapuhfYP4FdXR5SN3EBjEg5t X-Received: by 2002:a17:906:5ace:: with SMTP id x14mr1050536ejs.507.1624325780242; Mon, 21 Jun 2021 18:36:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624325780; cv=none; d=google.com; s=arc-20160816; b=IirVNoyLTOCUESMMqZO5Lp7Yd5OlU0GE1IoMNvOZcPEfcTOOaqoTPVbzzb/Z+v3VrT 6NBk4sYNpSClvWtyB2u7kXO6CQyUTeYS/Y+akfkHU42qdXrVBBiD4jDrNs3fEd2RONGM PeJL+0Y5gr4u8MMXeyYUgVohH/zfqVygMjavPU0PkumIzqAUJihEcC67BAId47Dwdod/ lvBAU3x/mkzAlczVX/MYU9Y68Pa2KvYCKxebFanWGi81+HK8XomBeV+0emPG+J71X+IP G3xx83eJDS5uIXd4WfKtUKP3s1H8fZ+5fKTf4LgX5SKmo3hsW50HydfQqbuccud4tb1O TBTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to; bh=oDalBwVJcXf2y7ShRa1XEVgooX6nPhISRUfqDVsgYjY=; b=i3CurJsx9IJKK9b6FvNpCD3vuDVR/sIb8lRysgkPpjcNue5HwpxV/3FGdLI8TR37y+ BDpQIQIYKaTdze3V8CcK39KHK4UZt6WhFRjXgtagFh7B0gP3JV7pmXPFDaVFwGi4HVTv WWUG4WR1LhMvJ477E2yeGmXYymhC0XXPhjwtsKlv1Euo/sHOVw4mG6MZoFbJLumDFu+1 eaWQoNwptC+oe2BAmiD5hpopWQWZ2dD5Oje//lPrF+AKQdBqAeXLQkYMTl+18gaTlqUI /fWic1A8h7BganwOtFBMAs8IfTTqfS5H0WHlp3chhR8vaje+TxkxZLF6x1VJh8MpIqTJ bGXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=nV9vbh4e; 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 sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id w9si11962404ejk.580.2021.06.21.18.36.19; Mon, 21 Jun 2021 18:36:20 -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=@gmail.com header.s=20161025 header.b=nV9vbh4e; 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 sp=QUARANTINE 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 2E1CB689F8E; Tue, 22 Jun 2021 04:36:17 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D8B846801E6 for ; Tue, 22 Jun 2021 04:36:10 +0300 (EEST) Received: by mail-pl1-f182.google.com with SMTP id v12so9594242plo.10 for ; Mon, 21 Jun 2021 18:36:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nEKtV/11FiZxdWyqKlA2CoPC1FXQDFar1HwmWkxI1u4=; b=nV9vbh4eDVowVyeYICmZDGgz0Umo7o8Kq90y3TJ3jLKQHgHOlUCp5jHGsDfpZIbh6K 2mqfREC9y/oJYmFpxcHp6giIFFPqFqAGrlE3AFmFs3ySU8VIpAIlY43A5nKPRC3vr3Nw 0Nwb7RHOmTk0fQ8D+WbKg/pEN12Y9cRyF1AkuwSF6DJ+t2AbE92eWWB778B/c5B66wJ7 PpmwKjlvcuFbxp4hP4essGI3ti9bjHpJnqpVkztzrWCaOL0pAcJDBgiIgzzddWUwFEgW 3yGlgte3uhKVVzospzDYc57ifRwOMSjT7ITomQa2K9g03q5Ms0mLLVc2+m2SXXV/SDwQ znIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nEKtV/11FiZxdWyqKlA2CoPC1FXQDFar1HwmWkxI1u4=; b=D6KJwv/rh4s+1eFKa2uH3UwvxZg2efoWk+PfgIt3wUPTjSA6IDWRuvgbkBrhsjDJSa IgF2PtrbioIa9huTFr0FS+wri0qMLtbL/ZHxj/hCfrEQRIlEHowDxm2KvKCPMwHz3T41 7k5kiQMBD4fl2K01faP6k80YVVacdzij+Dkl6rH+ap3gvbs9bt/nmS6ZbI/cMU4NukR0 2ymw1raibarg8tafIjbh8Rp1UXusNFBY1c7wfNK9N8GYD/WbcfjCKvxDGG1fGWHX9ajC k/1MPrnctQJF9X2/5oAW8PmJFScE/byzPZHniN0M2ulQ5ZS1yO/w3oJ8bHhbF908krGs grxg== X-Gm-Message-State: AOAM530BqhN67qY/e7O/2QEO1mpLcLzBnpncpjshGx93G5/wxEG/u4oT /V1vhElMAvvbfJqTazJojgZGAqMHl04= X-Received: by 2002:a17:902:820c:b029:123:4141:c8a9 with SMTP id x12-20020a170902820cb02901234141c8a9mr12246919pln.5.1624325768486; Mon, 21 Jun 2021 18:36:08 -0700 (PDT) Received: from vpn2.localdomain ([161.117.202.209]) by smtp.gmail.com with ESMTPSA id p26sm7291389pgc.53.2021.06.21.18.36.07 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Jun 2021 18:36:08 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Tue, 22 Jun 2021 09:36:04 +0800 Message-Id: <1624325764-27028-1-git-send-email-lance.lmwang@gmail.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1624153359-28171-1-git-send-email-lance.lmwang@gmail.com> References: <1624153359-28171-1-git-send-email-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v3 1/2] avcodec/libx264: Add support for Sony XAVC Class 300 and 480 X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: yAZpS+s2tuUd From: Limin Wang Signed-off-by: Limin Wang --- libavcodec/libx264.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index 36fdb56..d580f5a 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -749,6 +749,19 @@ static av_cold int X264_init(AVCodecContext *avctx) av_log(avctx, AV_LOG_ERROR, "x264 too old for AVC Intra, at least version 142 needed\n"); #endif + +#if X264_BUILD >= 142 + if (x4->avcintra_class > 200) { +#if X264_BUILD < 164 + av_log(avctx, AV_LOG_ERROR, + "x264 too old for AVC Intra 300/480, at least version 164 needed\n"); + return AVERROR(EINVAL); +#endif + /* AVC-Intra 300/480 only supported by Sony XAVC flavor */ + x4->params.i_avcintra_flavor = X264_AVCINTRA_FLAVOR_SONY; + } +#endif + if (x4->b_bias != INT_MIN) x4->params.i_bframe_bias = x4->b_bias; if (x4->b_pyramid >= 0) @@ -1082,7 +1095,7 @@ static const AVOption options[] = { { "none", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_NONE}, INT_MIN, INT_MAX, VE, "nal-hrd" }, { "vbr", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_VBR}, INT_MIN, INT_MAX, VE, "nal-hrd" }, { "cbr", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = X264_NAL_HRD_CBR}, INT_MIN, INT_MAX, VE, "nal-hrd" }, - { "avcintra-class","AVC-Intra class 50/100/200", OFFSET(avcintra_class),AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 200 , VE}, + { "avcintra-class","AVC-Intra class 50/100/200/300/480", OFFSET(avcintra_class),AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 480 , VE}, { "me_method", "Set motion estimation method", OFFSET(motion_est), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, X264_ME_TESA, VE, "motion-est"}, { "motion-est", "Set motion estimation method", OFFSET(motion_est), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, X264_ME_TESA, VE, "motion-est"}, { "dia", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = X264_ME_DIA }, INT_MIN, INT_MAX, VE, "motion-est" },