From patchwork Wed Oct 19 22:47:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Degawa X-Patchwork-Id: 38827 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp602815pzb; Wed, 19 Oct 2022 15:49:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6erlR25SEPTJQWDifmsQnsp+pRmjck6LZmTAlG4bbghot0U8jew/bUUSNwdnts0lHnylNs X-Received: by 2002:a05:6402:42c7:b0:45c:a6f1:c0af with SMTP id i7-20020a05640242c700b0045ca6f1c0afmr9358915edc.75.1666219791873; Wed, 19 Oct 2022 15:49:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666219791; cv=none; d=google.com; s=arc-20160816; b=KOPGHEoZnOQBlfURP5BrfemT+7cWZi+qU56DCDMMnh7A9Z3ps1I4OnODKnR3Q7p4Lr Qm/STvF0Rc2akKyy4CZ9Kqy8M6NIdqy4lUSHf/0QBf9BWOO7us3gp6EthTed82uknNnq AdDma37uA3KvQX2N6JdGRbtIG8jSF6/1plFkofcINq85g/Uow6Nj12mWckHFFttKwahP JcYKoDdGzXvGoYyq0lUffJoGGrdfzDu3jPEVopTZ2Op72NQAuyUCSDzqsgInLZ28Ojok YvvMtDQhfQQozkzx5GteO0VhUAU2Pa5AFeuPv3EOtcDsEOo90z16W58Nk0j9y3ISXRW8 oSBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=758TJHOl54BTTlZ2v9l26IWC8TOREW9vYpznfJEJK0A=; b=vEu0iBH/3XvcbxXF8rE/2LXY7NZ7KDRCCQ02SE0xPvMfjBpXlkKOkUk/F67XwyDuh+ 2+zpYKxKCsZILTmpsp8P1mRGW61sNkHM8cEHN67XS0jFq95Bnmj3rIp5YmIfZCmTJsw7 R3JfSmdcS+YrsfGqweEuHyzIQcO/0Uzy+hQEeOcplL/JHkQjPjs3ft9qStlOxb72gb+G 1sMXtOAAfLHXj3bjOYegWOeysEFw/fe1uind18w3Tz4MkzgbJEgIcJrkLkDmrtAanxNg tyP0WJUJJRVdq/hrRRt5QY/aUsxUJsE9BWY2lLpSchmm7qT/Lxpb33bbrowk61cR5l1g 39xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@randomderp.com header.s=default header.b=huDy2eo3; 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=NONE dis=NONE) header.from=randomderp.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l15-20020a170906794f00b0078333d9f17bsi16834913ejo.819.2022.10.19.15.49.50; Wed, 19 Oct 2022 15:49:51 -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=@randomderp.com header.s=default header.b=huDy2eo3; 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=NONE dis=NONE) header.from=randomderp.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 60E5068BD63; Thu, 20 Oct 2022 01:49:46 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from degawa.com (174-127-109-95.slc.westdc.net [174.127.109.95]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 51DDA68BCAA for ; Thu, 20 Oct 2022 01:49:39 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=randomderp.com; s=default; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=FzUTvRG5r0+PBsZRs5M+oDNJ/NmrDmWKcqlmRbiOCfE=; b=huDy2eo3u1J4AKl+NvuDnbSSad WdhuJ50jJ6Q+ngtCctr1DBkRqTNAqRBIWCvxCXUhCiH1vlqOVH+7d1Ek8yXbDBCR5UXTxKMyWaa+t Wl7GlNh1H+JQNtPoRCeYJHQv8MBLMqM9CgsWSscIsI6k0g7e/+N1PiREbCKecO/mCHUEDtBhRTLHH V58LKnYyuuOAr4RVMvrSuEfLov82bLUOyHTNEo5b9lw6B1xUX62J5XjNcubkPBX+Tx1AS/27EEKqI LFrT8NpihbkxvsUclfLNAU1acg7HtanPkwk3ISYUqBBXLqCOmJqm7XL14Xy+PF2GOZWdFJO/q30HM 35oUv0yA==; Received: from c-75-64-74-17.hsd1.tn.comcast.net ([75.64.74.17]:49782 helo=localhost.localdomain) by slmp-550-1.slc.westdc.net with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1olHsX-0002CA-G5; Wed, 19 Oct 2022 16:49:35 -0600 From: Christopher Degawa To: ffmpeg-devel@ffmpeg.org Date: Wed, 19 Oct 2022 17:47:11 -0500 Message-Id: <20221019224712.194658-1-ccom@randomderp.com> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - slmp-550-1.slc.westdc.net X-AntiAbuse: Original Domain - ffmpeg.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - randomderp.com X-Get-Message-Sender-Via: slmp-550-1.slc.westdc.net: authenticated_id: ccom/from_h X-Authenticated-Sender: slmp-550-1.slc.westdc.net: ccom@randomderp.com X-Source: X-Source-Args: X-Source-Dir: Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/libsvtav1: remove compressed_ten_bit_format and simplify alloc_buffer 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: Christopher Degawa Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: x3SdxzdEXTBa From: Christopher Degawa compressed_ten_bit_format has been deprecated upstream and has no effect and can be removed. Plus, technically it was never used in the first place since it would require the app (ffmpeg) to set it and do additional processing of the input frames. Also simplify alloc_buffer by removing calculations relating to the non-existant processing. Signed-off-by: Christopher Degawa --- libavcodec/libsvtav1.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c index 2f5634cee0..28da206cf8 100644 --- a/libavcodec/libsvtav1.c +++ b/libavcodec/libsvtav1.c @@ -124,16 +124,12 @@ static int svt_print_error(void *log_ctx, EbErrorType err, static int alloc_buffer(EbSvtAv1EncConfiguration *config, SvtContext *svt_enc) { - const int pack_mode_10bit = - (config->encoder_bit_depth > 8) && (config->compressed_ten_bit_format == 0) ? 1 : 0; - const size_t luma_size_8bit = - config->source_width * config->source_height * (1 << pack_mode_10bit); - const size_t luma_size_10bit = - (config->encoder_bit_depth > 8 && pack_mode_10bit == 0) ? luma_size_8bit : 0; + const size_t luma_size = config->source_width * config->source_height * + (config->encoder_bit_depth > 8 ? 2 : 1); EbSvtIOFormat *in_data; - svt_enc->raw_size = (luma_size_8bit + luma_size_10bit) * 3 / 2; + svt_enc->raw_size = luma_size * 3 / 2; // allocate buffer for in and out svt_enc->in_buf = av_mallocz(sizeof(*svt_enc->in_buf));