summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/codecs/on2/h264dec/omxdl/arm11/vc/m4p2/src/armVCM4P2_Clip8_s.s
blob: 241d441f0a4a7f61ac4a607c242a56171f710b40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
;//
;// Copyright (C) 2007-2008 ARM Limited
;//
;// Licensed under the Apache License, Version 2.0 (the "License");
;// you may not use this file except in compliance with the License.
;// You may obtain a copy of the License at
;//
;//      http://www.apache.org/licenses/LICENSE-2.0
;//
;// Unless required by applicable law or agreed to in writing, software
;// distributed under the License is distributed on an "AS IS" BASIS,
;// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
;// See the License for the specific language governing permissions and
;// limitations under the License.
;//
; /**
; * 
; * File Name:  armVCM4P2_Clip8_s.s
; * OpenMAX DL: v1.0.2
; * Revision:   9641
; * Date:       Thursday, February 7, 2008
; * 
; * 
; * 
; *
; * Description: 
; * Contains module for Clipping 16 bit value to [0,255] Range
; */ 

      INCLUDE omxtypes_s.h
      INCLUDE armCOMM_s.h
      

      M_VARIANTS ARM1136JS

        
     
      IF ARM1136JS
 
;//Input Arguments

pSrc                 RN 0
pDst                 RN 1
step                 RN 2

;// Local variables

x0                   RN 3
x1                   RN 4
x2                   RN 5
x3                   RN 6

Count                RN 14
     
        
        M_START armVCM4P2_Clip8,r6
       

        MOV          Count,#8
loop

        LDMIA        pSrc!,{x0, x1}
        SUBS         Count,Count, #1          ;// count down
        LDMIA        pSrc!,{x2, x3}
        USAT16       x0, #8, x0                 ;// clip two samples to [0,255]
        USAT16       x1, #8, x1                 ;// clip two samples to [0,255]
        STRB         x0, [pDst]
        MOV          x0, x0, LSR #16
        STRB         x0, [pDst,#1]
        STRB         x1, [pDst,#2]
        MOV          x1, x1, LSR #16
        STRB         x1, [pDst,#3]
                
        USAT16       x2, #8, x2                 ;// clip two samples to [0,255]
        USAT16       x3, #8, x3                 ;// clip two samples to [0,255]
        STRB         x2, [pDst,#4]
        MOV          x2, x2, LSR #16
        STRB         x2, [pDst,#5]
        STRB         x3, [pDst,#6]
        MOV          x3, x3, LSR #16
        STRB         x3, [pDst,#7]
        ADD          pDst,pDst,step             ;// Increment pDst by step value
         
        BGT          loop                       ;// Continue loop until Count reaches 64 

        M_END
        ENDIF
        
        END