Also move AV_CHECK_OFFSET to its only user, namely lavc/arm/mpegvideo_arm.c and rename it to CHECK_OFFSET.
Showing the changes to libavcodec/arm (1 of 2 files). Show all
Unified · Split
| @@ -18,8 +18,9 @@ · 17 unmodified lines | ||
| 18 | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 19 | 19 | */ |
| 20 | 20 | |
| 21 | +#include <assert.h> | |
| 22 | + | |
| 21 | 23 | #include "libavutil/attributes.h" |
| 22 | −#include "libavutil/internal.h" | |
| 23 | 24 | #include "libavutil/arm/cpu.h" |
| 24 | 25 | #include "libavcodec/avcodec.h" |
| 25 | 26 | #include "libavcodec/mpegvideo.h" |
| @@ -27,13 +28,16 @@ · 1 unmodified line | ||
| 27 | 28 | #include "asm-offsets.h" |
| 28 | 29 | |
| 29 | 30 | #if HAVE_NEON |
| 30 | −AV_CHECK_OFFSET(MpegEncContext, y_dc_scale, Y_DC_SCALE); | |
| 31 | −AV_CHECK_OFFSET(MpegEncContext, c_dc_scale, C_DC_SCALE); | |
| 32 | −AV_CHECK_OFFSET(MpegEncContext, ac_pred, AC_PRED); | |
| 33 | −AV_CHECK_OFFSET(MpegEncContext, block_last_index, BLOCK_LAST_INDEX); | |
| 34 | −AV_CHECK_OFFSET(MpegEncContext, inter_scantable.raster_end, | |
| 35 | − INTER_SCANTAB_RASTER_END); | |
| 36 | −AV_CHECK_OFFSET(MpegEncContext, h263_aic, H263_AIC); | |
| 31 | +#define CHECK_OFFSET(s, m, o) \ | |
| 32 | + static_assert(offsetof(s, m) == o, \ | |
| 33 | + "Hardcoded ASM offset of " #s " field " #o " needs to be updated."); | |
| 34 | +CHECK_OFFSET(MpegEncContext, y_dc_scale, Y_DC_SCALE); | |
| 35 | +CHECK_OFFSET(MpegEncContext, c_dc_scale, C_DC_SCALE); | |
| 36 | +CHECK_OFFSET(MpegEncContext, ac_pred, AC_PRED); | |
| 37 | +CHECK_OFFSET(MpegEncContext, block_last_index, BLOCK_LAST_INDEX); | |
| 38 | +CHECK_OFFSET(MpegEncContext, inter_scantable.raster_end, | |
| 39 | + INTER_SCANTAB_RASTER_END); | |
| 40 | +CHECK_OFFSET(MpegEncContext, h263_aic, H263_AIC); | |
| 37 | 41 | #endif |
| 38 | 42 | |
| 39 | 43 | void ff_dct_unquantize_h263_inter_neon(MpegEncContext *s, int16_t *block, |