changeset 5641:1e93e637fa21 libavcodec

Fix put_*_xy2_arm bug and enable put_pixels16_arm and put_pixels8_y2_arm. Speed up > 4%. patch by Tao Huang, ulysses.huang gmail com
author diego
date Wed, 05 Sep 2007 11:05:33 +0000
parents 5935be5de1f3
children d2598034f2a9
files armv4l/dsputil_arm.c armv4l/dsputil_arm_s.S
diffstat 2 files changed, 23 insertions(+), 29 deletions(-) [+]
line wrap: on
line diff
--- a/armv4l/dsputil_arm.c	Wed Sep 05 10:38:59 2007 +0000
+++ b/armv4l/dsputil_arm.c	Wed Sep 05 11:05:33 2007 +0000
@@ -254,22 +254,22 @@
 #endif
     }
 
-/*     c->put_pixels_tab[0][0] = put_pixels16_arm; */ // NG!
+    c->put_pixels_tab[0][0] = put_pixels16_arm;
     c->put_pixels_tab[0][1] = put_pixels16_x2_arm; //OK!
     c->put_pixels_tab[0][2] = put_pixels16_y2_arm; //OK!
-/*     c->put_pixels_tab[0][3] = put_pixels16_xy2_arm; /\* NG *\/ */
-/*     c->put_no_rnd_pixels_tab[0][0] = put_pixels16_arm; */
+    c->put_pixels_tab[0][3] = put_pixels16_xy2_arm;
+    c->put_no_rnd_pixels_tab[0][0] = put_pixels16_arm;
     c->put_no_rnd_pixels_tab[0][1] = put_no_rnd_pixels16_x2_arm; // OK
     c->put_no_rnd_pixels_tab[0][2] = put_no_rnd_pixels16_y2_arm; //OK
-/*     c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_arm; //NG */
+    c->put_no_rnd_pixels_tab[0][3] = put_no_rnd_pixels16_xy2_arm;
     c->put_pixels_tab[1][0] = put_pixels8_arm; //OK
     c->put_pixels_tab[1][1] = put_pixels8_x2_arm; //OK
-/*     c->put_pixels_tab[1][2] = put_pixels8_y2_arm; //NG */
-/*     c->put_pixels_tab[1][3] = put_pixels8_xy2_arm; //NG */
+    c->put_pixels_tab[1][2] = put_pixels8_y2_arm;
+    c->put_pixels_tab[1][3] = put_pixels8_xy2_arm;
     c->put_no_rnd_pixels_tab[1][0] = put_pixels8_arm;//OK
     c->put_no_rnd_pixels_tab[1][1] = put_no_rnd_pixels8_x2_arm; //OK
     c->put_no_rnd_pixels_tab[1][2] = put_no_rnd_pixels8_y2_arm; //OK
-/*     c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_arm;//NG */
+    c->put_no_rnd_pixels_tab[1][3] = put_no_rnd_pixels8_xy2_arm;
 
 #ifdef HAVE_IWMMXT
     dsputil_init_iwmmxt(c, avctx);
--- a/armv4l/dsputil_arm_s.S	Wed Sep 05 10:38:59 2007 +0000
+++ b/armv4l/dsputil_arm_s.S	Wed Sep 05 11:05:33 2007 +0000
@@ -553,7 +553,7 @@
         .word 4b
 
 @ ----------------------------------------------------------------
-.macro  RND_XY2_IT align, rnd
+.macro  RND_XY2_IT align
         @ l1=  (a & 0x03030303) + (b & 0x03030303) ?(+ 0x02020202)
         @ h1= ((a & 0xFCFCFCFCUL) >> 2) + ((b & 0xFCFCFCFCUL) >> 2)
 .if \align == 0
@@ -582,11 +582,7 @@
         and r9, r5, r14
         and r10, r6, r14
         and r11, r7, r14
-.if \rnd == 1
-        ldreq r14, [r12, #16]   @ 0x02020202
-.else
-        ldreq r14, [r12, #28]   @ 0x01010101
-.endif
+        ldreq r14, [r12, #16]   @ 0x02020202/0x01010101
         add r8, r8, r10
         add r9, r9, r11
         addeq r8, r8, r14
@@ -598,12 +594,13 @@
         and r7, r14, r7, lsr #2
         add r10, r4, r6
         add r11, r5, r7
+        subs r3, r3, #1
 .endm
 
-.macro RND_XY2_EXPAND align, rnd
-        RND_XY2_IT \align, \rnd
+.macro RND_XY2_EXPAND align
+        RND_XY2_IT \align
 6:      stmfd sp!, {r8-r11}
-        RND_XY2_IT \align, \rnd
+        RND_XY2_IT \align
         ldmfd sp!, {r4-r7}
         add r4, r4, r8
         add r5, r5, r9
@@ -614,10 +611,9 @@
         and r5, r14, r5, lsr #2
         add r4, r4, r6
         add r5, r5, r7
-        subs r3, r3, #1
         stmia r0, {r4-r5}
         add r0, r0, r2
-        bne 6b
+        bge 6b
         ldmfd sp!, {r4-r11,pc}
 .endm
 
@@ -634,19 +630,19 @@
         bic r1, r1, #3
         ldrne pc, [r5]
 1:
-        RND_XY2_EXPAND 0, 1
+        RND_XY2_EXPAND 0
 
         .align 8
 2:
-        RND_XY2_EXPAND 1, 1
+        RND_XY2_EXPAND 1
 
         .align 8
 3:
-        RND_XY2_EXPAND 2, 1
+        RND_XY2_EXPAND 2
 
         .align 8
 4:
-        RND_XY2_EXPAND 3, 1
+        RND_XY2_EXPAND 3
 
 5:
         .word 0x03030303
@@ -656,7 +652,6 @@
         .word 0x02020202
         .word 0xFCFCFCFC >> 2
         .word 0x0F0F0F0F
-        .word 0x01010101
 
         .align 8
         .global put_no_rnd_pixels8_xy2_arm
@@ -671,26 +666,25 @@
         bic r1, r1, #3
         ldrne pc, [r5]
 1:
-        RND_XY2_EXPAND 0, 0
+        RND_XY2_EXPAND 0
 
         .align 8
 2:
-        RND_XY2_EXPAND 1, 0
+        RND_XY2_EXPAND 1
 
         .align 8
 3:
-        RND_XY2_EXPAND 2, 0
+        RND_XY2_EXPAND 2
 
         .align 8
 4:
-        RND_XY2_EXPAND 3, 0
+        RND_XY2_EXPAND 3
 
 5:
         .word 0x03030303
         .word 2b
         .word 3b
         .word 4b
-        .word 0x02020202
+        .word 0x01010101
         .word 0xFCFCFCFC >> 2
         .word 0x0F0F0F0F
-        .word 0x01010101