1;//
2;// Copyright (C) 2007-2008 ARM Limited
3;//
4;// Licensed under the Apache License, Version 2.0 (the "License");
5;// you may not use this file except in compliance with the License.
6;// You may obtain a copy of the License at
7;//
8;//      http://www.apache.org/licenses/LICENSE-2.0
9;//
10;// Unless required by applicable law or agreed to in writing, software
11;// distributed under the License is distributed on an "AS IS" BASIS,
12;// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13;// See the License for the specific language governing permissions and
14;// limitations under the License.
15;//
16; /**
17; *
18; * File Name:  armVCM4P2_Clip8_s.s
19; * OpenMAX DL: v1.0.2
20; * Revision:   9641
21; * Date:       Thursday, February 7, 2008
22; *
23; *
24; *
25; *
26; * Description:
27; * Contains module for Clipping 16 bit value to [0,255] Range
28; */
29
30      INCLUDE omxtypes_s.h
31      INCLUDE armCOMM_s.h
32
33
34      M_VARIANTS ARM1136JS
35
36
37
38      IF ARM1136JS
39
40;//Input Arguments
41
42pSrc                 RN 0
43pDst                 RN 1
44step                 RN 2
45
46;// Local variables
47
48x0                   RN 3
49x1                   RN 4
50x2                   RN 5
51x3                   RN 6
52
53Count                RN 14
54
55
56        M_START armVCM4P2_Clip8,r6
57
58
59        MOV          Count,#8
60loop
61
62        LDMIA        pSrc!,{x0, x1}
63        SUBS         Count,Count, #1          ;// count down
64        LDMIA        pSrc!,{x2, x3}
65        USAT16       x0, #8, x0                 ;// clip two samples to [0,255]
66        USAT16       x1, #8, x1                 ;// clip two samples to [0,255]
67        STRB         x0, [pDst]
68        MOV          x0, x0, LSR #16
69        STRB         x0, [pDst,#1]
70        STRB         x1, [pDst,#2]
71        MOV          x1, x1, LSR #16
72        STRB         x1, [pDst,#3]
73
74        USAT16       x2, #8, x2                 ;// clip two samples to [0,255]
75        USAT16       x3, #8, x3                 ;// clip two samples to [0,255]
76        STRB         x2, [pDst,#4]
77        MOV          x2, x2, LSR #16
78        STRB         x2, [pDst,#5]
79        STRB         x3, [pDst,#6]
80        MOV          x3, x3, LSR #16
81        STRB         x3, [pDst,#7]
82        ADD          pDst,pDst,step             ;// Increment pDst by step value
83
84        BGT          loop                       ;// Continue loop until Count reaches 64
85
86        M_END
87        ENDIF
88
89        END
90