diff options
author | Mans Rullgard <mans@mansr.com> | 2011-01-29 20:14:29 +0300 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-01-30 05:41:47 +0300 |
commit | 451b4b86355216ee4b255ca86ea578864127e03a (patch) | |
tree | aefadb55aaf5ea0b58ad219358d8394775698964 /libavcodec/arm | |
parent | 5231d6277f2c3b7c13a309964a6edbfa0e9570b5 (diff) |
Rearrange MpegEncContext to simplify access from asm
This moves the fields needed by asm near the top, before any
structs or other members which complicate the offset calculation.
Modifying other structs will no longer require updating the offsets,
and the asm code is slightly simpler due to the smaller offsets.
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit d461a4731781e492d83ef254f9c0fbd0ce6e47eb)
Diffstat (limited to 'libavcodec/arm')
-rw-r--r-- | libavcodec/arm/asm-offsets.h | 21 | ||||
-rw-r--r-- | libavcodec/arm/mpegvideo_neon.S | 13 |
2 files changed, 11 insertions, 23 deletions
diff --git a/libavcodec/arm/asm-offsets.h b/libavcodec/arm/asm-offsets.h index 174b5aadcb..7f73534834 100644 --- a/libavcodec/arm/asm-offsets.h +++ b/libavcodec/arm/asm-offsets.h @@ -29,20 +29,11 @@ #endif /* MpegEncContext */ -#if defined(__ARM_EABI__) || defined(__eabi__) -#define Y_DC_SCALE 0xab4 -#define C_DC_SCALE 0xab8 -#define AC_PRED 0xae0 -#define BLOCK_LAST_INDEX 0x21c0 -#define INTER_SCANTAB_RASTER_END 0x23c0 -#define H263_AIC 0x2670 -#elif defined(__APPLE__) -#define Y_DC_SCALE 0xa70 -#define C_DC_SCALE 0xa74 -#define AC_PRED 0xa9c -#define BLOCK_LAST_INDEX 0x217c -#define INTER_SCANTAB_RASTER_END 0x237c -#define H263_AIC 0x2620 -#endif +#define Y_DC_SCALE 0xb4 +#define C_DC_SCALE 0xb8 +#define AC_PRED 0xbc +#define BLOCK_LAST_INDEX 0xc0 +#define H263_AIC 0xf0 +#define INTER_SCANTAB_RASTER_END 0x138 #endif diff --git a/libavcodec/arm/mpegvideo_neon.S b/libavcodec/arm/mpegvideo_neon.S index b25ead4941..b695fb7c22 100644 --- a/libavcodec/arm/mpegvideo_neon.S +++ b/libavcodec/arm/mpegvideo_neon.S @@ -22,10 +22,9 @@ #include "asm-offsets.h" function ff_dct_unquantize_h263_inter_neon, export=1 - add r0, r0, #0x2200 - add r12, r0, #BLOCK_LAST_INDEX-0x2200 + add r12, r0, #BLOCK_LAST_INDEX ldr r12, [r12, r2, lsl #2] - add r0, r0, #INTER_SCANTAB_RASTER_END-0x2200 + add r0, r0, #INTER_SCANTAB_RASTER_END ldrb r12, [r0, r12] sub r2, r3, #1 lsl r0, r3, #1 @@ -75,17 +74,15 @@ endfunc function ff_dct_unquantize_h263_intra_neon, export=1 push {r4-r6,lr} + add r12, r0, #BLOCK_LAST_INDEX ldr r6, [r0, #AC_PRED] - add r5, r0, #0x2700 + add lr, r0, #INTER_SCANTAB_RASTER_END cmp r6, #0 movne r12, #63 bne 1f - add lr, r0, #0x2200 - add r12, lr, #BLOCK_LAST_INDEX-0x2200 - add lr, lr, #INTER_SCANTAB_RASTER_END-0x2200 ldr r12, [r12, r2, lsl #2] ldrb r12, [lr, r12] -1: ldr r5, [r5, #H263_AIC-0x2700] +1: ldr r5, [r0, #H263_AIC] ldrsh r4, [r1] cmp r5, #0 mov r5, r1 |