]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/arm/simple_idct_armv6.S
dashenc: Simplify code by using a local variable
[ffmpeg] / libavcodec / arm / simple_idct_armv6.S
index d61c1fd3eace616c82a557755c5865018301e92e..60723467a08bad3510bc4bc084c79ceadca2b4f0 100644 (file)
@@ -4,24 +4,24 @@
  * Copyright (c) 2001 Michael Niedermayer <michaelni@gmx.at>
  * Copyright (c) 2007 Mans Rullgard <mans@mansr.com>
  *
- * This file is part of FFmpeg.
+ * This file is part of Libav.
  *
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "asm.S"
+#include "libavutil/arm/asm.S"
 
 #define W1  22725   /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
 #define W2  21407   /* cos(i*M_PI/16)*sqrt(2)*(1<<14) + 0.5 */
 #define W46 (W4 | (W6 << 16))
 #define W57 (W5 | (W7 << 16))
 
-        .text
-        .align
-w13:    .long W13
-w26:    .long W26
-w42:    .long W42
-w42n:   .long W42n
-w46:    .long W46
-w57:    .long W57
-
 /*
   Compute partial IDCT of single row.
   shift = left-shift amount
@@ -60,12 +51,12 @@ w57:    .long W57
   Output in registers r4--r11
 */
         .macro idct_row shift
-        ldr    lr, w46               /* lr  = W4 | (W6 << 16) */
+        ldr    lr, =W46              /* lr  = W4 | (W6 << 16) */
         mov    r1, #(1<<(\shift-1))
         smlad  r4, r2, ip, r1
         smlsd  r7, r2, ip, r1
-        ldr    ip, w13               /* ip  = W1 | (W3 << 16) */
-        ldr    r10,w57               /* r10 = W5 | (W7 << 16) */
+        ldr    ip, =W13              /* ip  = W1 | (W3 << 16) */
+        ldr    r10,=W57              /* r10 = W5 | (W7 << 16) */
         smlad  r5, r2, lr, r1
         smlsd  r6, r2, lr, r1
 
@@ -78,11 +69,11 @@ w57:    .long W57
         smlad  r8, lr, r10,r8        /* B0  +=      W5*row[5] + W7*row[7] */
         smusdx r10,r3, r1            /* r10 =  B2 = W5*row[1] - W1*row[3] */
 
-        ldr    r3, w42n              /* r3 =  -W4 | (-W2 << 16) */
+        ldr    r3, =W42n             /* r3 =  -W4 | (-W2 << 16) */
         smlad  r10,lr, r2, r10       /* B2 +=  W7*row[5] + W3*row[7] */
         ldr    r2, [r0, #4]          /* r2 =   row[6,4] */
         smlsdx r11,lr, ip, r11       /* B3 +=  W3*row[5] - W1*row[7] */
-        ldr    ip, w46               /* ip =   W4 | (W6 << 16) */
+        ldr    ip, =W46              /* ip =   W4 | (W6 << 16) */
         smlad  r9, lr, r1, r9        /* B1 -=  W1*row[5] + W5*row[7] */
 
         smlad  r5, r2, r3, r5        /* A1 += -W4*row[4] - W2*row[6] */
@@ -101,12 +92,12 @@ w57:    .long W57
   Output in registers r4--r11
 */
         .macro idct_row4 shift
-        ldr    lr, w46               /* lr =  W4 | (W6 << 16) */
-        ldr    r10,w57               /* r10 = W5 | (W7 << 16) */
+        ldr    lr, =W46              /* lr =  W4 | (W6 << 16) */
+        ldr    r10,=W57              /* r10 = W5 | (W7 << 16) */
         mov    r1, #(1<<(\shift-1))
         smlad  r4, r2, ip, r1
         smlsd  r7, r2, ip, r1
-        ldr    ip, w13               /* ip =  W1 | (W3 << 16) */
+        ldr    ip, =W13              /* ip =  W1 | (W3 << 16) */
         smlad  r5, r2, lr, r1
         smlsd  r6, r2, lr, r1
         smusdx r11,r3, r10           /* r11 =  B3 = W7*row[1] - W5*row[3] */
@@ -200,11 +191,12 @@ function idct_row_armv6
         ldr    r3, [r0, #8]          /* r3 = row[3,1] */
         ldr    r2, [r0]              /* r2 = row[2,0] */
         orrs   lr, lr, ip
+        itt    eq
         cmpeq  lr, r3
         cmpeq  lr, r2, lsr #16
         beq    1f
         push   {r1}
-        ldr    ip, w42               /* ip = W4 | (W2 << 16) */
+        ldr    ip, =W42              /* ip = W4 | (W2 << 16) */
         cmp    lr, #0
         beq    2f
 
@@ -248,7 +240,7 @@ function idct_col_armv6
         push   {r1, lr}
 
         ldr    r2, [r0]              /* r2 = row[2,0] */
-        ldr    ip, w42               /* ip = W4 | (W2 << 16) */
+        ldr    ip, =W42              /* ip = W4 | (W2 << 16) */
         ldr    r3, [r0, #8]          /* r3 = row[3,1] */
         idct_row COL_SHIFT
         pop    {r1}
@@ -276,20 +268,20 @@ function idct_col_put_armv6
         push   {r1, r2, lr}
 
         ldr    r2, [r0]              /* r2 = row[2,0] */
-        ldr    ip, w42               /* ip = W4 | (W2 << 16) */
+        ldr    ip, =W42              /* ip = W4 | (W2 << 16) */
         ldr    r3, [r0, #8]          /* r3 = row[3,1] */
         idct_row COL_SHIFT
         pop    {r1, r2}
         idct_finish_shift_sat COL_SHIFT
 
-        strb   r4, [r1], r2
-        strb   r5, [r1], r2
-        strb   r6, [r1], r2
-        strb   r7, [r1], r2
-        strb   r11,[r1], r2
-        strb   r10,[r1], r2
-        strb   r9, [r1], r2
-        strb   r8, [r1], r2
+        strb_post r4, r1, r2
+        strb_post r5, r1, r2
+        strb_post r6, r1, r2
+        strb_post r7, r1, r2
+        strb_post r11,r1, r2
+        strb_post r10,r1, r2
+        strb_post r9, r1, r2
+        strb_post r8, r1, r2
 
         sub    r1, r1, r2, lsl #3
 
@@ -306,7 +298,7 @@ function idct_col_add_armv6
         push   {r1, r2, lr}
 
         ldr    r2, [r0]              /* r2 = row[2,0] */
-        ldr    ip, w42               /* ip = W4 | (W2 << 16) */
+        ldr    ip, =W42              /* ip = W4 | (W2 << 16) */
         ldr    r3, [r0, #8]          /* r3 = row[3,1] */
         idct_row COL_SHIFT
         pop    {r1, r2}
@@ -318,16 +310,16 @@ function idct_col_add_armv6
         add    ip, r3, ip, asr #COL_SHIFT
         usat   ip, #8, ip
         add    r4, r7, r4, asr #COL_SHIFT
-        strb   ip, [r1], r2
+        strb_post ip, r1, r2
         ldrb   ip, [r1, r2]
         usat   r4, #8, r4
         ldrb   r11,[r1, r2, lsl #2]
         add    r5, ip, r5, asr #COL_SHIFT
         usat   r5, #8, r5
-        strb   r4, [r1], r2
+        strb_post r4, r1, r2
         ldrb   r3, [r1, r2]
         ldrb   ip, [r1, r2, lsl #2]
-        strb   r5, [r1], r2
+        strb_post r5, r1, r2
         ldrb   r7, [r1, r2]
         ldrb   r4, [r1, r2, lsl #2]
         add    r6, r3, r6, asr #COL_SHIFT
@@ -340,11 +332,11 @@ function idct_col_add_armv6
         usat   r8, #8, r8
         add    lr, r4, lr, asr #COL_SHIFT
         usat   lr, #8, lr
-        strb   r6, [r1], r2
-        strb   r10,[r1], r2
-        strb   r9, [r1], r2
-        strb   r8, [r1], r2
-        strb   lr, [r1], r2
+        strb_post r6, r1, r2
+        strb_post r10,r1, r2
+        strb_post r9, r1, r2
+        strb_post r8, r1, r2
+        strb_post lr, r1, r2
 
         sub    r1, r1, r2, lsl #3
 
@@ -383,7 +375,7 @@ endfunc
         sub    r0, r0, #(16*7)
         .endm
 
-/* void ff_simple_idct_armv6(DCTELEM *data); */
+/* void ff_simple_idct_armv6(int16_t *data); */
 function ff_simple_idct_armv6, export=1
         push   {r4-r11, lr}
         sub    sp, sp, #128
@@ -398,7 +390,7 @@ function ff_simple_idct_armv6, export=1
         pop    {r4-r11, pc}
 endfunc
 
-/* ff_simple_idct_add_armv6(uint8_t *dest, int line_size, DCTELEM *data); */
+/* ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data); */
 function ff_simple_idct_add_armv6, export=1
         push   {r0, r1, r4-r11, lr}
         sub    sp, sp, #128
@@ -415,7 +407,7 @@ function ff_simple_idct_add_armv6, export=1
         pop    {r4-r11, pc}
 endfunc
 
-/* ff_simple_idct_put_armv6(uint8_t *dest, int line_size, DCTELEM *data); */
+/* ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data); */
 function ff_simple_idct_put_armv6, export=1
         push   {r0, r1, r4-r11, lr}
         sub    sp, sp, #128