From patchwork Sat Feb 4 10:41:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 40250 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:5494:b0:bf:7b3a:fd32 with SMTP id i20csp1868715pzk; Sat, 4 Feb 2023 02:44:47 -0800 (PST) X-Google-Smtp-Source: AK7set8jiai6mYToAH/mjYM02Sk355Y5IzSg77A/CN4hMOvxr95hzPq3CViRLBLzyIz1X83LiPoZ X-Received: by 2002:a17:906:5dcb:b0:877:61e8:915a with SMTP id p11-20020a1709065dcb00b0087761e8915amr13927033ejv.75.1675507487405; Sat, 04 Feb 2023 02:44:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675507487; cv=none; d=google.com; s=arc-20160816; b=oQMBAJrxYumvKs96f9yZF5tXKWkl0lBwSioUSlXLF1PSl9lxSP+TVjGfn0G0kNOKQy OTxaYcTXafnksGmDnbgyX7NCW1Cb6pO3Ye7KNv8yFLD4JCUgkK1aE/s/cF3beSqcENDN zkkpB3iRwyrRgzZXKf5T5Yixih12ZuNvnnOItQsITQpxISY/fgNN+8VJMBoKwdEV8wZX LPLsM6V6PU7o/agqrbEGisO7QQAQ9dQwvzU9d23kkDY2pNzttCnja4wqc14uqJVpBdIX ffva4ISy8z8lOSZqsnOOU7i1/UKvYTd2TCzwDDzyibhrBK3X/r+kZLVomI4H5uxy11e4 Bz2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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:delivered-to; bh=ggenvQzi8xpGzmvuRY/UPQGD4vbFW8OQIuaFGXRaxtw=; b=hPbarpY7KDyr50jfPNt8D6hhelQiw0jO6zQyL0UhOlPbIDYMNWSpl31taz83sI+2LM Gpnc82qtjOv5yx0UCbS+qjdbT5/ODsrG5Mbe9nSr5dfcoSJpVxnVBMDAsyJKys8wH5sj idc5ExSAKvmNC+3EY+p1S1u4Apnlwe13u/31eKEHpYIAqy9Wp8kt4bPncwfiQ4dX9heh soEcuA7/nyUXjJDtHUX53FT4craZr16h1SsCrBkEhuU8HCrIC/A1qpTHHCsj2a587v43 Vjf9eZbpVAiz16qgMIDFkyvsGLy6ANvwR6lTpPEeXHcAJZ7A3XHHz8u3x/LJqBMOV5wn Dlsw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id mi10-20020a1709071a8a00b008786913ebd3si5302532ejc.888.2023.02.04.02.44.43; Sat, 04 Feb 2023 02:44:47 -0800 (PST) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BFC4368BE0C; Sat, 4 Feb 2023 12:44:17 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1B1AE68BD0F for ; Sat, 4 Feb 2023 12:44:09 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 96156240591 for ; Sat, 4 Feb 2023 11:44:08 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id JWBIhuL5DJ-S for ; Sat, 4 Feb 2023 11:44:06 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (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 "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id A91532404EE for ; Sat, 4 Feb 2023 11:44:06 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 14D693A034A for ; Sat, 4 Feb 2023 11:44:05 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sat, 4 Feb 2023 11:41:33 +0100 Message-Id: <20230204104204.20721-3-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230204104204.20721-1-anton@khirnov.net> References: <20230204104204.20721-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 02/33] avformat/avformat: Move codecpar up in AVStream 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: Urhg0E1DQIS8 From: Andreas Rheinhardt It is the most commonly used field and moving it to the start e.g. allows to encode the offset in a pointer+offset addressing mode on one byte on x86. Signed-off-by: Andreas Rheinhardt Signed-off-by: Anton Khirnov --- libavformat/avformat.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 53bbc0063f0..a69ee1c575c 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -962,6 +962,17 @@ typedef struct AVStream { */ int id; + /** + * Codec parameters associated with this stream. Allocated and freed by + * libavformat in avformat_new_stream() and avformat_free_context() + * respectively. + * + * - demuxing: filled by libavformat on stream creation or in + * avformat_find_stream_info() + * - muxing: filled by the caller before avformat_write_header() + */ + AVCodecParameters *codecpar; + void *priv_data; /** @@ -1097,17 +1108,6 @@ typedef struct AVStream { */ AVRational r_frame_rate; - /** - * Codec parameters associated with this stream. Allocated and freed by - * libavformat in avformat_new_stream() and avformat_free_context() - * respectively. - * - * - demuxing: filled by libavformat on stream creation or in - * avformat_find_stream_info() - * - muxing: filled by the caller before avformat_write_header() - */ - AVCodecParameters *codecpar; - /** * Number of bits in timestamps. Used for wrapping control. *