From patchwork Fri Oct 21 03:55:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Degawa X-Patchwork-Id: 38861 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp528501pzb; Thu, 20 Oct 2022 20:55:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5uXXjyF4SGS3nPsJDPAgUcY0FR0KM/ivTRKYRG9S1SMSCqOk5d73VcK069DtXWJnfpXUxR X-Received: by 2002:a05:6402:3592:b0:45c:fb8a:c57d with SMTP id y18-20020a056402359200b0045cfb8ac57dmr15511978edc.290.1666324555945; Thu, 20 Oct 2022 20:55:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666324555; cv=none; d=google.com; s=arc-20160816; b=yc1Q/zhCtuBAQZe6WMaX8rag+SYVie8WFU0P/618sDrTg0GBX6rJnXLTimVjdhKhez 5RZgdLd3qrmxgcj9cxwjs7tRLkqiK/WI2XDxaGsYolcwE3U8l5iELC3kxc8FiuNhAzyU Vywmy6SIgLqi5T1jNeGyi69Q2whYxr2Z9JySiUXf82hhmrlmr/804JFD1IToJ1HoKZLq INWibBPsBU4jaACjbku4EYc6Qp7OidEOpMzjiuIct/BmhK5xikod82kxXgeR7ObB8pJ2 mZnKqa3XHEfeBJ5VZQEKyUQQ0oW8lhKlqhGZv5fmgFbib7V/Sg0VGNQtIEIOzWXaD5PR Qd/A== 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:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=3z0nOXRii5al6ix6G1fM2+5Ud9s2pzIYWxquwxRWFpQ=; b=so9Cq08Z7hiCfK7ISBcrSsCEgzfC2C+ITu9bwMobntGl/ddjsaNmxBMvPU2FHsXHBC r4nHdZVOe7szw8rSviNgZd5eN4h1hGYEpSDIRqdU8yvhGPx+sNA5eXv+hCuI5JFr4iaQ frtlBK5c11RmDzyLSAXNHLg0ktgobNjEvyvqocr6Lq6bYvLzCF/M0M7ZczUko/RdVPUQ GTCk4WlV/JQH5hBqkVLHf4CzrnSYQcTFumYSOQpN/c6E8IUpV7cX4y5xvXe6KO7vhdh8 0EdiE43gsb8Vg0QzPThwPnz6qw+SEEWwSi7pVr1xUM4GixbGNWK0xx1llLrzxXyRzyeI FSxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@randomderp.com header.s=default header.b=c17vBg9A; 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 y11-20020a056402358b00b0045d22bc81a0si19402180edc.231.2022.10.20.20.55.55; Thu, 20 Oct 2022 20:55:55 -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=c17vBg9A; 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 5C87C68BE23; Fri, 21 Oct 2022 06:55:52 +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 4095768BE04 for ; Fri, 21 Oct 2022 06:55:45 +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: References:In-Reply-To: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:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=j73JFItxYVKhJJkq20tsythv1hca3AZUac/kcAMvTPs=; b=c17vBg9AXFba2gMTB/5ej95U27 VQ/9BWTyUH8oF3sX2R6zwioMmslis3GWdiKX9/HnMOxdfycfNyDMbjvRnp7c5wCWBjQX20f8mWZ9+ I4WMheNSI2tC6ZCUfrbDctsiRmPMcwWGFu8LmTecZBdb80KX6PWfCjJNkWNSwhd8RPePX+80r4Y/a 14IMlh09/7DGWrGymV2Kl8vDV7m144dau21U+em68NrWd5IQbNUn0puLSg8BC8+kF9S12sxqXlRJW hVkohih2LGZuQNuygethAeHSx1L+eeLZOWbLnW4wyorwNXSBiab5tbBntR06LPr+0NgJRd55XmCbr m/OMpSBQ==; Received: from 108-216-168-194.lightspeed.mmphtn.sbcglobal.net ([108.216.168.194]:45254 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 1olj8L-0000Ez-BY; Thu, 20 Oct 2022 21:55:43 -0600 From: Christopher Degawa To: ffmpeg-devel@ffmpeg.org Date: Thu, 20 Oct 2022 22:55:27 -0500 Message-Id: <20221021035528.413664-1-ccom@randomderp.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221019224712.194658-2-ccom@randomderp.com> References: <20221019224712.194658-2-ccom@randomderp.com> 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 v2 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: ulj8lCrcha7F 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));