1@/******************************************************************************
2@ *
3@ * Copyright (C) 2015 The Android Open Source Project
4@ *
5@ * Licensed under the Apache License, Version 2.0 (the "License");
6@ * you may not use this file except in compliance with the License.
7@ * You may obtain a copy of the License at:
8@ *
9@ * http://www.apache.org/licenses/LICENSE-2.0
10@ *
11@ * Unless required by applicable law or agreed to in writing, software
12@ * distributed under the License is distributed on an "AS IS" BASIS,
13@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14@ * See the License for the specific language governing permissions and
15@ * limitations under the License.
16@ *
17@ *****************************************************************************
18@ * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore
19@*/
20
21
22@******************************************************************************
23@*
24@*
25@* @brief
26@*  This file contains definitions of routines for SAD caclulation
27@*
28@* @author
29@*  Ittiam
30@*
31@* @par List of Functions:
32@*  - icv_sad_8x4_a9()
33@*
34@* @remarks
35@*  None
36@*
37@*******************************************************************************
38
39
40@******************************************************************************
41@*
42@*  @brief computes distortion (SAD) between 2 8x4  blocks
43@*
44@*
45@*  @par   Description
46@*   This functions computes SAD between 2 8x4 blocks.
47@*
48@* @param[in] pu1_src
49@*  UWORD8 pointer to the source
50@*
51@* @param[out] pu1_ref
52@*  UWORD8 pointer to the reference buffer
53@*
54@* @param[in] src_strd
55@*  integer source stride
56@*
57@* @param[in] ref_strd
58@*  integer reference stride
59@*
60@* @param[in] wd
61@*  Width (assumed to be 8)
62@*
63@* @param[in] ht
64@*  Height (assumed to be 4)
65@*
66@* @returns
67@*  SAD value in r0
68@*
69@* @remarks
70@*
71@******************************************************************************
72
73    .global icv_sad_8x4_a9
74
75icv_sad_8x4_a9:
76
77    push          {lr}
78
79    vld1.8        d4, [r0], r2
80    vld1.8        d5, [r1], r3
81
82    vld1.8        d6, [r0], r2
83    vabdl.u8      q0, d5, d4
84
85    vld1.8        d7, [r1], r3
86    vabal.u8      q0, d7, d6
87
88    vld1.8        d4, [r0], r2
89    vld1.8        d5, [r1], r3
90
91    vld1.8        d6, [r0], r2
92    vabal.u8      q0, d5, d4
93
94    vld1.8        d7, [r1], r3
95    vabal.u8      q0, d7, d6
96
97    vadd.i16      d0, d1, d0
98    vpaddl.u16    d0, d0
99    vpaddl.u32    d0, d0
100
101    vmov.32       r0, d0[0]
102
103    pop           {pc}
104