[FFmpeg-devel] [PATCH v2 2/2] lavc/h2645_parse: Reorder H2645NAL to reduce size

Andriy Gelman andriy.gelman at gmail.com
Fri Dec 6 05:15:42 EET 2019


From: Andriy Gelman <andriy.gelman at gmail.com>

Size of H2645NAL reduced from 112 to 104 bytes on x86-64.

Signed-off-by: Andriy Gelman <andriy.gelman at gmail.com>
---
 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 {
-- 
2.24.0



More information about the ffmpeg-devel mailing list