From patchwork Mon Jul 29 04:43:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hutchinson X-Patchwork-Id: 50810 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:16f:b0:489:2eb3:e4c4 with SMTP id h47csp920452vqi; Sun, 28 Jul 2024 22:01:56 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVzjuTeH5f04vTaq4g+hkJDgthordofFIMzD6J755qJV6jNO+UmPan0DUzkwl3Lvw2k6dLyz+YMXkvHxEoh2TtyYsd1TX8aEAnSeg== X-Google-Smtp-Source: AGHT+IEdcD670A/PffYhFWNCKviTNKPKBNTIY9mtPLPSaC03td2zLjo272eobsggSf8Dt+BhFtFP X-Received: by 2002:a17:907:7b8b:b0:a7a:afe8:1013 with SMTP id a640c23a62f3a-a7d3f81db08mr741310366b.1.1722229315563; Sun, 28 Jul 2024 22:01:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1722229315; cv=none; d=google.com; s=arc-20160816; b=qncmOjNpheBkRW2PdtDn4zUiU9O3g7Zm4S6Ow/PbVaITvVTnaJ2kxprYZk9GdcGT4F 20jqgIJU26uYq2YrQ2pyAuU2fWSKpIpW3zeLohJAK9+f8Ng8BWBzhytYPT0H0tX4SamY KyRAuGv6csgk395dV0LHWoo1CrsRZxilqkjG9mDTqcnzYHBbuj5aN4fljX/2br1wxgZS 8zO11W+ngb1KX71uc3MZbCbPbHCX1GwXQIz9fqlrfy7GT4pVVs3+mMfh/L9oipY2DtWi Bs6YZZ6YA1KcypUZqfd9hCkXeMDuBiEtblsIpkEZaFLHXF4GexIzAQEKsaOyyVPZP5My hzEA== 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=PsGuvOk+TvG/sRQzhZAlMszXO17SBc4m0jzPrydsOMQ=; fh=dF+SszRLFyubUCP/LDvIY2NwiNB1Gp0Txz6w70WKHpo=; b=hRpOU70FUg1iDOv4LdiToWknWNGq0p7KzdWfarQbRUAouRTVIYXiWgSFBMGfK49J5x f/2xvIKRJ+eeB31M+VKeInVC9dl6DzVDQz1J97fNz/BExKMLPxcVtU1G8o5XxTEend64 IeqFigEHK9zZ8xKzlaqbRzxSHW8l1mteSYX5q3ENM0FXmq1lVPVu7f6FJV2LGRfAhUku /UHo+jo9K7wS3VKBLnqdoJEahxRUlG6g+kCf4hqTd1gUj9568NSLqsMTQn9Ot7ppsV1P rbBLsA9C/Y12h+8YvvIbt/TMLNG2MADSoHnlh7eu/LF6FTr4e3TdhDYULrKJtH/mtJJ2 BU7A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=FVGhbW5m; 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; dara=fail header.i=@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 a640c23a62f3a-a7acac63775si561470766b.627.2024.07.28.22.01.54; Sun, 28 Jul 2024 22:01: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=@gmail.com header.s=20230601 header.b=FVGhbW5m; 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; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7C3DC68D5A6; Mon, 29 Jul 2024 07:43:51 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-vk1-f174.google.com (mail-vk1-f174.google.com [209.85.221.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4145568D4AF for ; Mon, 29 Jul 2024 07:43:45 +0300 (EEST) Received: by mail-vk1-f174.google.com with SMTP id 71dfb90a1353d-4f6bc491759so880895e0c.0 for ; Sun, 28 Jul 2024 21:43:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722228223; x=1722833023; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5MxBBHidEsjbCOYcDVBkTp/J6BvX5qBaNOwG77LOhQs=; b=FVGhbW5msCZMNvxcY6AJYSNnf4Og4CiF49zLJMQQVd8owEO+UZWIb8gX4Zu4mSxW1J VzXyGULiU3++FWw91Zt8chx9wTcSTwgq97PuxpyfEFuuahjQcixfingdBihXa4WHrDDv YIf3ZuR14+jkCr0DYKczaf5TdG3UyPXQwNcaujAnFEgFbodzUDhOGyRT2l/5hOGImqG3 1j97atD/LqeVrRc2zfYQBEwpn5fT1x48/CscVzhI4Or5Rl+1WHYFMPzW71f3LvJxUFk1 Q00Nd6DkxBo3absByrVI5X9AICn0m317NtidUhzH4QTHoDCrvE2lFlryk5e6swKHMbvy 2SHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722228223; x=1722833023; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5MxBBHidEsjbCOYcDVBkTp/J6BvX5qBaNOwG77LOhQs=; b=Gvql820ndpfoZ1vlhLeMDFT2wnVYpqbOOMnVs+SFlt5EUFsoxHSMKzcIEpj9c2QxCD 8mmXORnhU5jRorhti0GHJ+aMJxZsS08Np9Z5W9qwvKau/nFuM3UaOiOMrVruIhWIHJBK IDakPVsaFZGgWKdst5jyC81NhHRvj8oLrfw1GSorbQjUhVxpo3oqNNZlxgwriIfJ1EZU faSmYgaAvNhwdS/LHIA+5H+x/YqOdL6er0Vqe2HLeucLE2NNfcrdWyFcH/3HmhBesxML bY8MbJY6Zjgba0q0xJr6OrX/zr7EOPr6D5u7bKpyh6AjQpEj/ysCgz6/uRN4K7H3Tyuc H6Mw== X-Gm-Message-State: AOJu0Yzb5pKugjfsoKgjNW+Fy0cToDxncU5Ghzamq+mSfCY9+YONFrKY 1jzo8xTUGDJFwT/Q6NXP6woJMn5/tTFVA+CGkkZnVPsN0gy8NLFvt2iiiQ== X-Received: by 2002:a05:6122:4693:b0:4f5:2276:1366 with SMTP id 71dfb90a1353d-4f6e68b1738mr2823441e0c.3.1722228222911; Sun, 28 Jul 2024 21:43:42 -0700 (PDT) Received: from cappuccino.. (syn-173-170-140-230.res.spectrum.com. [173.170.140.230]) by smtp.gmail.com with ESMTPSA id 71dfb90a1353d-4f6c86c8cecsm1023913e0c.32.2024.07.28.21.43.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jul 2024 21:43:42 -0700 (PDT) From: Stephen Hutchinson To: ffmpeg-devel@ffmpeg.org Date: Mon, 29 Jul 2024 00:43:40 -0400 Message-ID: <20240729044340.17459-1-qyot27@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/4] avformat/avisynth: move avs_planes* consts into relevant function 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: Stephen Hutchinson Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 76zzDe50i0Gw These consts are only used in the switch(planar) case located in avisynth_create_stream_video and nowhere else in the demuxer, so move them into that function directly. Signed-off-by: Stephen Hutchinson --- libavformat/avisynth.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c index b91d77b8d8..cb2be10925 100644 --- a/libavformat/avisynth.c +++ b/libavformat/avisynth.c @@ -118,17 +118,6 @@ typedef struct AviSynthContext { struct AviSynthLibrary avs_library; } AviSynthContext; -static const int avs_planes_packed[1] = { 0 }; -static const int avs_planes_grey[1] = { AVS_PLANAR_Y }; -static const int avs_planes_yuv[3] = { AVS_PLANAR_Y, AVS_PLANAR_U, - AVS_PLANAR_V }; -static const int avs_planes_rgb[3] = { AVS_PLANAR_G, AVS_PLANAR_B, - AVS_PLANAR_R }; -static const int avs_planes_yuva[4] = { AVS_PLANAR_Y, AVS_PLANAR_U, - AVS_PLANAR_V, AVS_PLANAR_A }; -static const int avs_planes_rgba[4] = { AVS_PLANAR_G, AVS_PLANAR_B, - AVS_PLANAR_R, AVS_PLANAR_A }; - static av_cold int avisynth_load_library(AviSynthContext *avs) { avs->avs_library.library = dlopen(AVISYNTH_LIB, RTLD_NOW | RTLD_LOCAL); @@ -225,6 +214,17 @@ static int avisynth_create_stream_video(AVFormatContext *s, AVStream *st) int sar_num = 1; int sar_den = 1; + static const int avs_planes_packed[1] = { 0 }; + static const int avs_planes_grey[1] = { AVS_PLANAR_Y }; + static const int avs_planes_yuv[3] = { AVS_PLANAR_Y, AVS_PLANAR_U, + AVS_PLANAR_V }; + static const int avs_planes_rgb[3] = { AVS_PLANAR_G, AVS_PLANAR_B, + AVS_PLANAR_R }; + static const int avs_planes_yuva[4] = { AVS_PLANAR_Y, AVS_PLANAR_U, + AVS_PLANAR_V, AVS_PLANAR_A }; + static const int avs_planes_rgba[4] = { AVS_PLANAR_G, AVS_PLANAR_B, + AVS_PLANAR_R, AVS_PLANAR_A }; + st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; st->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO; st->codecpar->width = avs->vi->width;