From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id A4D3A4B0C0 for ; Tue, 28 May 2024 03:07:54 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 48D7D68D4FD; Tue, 28 May 2024 06:07:52 +0300 (EEST) Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5A05968D4BE for ; Tue, 28 May 2024 06:07:46 +0300 (EEST) Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-68195b58daeso321127a12.2 for ; Mon, 27 May 2024 20:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716865664; x=1717470464; darn=ffmpeg.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=xNf49NSr2tv9D13wn63XuE/sVbIP9zBAEPC5gwAfE0o=; b=Q5Nyq1zdRI/YtUVK2gIYPYjcTM8gUdSyk+zklS0Niu8roUYChw1Xxch2idJglYz+gL M7INfJhwPKH4dfEadp1VEyGTKQo/l9Je5xV5l3GkcpruiD4MaC6gfr0V58JpkzVsQyaE kPl/ZEJVhPv+mrfqNA8kPnqF+kIjsVeCu54okjBowQiDzyF1paIC814kOQJ2SCrDW/8G PyiUZX2v18gSqnpFmnpEXqFYxIW84+kKXjTg6scHif6IyoAOZluzbZYfRZn6Vzy59Wzu xfNycEEWjZFdZU6xd8F92XxuRuulo+20mmxwB/lM2uBza+4VYGTdwqYpuCTMPr9CJET+ qOtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716865664; x=1717470464; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xNf49NSr2tv9D13wn63XuE/sVbIP9zBAEPC5gwAfE0o=; b=jzuZwRwRxDyLaE0dWvBou+NEwisHxL1+1A9KHGphnYu+jTg9FI2wKZaOymz8a9Snph /7aeh7B1yAfFL77ygFydld2COCrcdmLiS3DSKyoHldtepQN3v8XyZxmmYlvTg/Yyufwc WUPfri3rfpPwUMd1J3vMmXdTR79ZQpErtgBruaVEGmD6lZHg0rmCQHC4jw/6FnivHsgW Zq8gnhZ0jC87ZK+MZrXA8hxlCd+HrAkG0gUXlYkMsu5B5dwF9SFs0lvHr+1ayGH+hYdn KBcVGeMS7fJsly1ioAYfCX1B2vc9wxIUziETKc8FvyNl9KXEUxb7Du4Oag3s+Q+kalfr V9AA== X-Gm-Message-State: AOJu0YwWXJ8IZulELtj5LcF0eSZ5JMvFmpPxDtJVMx3ALB0WDP800cF1 d5aTBwvsi9QwOekzXwpaBDp4fly9/WmIlPqlGW2fbd4hq5Ooi+L6FOphmQ== X-Google-Smtp-Source: AGHT+IFSPoVzxb3Bco+WzRhJKZM9ssUn+6zbifwysUUIN4J9+OJWv+ota86xM4IbPfFEkETjlEq66Q== X-Received: by 2002:a17:903:230a:b0:1f3:83d:ee82 with SMTP id d9443c01a7336-1f448701bb3mr108905265ad.25.1716865663813; Mon, 27 May 2024 20:07:43 -0700 (PDT) Received: from [192.168.0.10] ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f44c7c59ebsm68939095ad.105.2024.05.27.20.07.42 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 May 2024 20:07:43 -0700 (PDT) Message-ID: <38e60694-4024-413a-81d8-dfd2c7a7c680@gmail.com> Date: Tue, 28 May 2024 00:07:41 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ffmpeg-devel@ffmpeg.org References: Content-Language: en-US From: James Almer In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH 5/7] avcodec/vc2enc: Avoid relocations for short strings 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On 5/27/2024 11:49 PM, Andreas Rheinhardt wrote: > These strings are so short that they can be put directly > into the containing structure, avoiding the pointer > and putting it into .rodata. > Also use chars for interlaced and level while at it, as > these are so small. > > Signed-off-by: Andreas Rheinhardt > --- > libavcodec/vc2enc.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c > index 3285218724..8b9641916a 100644 > --- a/libavcodec/vc2enc.c > +++ b/libavcodec/vc2enc.c > @@ -41,8 +41,9 @@ > typedef struct VC2BaseVideoFormat { > enum AVPixelFormat pix_fmt; > AVRational time_base; > - int width, height, interlaced, level; > - const char *name; > + int width, height; > + char interlaced, level; Use a fixed size type like uint8_t and not char. Neither of these values are characters (interlace should strictly speaking be a bool, but afaict that's not portable). > + char name[13]; > } VC2BaseVideoFormat; > > static const VC2BaseVideoFormat base_video_fmts[] = { _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".