History

move some common functions to common.cpp and add some functions in common

ruil2 committed 12 years ago

Commit 6b3f89d1 parent bbd3eb211 files · +276 −143Browse files

Showing the changes to codec/processing/src/common/common.cpp (1 of 11 files). Show all

Unified · Split

codec/processing/src/common/common.cpp+73−0
@@ -0,0 +1,73 @@
1/*!
2 * \copy
3 * Copyright (c) 2013, Cisco Systems
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * * Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * * Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
16 * distribution.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
24 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
28 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 *
31 */
32
33#include "common.h"
34#include "ls_defines.h"
35
36WELSVP_NAMESPACE_BEGIN
37
38void WelsI16x16LumaPredV_c (uint8_t* pPred, uint8_t* pRef, const int32_t kiStride) {
39 uint8_t i = 15;
40 const int8_t* kpSrc = (int8_t*)&pRef[-kiStride];
41 const uint64_t kuiT1 = LD64 (kpSrc);
42 const uint64_t kuiT2 = LD64 (kpSrc + 8);
43 uint8_t* pDst = pPred;
44
45 do {
46 ST64 (pDst , kuiT1);
47 ST64 (pDst + 8, kuiT2);
48 pDst += 16;
49 } while (i-- > 0);
50}
51
52void WelsI16x16LumaPredH_c (uint8_t* pPred, uint8_t* pRef, const int32_t kiStride) {
53 int32_t iStridex15 = (kiStride << 4) - kiStride;
54 int32_t iPredStride = 16;
55 int32_t iPredStridex15 = 240; //(iPredStride<<4)-iPredStride;
56 uint8_t i = 15;
57
58 do {
59 const uint8_t kuiSrc8 = pRef[iStridex15 - 1];
60#ifdef _MSC_VER
61 const uint64_t kuiV64 = (uint64_t) (0x0101010101010101U * kuiSrc8);
62#else
63 const uint64_t kuiV64 = (uint64_t) (0x0101010101010101LL * kuiSrc8);
64#endif
65 ST64 (&pPred[iPredStridex15], kuiV64);
66 ST64 (&pPred[iPredStridex15 + 8], kuiV64);
67
68 iStridex15 -= kiStride;
69 iPredStridex15 -= iPredStride;
70 } while (i-- > 0);
71}
72
73WELSVP_NAMESPACE_END

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t