aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/arm/mpegvideo_armv5te_s.S
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2011-06-13 00:33:19 +0100
committerMans Rullgard <mans@mansr.com>2011-06-14 10:43:54 +0100
commite897a633cded0a8f283114e22766790f48ae8fa7 (patch)
tree24f437b9d36b7f44437ebae0afa35d960b35546b /libavcodec/arm/mpegvideo_armv5te_s.S
parent11177a4d82da8f4987bf6dc755461be6a4e750c5 (diff)
downloadffmpeg-e897a633cded0a8f283114e22766790f48ae8fa7.tar.gz
ARM: factor some repetitive code into macros
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/arm/mpegvideo_armv5te_s.S')
-rw-r--r--libavcodec/arm/mpegvideo_armv5te_s.S61
1 files changed, 23 insertions, 38 deletions
diff --git a/libavcodec/arm/mpegvideo_armv5te_s.S b/libavcodec/arm/mpegvideo_armv5te_s.S
index e83fe991e6..e3461601d5 100644
--- a/libavcodec/arm/mpegvideo_armv5te_s.S
+++ b/libavcodec/arm/mpegvideo_armv5te_s.S
@@ -35,6 +35,21 @@
*
* Inner loop should take 6 cycles per element on arm926ej-s (Nokia 770)
*/
+
+.macro dequant_t dst, src, mul, add, tmp
+ rsbs \tmp, ip, \src, asr #16
+ addgt \tmp, \add, #0
+ rsblt \tmp, \add, #0
+ smlatbne \dst, \src, \mul, \tmp
+.endm
+
+.macro dequant_b dst, src, mul, add, tmp
+ rsbs \tmp, ip, \src, lsl #16
+ addgt \tmp, \add, #0
+ rsblt \tmp, \add, #0
+ smlabbne \dst, \src, \mul, \tmp
+.endm
+
function ff_dct_unquantize_h263_armv5te, export=1
push {r4-r9,lr}
mov ip, #0
@@ -44,50 +59,20 @@ function ff_dct_unquantize_h263_armv5te, export=1
1:
ldrd r6, [r0, #8]
- rsbs r9, ip, r4, asr #16
- addgt r9, r2, #0
- rsblt r9, r2, #0
- smlatbne r9, r4, r1, r9
-
- rsbs lr, ip, r5, asr #16
- addgt lr, r2, #0
- rsblt lr, r2, #0
- smlatbne lr, r5, r1, lr
-
- rsbs r8, ip, r4, asl #16
- addgt r8, r2, #0
- rsblt r8, r2, #0
- smlabbne r4, r4, r1, r8
-
- rsbs r8, ip, r5, asl #16
- addgt r8, r2, #0
- rsblt r8, r2, #0
- smlabbne r5, r5, r1, r8
+ dequant_t r9, r4, r1, r2, r9
+ dequant_t lr, r5, r1, r2, lr
+ dequant_b r4, r4, r1, r2, r8
+ dequant_b r5, r5, r1, r2, r8
strh r4, [r0], #2
strh r9, [r0], #2
strh r5, [r0], #2
strh lr, [r0], #2
- rsbs r9, ip, r6, asr #16
- addgt r9, r2, #0
- rsblt r9, r2, #0
- smlatbne r9, r6, r1, r9
-
- rsbs lr, ip, r7, asr #16
- addgt lr, r2, #0
- rsblt lr, r2, #0
- smlatbne lr, r7, r1, lr
-
- rsbs r8, ip, r6, asl #16
- addgt r8, r2, #0
- rsblt r8, r2, #0
- smlabbne r6, r6, r1, r8
-
- rsbs r8, ip, r7, asl #16
- addgt r8, r2, #0
- rsblt r8, r2, #0
- smlabbne r7, r7, r1, r8
+ dequant_t r9, r6, r1, r2, r9
+ dequant_t lr, r7, r1, r2, lr
+ dequant_b r6, r6, r1, r2, r8
+ dequant_b r7, r7, r1, r2, r8
strh r6, [r0], #2
strh r9, [r0], #2