Coverage Report

Created: 2025-07-12 07:05

/src/openh264/codec/common/src/copy_mb.cpp
Line
Count
Source (jump to first uncovered line)
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    copy_mb.cpp
33
 *
34
 * \brief   copy MB YUV data
35
 *
36
 * \date    2014.04.14 Created
37
 *
38
 *************************************************************************************
39
 */
40
41
#include "copy_mb.h"
42
#include "macros.h"
43
#include "ls_defines.h"
44
45
/****************************************************************************
46
 * Copy functions
47
 ****************************************************************************/
48
0
void WelsCopy4x4_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS) {
49
0
  const int32_t kiSrcStride2 = iStrideS << 1;
50
0
  const int32_t kiSrcStride3 = iStrideS + kiSrcStride2;
51
0
  const int32_t kiDstStride2 = iStrideD << 1;
52
0
  const int32_t kiDstStride3 = iStrideD + kiDstStride2;
53
54
0
  ST32 (pDst,                LD32 (pSrc));
55
0
  ST32 (pDst + iStrideD,     LD32 (pSrc + iStrideS));
56
0
  ST32 (pDst + kiDstStride2, LD32 (pSrc + kiSrcStride2));
57
0
  ST32 (pDst + kiDstStride3, LD32 (pSrc + kiSrcStride3));
58
0
}
59
0
void WelsCopy8x4_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS) {
60
0
  WelsCopy4x4_c (pDst, iStrideD, pSrc, iStrideS);
61
0
  WelsCopy4x4_c (pDst + 4, iStrideD, pSrc + 4, iStrideS);
62
0
}
63
0
void WelsCopy4x8_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS) {
64
0
  WelsCopy4x4_c (pDst, iStrideD, pSrc, iStrideS);
65
0
  WelsCopy4x4_c (pDst + (iStrideD << 2), iStrideD, pSrc + (iStrideS << 2), iStrideS);
66
0
}
67
0
void WelsCopy8x8_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS) {
68
0
  int32_t i;
69
0
  for (i = 0; i < 4; i++) {
70
0
    ST32 (pDst,                 LD32 (pSrc));
71
0
    ST32 (pDst + 4 ,            LD32 (pSrc + 4));
72
0
    ST32 (pDst + iStrideD,      LD32 (pSrc + iStrideS));
73
0
    ST32 (pDst + iStrideD + 4 , LD32 (pSrc + iStrideS + 4));
74
0
    pDst += iStrideD << 1;
75
0
    pSrc += iStrideS << 1;
76
0
  }
77
0
}
78
0
void WelsCopy8x16_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS) {
79
0
  int32_t i;
80
0
  for (i = 0; i < 8; ++i) {
81
0
    ST32 (pDst,                 LD32 (pSrc));
82
0
    ST32 (pDst + 4 ,            LD32 (pSrc + 4));
83
0
    ST32 (pDst + iStrideD,      LD32 (pSrc + iStrideS));
84
0
    ST32 (pDst + iStrideD + 4 , LD32 (pSrc + iStrideS + 4));
85
0
    pDst += iStrideD << 1;
86
0
    pSrc += iStrideS << 1;
87
0
  }
88
0
}
89
0
void WelsCopy16x8_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS) {
90
0
  int32_t i;
91
0
  for (i = 0; i < 8; i++) {
92
0
    ST32 (pDst,         LD32 (pSrc));
93
0
    ST32 (pDst + 4 ,    LD32 (pSrc + 4));
94
0
    ST32 (pDst + 8 ,    LD32 (pSrc + 8));
95
0
    ST32 (pDst + 12 ,   LD32 (pSrc + 12));
96
0
    pDst += iStrideD ;
97
0
    pSrc += iStrideS;
98
0
  }
99
0
}
100
0
void WelsCopy16x16_c (uint8_t* pDst, int32_t iStrideD, uint8_t* pSrc, int32_t iStrideS) {
101
0
  int32_t i;
102
0
  for (i = 0; i < 16; i++) {
103
0
    ST32 (pDst,         LD32 (pSrc));
104
0
    ST32 (pDst + 4 ,    LD32 (pSrc + 4));
105
0
    ST32 (pDst + 8 ,    LD32 (pSrc + 8));
106
0
    ST32 (pDst + 12 ,   LD32 (pSrc + 12));
107
0
    pDst += iStrideD ;
108
0
    pSrc += iStrideS;
109
0
  }
110
0
}
111