annotate bfin/pixels_bfin.S @ 4765:85298e8c55c4 libavcodec

bfin dsputils, basic pixel operations sads, diffs, motion compensation and standard IEEE 8x8 block transforms patch by Marc Hoffman, mmh pleasantst com
author diego
date Sun, 01 Apr 2007 22:28:45 +0000
parents
children 75bf61c6c385
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4765
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
1 /*
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
2 * Blackfin Pixel Operations
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
3 * Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com>
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
4 *
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
5 * This file is part of FFmpeg.
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
6 *
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
11 *
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
15 * Lesser General Public License for more details.
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
16 *
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
20 */
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
21 #include "config_bfin.h"
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
22
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
23 DEFUN(put_pixels_clamped,mL1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
24 (DCTELEM *block, uint8_t *dest, int line_size)):
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
25 [--SP] = (R7:4);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
26 R4 = 0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
27 R5.l = 0x00ff;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
28 R5.h = 0x00ff;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
29 I0 = R0; // block
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
30 I1 = R1; // dest
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
31 R2 += -4; // line_size
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
32 M1 = R2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
33 P0 = 8;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
34 R0 = [I0++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
35 R1 = [I0++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
36 R2 = MAX(R0, R4) (V);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
37 LSETUP (ppc$0,ppc$1) LC0=P0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
38 ppc$0: R2 = MIN(R2, R5) (V);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
39 R3 = MAX(R1, R4) (V);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
40 R3 = MIN(R3, R5) (V) || R0 = [I0++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
41 R6 = BYTEPACK (R2,R3) || R1 = [I0++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
42 R2 = MAX(R0, R4) (V) || [I1++] = R6;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
43 R2 = MIN(R2, R5) (V);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
44 R3 = MAX(R1, R4) (V);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
45 R3 = MIN(R3, R5) (V) || R0 = [I0++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
46 R6 = BYTEPACK (R2,R3) || R1 = [I0++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
47 ppc$1: R2 = Max(R0, R4) (V) || [I1++M1] = R6;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
48
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
49 (R7:4) = [SP++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
50 RTS;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
51
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
52 DEFUN(add_pixels_clamped,mL1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
53 (DCTELEM *block, uint8_t *dest, int line_size)):
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
54 [-- SP] = (R7:4);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
55 R4 = 0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
56 I0 = 0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
57 R2 += -4; // line_size
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
58 M0 = R2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
59 I1 = R1; // dest
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
60 I3 = R0; // block
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
61 I2 = R1; // dest
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
62 P0 = 8;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
63 M3 = 2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
64 R0 = [I3++] || R2 = [I1];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
65 R2 = R2 << 8 || R0.H = W[I3--] || R3 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
66 R3 = R3 >> 8 || R1.L = W[I3] || I3 += 4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
67 R6 = BYTEOP3P(R1:0, R3:2) (LO) || R1.H = W[I3++] || R2 = [I1];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
68
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
69 LSETUP(apc$2,apc$3) LC1 = P0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
70 apc$2: R7 = BYTEOP3P(R1:0, R3:2) (HI, R) || R0 = [I3++] || R3 = [I1++M0];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
71 R2 = R2 << 8 || R0.H = W[I3--];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
72 R3 = R3 >> 8 || R1.L = W[I3] || I3 += 4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
73 R6 = R6 + R7 (S) || R1.H = W[I3];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
74 R6 = BYTEOP3P(R1:0, R3:2) (LO) || I3+=M3 || [I2++]=R6;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
75 R7 = BYTEOP3P(R1:0, R3:2) (HI, R) || R0 = [I3++] || R2 = [I1];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
76 R2 = R2 << 8 || R0.H = W[I3--] || R3 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
77 R3 = R3 >> 8 || R1.L = W[I3] || I3 += 4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
78 R6 = R6 + R7 (S) || R1.H = W[I3++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
79 apc$3: R6 = BYTEOP3P(R1:0, R3:2) (LO) || [I2++M0] = R6 || R2 = [I1];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
80
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
81 (R7:4) = [SP++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
82 RTS;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
83
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
84
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
85 /*
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
86 motion compensation
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
87 primitives
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
88
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
89 * Halfpel motion compensation with rounding (a+b+1)>>1.
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
90 * This is an array[4][4] of motion compensation funcions for 4
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
91 * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
92 * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
93 * @param block destination where the result is stored
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
94 * @param pixels source
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
95 * @param line_size number of bytes in a horizontal line of block
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
96 * @param h height
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
97
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
98 */
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
99
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
100 DEFUN(put_pixels8uc,mL1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
101 (uint8_t *block, const uint8_t *s0, const uint8_t *s1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
102 int dest_size, int line_size, int h)):
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
103 i3=r0; // dest
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
104 i0=r1; // src0
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
105 i1=r2; // src1
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
106 r0=[sp+12]; // dest_size
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
107 r2=[sp+16]; // line_size
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
108 p0=[sp+20]; // h
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
109 [--sp] = (r7:6);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
110 r0+=-4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
111 m3=r0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
112 r2+=-8;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
113 m0=r2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
114 LSETUP(pp8$0,pp8$1) LC0=P0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
115 DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
116
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
117 pp8$0: DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
118 R6 = BYTEOP1P(R1:0,R3:2) || R0 = [I0++M0]|| R2 =[I1++M0];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
119 R7 = BYTEOP1P(R1:0,R3:2)(R) || R0 = [I0++] || [I3++] = R6 ;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
120 pp8$1: DISALGNEXCPT || R2 = [I1++] || [I3++M3] = R7;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
121
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
122 (r7:6) = [sp++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
123 RTS;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
124
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
125 DEFUN(put_pixels16uc,mL1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
126 (uint8_t *block, const uint8_t *s0, const uint8_t *s1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
127 int dest_size, int line_size, int h)):
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
128 link 0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
129 [--sp] = (r7:6);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
130 i3=r0; // dest
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
131 i0=r1; // src0
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
132 i1=r2; // src1
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
133 r0=[fp+20]; // dest_size
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
134 r2=[fp+24]; // line_size
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
135 p0=[fp+28]; // h
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
136
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
137
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
138 r0+=-12;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
139 m3=r0; // line_size
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
140 r2+=-16;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
141 m0=r2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
142
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
143 LSETUP(pp16$0,pp16$1) LC0=P0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
144 DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
145
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
146 pp16$0: DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
147 R6 = BYTEOP1P(R1:0,R3:2) || R0 = [I0++] || R2 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
148 R7 = BYTEOP1P(R1:0,R3:2)(R) || R1 = [I0++] || R3 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
149 [I3++] = R6;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
150 R6 = BYTEOP1P(R1:0,R3:2) || R0 = [I0++M0] || R2 =[I1++M0];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
151 R7 = BYTEOP1P(R1:0,R3:2)(R) || R0 = [I0++] || [I3++] = R7 ;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
152 [I3++] = R6;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
153 pp16$1: DISALGNEXCPT || R2 = [I1++] || [I3++M3] = R7;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
154
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
155 (r7:6) = [sp++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
156 unlink;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
157 RTS;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
158
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
159
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
160
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
161
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
162
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
163
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
164 DEFUN(put_pixels8uc_nornd,mL1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
165 (uint8_t *block, const uint8_t *s0, const uint8_t *s1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
166 int line_size, int h)):
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
167 i3=r0; // dest
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
168 i0=r1; // src0
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
169 i1=r2; // src1
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
170 r2=[sp+12]; // line_size
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
171 p0=[sp+16]; // h
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
172 [--sp] = (r7:6);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
173 r2+=-4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
174 m3=r2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
175 r2+=-4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
176 m0=r2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
177 LSETUP(pp8$2,pp8$3) LC0=P0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
178 DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
179
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
180 pp8$2: DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
181 R6 = BYTEOP1P(R1:0,R3:2)(T) || R0 = [I0++M0]|| R2 =[I1++M0];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
182 R7 = BYTEOP1P(R1:0,R3:2)(T,R) || R0 = [I0++] || [I3++] = R6 ;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
183 pp8$3: DISALGNEXCPT || R2 = [I1++] || [I3++M3] = R7;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
184
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
185 (r7:6) = [sp++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
186 RTS;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
187
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
188 DEFUN(put_pixels16uc_nornd,mL1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
189 (uint8_t *block, const uint8_t *s0, const uint8_t *s1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
190 int line_size, int h)):
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
191 i3=r0; // dest
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
192 i0=r1; // src0
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
193 i1=r2; // src1
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
194 r2=[sp+12]; // line_size
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
195 p0=[sp+16]; // h
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
196
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
197 [--sp] = (r7:6);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
198 r2+=-12;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
199 m3=r2; // line_size
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
200 r2+=-4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
201 m0=r2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
202
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
203 LSETUP(pp16$2,pp16$3) LC0=P0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
204 DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
205
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
206 pp16$2:
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
207 DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
208 R6 = BYTEOP1P(R1:0,R3:2)(T) || R0 = [I0++] || R2 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
209 R7 = BYTEOP1P(R1:0,R3:2)(T,R) || R1 = [I0++] || R3 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
210 [I3++] = R6;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
211
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
212 R6 = BYTEOP1P(R1:0,R3:2)(T) || R0 = [I0++M0] || R2 =[I1++M0];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
213 R7 = BYTEOP1P(R1:0,R3:2)(T,R) || R0 = [I0++] || [I3++] = R7 ;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
214 [I3++] = R6;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
215 pp16$3: DISALGNEXCPT || R2 = [I1++] || [I3++M3] = R7;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
216
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
217 (r7:6) = [sp++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
218
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
219 RTS;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
220
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
221 DEFUN(z_put_pixels16_xy2,mL1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
222 (uint8_t *block, const uint8_t *s0,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
223 int dest_size, int line_size, int h)):
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
224 link 0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
225 [--sp] = (r7:4);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
226 i3=r0; // dest
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
227 i0=r1; // src0--> pixels
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
228 i1=r1; // src1--> pixels + line_size
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
229 r2+=-12;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
230 m2=r2; // m2=dest_width-4
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
231 r2=[fp+20];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
232 m3=r2; // line_size
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
233 p0=[fp+24]; // h
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
234 r2+=-16;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
235 i1+=m3; /* src1 + line_size */
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
236 m0=r2; /* line-size - 20 */
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
237
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
238 B0 = I0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
239 B1 = I1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
240 B3 = I3;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
241
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
242 DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
243
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
244 LSETUP(LS$16E,LE$16E) LC0=P0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
245 LS$16E: DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
246 R4 = BYTEOP2P (R3:2,R1:0) (RNDL) || R0 = [I0++] || R2 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
247 R5 = BYTEOP2P (R3:2,R1:0) (RNDL,R) || R1 = [I0++] || [I3++] = R4 ;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
248 DISALGNEXCPT || R3 = [I1++] || [I3++] = R5;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
249 R4 = BYTEOP2P (R3:2,R1:0) (RNDL) || R0 = [I0++M0]|| R2 = [I1++M0];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
250 R5 = BYTEOP2P (R3:2,R1:0) (RNDL,R) || R0 = [I0++] || [I3++] = R4 ;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
251 LE$16E: DISALGNEXCPT || R2 = [I1++] || [I3++M2] = R5;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
252
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
253 M1 = 1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
254 I3 = B3;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
255 I1 = B1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
256 I0 = B0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
257
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
258 I0 += M1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
259 I1 += M1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
260
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
261 DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
262 LSETUP(LS$16O,LE$16O) LC0=P0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
263 LS$16O: DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
264 R4 = BYTEOP2P (R3:2,R1:0) (RNDH) || R0 = [I0++] || R2 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
265 R5 = BYTEOP2P (R3:2,R1:0) (RNDH,R) || R1 = [I0++] || R6 =[I3++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
266 R4 = R4 +|+ R6 || R7 = [I3--];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
267 R5 = R5 +|+ R7 || [I3++] = R4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
268 DISALGNEXCPT || R3 =[I1++] || [I3++] = R5;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
269 R4 = BYTEOP2P (R3:2,R1:0) (RNDH) || R0 = [I0++M0]|| R2 = [I1++M0];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
270 R5 = BYTEOP2P (R3:2,R1:0) (RNDH,R) || R0 = [I0++] || R6 = [I3++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
271 R4 = R4 +|+ R6 || R7 = [I3--];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
272 R5 = R5 +|+ R7 || [I3++] = R4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
273 LE$16O: DISALGNEXCPT || R2 = [I1++] || [I3++M2] = R5;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
274
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
275 (r7:4) = [sp++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
276 unlink;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
277 rts;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
278
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
279 DEFUN(put_pixels16_xy2_nornd,mL1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
280 (uint8_t *block, const uint8_t *s0,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
281 int line_size, int h)):
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
282 link 0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
283 [--sp] = (r7:4);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
284 i3=r0; // dest
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
285 i0=r1; // src0--> pixels
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
286 i1=r1; // src1--> pixels + line_size
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
287 m3=r2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
288 r2+=-12;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
289 m2=r2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
290 r2+=-4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
291 i1+=m3; /* src1 + line_size */
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
292 m0=r2; /* line-size - 20 */
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
293 p0=[fp+20]; // h
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
294
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
295 B0=I0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
296 B1=I1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
297 B3=I3;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
298
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
299 DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
300
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
301 LSETUP(LS$16ET,LE$16ET) LC0=P0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
302 LS$16ET:DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
303 R4 = BYTEOP2P (R3:2,R1:0) (TL) || R0 = [I0++] || R2 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
304 R5 = BYTEOP2P (R3:2,R1:0) (TL,R) || R1 = [I0++] || [I3++] = R4 ;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
305 DISALGNEXCPT || R3 = [I1++] || [I3++] = R5;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
306 R4 = BYTEOP2P (R3:2,R1:0) (TL) || R0 = [I0++M0]|| R2 = [I1++M0];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
307 R5 = BYTEOP2P (R3:2,R1:0) (TL,R) || R0 = [I0++] || [I3++] = R4 ;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
308 LE$16ET:DISALGNEXCPT || R2 = [I1++] || [I3++M2] = R5;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
309
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
310 M1 = 1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
311 I3=B3;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
312 I1=B1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
313 I0=B0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
314
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
315 I0 += M1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
316 I1 += M1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
317
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
318 DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
319 LSETUP(LS$16OT,LE$16OT) LC0=P0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
320 LS$16OT:DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
321 R4 = BYTEOP2P (R3:2,R1:0) (TH) || R0 = [I0++] || R2 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
322 R5 = BYTEOP2P (R3:2,R1:0) (TH,R) || R1 = [I0++] || R6 =[I3++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
323 R4 = R4 +|+ R6 || R7 = [I3--];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
324 R5 = R5 +|+ R7 || [I3++] = R4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
325 DISALGNEXCPT || R3 =[I1++] || [I3++] = R5;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
326 R4 = BYTEOP2P (R3:2,R1:0) (TH) || R0 = [I0++M0]|| R2 = [I1++M0];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
327 R5 = BYTEOP2P (R3:2,R1:0) (TH,R) || R0 = [I0++] || R6 = [I3++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
328 R4 = R4 +|+ R6 || R7 = [I3--];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
329 R5 = R5 +|+ R7 || [I3++] = R4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
330 LE$16OT:DISALGNEXCPT || R2 = [I1++] || [I3++M2] = R5;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
331
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
332 (r7:4) = [sp++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
333 unlink;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
334 rts;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
335
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
336 DEFUN(z_put_pixels8_xy2,mL1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
337 (uint8_t *block, const uint8_t *s0,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
338 int dest_size, int line_size, int h)):
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
339 link 0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
340 [--sp] = (r7:4);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
341 i3=r0; // dest
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
342 i0=r1; // src0--> pixels
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
343 i1=r1; // src1--> pixels + line_size
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
344 r2+=-4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
345 m2=r2; // m2=dest_width-4
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
346 r2=[fp+20];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
347 m3=r2; // line_size
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
348 p0=[fp+24]; // h
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
349 r2+=-8;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
350 i1+=m3; /* src1 + line_size */
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
351 m0=r2; /* line-size - 20 */
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
352
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
353 b0 = I0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
354 b1 = I1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
355 b3 = I3;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
356
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
357 LSETUP(LS$8E,LE$8E) LC0=P0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
358 DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
359 LS$8E: DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
360 R4 = BYTEOP2P (R3:2,R1:0) (RNDL) || R0 = [I0++M0] || R2 =[I1++M0];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
361 R5 = BYTEOP2P (R3:2,R1:0) (RNDL,R) || R0 = [I0++] || [I3++] = R4 ;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
362 LE$8E: DISALGNEXCPT || R2 = [I1++] || [I3++M2] = R5;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
363
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
364 M1 = 1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
365 I3 = b3;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
366 I1 = b1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
367 I0 = b0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
368
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
369 I0 += M1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
370 I1 += M1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
371
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
372 LSETUP(LS$8O,LE$8O) LC0=P0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
373 DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
374 LS$8O: DISALGNEXCPT || R1 = [I0++] || R3 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
375 R4 = BYTEOP2P (R3:2,R1:0) (RNDH) || R0 = [I0++M0] || R2 =[I1++M0];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
376 R5 = BYTEOP2P (R3:2,R1:0) (RNDH,R) || R0 = [I0++] || R6 =[I3++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
377 R4 = R4 +|+ R6 || R7 = [I3--];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
378 R5 = R5 +|+ R7 || [I3++] = R4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
379 LE$8O: DISALGNEXCPT || R2 =[I1++] || [I3++M2] = R5;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
380
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
381 (r7:4) = [sp++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
382 unlink;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
383 rts;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
384
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
385 DEFUN(put_pixels8_xy2_nornd,mL1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
386 (uint8_t *block, const uint8_t *s0, int line_size, int h)):
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
387 link 0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
388 [--sp] = (r7:4);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
389 i3=r0; // dest
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
390 i0=r1; // src0--> pixels
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
391 i1=r1; // src1--> pixels + line_size
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
392 m3=r2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
393 r2+=-4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
394 m2=r2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
395 r2+=-4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
396 i1+=m3; /* src1 + line_size */
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
397 m0=r2; /* line-size - 20 */
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
398 p0=[fp+20]; // h
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
399
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
400
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
401 b0 = I0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
402 b1 = I1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
403 b3 = I3;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
404
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
405 LSETUP(LS$8ET,LE$8ET) LC0=P0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
406 DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
407
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
408 LS$8ET: DISALGNEXCPT || R1 = [I0++] || R3 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
409 R4 = BYTEOP2P (R3:2,R1:0) (TL) || R0 = [I0++M0] || R2 = [I1++M0];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
410 R5 = BYTEOP2P (R3:2,R1:0) (TL,R) || R0 = [I0++] || [I3++] = R4 ;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
411 LE$8ET: DISALGNEXCPT || R2 = [I1++] || [I3++M2] = R5;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
412
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
413 M1 = 1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
414 I3 = b3;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
415 I1 = b1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
416 I0 = b0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
417
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
418 I0 += M1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
419 I1 += M1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
420
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
421 LSETUP(LS$8OT,LE$8OT) LC0=P0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
422 DISALGNEXCPT || R0 = [I0++] || R2 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
423
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
424 LS$8OT: DISALGNEXCPT || R1 = [I0++] || R3 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
425 R4 = BYTEOP2P (R3:2,R1:0) (TH) || R0 = [I0++M0] || R2 = [I1++M0];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
426 R5 = BYTEOP2P (R3:2,R1:0) (TH,R) || R0 = [I0++] || R6 = [I3++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
427 R4 = R4 +|+ R6 || R7 = [I3--];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
428 R5 = R5 +|+ R7 || [I3++] = R4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
429 LE$8OT: DISALGNEXCPT || R2 =[I1++] || [I3++M2] = R5;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
430
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
431 (r7:4) = [sp++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
432 unlink;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
433 rts;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
434
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
435 DEFUN(diff_pixels,mL1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
436 (DCTELEM *block, uint8_t *s1, uint8_t *s2, int stride)):
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
437 link 0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
438 [--sp] = (r7:4);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
439 p0=8;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
440 i3=r0; // block
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
441 i0=r1; // s1
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
442 i1=r2; // s2
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
443 r2=[fp+20]; // stride
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
444 r2+=-8;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
445 m0=r2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
446
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
447
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
448 LSETUP(.LS0,.LE0) LC0=P0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
449 DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
450
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
451 .LS0: DISALGNEXCPT || R1 = [I0++] || R3 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
452 (R5,R4) = BYTEOP16M (R1:0,R3:2) || R0 = [I0++M0] || R2 = [I1++M0];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
453 (R7,R6) = BYTEOP16M (R1:0,R3:2) (R)|| R0 = [I0++] || [I3++] = R4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
454 DISALGNEXCPT || R2 = [I1++] || [I3++] = R5;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
455 [i3++]=r6;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
456 .LE0: [i3++]=r7;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
457
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
458 (r7:4) = [sp++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
459 unlink;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
460 rts;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
461
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
462 /*
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
463 for (i = 0; i < 16; i++) {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
464 for (j = 0; j < 16; j++) {
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
465 sum += pix[j];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
466 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
467 pix += line_size;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
468 }
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
469 */
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
470 DEFUN(pix_sum,mL1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
471 (uint8_t *p, int stride)):
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
472 link 0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
473 [--sp] = (r7:4);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
474 p0=8;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
475 i0=r0; // s1
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
476 i1=r0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
477 m1=r1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
478 r1=r1+r1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
479 r1+=-16; // stride
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
480 m0=r1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
481 i1+=m1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
482
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
483 r6=0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
484
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
485 LSETUP(LS$PS,LE$PS) LC0=P0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
486 DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
487
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
488 LS$PS: DISALGNEXCPT || R1 = [I0++] || R3 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
489 (R5,R4) = BYTEOP16P (R3:2,R1:0) || R0 = [I0++] || R2 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
490 r6=r6+|+r5;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
491 r6=r6+|+r4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
492 (R5,R4) = BYTEOP16P (R3:2,R1:0) (R)|| R1 = [I0++] || R3 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
493 r6=r6+|+r5;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
494 r6=r6+|+r4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
495 (R5,R4) = BYTEOP16P (R3:2,R1:0) || R0 = [I0++m0] || R2 = [I1++m0];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
496 r6=r6+|+r5;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
497 r6=r6+|+r4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
498 (R5,R4) = BYTEOP16P (R3:2,R1:0) (R)|| R0 = [I0++] || R2 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
499 r6=r6+|+r5;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
500 LE$PS: r6=r6+|+r4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
501 r0.l=r6.l+r6.h;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
502 r0.h=0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
503
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
504 (r7:4) = [sp++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
505 unlink;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
506 rts;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
507
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
508
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
509 DEFUN(get_pixels,mL1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
510 (DCTELEM *restrict block, const uint8_t *pixels, int line_size)):
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
511 [--sp] = (r7:4);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
512 i3=r0; // dest
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
513 i0=r1; // src0
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
514 p0=8;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
515 r2+=-8;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
516 m0=r2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
517 LSETUP(gp8$0,gp8$1) LC0=P0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
518
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
519 DISALGNEXCPT || R0 = [I0++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
520 DISALGNEXCPT || R1 = [I0++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
521
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
522 gp8$0: (R7,R6) = byteunpack R1:0 || R0 = [I0++M0];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
523 (R5,R4) = byteunpack R1:0 (R) || R0 = [I0++] || [I3++]=R6;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
524 DISALGNEXCPT || R1 = [I0++] || [I3++]=R7;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
525 [I3++]=R4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
526 gp8$1: [I3++]=R5
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
527
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
528
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
529 (r7:4) = [sp++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
530 RTS;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
531
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
532
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
533 /* sad = sad16x16 (ubyte *mb, ubyte *refwin, srcwidth, refwinwidth, h) */
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
534 /* 91 cycles */
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
535 DEFUN(z_sad16x16,mL1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
536 (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h)):
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
537 link 0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
538 I0 = R0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
539 I1 = R1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
540
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
541 A1 = A0 = 0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
542 R0 = [sp+20]; // rwidth
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
543 P2 = [sp+24]; // height
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
544 R3 = 16;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
545 R0 = R0 - R3;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
546 R3 = R2 - R3;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
547 M1 = R0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
548 M0 = R3;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
549
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
550 DISALGNEXCPT || R0 = [I0++] || R2 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
551 LSETUP (s$16, e$16) LC0=P2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
552 s$16: DISALGNEXCPT || R1 = [I0++] || R3 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
553 SAA (R1:0,R3:2) || R0 = [I0++] || R2 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
554 SAA (R1:0,R3:2) (R) || R1 = [I0++] || R3 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
555 SAA (R1:0,R3:2) || R0 = [I0++M0] || R2 = [I1++M1];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
556 e$16: SAA (R1:0,R3:2) (R) || R0 = [I0++] || R2 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
557
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
558 R3=A1.L+A1.H, R2=A0.L+A0.H ;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
559 R0 = R2 + R3 ;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
560 unlink;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
561 RTS;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
562
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
563 /* sad = sad8x8 (ubyte *mb, ubyte *refwin, int srcwidth, int refwinwidth, int h) */
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
564 /* 36 cycles */
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
565 DEFUN(z_sad8x8,mL1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
566 (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h)):
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
567 I0 = R0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
568 I1 = R1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
569
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
570 A1 = A0 = 0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
571 r0 = [sp+12]; // rwidth
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
572 P2 = [sp+16]; //height
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
573 R3 = 8;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
574 R0 = R0 - R3;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
575 R3 = R2 - R3;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
576 M0 = R3;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
577 M1 = R0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
578
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
579 LSETUP (s$8, e$8) LC0=P2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
580 DISALGNEXCPT || R0 = [I0++] || R2 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
581 DISALGNEXCPT || R1 = [I0++] || R3 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
582 s$8: SAA (R1:0,R3:2) || R0 = [I0++M0] || R2 = [I1++M1];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
583 SAA (R1:0,R3:2) (R) || R0 = [I0++] || R2 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
584 e$8: DISALGNEXCPT || R1 = [I0++] || R3 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
585
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
586 R3=A1.L+A1.H, R2=A0.L+A0.H ;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
587 R0 = R2 + R3 ;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
588 RTS;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
589
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
590 DEFUN(pix_norm1,mL1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
591 (uint8_t * pix, int line_size)):
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
592 [--SP]=(R7:4,P5:3);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
593
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
594 // Fetch the input arguments.
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
595 P1 = R0; // pix
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
596 P0 = R1; // line_size
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
597 P5 = 16; // loop ctr.
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
598 P0 -= P5;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
599 M0 = P0; // M0 = line_size-16;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
600 // Now for the real work.
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
601 A1 = A0 = 0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
602 lsetup(_pix_norm1_blkfn_loopStart, _pix_norm1_blkfn_loopEnd) LC1 = P5;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
603 I0 = P1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
604 DISALGNEXCPT || r0 = [i0++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
605
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
606 _pix_norm1_blkfn_loopStart:
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
607 // following unpacks pix1[0..15] pix1+line_size[0..15]
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
608 DISALGNEXCPT || r1 = [i0++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
609
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
610 (r5, r4) = byteunpack r1:0 || r0 = [i0++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
611 a1 += r5.h * r5.h, a0 += r5.l * r5.l (is);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
612 a1 += r4.h * r4.h, a0 += r4.l * r4.l (is);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
613 (r5, r4) = byteunpack r1:0(r) || r1 = [i0++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
614 a1 += r5.h * r5.h, a0 += r5.l * r5.l (is);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
615 a1 += r4.h * r4.h, a0 += r4.l * r4.l (is);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
616 (r5, r4) = byteunpack r1:0 || r0 = [i0++M0];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
617 a1 += r5.h * r5.h, a0 += r5.l * r5.l (is);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
618 a1 += r4.h * r4.h, a0 += r4.l * r4.l (is);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
619 (r5, r4) = byteunpack r1:0(r) || r0 = [i0++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
620 a1 += r5.h * r5.h, a0 += r5.l * r5.l (is);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
621 _pix_norm1_blkfn_loopEnd:
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
622 a1 += r4.h * r4.h, a0 += r4.l * r4.l (is);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
623
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
624
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
625 // Clean up at the end:
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
626 R2 = A0, R3 = A1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
627 R0 = R2 + R3 (S);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
628
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
629 (R7:4,P5:3)=[SP++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
630
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
631 RTS;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
632
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
633 DEFUN(sse4,mL1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
634 (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)):
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
635 link 0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
636 [--sp] = (r7:6);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
637 p0=[fp+24]; // h
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
638 i0=r1; // pix1
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
639 i1=r2; // pix2
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
640 r2=[fp+20]; // line_size
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
641 r2+=-4;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
642 m0=r2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
643
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
644 a0=a1=0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
645 LSETUP(.S40,.E40) LC0=P0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
646 DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
647
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
648 .S40: DISALGNEXCPT || R1 = [I0++M0] || R3 = [I1++M0];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
649 (R7,R6) = BYTEOP16M (R1:0,R3:2);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
650 a0 += r7.l * r7.l, a1 += r7.h * r7.h (is);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
651 .E40: a0 += r6.l * r6.l, a1 += r6.h * r6.h (is);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
652 a0 += a1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
653 r0 = a0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
654
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
655 (r7:6) = [sp++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
656 unlink;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
657 rts;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
658
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
659 DEFUN(sse8,mL1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
660 (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)):
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
661 link 0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
662 [--sp] = (r7:6);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
663 p0=[fp+24]; // h
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
664 i0=r1; // pix1
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
665 i1=r2; // pix2
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
666 r2=[fp+20]; // line_size
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
667 r2+=-8;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
668 m0=r2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
669
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
670 a0=a1=0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
671 LSETUP(.S80,.E80) LC0=P0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
672 DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
673
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
674 .S80: DISALGNEXCPT || R1 = [I0++] || R3 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
675 (R7,R6) = BYTEOP16M (R1:0,R3:2) || R0 = [I0++M0] || R2 = [I1++M0];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
676 a0 += r7.l * r7.l, a1 += r7.h * r7.h (is);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
677 a0 += r6.l * r6.l, a1 += r6.h * r6.h (is);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
678 (R7,R6) = BYTEOP16M (R1:0,R3:2) (R)|| R0 = [I0++] || R2 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
679 a0 += r7.l * r7.l, a1 += r7.h * r7.h (is);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
680 .E80: a0 += r6.l * r6.l, a1 += r6.h * r6.h (is);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
681 a0 += a1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
682 r0 = a0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
683
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
684 (r7:6) = [sp++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
685 unlink;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
686 rts;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
687
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
688 DEFUN(sse16,mL1,
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
689 (void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)):
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
690 link 0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
691 [--sp] = (r7:6);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
692 p0=[fp+24]; // h
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
693 i0=r1; // pix1
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
694 i1=r2; // pix2
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
695 r2=[fp+20]; // line_size
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
696 r2+=-16;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
697 m0=r2;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
698
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
699 a0=a1=0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
700 DISALGNEXCPT || R0 = [I0++] || R2 =[I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
701 LSETUP(.S160,.E160) LC0=P0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
702
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
703 .S160: DISALGNEXCPT || R1 = [I0++] || R3 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
704 (R7,R6) = BYTEOP16M (R1:0,R3:2) || R0 = [I0++] || R2 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
705 a0 += r7.l * r7.l, a1 += r7.h * r7.h (is);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
706 a0 += r6.l * r6.l, a1 += r6.h * r6.h (is);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
707 (R7,R6) = BYTEOP16M (R1:0,R3:2) (R)|| R1 = [I0++] || R3 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
708 a0 += r7.l * r7.l, a1 += r7.h * r7.h (is);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
709 a0 += r6.l * r6.l, a1 += r6.h * r6.h (is);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
710 (R7,R6) = BYTEOP16M (R1:0,R3:2) || R0 = [I0++M0] || R2 = [I1++M0];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
711 a0 += r7.l * r7.l, a1 += r7.h * r7.h (is);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
712 a0 += r6.l * r6.l, a1 += r6.h * r6.h (is);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
713 (R7,R6) = BYTEOP16M (R1:0,R3:2) (R)|| R0 = [I0++] || R2 = [I1++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
714 a0 += r7.l * r7.l, a1 += r7.h * r7.h (is);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
715 .E160: a0 += r6.l * r6.l, a1 += r6.h * r6.h (is);
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
716 a0 += a1;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
717 r0 = a0;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
718
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
719 (r7:6) = [sp++];
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
720 unlink;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
721 rts;
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
722
85298e8c55c4 bfin dsputils, basic pixel operations sads, diffs, motion compensation
diego
parents:
diff changeset
723