From patchwork Fri Dec 6 03:15:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andriy Gelman X-Patchwork-Id: 16608 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 19A8C44AA71 for ; Fri, 6 Dec 2019 05:24:15 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E8E3D68B5AA; Fri, 6 Dec 2019 05:24:14 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qt1-f193.google.com (mail-qt1-f193.google.com [209.85.160.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2777368B5A8 for ; Fri, 6 Dec 2019 05:24:09 +0200 (EET) Received: by mail-qt1-f193.google.com with SMTP id w47so5806050qtk.4 for ; Thu, 05 Dec 2019 19:24:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=RjSbVJL8R5nPlzpwbfs5PMlEzPdoRfCrp9OeM7BCArA=; b=RyhC/4ZrWV37N4dkD1ZBlbHlrzKFChYhTdITmV3skRCXItP9Sdo3q6WZA/UwImXVOS 3ANKOEKeLIAFju2gzUvmA0H2pN78BCVLa79K/iFPaftVcjSHCOv86NQbJfGYLgI+Y8dg lNer35O9evpsC/Jk6So1tmu3RpZrfq/vrgmpaBnfe55adnSaAy0uLWPoUe4Tl/IUJ0PM SUu65G/xu79TGYKdjU/ftl3KQlGU/KA89wav9/40OWajUhariKTeqm/v/maBL3CfWU71 jmkO1WXtM7w3EwXXL3SFdh0WH9js1PMUUN2+xii8Rpyg7Na17OuTQGGb+FS4Ok+xd9dW KVhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RjSbVJL8R5nPlzpwbfs5PMlEzPdoRfCrp9OeM7BCArA=; b=Qgpm593vdtQMr+Wo1HkWDOzpm4MhQ+DIM35CIKVxlf0xWveWWHaaaEY88C5Zr+FH2y 8wJ+jVWRoeHqREhgraO2zMMw2+39yJ4Tb9EuJhS99rTgqaQvmALZbaGTmW3X2jXYF7/d vwyvOyTge+pBijXCeb1j4VeDdjttSEEFBiO+llbpkA6czshVdQA0HqBM3Y/ek7/mHmK6 ggcjYsZQMfwtv8bV/VyhVDjwchmCsfcNhvEEMHDOHYhtcjp6rRjl5XmxCMUmWBTOT/Ho zWD2SGu7wCgB6FKrGGJJbpPWwYX74Vz02QXYuNVBYpIzICd3Oefp1rxZlp0be5Yc/VBn DPPQ== X-Gm-Message-State: APjAAAWt9c2erB0GBmHmPuUwe1EF9DJ83KXyYTbozwRiraTUx+fW/F27 hpAgGSxo6bIA08HCONbcVwUyk5Ed X-Google-Smtp-Source: APXvYqxyQ9ip4m+W24Z/kE3MfLoHiv04y91ALj+5vQrkqsg+L5XkLEqvHBmr8hsH/RVKegIINBAquw== X-Received: by 2002:a05:620a:1137:: with SMTP id p23mr7732791qkk.160.1575602162745; Thu, 05 Dec 2019 19:16:02 -0800 (PST) Received: from localhost.localdomain (c-71-232-27-28.hsd1.ma.comcast.net. [71.232.27.28]) by smtp.gmail.com with ESMTPSA id f26sm5969476qtv.77.2019.12.05.19.16.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2019 19:16:02 -0800 (PST) From: Andriy Gelman X-Google-Original-From: Andriy Gelman To: ffmpeg-devel@ffmpeg.org Date: Thu, 5 Dec 2019 22:15:42 -0500 Message-Id: <20191206031542.20853-2-andriy.gelman@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191206031542.20853-1-andriy.gelman@gmail.com> References: <20191206031542.20853-1-andriy.gelman@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 2/2] lavc/h2645_parse: Reorder H2645NAL to reduce size X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: Andriy Gelman Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Andriy Gelman Size of H2645NAL reduced from 112 to 104 bytes on x86-64. Signed-off-by: Andriy Gelman --- libavcodec/h2645_parse.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/libavcodec/h2645_parse.h b/libavcodec/h2645_parse.h index 3e47f86c53b..b88707f207c 100644 --- a/libavcodec/h2645_parse.h +++ b/libavcodec/h2645_parse.h @@ -32,8 +32,8 @@ typedef struct H2645NAL { uint8_t *rbsp_buffer; - int size; const uint8_t *data; + int size; /** * Size, in bits, of just the data, excluding the stop bit and any trailing @@ -41,16 +41,16 @@ typedef struct H2645NAL { */ int size_bits; - int raw_size; - const uint8_t *raw_data; - - GetBitContext gb; - /** * NAL unit type */ int type; + int raw_size; + const uint8_t *raw_data; + + GetBitContext gb; + /** * HEVC only, nuh_temporal_id_plus_1 - 1 */ @@ -61,13 +61,14 @@ typedef struct H2645NAL { */ int nuh_layer_id; - int skipped_bytes; - int skipped_bytes_pos_size; - int *skipped_bytes_pos; /** * H.264 only, nal_ref_idc */ int ref_idc; + + int skipped_bytes; + int skipped_bytes_pos_size; + int *skipped_bytes_pos; } H2645NAL; typedef struct H2645RBSP {