~ubuntu-branches/ubuntu/saucy/gst-libav1.0/saucy-proposed

« back to all changes in this revision

Viewing changes to gst-libs/ext/libav/libavcodec/arm/simple_idct_arm.S

  • Committer: Package Import Robot
  • Author(s): Sebastian Dröge
  • Date: 2013-07-30 09:00:15 UTC
  • mfrom: (1.1.16) (7.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20130730090015-sc1ou2yssu7q5w4e
Tags: 1.1.3-1
* New upstream development snapshot:
  + debian/control:
    - Build depend on GStreamer and gst-plugins-base >= 1.1.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24
24
 */
25
25
 
26
 
#include "asm.S"
 
26
#include "libavutil/arm/asm.S"
27
27
 
28
 
/* useful constants for the algorithm, they are save in __constant_ptr__ at */
29
 
/* the end of the source code.*/
 
28
/* useful constants for the algorithm */
30
29
#define W1  22725
31
30
#define W2  21407
32
31
#define W3  19266
36
35
#define W7  4520
37
36
#define MASK_MSHW 0xFFFF0000
38
37
 
39
 
/* offsets of the constants in the vector */
40
 
#define offW1  0
41
 
#define offW2  4
42
 
#define offW3  8
43
 
#define offW4  12
44
 
#define offW5  16
45
 
#define offW6  20
46
 
#define offW7  24
47
 
#define offMASK_MSHW 28
48
 
 
49
38
#define ROW_SHIFT 11
50
39
#define ROW_SHIFT2MSHW (16-11)
51
40
#define COL_SHIFT 20
63
52
        stmfd sp!, {r4-r11, r14} @ R14 is also called LR
64
53
        @@ at this point, R0=block, other registers are free.
65
54
        add r14, r0, #112        @ R14=&block[8*7], better start from the last row, and decrease the value until row=0, i.e. R12=block.
66
 
        adr r12, __constant_ptr__ @ R12=__constant_ptr__, the vector containing the constants, probably not necessary to reserve a register for it
67
55
        @@ add 2 temporary variables in the stack: R0 and R14
68
56
        sub sp, sp, #8          @ allow 2 local variables
69
57
        str r0, [sp, #0]        @ save block in sp[0]
109
97
        @@ MAC16(b1, -W7, row[3]);
110
98
        @@ MAC16(b2, -W1, row[3]);
111
99
        @@ MAC16(b3, -W5, row[3]);
112
 
        ldr r8, [r12, #offW1]    @ R8=W1
 
100
        ldr r8, =W1              @ R8=W1
113
101
        mov r2, r2, asr #16      @ R2=ROWr16[3]
114
102
        mul r0, r8, r7           @ R0=W1*ROWr16[1]=b0 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
115
 
        ldr r9, [r12, #offW3]    @ R9=W3
116
 
        ldr r10, [r12, #offW5]   @ R10=W5
 
103
        ldr r9, =W3              @ R9=W3
 
104
        ldr r10, =W5             @ R10=W5
117
105
        mul r1, r9, r7           @ R1=W3*ROWr16[1]=b1 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
118
 
        ldr r11, [r12, #offW7]   @ R11=W7
 
106
        ldr r11, =W7             @ R11=W7
119
107
        mul r5, r10, r7          @ R5=W5*ROWr16[1]=b2 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
120
108
        mul r7, r11, r7          @ R7=W7*ROWr16[1]=b3 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
121
109
        teq r2, #0               @ if null avoid muls
177
165
        @@ a2 = a0 - W6 * row[2];
178
166
        @@ a3 = a0 - W2 * row[2];
179
167
        @@ a0 = a0 + W2 * row[2];
180
 
        ldr r9, [r12, #offW4]    @ R9=W4
 
168
        ldr r9, =W4              @ R9=W4
181
169
        mul r6, r9, r6           @ R6=W4*ROWr16[0]
182
 
        ldr r10, [r12, #offW6]   @ R10=W6
 
170
        ldr r10, =W6             @ R10=W6
183
171
        ldrsh r4, [r14, #4]      @ R4=ROWr16[2] (a3 not defined yet)
184
172
        add r6, r6, #ROW_SHIFTED_1 @ R6=W4*ROWr16[0] + 1<<(ROW_SHIFT-1) (a0)
185
173
 
186
174
        mul r11, r10, r4         @ R11=W6*ROWr16[2]
187
 
        ldr r8, [r12, #offW2]    @ R8=W2
 
175
        ldr r8, =W2              @ R8=W2
188
176
        sub r3, r6, r11          @ R3=a0-W6*ROWr16[2] (a2)
189
177
        @@ temp = ((uint32_t*)row)[2] | ((uint32_t*)row)[3];
190
178
        @@ if (temp != 0) {}
248
236
        add r9, r2, r1           @ R9=a1+b1
249
237
        @@ put 2 16 bits half-words in a 32bits word
250
238
        @@ ROWr32[0]=ROWr16[0] | (ROWr16[1]<<16) (only Little Endian compliant then!!!)
251
 
        ldr r10, [r12, #offMASK_MSHW] @ R10=0xFFFF0000
 
239
        ldr r10, =MASK_MSHW      @ R10=0xFFFF0000
252
240
        and r9, r10, r9, lsl #ROW_SHIFT2MSHW @ R9=0xFFFF0000 & ((a1+b1)<<5)
253
241
        mvn r11, r10             @ R11= NOT R10= 0x0000FFFF
254
242
        and r8, r11, r8, asr #ROW_SHIFT @ R8=0x0000FFFF & ((a0+b0)>>11)
319
307
        @@ MAC16(b1, -W7, col[8x3]);
320
308
        @@ MAC16(b2, -W1, col[8x3]);
321
309
        @@ MAC16(b3, -W5, col[8x3]);
322
 
        ldr r8, [r12, #offW1]    @ R8=W1
 
310
        ldr r8, =W1              @ R8=W1
323
311
        ldrsh r7, [r14, #16]
324
312
        mul r0, r8, r7           @ R0=W1*ROWr16[1]=b0 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
325
 
        ldr r9, [r12, #offW3]    @ R9=W3
326
 
        ldr r10, [r12, #offW5]   @ R10=W5
 
313
        ldr r9, =W3              @ R9=W3
 
314
        ldr r10, =W5             @ R10=W5
327
315
        mul r1, r9, r7           @ R1=W3*ROWr16[1]=b1 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
328
 
        ldr r11, [r12, #offW7]   @ R11=W7
 
316
        ldr r11, =W7             @ R11=W7
329
317
        mul r5, r10, r7          @ R5=W5*ROWr16[1]=b2 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
330
318
        ldrsh r2, [r14, #48]
331
319
        mul r7, r11, r7          @ R7=W7*ROWr16[1]=b3 (ROWr16[1] must be the second arg, to have the possibility to save 1 cycle)
381
369
        @@ a3 = a0 - W2 * row[2];
382
370
        @@ a0 = a0 + W2 * row[2];
383
371
        ldrsh r6, [r14, #0]
384
 
        ldr r9, [r12, #offW4]    @ R9=W4
 
372
        ldr r9, =W4              @ R9=W4
385
373
        mul r6, r9, r6           @ R6=W4*ROWr16[0]
386
 
        ldr r10, [r12, #offW6]   @ R10=W6
 
374
        ldr r10, =W6             @ R10=W6
387
375
        ldrsh r4, [r14, #32]     @ R4=ROWr16[2] (a3 not defined yet)
388
376
        add r6, r6, #COL_SHIFTED_1 @ R6=W4*ROWr16[0] + 1<<(COL_SHIFT-1) (a0)
389
377
        mul r11, r10, r4         @ R11=W6*ROWr16[2]
390
 
        ldr r8, [r12, #offW2]    @ R8=W2
 
378
        ldr r8, =W2              @ R8=W2
391
379
        add r2, r6, r11          @ R2=a0+W6*ROWr16[2] (a1)
392
380
        sub r3, r6, r11          @ R3=a0-W6*ROWr16[2] (a2)
393
381
        mul r11, r8, r4          @ R11=W2*ROWr16[2]
489
477
        sub r4, r6, r11          @ R4=a0-W2*ROWr16[2] (a3)
490
478
        add r6, r6, r11          @ R6=a0+W2*ROWr16[2] (a0)
491
479
        bal __end_a_evaluation
492
 
 
493
 
 
494
 
        .align
495
 
__constant_ptr__:  @@ see #defines at the beginning of the source code for values.
496
 
        .word   W1
497
 
        .word   W2
498
 
        .word   W3
499
 
        .word   W4
500
 
        .word   W5
501
 
        .word   W6
502
 
        .word   W7
503
 
        .word   MASK_MSHW