omxVCCOMM_ExpandFrame_I_s.s revision 0c1bc742181ded4930842b46e9507372f0b1b963
1;//
2;//
3;// File Name:  omxVCCOMM_ExpandFrame_I_s.s
4;// OpenMAX DL: v1.0.2
5;// Revision:   12290
6;// Date:       Wednesday, April 9, 2008
7;//
8;// (c) Copyright 2007-2008 ARM Limited. All Rights Reserved.
9;//
10;//
11;//
12;// Description:
13;// This function will Expand Frame boundary pixels into Plane
14;//
15;//
16
17;// Include standard headers
18
19        INCLUDE omxtypes_s.h
20        INCLUDE armCOMM_s.h
21
22        M_VARIANTS CortexA8
23
24;// Import symbols required from other files
25;// (For example tables)
26
27
28;// Set debugging level
29DEBUG_ON    SETL {FALSE}
30
31
32
33    IF CortexA8
34
35        M_START omxVCCOMM_ExpandFrame_I,r11
36
37;//Input registers
38
39pSrcDstPlane    RN  0
40iFrameWidth     RN  1
41iFrameHeight    RN  2
42iExpandPels     RN  3
43iPlaneStep      RN  4
44pTop            RN  5
45pBot            RN  6
46pDstTop         RN  7
47pDstBot         RN  8
48pLeft           RN  5
49pRight          RN  6
50pDstLeft        RN  9
51pDstRight       RN  10
52Offset          RN  11
53Temp            RN  14
54Counter         RN  12
55Tmp             RN  7
56;//Output registers
57
58result          RN  0
59;// Neon registers
60qData0          QN  0.U8
61qData1          QN  1.U8
62dData0          DN  0.U8
63dData1          DN  1.U8
64dData2          DN  2.U8
65dData3          DN  3.U8
66
67        ;// Define stack arguments
68        M_ARG       pPlaneStep, 4
69
70        ;// Load argument from the stack
71        M_LDR       iPlaneStep, pPlaneStep
72
73        SUB         pTop, pSrcDstPlane, #0              ;// Top row pointer of the frame
74        MUL         Offset, iExpandPels, iPlaneStep     ;// E*Step
75        SUB         Temp, iFrameHeight, #1              ;// H-1
76        MUL         Temp, iPlaneStep, Temp              ;// (H-1)*Step
77        ADD         pBot, Temp, pSrcDstPlane            ;// BPtr = TPtr + (H-1)*Step
78        MOV         Temp, iFrameWidth                   ;// Outer loop counter
79
80        ;// Check if pSrcDstPlane and iPlaneStep are 16 byte aligned
81        TST         pSrcDstPlane, #0xf
82        TSTEQ       iPlaneStep, #0xf
83        BNE         Hor8Loop00
84
85        ;//
86        ;// Copy top and bottom region of the plane as follows
87        ;// top region = top row elements from the frame
88        ;// bottom region = last row elements from the frame
89        ;//
90
91        ;// Case for 16 byte alignment
92Hor16Loop00
93        SUB         pDstTop, pTop, Offset
94        VLD1        qData0, [pTop @128]!
95        MOV         Counter, iExpandPels                ;// Inner loop counter
96        ADD         pDstBot, pBot, iPlaneStep
97        VLD1        qData1, [pBot @128]!
98Ver16Loop0
99        VST1        qData0, [pDstTop @128], iPlaneStep
100        VST1        qData0, [pDstTop @128], iPlaneStep
101        VST1        qData0, [pDstTop @128], iPlaneStep
102        VST1        qData0, [pDstTop @128], iPlaneStep
103        VST1        qData0, [pDstTop @128], iPlaneStep
104        VST1        qData0, [pDstTop @128], iPlaneStep
105        VST1        qData0, [pDstTop @128], iPlaneStep
106        VST1        qData0, [pDstTop @128], iPlaneStep
107        SUBS        Counter, Counter, #8
108        VST1        qData1, [pDstBot @128], iPlaneStep
109        VST1        qData1, [pDstBot @128], iPlaneStep
110        VST1        qData1, [pDstBot @128], iPlaneStep
111        VST1        qData1, [pDstBot @128], iPlaneStep
112        VST1        qData1, [pDstBot @128], iPlaneStep
113        VST1        qData1, [pDstBot @128], iPlaneStep
114        VST1        qData1, [pDstBot @128], iPlaneStep
115        VST1        qData1, [pDstBot @128], iPlaneStep
116        BGT         Ver16Loop0
117
118        SUBS        Temp, Temp, #16
119        BGT         Hor16Loop00
120        B           EndAlignedLoop
121
122        ;// Case for 8 byte alignment
123Hor8Loop00
124        SUB         pDstTop, pTop, Offset
125        VLD1        qData0, [pTop @64]!
126        MOV         Counter, iExpandPels                ;// Inner loop counter
127        ADD         pDstBot, pBot, iPlaneStep
128        VLD1        qData1, [pBot @64]!
129Ver8Loop0
130        VST1        qData0, [pDstTop @64], iPlaneStep
131        VST1        qData0, [pDstTop @64], iPlaneStep
132        VST1        qData0, [pDstTop @64], iPlaneStep
133        VST1        qData0, [pDstTop @64], iPlaneStep
134        VST1        qData0, [pDstTop @64], iPlaneStep
135        VST1        qData0, [pDstTop @64], iPlaneStep
136        VST1        qData0, [pDstTop @64], iPlaneStep
137        VST1        qData0, [pDstTop @64], iPlaneStep
138        SUBS        Counter, Counter, #8
139        VST1        qData1, [pDstBot @64], iPlaneStep
140        VST1        qData1, [pDstBot @64], iPlaneStep
141        VST1        qData1, [pDstBot @64], iPlaneStep
142        VST1        qData1, [pDstBot @64], iPlaneStep
143        VST1        qData1, [pDstBot @64], iPlaneStep
144        VST1        qData1, [pDstBot @64], iPlaneStep
145        VST1        qData1, [pDstBot @64], iPlaneStep
146        VST1        qData1, [pDstBot @64], iPlaneStep
147        BGT         Ver8Loop0
148
149        SUBS        Temp, Temp, #16
150        BGT         Hor8Loop00
151
152EndAlignedLoop
153        ADD         Temp, pSrcDstPlane, iFrameWidth
154        SUB         pDstRight, Temp, Offset
155        SUB         pRight, Temp, #1
156        SUB         pDstLeft, pSrcDstPlane, Offset
157        SUB         pDstLeft, pDstLeft, iExpandPels
158        ADD         pLeft, pSrcDstPlane, #0
159
160        VLD1        {dData0 []}, [pLeft], iPlaneStep        ;// Top-Left corner pixel from frame duplicated in dData0
161        SUB         Offset, iPlaneStep, iExpandPels
162        VLD1        {dData1 []}, [pRight], iPlaneStep       ;// Top-Right corner pixel from frame duplicated in dData1
163        MOV         Temp, iExpandPels
164
165        ;//
166        ;// Copy top-left and top-right region of the plane as follows
167        ;// top-left region = top-left corner pixel from the frame
168        ;// top-right region = top-right corner pixel from the frame
169        ;//
170HorLoop11
171        MOV         Counter, iExpandPels
172VerLoop1
173        VST1        dData0, [pDstLeft], #8
174        SUBS        Counter, Counter, #8
175        VST1        dData1, [pDstRight], #8
176        BGT         VerLoop1
177
178        SUBS        Temp, Temp, #1
179        ADD         pDstLeft, pDstLeft, Offset
180        ADD         pDstRight, pDstRight, Offset
181        BPL         HorLoop11
182
183        SUB         iFrameHeight, iFrameHeight, #1
184        ;//
185        ;// Copy left and right region of the plane as follows
186        ;// Left region = copy the row with left start pixel from the frame
187        ;// Right region = copy the row with right end pixel from the frame
188        ;//
189HorLoop22
190        VLD1        {dData0 []}, [pLeft], iPlaneStep
191        MOV         Counter, iExpandPels
192        VLD1        {dData1 []}, [pRight], iPlaneStep
193VerLoop2
194        VST1        dData0, [pDstLeft], #8
195        SUBS        Counter, Counter, #8
196        VST1        dData1, [pDstRight], #8
197        BGT         VerLoop2
198
199        SUBS        iFrameHeight, iFrameHeight, #1
200        ADD         pDstLeft, pDstLeft, Offset
201        ADD         pDstRight, pDstRight, Offset
202        BGT         HorLoop22
203
204        MOV         Temp, iExpandPels
205        ;//
206        ;// Copy bottom-left and bottom-right region of the plane as follows
207        ;// bottom-left region = bottom-left corner pixel from the frame
208        ;// bottom-right region = bottom-right corner pixel from the frame
209        ;//
210HorLoop33
211        MOV         Counter, iExpandPels
212VerLoop3
213        VST1        dData0, [pDstLeft], #8
214        SUBS        Counter, Counter, #8
215        VST1        dData1, [pDstRight], #8
216        BGT         VerLoop3
217
218        SUBS        Temp, Temp, #1
219        ADD         pDstLeft, pDstLeft, Offset
220        ADD         pDstRight, pDstRight, Offset
221        BGT         HorLoop33
222End
223        MOV         r0, #OMX_Sts_NoErr
224
225        M_END
226
227    ENDIF
228
229
230
231
232;// Guarding implementation by the processor name
233
234
235
236    END