Add ATTRIBUTE_PACKED to some enum types. Add ATTRIBUTE_PACKED to all the enum types used in the MB_MODE_INFO structure. This is a futile attempt to make the 'mip' array in AV1_COMMON (cm->mip) smaller. Also add ATTRIBUTE_PACKED to the other enum types defined in the modified header files, except for BITSTREAM_PROFILE. BUG=oss-fuzz:9497 Change-Id: I41b4b9da39fcd8e41410e363b55425dff51c8661
diff --git a/av1/common/blockd.h b/av1/common/blockd.h index 979f13b..da65cfe 100644 --- a/av1/common/blockd.h +++ b/av1/common/blockd.h
@@ -38,13 +38,13 @@ #define MAX_DIFFWTD_MASK_BITS 1 // DIFFWTD_MASK_TYPES should not surpass 1 << MAX_DIFFWTD_MASK_BITS -typedef enum { +typedef enum ATTRIBUTE_PACKED { DIFFWTD_38 = 0, DIFFWTD_38_INV, DIFFWTD_MASK_TYPES, } DIFFWTD_MASK_TYPE; -typedef enum { +typedef enum ATTRIBUTE_PACKED { KEY_FRAME = 0, INTER_FRAME = 1, INTRA_ONLY_FRAME = 2, // replaces intra-only @@ -376,7 +376,7 @@ } #endif -enum mv_precision { MV_PRECISION_Q3, MV_PRECISION_Q4 }; +enum ATTRIBUTE_PACKED mv_precision { MV_PRECISION_Q3, MV_PRECISION_Q4 }; struct buf_2d { uint8_t *buf;
diff --git a/av1/common/enums.h b/av1/common/enums.h index 689c25f..bd4dcc8 100644 --- a/av1/common/enums.h +++ b/av1/common/enums.h
@@ -274,7 +274,7 @@ TX_TYPES, } TX_TYPE; -typedef enum { +typedef enum ATTRIBUTE_PACKED { REG_REG, REG_SMOOTH, REG_SHARP, @@ -478,7 +478,7 @@ INTERINTRA_MODES } INTERINTRA_MODE; -typedef enum { +typedef enum ATTRIBUTE_PACKED { COMPOUND_AVERAGE, COMPOUND_WEDGE, COMPOUND_DIFFWTD,
diff --git a/av1/common/mv.h b/av1/common/mv.h index c249564..2f2e7f2 100644 --- a/av1/common/mv.h +++ b/av1/common/mv.h
@@ -56,7 +56,7 @@ #define WARPEDDIFF_PREC_BITS (WARPEDMODEL_PREC_BITS - WARPEDPIXEL_PREC_BITS) /* clang-format off */ -typedef enum { +typedef enum ATTRIBUTE_PACKED { IDENTITY = 0, // identity transformation, 0-parameter TRANSLATION = 1, // translational motion 2-parameter ROTZOOM = 2, // simplified affine with rotation + zoom only, 4-parameter