History

refine common moudle for part of intra prediction function

ruil2 committed 12 years ago

Commit ed341041 parent ffebbdb20 files · +482 −193Browse files

Showing the changes to codec/processing/src (3 of 20 files). Show all

Unified · Split

3 files
  1. codec/processing/src/common/common.cpp +0 −69
  2. codec/processing/src/common/common.h +12 −8
  3. codec/processing/src/complexityanalysis/ComplexityAnalysis.cpp +9 −1
codec/processing/src/common/common.cpp+0−69
@@ -1,69 +0,0 @@
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−
36−WELSVP_NAMESPACE_BEGIN
37−
38−void 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−
52−void 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− const uint64_t kuiV64 = (uint64_t) (0x0101010101010101ULL * kuiSrc8);
61− ST64 (&pPred[iPredStridex15], kuiV64);
62− ST64 (&pPred[iPredStridex15 + 8], kuiV64);
63−
64− iStridex15 -= kiStride;
65− iPredStridex15 -= iPredStride;
66− } while (i-- > 0);
67−}
68−
69−WELSVP_NAMESPACE_END
codec/processing/src/common/common.h+12−8
@@ -38,14 +38,24 @@ · 37 unmodified lines
3838 *
3939 */
4040
41−#ifndef WELSVP_SCENECHANGEDETECTIONCOMMON_H
42−#define WELSVP_SCENECHANGEDETECTIONCOMMON_H
41+#ifndef WELSVP_COMMON_H
42+#define WELSVP_COMMON_H
4343
4444 #include "util.h"
4545 #include "memory.h"
4646 #include "WelsFrameWork.h"
4747 #include "IWelsVP.h"
4848 #include "sad_common.h"
49+#include "intra_pred_common.h"
50+
51+
52+
53+typedef void (GetIntraPred) (uint8_t* pPred, uint8_t* pRef, const int32_t kiStride);
54+
55+typedef GetIntraPred* GetIntraPredPtr;
56+
57+GetIntraPred WelsI16x16LumaPredV_c;
58+GetIntraPred WelsI16x16LumaPredH_c;
4959
5060 WELSVP_NAMESPACE_BEGIN
5161
@@ -56,12 +66,6 @@ typedef SadFunc* SadFuncPtr; · 4 unmodified lines
5666 typedef int32_t (Sad16x16Func) (uint8_t* pSrcY, int32_t iSrcStrideY, uint8_t* pRefY, int32_t iRefStrideY);
5767 typedef Sad16x16Func* PSad16x16Func;
5868
59−typedef void (GetIntraPred) (uint8_t* pPred, uint8_t* pRef, const int32_t kiStride);
60−
61−typedef GetIntraPred* GetIntraPredPtr;
62−
63−GetIntraPred WelsI16x16LumaPredV_c;
64−GetIntraPred WelsI16x16LumaPredH_c;
6569
6670 #ifdef HAVE_NEON
6771 WELSVP_EXTERN_C_BEGIN
codec/processing/src/complexityanalysis/ComplexityAnalysis.cpp+9−1
@@ -33,10 +33,10 @@ · 32 unmodified lines
3333 #include "ComplexityAnalysis.h"
3434 #include "cpu.h"
3535 #include "macros.h"
36+#include "intra_pred_common.h"
3637
3738 WELSVP_NAMESPACE_BEGIN
3839
39−
4040 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
4141
4242 CComplexityAnalysis::CComplexityAnalysis (int32_t iCpuFlag) {
@@ -280,18 +280,26 @@ CComplexityAnalysisScreen::CComplexityAnalysisScreen (int32_t iCpuFlag) { · 237 unmodified lines
280280 #ifdef X86_ASM
281281 if (iCpuFlag & WELS_CPU_SSE2) {
282282 m_pSadFunc = WelsSampleSad16x16_sse2;
283+ m_pIntraFunc[0] = WelsI16x16LumaPredV_sse2;
284+ m_pIntraFunc[1] = WelsI16x16LumaPredH_sse2;
285+
283286 }
284287 #endif
285288
286289 #if defined (HAVE_NEON)
287290 if (iCpuFlag & WELS_CPU_NEON) {
288291 m_pSadFunc = WelsSampleSad16x16_neon;
292+ m_pIntraFunc[0] = WelsI16x16LumaPredV_neon;
293+ m_pIntraFunc[1] = WelsI16x16LumaPredH_neon;
294+
289295 }
290296 #endif
291297
292298 #if defined (HAVE_NEON_AARCH64)
293299 if (iCpuFlag & WELS_CPU_NEON) {
294300 m_pSadFunc = WelsSampleSad16x16_AArch64_neon;
301+ m_pIntraFunc[0] = WelsI16x16LumaPredV_AArch64_neon;
302+ m_pIntraFunc[1] = WelsI16x16LumaPredH_AArch64_neon;
295303 }
296304 #endif
297305

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