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 5BA674AF2E for ; Fri, 24 May 2024 09:19:57 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D747068D53F; Fri, 24 May 2024 12:19:54 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 503CD68D39C for ; Fri, 24 May 2024 12:19:48 +0300 (EEST) Authentication-Results: mail0.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=oGW0zfK6; dkim-atps=neutral Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id D88EC240DAC for ; Fri, 24 May 2024 11:19:47 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id OmA5V16ZUWmh for ; Fri, 24 May 2024 11:19:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1716542387; bh=GILSRwbOMgK7n4P4p+MWiDLhJyceW+REt6rSv0nG3qk=; h=Subject:From:To:In-Reply-To:References:Date:From; b=oGW0zfK6duCwHndgU/l7rQqDYTwq2PUoy2u7qjwOzN4wM3fbrA8vxcR6CNyVYddj1 TLrXoZzH8ymhvzb9EbsZhHRZYVLtb7bzUapxrSVlQCBSz/j3djGjyK+eChWOPGKbIK 4hWMI/CESb4XTX4KptszmdulL7SFqX2bh5esVrt7scx2v6RPp6V29K6YbT1sO4rWoC JEE4dYDzCgLRehTNwBy65OJ0Pkp3H7+Z4Gt7myBlLOLYo0TajNVs7e8A1XWwPcMV2O efNuWkAUhlOxeoZgp+HPVlaSSYx7mOezHPqGDW6RIeq4eKzAW/tVjf9l11vJnmv6Ys NjFpgz2fY69sg== Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 56B982404E5 for ; Fri, 24 May 2024 11:19:47 +0200 (CEST) Received: by lain.khirnov.net (Postfix, from userid 1000) id 3298E1601B9; Fri, 24 May 2024 11:19:47 +0200 (CEST) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: <10d1bd4f-674b-4202-8b28-7fb02235c6df@gmail.com> References: <20240410133118.28144-1-anton@khirnov.net> <20240410133118.28144-10-anton@khirnov.net> <10d1bd4f-674b-4202-8b28-7fb02235c6df@gmail.com> Mail-Followup-To: FFmpeg development discussions and patches Date: Fri, 24 May 2024 11:19:47 +0200 Message-ID: <171654238717.28895.7356996411477669686@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 10/10] lavc/hevc_ps: compactify ShortTermRPS 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Quoting James Almer (2024-04-11 14:35:37) > > diff --git a/libavcodec/hevc_ps.h b/libavcodec/hevc_ps.h > > index 92b85115f7..a8d07aa1b2 100644 > > --- a/libavcodec/hevc_ps.h > > +++ b/libavcodec/hevc_ps.h > > @@ -70,16 +70,19 @@ typedef struct HEVCHdrParams { > > } HEVCHdrParams; > > > > typedef struct ShortTermRPS { > > - uint8_t rps_predict; > > - unsigned int delta_idx; > > - uint8_t use_delta_flag; > > - uint8_t delta_rps_sign; > > - unsigned int abs_delta_rps; > > - unsigned int num_negative_pics; > > - int num_delta_pocs; > > - int rps_idx_num_delta_pocs; > > int32_t delta_poc[32]; > > uint32_t used; > > + > > + uint8_t delta_idx; > > + uint8_t num_negative_pics; > > + uint8_t num_delta_pocs; > > + uint8_t rps_idx_num_delta_pocs; > > + > > + uint16_t abs_delta_rps; > > + unsigned delta_rps_sign:1; > > Wont the compiler add two bytes of padding if you put this here? No. Pahole says struct ShortTermRPS { int32_t delta_poc[32]; /* 0 128 */ /* --- cacheline 2 boundary (128 bytes) --- */ uint32_t used; /* 128 4 */ uint8_t delta_idx; /* 132 1 */ uint8_t num_negative_pics; /* 133 1 */ uint8_t num_delta_pocs; /* 134 1 */ uint8_t rps_idx_num_delta_pocs; /* 135 1 */ uint16_t abs_delta_rps; /* 136 2 */ /* Bitfield combined with previous fields */ unsigned int delta_rps_sign:1; /* 136:16 4 */ unsigned int rps_predict:1; /* 136:17 4 */ unsigned int use_delta:1; /* 136:18 4 */ /* size: 140, cachelines: 3, members: 10 */ /* bit_padding: 13 bits */ /* last cacheline: 12 bytes */ }; -- Anton Khirnov _______________________________________________ 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".