• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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    expand_pic.h
33  *
34  * \brief   Interface for expanding reconstructed picture to be used for reference
35  *
36  * \date    06/08/2009
37  *************************************************************************************
38  */
39 
40 #ifndef EXPAND_PICTURE_H
41 #define EXPAND_PICTURE_H
42 
43 #include "typedefs.h"
44 
45 #if defined(__cplusplus)
46 extern "C" {
47 #endif//__cplusplus
48 
49 #define PADDING_LENGTH 32 // reference extension
50 #define CHROMA_PADDING_LENGTH 16 // chroma reference extension
51 
52 #if defined(X86_ASM)
53 void ExpandPictureLuma_sse2 (uint8_t* pDst,
54                              const int32_t kiStride,
55                              const int32_t kiPicW,
56                              const int32_t kiPicH);
57 void ExpandPictureChromaAlign_sse2 (uint8_t* pDst,
58                                     const int32_t kiStride,
59                                     const int32_t kiPicW,
60                                     const int32_t kiPicH);
61 void ExpandPictureChromaUnalign_sse2 (uint8_t* pDst,
62                                       const int32_t kiStride,
63                                       const int32_t kiPicW,
64                                       const int32_t kiPicH);
65 #endif//X86_ASM
66 
67 #if defined(HAVE_NEON)
68 void ExpandPictureLuma_neon (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW, const int32_t kiPicH);
69 void ExpandPictureChroma_neon (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW, const int32_t kiPicH);
70 #endif
71 #if defined(HAVE_NEON_AARCH64)
72 void ExpandPictureLuma_AArch64_neon (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW, const int32_t kiPicH);
73 void ExpandPictureChroma_AArch64_neon (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW,
74                                        const int32_t kiPicH);
75 #endif
76 
77 #if defined(HAVE_MMI)
78 void ExpandPictureLuma_mmi (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW,
79                             const int32_t kiPicH);
80 void ExpandPictureChromaAlign_mmi (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW,
81                                    const int32_t kiPicH);
82 void ExpandPictureChromaUnalign_mmi (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW,
83                                      const int32_t kiPicH);
84 #endif//HAVE_MMI
85 
86 typedef void (*PExpandPictureFunc) (uint8_t* pDst, const int32_t kiStride, const int32_t kiPicW, const int32_t kiPicH);
87 
88 typedef struct TagExpandPicFunc {
89   PExpandPictureFunc pfExpandLumaPicture;
90   PExpandPictureFunc pfExpandChromaPicture[2];
91 } SExpandPicFunc;
92 
93 void PadMBLuma_c (uint8_t*& pDst, const int32_t& kiStride, const int32_t& kiPicW, const int32_t& kiPicH,
94                   const int32_t& kiMbX, const int32_t& kiMbY, const int32_t& kiMBWidth, const int32_t& kiMBHeight);
95 void PadMBChroma_c (uint8_t*& pDst, const int32_t& kiStride, const int32_t& kiPicW, const int32_t& kiPicH,
96                     const int32_t& kiMbX, const int32_t& kiMbY, const int32_t& kiMBWidth, const int32_t& kiMBHeight);
97 
98 void ExpandReferencingPicture (uint8_t* pData[3], int32_t iWidth, int32_t iHeight, int32_t iStride[3],
99                                PExpandPictureFunc pExpLuma, PExpandPictureFunc pExpChrom[2]);
100 
101 void InitExpandPictureFunc (SExpandPicFunc* pExpandPicFunc, const uint32_t kuiCPUFlags);
102 
103 #if defined(__cplusplus)
104 }
105 #endif//__cplusplus
106 
107 #endif
108