/src/openh264/codec/common/src/intra_pred_common.cpp
Line | Count | Source |
1 | | /*! |
2 | | * \copy |
3 | | * Copyright (c) 2009-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 | | * \file get_intra_predictor.c |
33 | | * |
34 | | * \brief implementation for get intra predictor about 16x16, 4x4, chroma. |
35 | | * |
36 | | * \date 4/2/2009 Created |
37 | | * 9/14/2009 C level based optimization with high performance gained. |
38 | | * [const, using ST32/ST64 to replace memset, memcpy and memmove etc.] |
39 | | * |
40 | | ************************************************************************************* |
41 | | */ |
42 | | #include "ls_defines.h" |
43 | | #include "cpu_core.h" |
44 | | #include "intra_pred_common.h" |
45 | | |
46 | | |
47 | 0 | void WelsI16x16LumaPredV_c (uint8_t* pPred, uint8_t* pRef, const int32_t kiStride) { |
48 | 0 | uint8_t i = 15; |
49 | 0 | const int8_t* kpSrc = (int8_t*)&pRef[-kiStride]; |
50 | 0 | const uint64_t kuiT1 = LD64 (kpSrc); |
51 | 0 | const uint64_t kuiT2 = LD64 (kpSrc + 8); |
52 | 0 | uint8_t* pDst = pPred; |
53 | |
|
54 | 0 | do { |
55 | 0 | ST64 (pDst , kuiT1); |
56 | 0 | ST64 (pDst + 8, kuiT2); |
57 | 0 | pDst += 16; |
58 | 0 | } while (i-- > 0); |
59 | 0 | } |
60 | | |
61 | 0 | void WelsI16x16LumaPredH_c (uint8_t* pPred, uint8_t* pRef, const int32_t kiStride) { |
62 | 0 | int32_t iStridex15 = (kiStride << 4) - kiStride; |
63 | 0 | int32_t iPredStride = 16; |
64 | 0 | int32_t iPredStridex15 = 240; //(iPredStride<<4)-iPredStride; |
65 | 0 | uint8_t i = 15; |
66 | |
|
67 | 0 | do { |
68 | 0 | const uint8_t kuiSrc8 = pRef[iStridex15 - 1]; |
69 | 0 | const uint64_t kuiV64 = (uint64_t) (0x0101010101010101ULL * kuiSrc8); |
70 | 0 | ST64 (&pPred[iPredStridex15], kuiV64); |
71 | 0 | ST64 (&pPred[iPredStridex15 + 8], kuiV64); |
72 | |
|
73 | 0 | iStridex15 -= kiStride; |
74 | 0 | iPredStridex15 -= iPredStride; |
75 | 0 | } while (i-- > 0); |
76 | 0 | } |
77 | | |