Showing the changes to codec/decoder/core/src/mc.cpp (1 of 8 files). Show all
Unified · Split
| @@ -85,13 +85,13 @@ static const uint8_t g_kuiABCD[8][8][4] = { //g_kA[dy][dx], g_kB[dy][dx], g_kC[d · 84 unmodified lines | ||
| 85 | 85 | }; |
| 86 | 86 | |
| 87 | 87 | typedef void (*PWelsMcWidthHeightFunc) (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 88 | − int32_t iWidth, int32_t iHeight); | |
| 88 | + int32_t iWidth, int32_t iHeight); | |
| 89 | 89 | |
| 90 | 90 | //***************************************************************************// |
| 91 | 91 | // C code implementation // |
| 92 | 92 | //***************************************************************************// |
| 93 | 93 | static inline void McCopyWidthEq2_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 94 | − int32_t iHeight) { | |
| 94 | + int32_t iHeight) { | |
| 95 | 95 | int32_t i; |
| 96 | 96 | for (i = 0; i < iHeight; i++) { // iWidth == 2 only for chroma |
| 97 | 97 | ST16A2 (pDst, LD16 (pSrc)); |
| @@ -101,7 +101,7 @@ static inline void McCopyWidthEq2_c (const uint8_t* pSrc, int32_t iSrcStride, ui · 3 unmodified lines | ||
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | static inline void McCopyWidthEq4_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 104 | − int32_t iHeight) { | |
| 104 | + int32_t iHeight) { | |
| 105 | 105 | int32_t i; |
| 106 | 106 | for (i = 0; i < iHeight; i++) { |
| 107 | 107 | ST32A4 (pDst, LD32 (pSrc)); |
| @@ -111,7 +111,7 @@ static inline void McCopyWidthEq4_c (const uint8_t* pSrc, int32_t iSrcStride, ui · 3 unmodified lines | ||
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | static inline void McCopyWidthEq8_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 114 | − int32_t iHeight) { | |
| 114 | + int32_t iHeight) { | |
| 115 | 115 | int32_t i; |
| 116 | 116 | for (i = 0; i < iHeight; i++) { |
| 117 | 117 | ST64A8 (pDst, LD64 (pSrc)); |
| @@ -121,7 +121,7 @@ static inline void McCopyWidthEq8_c (const uint8_t* pSrc, int32_t iSrcStride, ui · 3 unmodified lines | ||
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | static inline void McCopyWidthEq16_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 124 | − int32_t iHeight) { | |
| 124 | + int32_t iHeight) { | |
| 125 | 125 | int32_t i; |
| 126 | 126 | for (i = 0; i < iHeight; i++) { |
| 127 | 127 | ST64A8 (pDst , LD64 (pSrc)); |
| @@ -138,7 +138,7 @@ static inline int32_t HorFilterInput16bit_c (int16_t* pSrc) { · 10 unmodified lines | ||
| 138 | 138 | int32_t iPix14 = pSrc[-1] + pSrc[2]; |
| 139 | 139 | int32_t iPix23 = pSrc[ 0] + pSrc[1]; |
| 140 | 140 | |
| 141 | − return (iPix05 - (iPix14 * 5)+ (iPix23 * 20)); | |
| 141 | + return (iPix05 - (iPix14 * 5) + (iPix23 * 20)); | |
| 142 | 142 | } |
| 143 | 143 | // h: iOffset=1 / v: iOffset=iSrcStride |
| 144 | 144 | static inline int32_t FilterInput8bitWithStride_c (const uint8_t* pSrc, const int32_t kiOffset) { |
| @@ -153,7 +153,7 @@ static inline int32_t FilterInput8bitWithStride_c (const uint8_t* pSrc, const in · 8 unmodified lines | ||
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | static inline void PixelAvg_c (uint8_t* pDst, int32_t iDstStride, const uint8_t* pSrcA, int32_t iSrcAStride, |
| 156 | − const uint8_t* pSrcB, int32_t iSrcBStride, int32_t iWidth, int32_t iHeight) { | |
| 156 | + const uint8_t* pSrcB, int32_t iSrcBStride, int32_t iWidth, int32_t iHeight) { | |
| 157 | 157 | int32_t i, j; |
| 158 | 158 | for (i = 0; i < iHeight; i++) { |
| 159 | 159 | for (j = 0; j < iWidth; j++) { |
| @@ -165,7 +165,7 @@ static inline void PixelAvg_c (uint8_t* pDst, int32_t iDstStride, const uint8_t* · 5 unmodified lines | ||
| 165 | 165 | } |
| 166 | 166 | } |
| 167 | 167 | static inline void McCopy_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, |
| 168 | − int32_t iHeight) { | |
| 168 | + int32_t iHeight) { | |
| 169 | 169 | if (iWidth == 16) |
| 170 | 170 | McCopyWidthEq16_c (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 171 | 171 | else if (iWidth == 8) |
| @@ -176,8 +176,9 @@ static inline void McCopy_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* p · 4 unmodified lines | ||
| 176 | 176 | McCopyWidthEq2_c (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | −static inline void McHorVer20_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, | |
| 180 | − int32_t iHeight) { | |
| 179 | +static inline void McHorVer20_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 180 | + int32_t iWidth, | |
| 181 | + int32_t iHeight) { | |
| 181 | 182 | int32_t i, j; |
| 182 | 183 | for (i = 0; i < iHeight; i++) { |
| 183 | 184 | for (j = 0; j < iWidth; j++) { |
| @@ -188,8 +189,9 @@ static inline void McHorVer20_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_ · 4 unmodified lines | ||
| 188 | 189 | } |
| 189 | 190 | } |
| 190 | 191 | |
| 191 | −static inline void McHorVer02_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, | |
| 192 | − int32_t iHeight) { | |
| 192 | +static inline void McHorVer02_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 193 | + int32_t iWidth, | |
| 194 | + int32_t iHeight) { | |
| 193 | 195 | int32_t i, j; |
| 194 | 196 | for (i = 0; i < iHeight; i++) { |
| 195 | 197 | for (j = 0; j < iWidth; j++) { |
| @@ -200,8 +202,9 @@ static inline void McHorVer02_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_ · 4 unmodified lines | ||
| 200 | 202 | } |
| 201 | 203 | } |
| 202 | 204 | |
| 203 | −static inline void McHorVer22_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, | |
| 204 | − int32_t iHeight) { | |
| 205 | +static inline void McHorVer22_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 206 | + int32_t iWidth, | |
| 207 | + int32_t iHeight) { | |
| 205 | 208 | int16_t iTmp[16 + 5]; //16 |
| 206 | 209 | int32_t i, j, k; |
| 207 | 210 | |
| @@ -218,88 +221,100 @@ static inline void McHorVer22_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_ · 10 unmodified lines | ||
| 218 | 221 | } |
| 219 | 222 | |
| 220 | 223 | /////////////////////luma MC////////////////////////// |
| 221 | −static inline void McHorVer01_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, | |
| 222 | − int32_t iHeight) { | |
| 224 | +static inline void McHorVer01_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 225 | + int32_t iWidth, | |
| 226 | + int32_t iHeight) { | |
| 223 | 227 | uint8_t uiTmp[256]; |
| 224 | 228 | McHorVer02_c (pSrc, iSrcStride, uiTmp, 16, iWidth, iHeight); |
| 225 | 229 | PixelAvg_c (pDst, iDstStride, pSrc, iSrcStride, uiTmp, 16, iWidth, iHeight); |
| 226 | 230 | } |
| 227 | −static inline void McHorVer03_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, | |
| 228 | − int32_t iHeight) { | |
| 231 | +static inline void McHorVer03_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 232 | + int32_t iWidth, | |
| 233 | + int32_t iHeight) { | |
| 229 | 234 | uint8_t uiTmp[256]; |
| 230 | 235 | McHorVer02_c (pSrc, iSrcStride, uiTmp, 16, iWidth, iHeight); |
| 231 | 236 | PixelAvg_c (pDst, iDstStride, pSrc + iSrcStride, iSrcStride, uiTmp, 16, iWidth, iHeight); |
| 232 | 237 | } |
| 233 | −static inline void McHorVer10_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, | |
| 234 | − int32_t iHeight) { | |
| 238 | +static inline void McHorVer10_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 239 | + int32_t iWidth, | |
| 240 | + int32_t iHeight) { | |
| 235 | 241 | uint8_t uiTmp[256]; |
| 236 | 242 | McHorVer20_c (pSrc, iSrcStride, uiTmp, 16, iWidth, iHeight); |
| 237 | 243 | PixelAvg_c (pDst, iDstStride, pSrc, iSrcStride, uiTmp, 16, iWidth, iHeight); |
| 238 | 244 | } |
| 239 | −static inline void McHorVer11_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, | |
| 240 | − int32_t iHeight) { | |
| 245 | +static inline void McHorVer11_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 246 | + int32_t iWidth, | |
| 247 | + int32_t iHeight) { | |
| 241 | 248 | uint8_t uiHorTmp[256]; |
| 242 | 249 | uint8_t uiVerTmp[256]; |
| 243 | 250 | McHorVer20_c (pSrc, iSrcStride, uiHorTmp, 16, iWidth, iHeight); |
| 244 | 251 | McHorVer02_c (pSrc, iSrcStride, uiVerTmp, 16, iWidth, iHeight); |
| 245 | 252 | PixelAvg_c (pDst, iDstStride, uiHorTmp, 16, uiVerTmp, 16, iWidth, iHeight); |
| 246 | 253 | } |
| 247 | −static inline void McHorVer12_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, | |
| 248 | − int32_t iHeight) { | |
| 254 | +static inline void McHorVer12_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 255 | + int32_t iWidth, | |
| 256 | + int32_t iHeight) { | |
| 249 | 257 | uint8_t uiVerTmp[256]; |
| 250 | 258 | uint8_t uiCtrTmp[256]; |
| 251 | 259 | McHorVer02_c (pSrc, iSrcStride, uiVerTmp, 16, iWidth, iHeight); |
| 252 | 260 | McHorVer22_c (pSrc, iSrcStride, uiCtrTmp, 16, iWidth, iHeight); |
| 253 | 261 | PixelAvg_c (pDst, iDstStride, uiVerTmp, 16, uiCtrTmp, 16, iWidth, iHeight); |
| 254 | 262 | } |
| 255 | −static inline void McHorVer13_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, | |
| 256 | − int32_t iHeight) { | |
| 263 | +static inline void McHorVer13_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 264 | + int32_t iWidth, | |
| 265 | + int32_t iHeight) { | |
| 257 | 266 | uint8_t uiHorTmp[256]; |
| 258 | 267 | uint8_t uiVerTmp[256]; |
| 259 | 268 | McHorVer20_c (pSrc + iSrcStride, iSrcStride, uiHorTmp, 16, iWidth, iHeight); |
| 260 | 269 | McHorVer02_c (pSrc, iSrcStride, uiVerTmp, 16, iWidth, iHeight); |
| 261 | 270 | PixelAvg_c (pDst, iDstStride, uiHorTmp, 16, uiVerTmp, 16, iWidth, iHeight); |
| 262 | 271 | } |
| 263 | −static inline void McHorVer21_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, | |
| 264 | − int32_t iHeight) { | |
| 272 | +static inline void McHorVer21_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 273 | + int32_t iWidth, | |
| 274 | + int32_t iHeight) { | |
| 265 | 275 | uint8_t uiHorTmp[256]; |
| 266 | 276 | uint8_t uiCtrTmp[256]; |
| 267 | 277 | McHorVer20_c (pSrc, iSrcStride, uiHorTmp, 16, iWidth, iHeight); |
| 268 | 278 | McHorVer22_c (pSrc, iSrcStride, uiCtrTmp, 16, iWidth, iHeight); |
| 269 | 279 | PixelAvg_c (pDst, iDstStride, uiHorTmp, 16, uiCtrTmp, 16, iWidth, iHeight); |
| 270 | 280 | } |
| 271 | −static inline void McHorVer23_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, | |
| 272 | − int32_t iHeight) { | |
| 281 | +static inline void McHorVer23_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 282 | + int32_t iWidth, | |
| 283 | + int32_t iHeight) { | |
| 273 | 284 | uint8_t uiHorTmp[256]; |
| 274 | 285 | uint8_t uiCtrTmp[256]; |
| 275 | 286 | McHorVer20_c (pSrc + iSrcStride, iSrcStride, uiHorTmp, 16, iWidth, iHeight); |
| 276 | 287 | McHorVer22_c (pSrc, iSrcStride, uiCtrTmp, 16, iWidth, iHeight); |
| 277 | 288 | PixelAvg_c (pDst, iDstStride, uiHorTmp, 16, uiCtrTmp, 16, iWidth, iHeight); |
| 278 | 289 | } |
| 279 | −static inline void McHorVer30_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, | |
| 280 | − int32_t iHeight) { | |
| 290 | +static inline void McHorVer30_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 291 | + int32_t iWidth, | |
| 292 | + int32_t iHeight) { | |
| 281 | 293 | uint8_t uiHorTmp[256]; |
| 282 | 294 | McHorVer20_c (pSrc, iSrcStride, uiHorTmp, 16, iWidth, iHeight); |
| 283 | 295 | PixelAvg_c (pDst, iDstStride, pSrc + 1, iSrcStride, uiHorTmp, 16, iWidth, iHeight); |
| 284 | 296 | } |
| 285 | −static inline void McHorVer31_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, | |
| 286 | − int32_t iHeight) { | |
| 297 | +static inline void McHorVer31_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 298 | + int32_t iWidth, | |
| 299 | + int32_t iHeight) { | |
| 287 | 300 | uint8_t uiHorTmp[256]; |
| 288 | 301 | uint8_t uiVerTmp[256]; |
| 289 | 302 | McHorVer20_c (pSrc, iSrcStride, uiHorTmp, 16, iWidth, iHeight); |
| 290 | 303 | McHorVer02_c (pSrc + 1, iSrcStride, uiVerTmp, 16, iWidth, iHeight); |
| 291 | 304 | PixelAvg_c (pDst, iDstStride, uiHorTmp, 16, uiVerTmp, 16, iWidth, iHeight); |
| 292 | 305 | } |
| 293 | −static inline void McHorVer32_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, | |
| 294 | − int32_t iHeight) { | |
| 306 | +static inline void McHorVer32_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 307 | + int32_t iWidth, | |
| 308 | + int32_t iHeight) { | |
| 295 | 309 | uint8_t uiVerTmp[256]; |
| 296 | 310 | uint8_t uiCtrTmp[256]; |
| 297 | 311 | McHorVer02_c (pSrc + 1, iSrcStride, uiVerTmp, 16, iWidth, iHeight); |
| 298 | 312 | McHorVer22_c (pSrc, iSrcStride, uiCtrTmp, 16, iWidth, iHeight); |
| 299 | 313 | PixelAvg_c (pDst, iDstStride, uiVerTmp, 16, uiCtrTmp, 16, iWidth, iHeight); |
| 300 | 314 | } |
| 301 | −static inline void McHorVer33_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, | |
| 302 | − int32_t iHeight) { | |
| 315 | +static inline void McHorVer33_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 316 | + int32_t iWidth, | |
| 317 | + int32_t iHeight) { | |
| 303 | 318 | uint8_t uiHorTmp[256]; |
| 304 | 319 | uint8_t uiVerTmp[256]; |
| 305 | 320 | McHorVer20_c (pSrc + iSrcStride, iSrcStride, uiHorTmp, 16, iWidth, iHeight); |
| @@ -308,7 +323,7 @@ static inline void McHorVer33_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_ · 2 unmodified lines | ||
| 308 | 323 | } |
| 309 | 324 | |
| 310 | 325 | void McLuma_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 311 | − int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) | |
| 326 | + int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) | |
| 312 | 327 | //pSrc has been added the offset of mv |
| 313 | 328 | { |
| 314 | 329 | static const PWelsMcWidthHeightFunc pWelsMcFunc[4][4] = { //[x][y] |
| @@ -326,7 +341,7 @@ static inline void McChromaWithFragMv_c (const uint8_t* pSrc, int32_t iSrcStride · 11 unmodified lines | ||
| 326 | 341 | int32_t i, j; |
| 327 | 342 | int32_t iA, iB, iC, iD; |
| 328 | 343 | const uint8_t* pSrcNext = pSrc + iSrcStride; |
| 329 | − const uint8_t *pABCD = g_kuiABCD[iMvY & 0x07][iMvX & 0x07]; | |
| 344 | + const uint8_t* pABCD = g_kuiABCD[iMvY & 0x07][iMvX & 0x07]; | |
| 330 | 345 | iA = pABCD[0]; |
| 331 | 346 | iB = pABCD[1]; |
| 332 | 347 | iC = pABCD[2]; |
| @@ -342,7 +357,7 @@ static inline void McChromaWithFragMv_c (const uint8_t* pSrc, int32_t iSrcStride · 9 unmodified lines | ||
| 342 | 357 | } |
| 343 | 358 | |
| 344 | 359 | void McChroma_c (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 345 | − int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) | |
| 360 | + int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) | |
| 346 | 361 | //pSrc has been added the offset of mv |
| 347 | 362 | { |
| 348 | 363 | const int32_t kiD8x = iMvX & 0x07; |
| @@ -376,8 +391,9 @@ static inline void McHorVer22WidthEq16_sse2 (const uint8_t* pSrc, int32_t iSrcSt · 27 unmodified lines | ||
| 376 | 391 | McHorVer22WidthEq8_sse2 (&pSrc[8], iSrcStride, &pDst[8], iDstStride, iHeight); |
| 377 | 392 | } |
| 378 | 393 | |
| 379 | −static inline void McCopy_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, int32_t iWidth, | |
| 380 | − int32_t iHeight) { | |
| 394 | +static inline void McCopy_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 395 | + int32_t iWidth, | |
| 396 | + int32_t iHeight) { | |
| 381 | 397 | if (iWidth == 16) |
| 382 | 398 | McCopyWidthEq16_sse2 (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 383 | 399 | else if (iWidth == 8) |
| @@ -389,7 +405,7 @@ static inline void McCopy_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t · 5 unmodified lines | ||
| 389 | 405 | } |
| 390 | 406 | |
| 391 | 407 | static inline void McHorVer20_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 392 | − int32_t iWidth, int32_t iHeight) { | |
| 408 | + int32_t iWidth, int32_t iHeight) { | |
| 393 | 409 | if (iWidth == 16) |
| 394 | 410 | McHorVer20WidthEq16_sse2 (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 395 | 411 | else if (iWidth == 8) |
| @@ -399,7 +415,7 @@ static inline void McHorVer20_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 3 unmodified lines | ||
| 399 | 415 | } |
| 400 | 416 | |
| 401 | 417 | static inline void McHorVer02_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 402 | − int32_t iWidth, int32_t iHeight) { | |
| 418 | + int32_t iWidth, int32_t iHeight) { | |
| 403 | 419 | if (iWidth == 16) |
| 404 | 420 | McHorVer02WidthEq16_sse2 (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 405 | 421 | else if (iWidth == 8) |
| @@ -409,7 +425,7 @@ static inline void McHorVer02_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 3 unmodified lines | ||
| 409 | 425 | } |
| 410 | 426 | |
| 411 | 427 | static inline void McHorVer22_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 412 | − int32_t iWidth, int32_t iHeight) { | |
| 428 | + int32_t iWidth, int32_t iHeight) { | |
| 413 | 429 | if (iWidth == 16) |
| 414 | 430 | McHorVer22WidthEq16_sse2 (pSrc, iSrcStride, pDst, iDstStride, iHeight); |
| 415 | 431 | else if (iWidth == 8) |
| @@ -419,7 +435,7 @@ static inline void McHorVer22_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 3 unmodified lines | ||
| 419 | 435 | } |
| 420 | 436 | |
| 421 | 437 | static inline void McHorVer01_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 422 | − int32_t iWidth, int32_t iHeight) { | |
| 438 | + int32_t iWidth, int32_t iHeight) { | |
| 423 | 439 | ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 256, 16); |
| 424 | 440 | if (iWidth == 16) { |
| 425 | 441 | McHorVer02WidthEq16_sse2 (pSrc, iSrcStride, pTmp, 16, iHeight); |
| @@ -433,7 +449,7 @@ static inline void McHorVer01_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 7 unmodified lines | ||
| 433 | 449 | } |
| 434 | 450 | } |
| 435 | 451 | static inline void McHorVer03_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 436 | − int32_t iWidth, int32_t iHeight) { | |
| 452 | + int32_t iWidth, int32_t iHeight) { | |
| 437 | 453 | ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 256, 16); |
| 438 | 454 | if (iWidth == 16) { |
| 439 | 455 | McHorVer02WidthEq16_sse2 (pSrc, iSrcStride, pTmp, 16, iHeight); |
| @@ -447,7 +463,7 @@ static inline void McHorVer03_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 7 unmodified lines | ||
| 447 | 463 | } |
| 448 | 464 | } |
| 449 | 465 | static inline void McHorVer10_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 450 | − int32_t iWidth, int32_t iHeight) { | |
| 466 | + int32_t iWidth, int32_t iHeight) { | |
| 451 | 467 | ENFORCE_STACK_ALIGN_1D (uint8_t, pTmp, 256, 16); |
| 452 | 468 | if (iWidth == 16) { |
| 453 | 469 | McHorVer20WidthEq16_sse2 (pSrc, iSrcStride, pTmp, 16, iHeight); |
| @@ -461,7 +477,7 @@ static inline void McHorVer10_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 7 unmodified lines | ||
| 461 | 477 | } |
| 462 | 478 | } |
| 463 | 479 | static inline void McHorVer11_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 464 | − int32_t iWidth, int32_t iHeight) { | |
| 480 | + int32_t iWidth, int32_t iHeight) { | |
| 465 | 481 | ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); |
| 466 | 482 | ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); |
| 467 | 483 | if (iWidth == 16) { |
| @@ -479,7 +495,7 @@ static inline void McHorVer11_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 11 unmodified lines | ||
| 479 | 495 | } |
| 480 | 496 | } |
| 481 | 497 | static inline void McHorVer12_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 482 | − int32_t iWidth, int32_t iHeight) { | |
| 498 | + int32_t iWidth, int32_t iHeight) { | |
| 483 | 499 | ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); |
| 484 | 500 | ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16); |
| 485 | 501 | if (iWidth == 16) { |
| @@ -497,7 +513,7 @@ static inline void McHorVer12_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 11 unmodified lines | ||
| 497 | 513 | } |
| 498 | 514 | } |
| 499 | 515 | static inline void McHorVer13_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 500 | − int32_t iWidth, int32_t iHeight) { | |
| 516 | + int32_t iWidth, int32_t iHeight) { | |
| 501 | 517 | ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); |
| 502 | 518 | ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); |
| 503 | 519 | if (iWidth == 16) { |
| @@ -515,7 +531,7 @@ static inline void McHorVer13_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 11 unmodified lines | ||
| 515 | 531 | } |
| 516 | 532 | } |
| 517 | 533 | static inline void McHorVer21_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 518 | − int32_t iWidth, int32_t iHeight) { | |
| 534 | + int32_t iWidth, int32_t iHeight) { | |
| 519 | 535 | ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); |
| 520 | 536 | ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16); |
| 521 | 537 | if (iWidth == 16) { |
| @@ -533,7 +549,7 @@ static inline void McHorVer21_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 11 unmodified lines | ||
| 533 | 549 | } |
| 534 | 550 | } |
| 535 | 551 | static inline void McHorVer23_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 536 | − int32_t iWidth, int32_t iHeight) { | |
| 552 | + int32_t iWidth, int32_t iHeight) { | |
| 537 | 553 | ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); |
| 538 | 554 | ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16); |
| 539 | 555 | if (iWidth == 16) { |
| @@ -551,7 +567,7 @@ static inline void McHorVer23_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 11 unmodified lines | ||
| 551 | 567 | } |
| 552 | 568 | } |
| 553 | 569 | static inline void McHorVer30_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 554 | − int32_t iWidth, int32_t iHeight) { | |
| 570 | + int32_t iWidth, int32_t iHeight) { | |
| 555 | 571 | ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); |
| 556 | 572 | if (iWidth == 16) { |
| 557 | 573 | McHorVer20WidthEq16_sse2 (pSrc, iSrcStride, pHorTmp, 16, iHeight); |
| @@ -565,7 +581,7 @@ static inline void McHorVer30_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 7 unmodified lines | ||
| 565 | 581 | } |
| 566 | 582 | } |
| 567 | 583 | static inline void McHorVer31_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 568 | − int32_t iWidth, int32_t iHeight) { | |
| 584 | + int32_t iWidth, int32_t iHeight) { | |
| 569 | 585 | ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); |
| 570 | 586 | ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); |
| 571 | 587 | if (iWidth == 16) { |
| @@ -583,7 +599,7 @@ static inline void McHorVer31_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 11 unmodified lines | ||
| 583 | 599 | } |
| 584 | 600 | } |
| 585 | 601 | static inline void McHorVer32_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 586 | − int32_t iWidth, int32_t iHeight) { | |
| 602 | + int32_t iWidth, int32_t iHeight) { | |
| 587 | 603 | ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); |
| 588 | 604 | ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16); |
| 589 | 605 | if (iWidth == 16) { |
| @@ -601,7 +617,7 @@ static inline void McHorVer32_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 11 unmodified lines | ||
| 601 | 617 | } |
| 602 | 618 | } |
| 603 | 619 | static inline void McHorVer33_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 604 | − int32_t iWidth, int32_t iHeight) { | |
| 620 | + int32_t iWidth, int32_t iHeight) { | |
| 605 | 621 | ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); |
| 606 | 622 | ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); |
| 607 | 623 | if (iWidth == 16) { |
| @@ -620,7 +636,7 @@ static inline void McHorVer33_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uin · 12 unmodified lines | ||
| 620 | 636 | } |
| 621 | 637 | |
| 622 | 638 | void McLuma_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 623 | − int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) | |
| 639 | + int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) | |
| 624 | 640 | //pSrc has been added the offset of mv |
| 625 | 641 | { |
| 626 | 642 | static const PWelsMcWidthHeightFunc pWelsMcFunc[4][4] = { //[x][y] |
| @@ -634,9 +650,9 @@ void McLuma_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_ · 7 unmodified lines | ||
| 634 | 650 | } |
| 635 | 651 | |
| 636 | 652 | void McChroma_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, |
| 637 | − int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) { | |
| 653 | + int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) { | |
| 638 | 654 | static const PMcChromaWidthExtFunc kpMcChromaWidthFuncs[2] = { |
| 639 | − McChromaWidthEq4_mmx, | |
| 655 | + McChromaWidthEq4_mmx, | |
| 640 | 656 | McChromaWidthEq8_sse2 |
| 641 | 657 | }; |
| 642 | 658 | const int32_t kiD8x = iMvX & 0x07; |
| @@ -656,331 +672,528 @@ void McChroma_sse2 (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int3 · 13 unmodified lines | ||
| 656 | 672 | // NEON implementation // |
| 657 | 673 | //***************************************************************************// |
| 658 | 674 | #if defined(HAVE_NEON) |
| 659 | −void McCopy_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 660 | − int32_t iWidth, int32_t iHeight) | |
| 661 | −{ | |
| 675 | +void McCopy_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 676 | + int32_t iWidth, int32_t iHeight) { | |
| 662 | 677 | if (16 == iWidth) |
| 663 | − McCopyWidthEq16_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 664 | − else if(8 == iWidth) | |
| 665 | − McCopyWidthEq8_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 666 | − else | |
| 667 | − McCopyWidthEq4_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 668 | − } | |
| 669 | −void McHorVer20_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 670 | − int32_t iWidth, int32_t iHeight) | |
| 671 | −{ | |
| 678 | + McCopyWidthEq16_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 679 | + else if (8 == iWidth) | |
| 680 | + McCopyWidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 681 | + else | |
| 682 | + McCopyWidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 683 | +} | |
| 684 | +void McHorVer20_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 685 | + int32_t iWidth, int32_t iHeight) { | |
| 672 | 686 | if (iWidth == 16) |
| 673 | − McHorVer20WidthEq16_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 674 | − else if (iWidth == 8) | |
| 675 | − McHorVer20WidthEq8_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 676 | − else if (iWidth == 4) | |
| 677 | − McHorVer20WidthEq4_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 678 | −} | |
| 679 | −void McHorVer02_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 680 | − int32_t iWidth, int32_t iHeight) | |
| 681 | −{ | |
| 682 | − if (iWidth == 16) | |
| 683 | − McHorVer02WidthEq16_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 684 | − else if (iWidth == 8) | |
| 685 | − McHorVer02WidthEq8_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 686 | − else if (iWidth == 4) | |
| 687 | − McHorVer02WidthEq4_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 688 | −} | |
| 689 | −void McHorVer22_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 690 | − int32_t iWidth, int32_t iHeight) | |
| 691 | −{ | |
| 692 | − if (iWidth == 16) | |
| 693 | − McHorVer22WidthEq16_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 694 | − else if (iWidth == 8) | |
| 695 | − McHorVer22WidthEq8_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 696 | − else if (iWidth == 4) | |
| 697 | − McHorVer22WidthEq4_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 687 | + McHorVer20WidthEq16_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 688 | + else if (iWidth == 8) | |
| 689 | + McHorVer20WidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 690 | + else if (iWidth == 4) | |
| 691 | + McHorVer20WidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 692 | +} | |
| 693 | +void McHorVer02_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 694 | + int32_t iWidth, int32_t iHeight) { | |
| 695 | + if (iWidth == 16) | |
| 696 | + McHorVer02WidthEq16_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 697 | + else if (iWidth == 8) | |
| 698 | + McHorVer02WidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 699 | + else if (iWidth == 4) | |
| 700 | + McHorVer02WidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 701 | +} | |
| 702 | +void McHorVer22_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 703 | + int32_t iWidth, int32_t iHeight) { | |
| 704 | + if (iWidth == 16) | |
| 705 | + McHorVer22WidthEq16_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 706 | + else if (iWidth == 8) | |
| 707 | + McHorVer22WidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 708 | + else if (iWidth == 4) | |
| 709 | + McHorVer22WidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 698 | 710 | } |
| 699 | 711 | |
| 700 | −void McHorVer01_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 701 | − int32_t iWidth, int32_t iHeight) | |
| 702 | −{ | |
| 712 | +void McHorVer01_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 713 | + int32_t iWidth, int32_t iHeight) { | |
| 703 | 714 | if (iWidth == 16) |
| 704 | − McHorVer01WidthEq16_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 715 | + McHorVer01WidthEq16_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 705 | 716 | else if (iWidth == 8) |
| 706 | − McHorVer01WidthEq8_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 717 | + McHorVer01WidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 707 | 718 | else if (iWidth == 4) |
| 708 | − McHorVer01WidthEq4_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 719 | + McHorVer01WidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 709 | 720 | } |
| 710 | −void McHorVer03_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 711 | − int32_t iWidth, int32_t iHeight) | |
| 712 | −{ | |
| 721 | +void McHorVer03_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 722 | + int32_t iWidth, int32_t iHeight) { | |
| 713 | 723 | if (iWidth == 16) |
| 714 | − McHorVer03WidthEq16_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 715 | − else if (iWidth == 8) | |
| 716 | − McHorVer03WidthEq8_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 717 | − else if (iWidth == 4) | |
| 718 | − McHorVer03WidthEq4_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 719 | −} | |
| 720 | −void McHorVer10_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 721 | − int32_t iWidth, int32_t iHeight) | |
| 722 | −{ | |
| 724 | + McHorVer03WidthEq16_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 725 | + else if (iWidth == 8) | |
| 726 | + McHorVer03WidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 727 | + else if (iWidth == 4) | |
| 728 | + McHorVer03WidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 729 | +} | |
| 730 | +void McHorVer10_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 731 | + int32_t iWidth, int32_t iHeight) { | |
| 723 | 732 | if (iWidth == 16) |
| 724 | − McHorVer10WidthEq16_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 725 | − else if (iWidth == 8) | |
| 726 | − McHorVer10WidthEq8_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 727 | − else if (iWidth == 4) | |
| 728 | − McHorVer10WidthEq4_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 729 | −} | |
| 730 | −void McHorVer11_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 731 | − int32_t iWidth, int32_t iHeight) | |
| 732 | −{ | |
| 733 | − ENFORCE_STACK_ALIGN_1D( uint8_t, pHorTmp, 256, 16 ); | |
| 734 | − ENFORCE_STACK_ALIGN_1D( uint8_t, pVerTmp, 256, 16 ); | |
| 733 | + McHorVer10WidthEq16_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 734 | + else if (iWidth == 8) | |
| 735 | + McHorVer10WidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 736 | + else if (iWidth == 4) | |
| 737 | + McHorVer10WidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 738 | +} | |
| 739 | +void McHorVer11_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 740 | + int32_t iWidth, int32_t iHeight) { | |
| 741 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); | |
| 742 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); | |
| 743 | + if (iWidth == 16) { | |
| 744 | + McHorVer20WidthEq16_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 745 | + McHorVer02WidthEq16_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 746 | + PixelAvgWidthEq16_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 747 | + } else if (iWidth == 8) { | |
| 748 | + McHorVer20WidthEq8_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 749 | + McHorVer02WidthEq8_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 750 | + PixelAvgWidthEq8_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 751 | + } else if (iWidth == 4) { | |
| 752 | + McHorVer20WidthEq4_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 753 | + McHorVer02WidthEq4_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 754 | + PixelAvgWidthEq4_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 755 | + } | |
| 756 | +} | |
| 757 | +void McHorVer12_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 758 | + int32_t iWidth, int32_t iHeight) { | |
| 759 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); | |
| 760 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16); | |
| 761 | + if (iWidth == 16) { | |
| 762 | + McHorVer02WidthEq16_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 763 | + McHorVer22WidthEq16_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 764 | + PixelAvgWidthEq16_neon (pDst, iDstStride, pVerTmp, pCtrTmp, iHeight); | |
| 765 | + } else if (iWidth == 8) { | |
| 766 | + McHorVer02WidthEq8_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 767 | + McHorVer22WidthEq8_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 768 | + PixelAvgWidthEq8_neon (pDst, iDstStride, pVerTmp, pCtrTmp, iHeight); | |
| 769 | + } else if (iWidth == 4) { | |
| 770 | + McHorVer02WidthEq4_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 771 | + McHorVer22WidthEq4_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 772 | + PixelAvgWidthEq4_neon (pDst, iDstStride, pVerTmp, pCtrTmp, iHeight); | |
| 773 | + } | |
| 774 | +} | |
| 775 | +void McHorVer13_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 776 | + int32_t iWidth, int32_t iHeight) { | |
| 777 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); | |
| 778 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); | |
| 779 | + if (iWidth == 16) { | |
| 780 | + McHorVer20WidthEq16_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 781 | + McHorVer02WidthEq16_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 782 | + PixelAvgWidthEq16_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 783 | + } else if (iWidth == 8) { | |
| 784 | + McHorVer20WidthEq8_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 785 | + McHorVer02WidthEq8_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 786 | + PixelAvgWidthEq8_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 787 | + } else if (iWidth == 4) { | |
| 788 | + McHorVer20WidthEq4_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 789 | + McHorVer02WidthEq4_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 790 | + PixelAvgWidthEq4_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 791 | + } | |
| 792 | +} | |
| 793 | +void McHorVer21_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 794 | + int32_t iWidth, int32_t iHeight) { | |
| 795 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); | |
| 796 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16); | |
| 797 | + if (iWidth == 16) { | |
| 798 | + McHorVer20WidthEq16_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 799 | + McHorVer22WidthEq16_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 800 | + PixelAvgWidthEq16_neon (pDst, iDstStride, pHorTmp, pCtrTmp, iHeight); | |
| 801 | + } else if (iWidth == 8) { | |
| 802 | + McHorVer20WidthEq8_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 803 | + McHorVer22WidthEq8_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 804 | + PixelAvgWidthEq8_neon (pDst, iDstStride, pHorTmp, pCtrTmp, iHeight); | |
| 805 | + } else if (iWidth == 4) { | |
| 806 | + McHorVer20WidthEq4_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 807 | + McHorVer22WidthEq4_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 808 | + PixelAvgWidthEq4_neon (pDst, iDstStride, pHorTmp, pCtrTmp, iHeight); | |
| 809 | + } | |
| 810 | +} | |
| 811 | +void McHorVer23_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 812 | + int32_t iWidth, int32_t iHeight) { | |
| 813 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); | |
| 814 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16); | |
| 815 | + if (iWidth == 16) { | |
| 816 | + McHorVer20WidthEq16_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 817 | + McHorVer22WidthEq16_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 818 | + PixelAvgWidthEq16_neon (pDst, iDstStride, pHorTmp, pCtrTmp, iHeight); | |
| 819 | + } else if (iWidth == 8) { | |
| 820 | + McHorVer20WidthEq8_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 821 | + McHorVer22WidthEq8_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 822 | + PixelAvgWidthEq8_neon (pDst, iDstStride, pHorTmp, pCtrTmp, iHeight); | |
| 823 | + } else if (iWidth == 4) { | |
| 824 | + McHorVer20WidthEq4_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 825 | + McHorVer22WidthEq4_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 826 | + PixelAvgWidthEq4_neon (pDst, iDstStride, pHorTmp, pCtrTmp, iHeight); | |
| 827 | + } | |
| 828 | +} | |
| 829 | +void McHorVer30_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 830 | + int32_t iWidth, int32_t iHeight) { | |
| 735 | 831 | if (iWidth == 16) |
| 736 | − { | |
| 737 | − McHorVer20WidthEq16_neon(pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 738 | − McHorVer02WidthEq16_neon(pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 739 | − PixelAvgWidthEq16_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 740 | − } | |
| 741 | − else if (iWidth == 8) | |
| 742 | − { | |
| 743 | − McHorVer20WidthEq8_neon(pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 744 | − McHorVer02WidthEq8_neon(pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 745 | − PixelAvgWidthEq8_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 746 | − } | |
| 747 | − else if (iWidth == 4) | |
| 748 | − { | |
| 749 | − McHorVer20WidthEq4_neon(pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 750 | − McHorVer02WidthEq4_neon(pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 751 | − PixelAvgWidthEq4_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 752 | − } | |
| 753 | −} | |
| 754 | −void McHorVer12_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 755 | − int32_t iWidth, int32_t iHeight) | |
| 756 | −{ | |
| 757 | − ENFORCE_STACK_ALIGN_1D( uint8_t, pVerTmp, 256, 16 ); | |
| 758 | − ENFORCE_STACK_ALIGN_1D( uint8_t, pCtrTmp, 256, 16 ); | |
| 832 | + McHorVer30WidthEq16_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 833 | + else if (iWidth == 8) | |
| 834 | + McHorVer30WidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 835 | + else if (iWidth == 4) | |
| 836 | + McHorVer30WidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 837 | +} | |
| 838 | +void McHorVer31_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 839 | + int32_t iWidth, int32_t iHeight) { | |
| 840 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); | |
| 841 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); | |
| 842 | + if (iWidth == 16) { | |
| 843 | + McHorVer20WidthEq16_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 844 | + McHorVer02WidthEq16_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); | |
| 845 | + PixelAvgWidthEq16_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 846 | + } else if (iWidth == 8) { | |
| 847 | + McHorVer20WidthEq8_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 848 | + McHorVer02WidthEq8_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); | |
| 849 | + PixelAvgWidthEq8_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 850 | + } else if (iWidth == 4) { | |
| 851 | + McHorVer20WidthEq4_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 852 | + McHorVer02WidthEq4_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); | |
| 853 | + PixelAvgWidthEq4_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 854 | + } | |
| 855 | +} | |
| 856 | +void McHorVer32_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 857 | + int32_t iWidth, int32_t iHeight) { | |
| 858 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); | |
| 859 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16); | |
| 860 | + if (iWidth == 16) { | |
| 861 | + McHorVer02WidthEq16_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); | |
| 862 | + McHorVer22WidthEq16_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 863 | + PixelAvgWidthEq16_neon (pDst, iDstStride, pVerTmp, pCtrTmp, iHeight); | |
| 864 | + } else if (iWidth == 8) { | |
| 865 | + McHorVer02WidthEq8_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); | |
| 866 | + McHorVer22WidthEq8_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 867 | + PixelAvgWidthEq8_neon (pDst, iDstStride, pVerTmp, pCtrTmp, iHeight); | |
| 868 | + } else if (iWidth == 4) { | |
| 869 | + McHorVer02WidthEq4_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); | |
| 870 | + McHorVer22WidthEq4_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 871 | + PixelAvgWidthEq4_neon (pDst, iDstStride, pVerTmp, pCtrTmp, iHeight); | |
| 872 | + } | |
| 873 | +} | |
| 874 | +void McHorVer33_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 875 | + int32_t iWidth, int32_t iHeight) { | |
| 876 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); | |
| 877 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); | |
| 878 | + if (iWidth == 16) { | |
| 879 | + McHorVer20WidthEq16_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 880 | + McHorVer02WidthEq16_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); | |
| 881 | + PixelAvgWidthEq16_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 882 | + } else if (iWidth == 8) { | |
| 883 | + McHorVer20WidthEq8_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 884 | + McHorVer02WidthEq8_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); | |
| 885 | + PixelAvgWidthEq8_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 886 | + } else if (iWidth == 4) { | |
| 887 | + McHorVer20WidthEq4_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 888 | + McHorVer02WidthEq4_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); | |
| 889 | + PixelAvgWidthEq4_neon (pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 890 | + } | |
| 891 | +} | |
| 892 | + | |
| 893 | +void McLuma_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 894 | + int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) { | |
| 895 | + static PWelsMcWidthHeightFunc pWelsMcFunc[4][4] = { //[x][y] | |
| 896 | + {McCopy_neon, McHorVer01_neon, McHorVer02_neon, McHorVer03_neon}, | |
| 897 | + {McHorVer10_neon, McHorVer11_neon, McHorVer12_neon, McHorVer13_neon}, | |
| 898 | + {McHorVer20_neon, McHorVer21_neon, McHorVer22_neon, McHorVer23_neon}, | |
| 899 | + {McHorVer30_neon, McHorVer31_neon, McHorVer32_neon, McHorVer33_neon}, | |
| 900 | + }; | |
| 901 | + // pSrc += (iMvY >> 2) * iSrcStride + (iMvX >> 2); | |
| 902 | + pWelsMcFunc[iMvX & 0x03][iMvY & 0x03] (pSrc, iSrcStride, pDst, iDstStride, iWidth, iHeight); | |
| 903 | +} | |
| 904 | +void McChroma_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 905 | + int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) { | |
| 906 | + if (0 == iMvX && 0 == iMvY) { | |
| 907 | + if (8 == iWidth) | |
| 908 | + McCopyWidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 909 | + else if (iWidth == 4) | |
| 910 | + McCopyWidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 911 | + else //here iWidth == 2 | |
| 912 | + McCopyWidthEq2_c (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 913 | + } else { | |
| 914 | + const int32_t kiD8x = iMvX & 0x07; | |
| 915 | + const int32_t kiD8y = iMvY & 0x07; | |
| 916 | + if (8 == iWidth) | |
| 917 | + McChromaWidthEq8_neon (pSrc, iSrcStride, pDst, iDstStride, (int32_t*) (g_kuiABCD[kiD8y][kiD8x]), iHeight); | |
| 918 | + else if (4 == iWidth) | |
| 919 | + McChromaWidthEq4_neon (pSrc, iSrcStride, pDst, iDstStride, (int32_t*) (g_kuiABCD[kiD8y][kiD8x]), iHeight); | |
| 920 | + else //here iWidth == 2 | |
| 921 | + McChromaWithFragMv_c (pSrc, iSrcStride, pDst, iDstStride, iMvX, iMvY, iWidth, iHeight); | |
| 922 | + } | |
| 923 | +} | |
| 924 | +#endif | |
| 925 | +#if defined(HAVE_NEON_AARCH64) | |
| 926 | +void McCopy_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 927 | + int32_t iWidth, int32_t iHeight) { | |
| 928 | + if (16 == iWidth) | |
| 929 | + McCopyWidthEq16_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 930 | + else if (8 == iWidth) | |
| 931 | + McCopyWidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 932 | + else | |
| 933 | + McCopyWidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 934 | +} | |
| 935 | +void McHorVer20_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 936 | + int32_t iWidth, int32_t iHeight) { | |
| 759 | 937 | if (iWidth == 16) |
| 760 | − { | |
| 761 | − McHorVer02WidthEq16_neon(pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 762 | − McHorVer22WidthEq16_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 763 | − PixelAvgWidthEq16_neon(pDst, iDstStride, pVerTmp, pCtrTmp, iHeight); | |
| 764 | − } | |
| 765 | − else if (iWidth == 8) | |
| 766 | − { | |
| 767 | − McHorVer02WidthEq8_neon(pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 768 | − McHorVer22WidthEq8_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 769 | − PixelAvgWidthEq8_neon(pDst, iDstStride, pVerTmp, pCtrTmp, iHeight); | |
| 770 | − } | |
| 771 | − else if (iWidth == 4) | |
| 772 | − { | |
| 773 | − McHorVer02WidthEq4_neon(pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 774 | − McHorVer22WidthEq4_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 775 | − PixelAvgWidthEq4_neon(pDst, iDstStride, pVerTmp, pCtrTmp, iHeight); | |
| 776 | − } | |
| 777 | −} | |
| 778 | −void McHorVer13_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 779 | − int32_t iWidth, int32_t iHeight) | |
| 780 | −{ | |
| 781 | − ENFORCE_STACK_ALIGN_1D( uint8_t, pHorTmp, 256, 16 ); | |
| 782 | − ENFORCE_STACK_ALIGN_1D( uint8_t, pVerTmp, 256, 16 ); | |
| 938 | + McHorVer20WidthEq16_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 939 | + else if (iWidth == 8) | |
| 940 | + McHorVer20WidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 941 | + else if (iWidth == 4) | |
| 942 | + McHorVer20WidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 943 | +} | |
| 944 | +void McHorVer02_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 945 | + int32_t iWidth, int32_t iHeight) { | |
| 783 | 946 | if (iWidth == 16) |
| 784 | − { | |
| 785 | − McHorVer20WidthEq16_neon(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 786 | − McHorVer02WidthEq16_neon(pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 787 | − PixelAvgWidthEq16_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 788 | − } | |
| 789 | − else if (iWidth == 8) | |
| 790 | − { | |
| 791 | − McHorVer20WidthEq8_neon(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 792 | − McHorVer02WidthEq8_neon(pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 793 | − PixelAvgWidthEq8_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 794 | − } | |
| 795 | − else if (iWidth == 4) | |
| 796 | − { | |
| 797 | − McHorVer20WidthEq4_neon(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 798 | − McHorVer02WidthEq4_neon(pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 799 | − PixelAvgWidthEq4_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 800 | − } | |
| 801 | −} | |
| 802 | −void McHorVer21_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 803 | − int32_t iWidth, int32_t iHeight) | |
| 804 | −{ | |
| 805 | − ENFORCE_STACK_ALIGN_1D( uint8_t, pHorTmp, 256, 16 ); | |
| 806 | − ENFORCE_STACK_ALIGN_1D( uint8_t, pCtrTmp, 256, 16 ); | |
| 947 | + McHorVer02WidthEq16_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 948 | + else if (iWidth == 8) | |
| 949 | + McHorVer02WidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 950 | + else if (iWidth == 4) | |
| 951 | + McHorVer02WidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 952 | +} | |
| 953 | +void McHorVer22_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 954 | + int32_t iWidth, int32_t iHeight) { | |
| 807 | 955 | if (iWidth == 16) |
| 808 | − { | |
| 809 | − McHorVer20WidthEq16_neon(pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 810 | − McHorVer22WidthEq16_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 811 | − PixelAvgWidthEq16_neon(pDst, iDstStride, pHorTmp, pCtrTmp, iHeight); | |
| 812 | − } | |
| 813 | − else if (iWidth == 8) | |
| 814 | − { | |
| 815 | − McHorVer20WidthEq8_neon(pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 816 | − McHorVer22WidthEq8_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 817 | − PixelAvgWidthEq8_neon(pDst, iDstStride, pHorTmp, pCtrTmp, iHeight); | |
| 818 | − } | |
| 819 | − else if (iWidth == 4) | |
| 820 | − { | |
| 821 | − McHorVer20WidthEq4_neon(pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 822 | − McHorVer22WidthEq4_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 823 | − PixelAvgWidthEq4_neon(pDst, iDstStride, pHorTmp, pCtrTmp, iHeight); | |
| 824 | − } | |
| 825 | −} | |
| 826 | −void McHorVer23_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 827 | − int32_t iWidth, int32_t iHeight) | |
| 828 | −{ | |
| 829 | − ENFORCE_STACK_ALIGN_1D( uint8_t, pHorTmp, 256, 16 ); | |
| 830 | − ENFORCE_STACK_ALIGN_1D( uint8_t, pCtrTmp, 256, 16 ); | |
| 956 | + McHorVer22WidthEq16_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 957 | + else if (iWidth == 8) | |
| 958 | + McHorVer22WidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 959 | + else if (iWidth == 4) | |
| 960 | + McHorVer22WidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 961 | +} | |
| 962 | + | |
| 963 | +void McHorVer01_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 964 | + int32_t iWidth, int32_t iHeight) { | |
| 831 | 965 | if (iWidth == 16) |
| 832 | − { | |
| 833 | − McHorVer20WidthEq16_neon(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 834 | − McHorVer22WidthEq16_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 835 | − PixelAvgWidthEq16_neon(pDst, iDstStride, pHorTmp, pCtrTmp, iHeight); | |
| 836 | − } | |
| 966 | + McHorVer01WidthEq16_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 837 | 967 | else if (iWidth == 8) |
| 838 | − { | |
| 839 | − McHorVer20WidthEq8_neon(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 840 | − McHorVer22WidthEq8_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 841 | − PixelAvgWidthEq8_neon(pDst, iDstStride, pHorTmp, pCtrTmp, iHeight); | |
| 842 | − } | |
| 843 | − else if (iWidth == 4) | |
| 844 | − { | |
| 845 | − McHorVer20WidthEq4_neon(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 846 | − McHorVer22WidthEq4_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 847 | − PixelAvgWidthEq4_neon(pDst, iDstStride, pHorTmp, pCtrTmp, iHeight); | |
| 848 | − } | |
| 849 | −} | |
| 850 | −void McHorVer30_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 851 | − int32_t iWidth, int32_t iHeight) | |
| 852 | −{ | |
| 968 | + McHorVer01WidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 969 | + else if (iWidth == 4) | |
| 970 | + McHorVer01WidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 971 | +} | |
| 972 | +void McHorVer03_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 973 | + int32_t iWidth, int32_t iHeight) { | |
| 853 | 974 | if (iWidth == 16) |
| 854 | − McHorVer30WidthEq16_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 855 | − else if (iWidth == 8) | |
| 856 | − McHorVer30WidthEq8_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 857 | − else if (iWidth == 4) | |
| 858 | − McHorVer30WidthEq4_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 859 | −} | |
| 860 | −void McHorVer31_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 861 | − int32_t iWidth, int32_t iHeight) | |
| 862 | −{ | |
| 863 | − ENFORCE_STACK_ALIGN_1D( uint8_t, pHorTmp, 256, 16 ); | |
| 864 | − ENFORCE_STACK_ALIGN_1D( uint8_t, pVerTmp, 256, 16 ); | |
| 865 | − if (iWidth == 16) { | |
| 866 | − McHorVer20WidthEq16_neon(pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 867 | − McHorVer02WidthEq16_neon(pSrc+1, iSrcStride, pVerTmp, 16, iHeight); | |
| 868 | − PixelAvgWidthEq16_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 869 | − } | |
| 870 | − else if (iWidth == 8){ | |
| 871 | − McHorVer20WidthEq8_neon(pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 872 | − McHorVer02WidthEq8_neon(pSrc+1, iSrcStride, pVerTmp, 16, iHeight); | |
| 873 | − PixelAvgWidthEq8_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 874 | − } | |
| 875 | − else if (iWidth == 4) | |
| 876 | − { | |
| 877 | − McHorVer20WidthEq4_neon(pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 878 | − McHorVer02WidthEq4_neon(pSrc+1, iSrcStride, pVerTmp, 16, iHeight); | |
| 879 | − PixelAvgWidthEq4_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 880 | − } | |
| 881 | −} | |
| 882 | −void McHorVer32_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 883 | − int32_t iWidth, int32_t iHeight) | |
| 884 | −{ | |
| 885 | − ENFORCE_STACK_ALIGN_1D( uint8_t, pVerTmp, 256, 16 ); | |
| 886 | − ENFORCE_STACK_ALIGN_1D( uint8_t, pCtrTmp, 256, 16 ); | |
| 975 | + McHorVer03WidthEq16_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 976 | + else if (iWidth == 8) | |
| 977 | + McHorVer03WidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 978 | + else if (iWidth == 4) | |
| 979 | + McHorVer03WidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 980 | +} | |
| 981 | +void McHorVer10_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 982 | + int32_t iWidth, int32_t iHeight) { | |
| 887 | 983 | if (iWidth == 16) |
| 888 | − { | |
| 889 | − McHorVer02WidthEq16_neon(pSrc+1, iSrcStride, pVerTmp, 16, iHeight); | |
| 890 | − McHorVer22WidthEq16_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 891 | − PixelAvgWidthEq16_neon(pDst, iDstStride, pVerTmp, pCtrTmp, iHeight); | |
| 892 | − } | |
| 893 | − else if (iWidth == 8) | |
| 894 | − { | |
| 895 | − McHorVer02WidthEq8_neon(pSrc+1, iSrcStride, pVerTmp, 16, iHeight); | |
| 896 | − McHorVer22WidthEq8_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 897 | − PixelAvgWidthEq8_neon(pDst, iDstStride, pVerTmp, pCtrTmp, iHeight); | |
| 898 | − } | |
| 899 | − else if (iWidth == 4) | |
| 900 | − { | |
| 901 | − McHorVer02WidthEq4_neon(pSrc+1, iSrcStride, pVerTmp, 16, iHeight); | |
| 902 | − McHorVer22WidthEq4_neon(pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 903 | − PixelAvgWidthEq4_neon(pDst, iDstStride, pVerTmp, pCtrTmp, iHeight); | |
| 904 | − } | |
| 905 | −} | |
| 906 | −void McHorVer33_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 907 | − int32_t iWidth, int32_t iHeight) | |
| 908 | −{ | |
| 909 | − ENFORCE_STACK_ALIGN_1D( uint8_t, pHorTmp, 256, 16 ); | |
| 910 | − ENFORCE_STACK_ALIGN_1D( uint8_t, pVerTmp, 256, 16 ); | |
| 984 | + McHorVer10WidthEq16_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 985 | + else if (iWidth == 8) | |
| 986 | + McHorVer10WidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 987 | + else if (iWidth == 4) | |
| 988 | + McHorVer10WidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 989 | +} | |
| 990 | +void McHorVer11_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 991 | + int32_t iWidth, int32_t iHeight) { | |
| 992 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); | |
| 993 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); | |
| 994 | + if (iWidth == 16) { | |
| 995 | + McHorVer20WidthEq16_AArch64_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 996 | + McHorVer02WidthEq16_AArch64_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 997 | + PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | |
| 998 | + } else if (iWidth == 8) { | |
| 999 | + McHorVer20WidthEq8_AArch64_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 1000 | + McHorVer02WidthEq8_AArch64_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 1001 | + PixelAvgWidthEq8_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | |
| 1002 | + } else if (iWidth == 4) { | |
| 1003 | + McHorVer20WidthEq4_AArch64_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 1004 | + McHorVer02WidthEq4_AArch64_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 1005 | + PixelAvgWidthEq4_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | |
| 1006 | + } | |
| 1007 | +} | |
| 1008 | +void McHorVer12_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 1009 | + int32_t iWidth, int32_t iHeight) { | |
| 1010 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); | |
| 1011 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16); | |
| 1012 | + if (iWidth == 16) { | |
| 1013 | + McHorVer02WidthEq16_AArch64_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 1014 | + McHorVer22WidthEq16_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 1015 | + PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight); | |
| 1016 | + } else if (iWidth == 8) { | |
| 1017 | + McHorVer02WidthEq8_AArch64_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 1018 | + McHorVer22WidthEq8_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 1019 | + PixelAvgWidthEq8_AArch64_neon (pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight); | |
| 1020 | + } else if (iWidth == 4) { | |
| 1021 | + McHorVer02WidthEq4_AArch64_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 1022 | + McHorVer22WidthEq4_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 1023 | + PixelAvgWidthEq4_AArch64_neon (pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight); | |
| 1024 | + } | |
| 1025 | +} | |
| 1026 | +void McHorVer13_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 1027 | + int32_t iWidth, int32_t iHeight) { | |
| 1028 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); | |
| 1029 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); | |
| 1030 | + if (iWidth == 16) { | |
| 1031 | + McHorVer20WidthEq16_AArch64_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 1032 | + McHorVer02WidthEq16_AArch64_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 1033 | + PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | |
| 1034 | + } else if (iWidth == 8) { | |
| 1035 | + McHorVer20WidthEq8_AArch64_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 1036 | + McHorVer02WidthEq8_AArch64_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 1037 | + PixelAvgWidthEq8_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | |
| 1038 | + } else if (iWidth == 4) { | |
| 1039 | + McHorVer20WidthEq4_AArch64_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 1040 | + McHorVer02WidthEq4_AArch64_neon (pSrc, iSrcStride, pVerTmp, 16, iHeight); | |
| 1041 | + PixelAvgWidthEq4_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | |
| 1042 | + } | |
| 1043 | +} | |
| 1044 | +void McHorVer21_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 1045 | + int32_t iWidth, int32_t iHeight) { | |
| 1046 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); | |
| 1047 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16); | |
| 1048 | + if (iWidth == 16) { | |
| 1049 | + McHorVer20WidthEq16_AArch64_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 1050 | + McHorVer22WidthEq16_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 1051 | + PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight); | |
| 1052 | + } else if (iWidth == 8) { | |
| 1053 | + McHorVer20WidthEq8_AArch64_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 1054 | + McHorVer22WidthEq8_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 1055 | + PixelAvgWidthEq8_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight); | |
| 1056 | + } else if (iWidth == 4) { | |
| 1057 | + McHorVer20WidthEq4_AArch64_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 1058 | + McHorVer22WidthEq4_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 1059 | + PixelAvgWidthEq4_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight); | |
| 1060 | + } | |
| 1061 | +} | |
| 1062 | +void McHorVer23_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 1063 | + int32_t iWidth, int32_t iHeight) { | |
| 1064 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); | |
| 1065 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16); | |
| 1066 | + if (iWidth == 16) { | |
| 1067 | + McHorVer20WidthEq16_AArch64_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 1068 | + McHorVer22WidthEq16_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 1069 | + PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight); | |
| 1070 | + } else if (iWidth == 8) { | |
| 1071 | + McHorVer20WidthEq8_AArch64_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 1072 | + McHorVer22WidthEq8_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 1073 | + PixelAvgWidthEq8_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight); | |
| 1074 | + } else if (iWidth == 4) { | |
| 1075 | + McHorVer20WidthEq4_AArch64_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 1076 | + McHorVer22WidthEq4_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 1077 | + PixelAvgWidthEq4_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pCtrTmp, 16, iHeight); | |
| 1078 | + } | |
| 1079 | +} | |
| 1080 | +void McHorVer30_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 1081 | + int32_t iWidth, int32_t iHeight) { | |
| 911 | 1082 | if (iWidth == 16) |
| 912 | − { | |
| 913 | − McHorVer20WidthEq16_neon(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 914 | − McHorVer02WidthEq16_neon(pSrc+1, iSrcStride, pVerTmp, 16, iHeight); | |
| 915 | − PixelAvgWidthEq16_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 916 | − } | |
| 917 | − else if (iWidth == 8) | |
| 918 | − { | |
| 919 | − McHorVer20WidthEq8_neon(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 920 | − McHorVer02WidthEq8_neon(pSrc+1, iSrcStride, pVerTmp, 16, iHeight); | |
| 921 | − PixelAvgWidthEq8_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 922 | − } | |
| 923 | − else if (iWidth == 4) | |
| 924 | − { | |
| 925 | − McHorVer20WidthEq4_neon(pSrc+iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 926 | − McHorVer02WidthEq4_neon(pSrc+1, iSrcStride, pVerTmp, 16, iHeight); | |
| 927 | − PixelAvgWidthEq4_neon(pDst, iDstStride, pHorTmp, pVerTmp, iHeight); | |
| 928 | − } | |
| 929 | −} | |
| 930 | − | |
| 931 | −void McLuma_neon(const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 932 | − int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) | |
| 933 | −{ | |
| 934 | − static PWelsMcWidthHeightFunc pWelsMcFunc[4][4] = //[x][y] | |
| 935 | − { | |
| 936 | − {McCopy_neon, McHorVer01_neon, McHorVer02_neon, McHorVer03_neon}, | |
| 937 | − {McHorVer10_neon, McHorVer11_neon, McHorVer12_neon, McHorVer13_neon}, | |
| 938 | − {McHorVer20_neon, McHorVer21_neon, McHorVer22_neon, McHorVer23_neon}, | |
| 939 | − {McHorVer30_neon, McHorVer31_neon, McHorVer32_neon, McHorVer33_neon}, | |
| 940 | − }; | |
| 1083 | + McHorVer30WidthEq16_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 1084 | + else if (iWidth == 8) | |
| 1085 | + McHorVer30WidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 1086 | + else if (iWidth == 4) | |
| 1087 | + McHorVer30WidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 1088 | +} | |
| 1089 | +void McHorVer31_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 1090 | + int32_t iWidth, int32_t iHeight) { | |
| 1091 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); | |
| 1092 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); | |
| 1093 | + if (iWidth == 16) { | |
| 1094 | + McHorVer20WidthEq16_AArch64_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 1095 | + McHorVer02WidthEq16_AArch64_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); | |
| 1096 | + PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | |
| 1097 | + } else if (iWidth == 8) { | |
| 1098 | + McHorVer20WidthEq8_AArch64_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 1099 | + McHorVer02WidthEq8_AArch64_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); | |
| 1100 | + PixelAvgWidthEq8_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | |
| 1101 | + } else if (iWidth == 4) { | |
| 1102 | + McHorVer20WidthEq4_AArch64_neon (pSrc, iSrcStride, pHorTmp, 16, iHeight); | |
| 1103 | + McHorVer02WidthEq4_AArch64_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); | |
| 1104 | + PixelAvgWidthEq4_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | |
| 1105 | + } | |
| 1106 | +} | |
| 1107 | +void McHorVer32_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 1108 | + int32_t iWidth, int32_t iHeight) { | |
| 1109 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); | |
| 1110 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pCtrTmp, 256, 16); | |
| 1111 | + if (iWidth == 16) { | |
| 1112 | + McHorVer02WidthEq16_AArch64_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); | |
| 1113 | + McHorVer22WidthEq16_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 1114 | + PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight); | |
| 1115 | + } else if (iWidth == 8) { | |
| 1116 | + McHorVer02WidthEq8_AArch64_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); | |
| 1117 | + McHorVer22WidthEq8_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 1118 | + PixelAvgWidthEq8_AArch64_neon (pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight); | |
| 1119 | + } else if (iWidth == 4) { | |
| 1120 | + McHorVer02WidthEq4_AArch64_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); | |
| 1121 | + McHorVer22WidthEq4_AArch64_neon (pSrc, iSrcStride, pCtrTmp, 16, iHeight); | |
| 1122 | + PixelAvgWidthEq4_AArch64_neon (pDst, iDstStride, pVerTmp, 16, pCtrTmp, 16, iHeight); | |
| 1123 | + } | |
| 1124 | +} | |
| 1125 | +void McHorVer33_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 1126 | + int32_t iWidth, int32_t iHeight) { | |
| 1127 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pHorTmp, 256, 16); | |
| 1128 | + ENFORCE_STACK_ALIGN_1D (uint8_t, pVerTmp, 256, 16); | |
| 1129 | + if (iWidth == 16) { | |
| 1130 | + McHorVer20WidthEq16_AArch64_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 1131 | + McHorVer02WidthEq16_AArch64_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); | |
| 1132 | + PixelAvgWidthEq16_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | |
| 1133 | + } else if (iWidth == 8) { | |
| 1134 | + McHorVer20WidthEq8_AArch64_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 1135 | + McHorVer02WidthEq8_AArch64_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); | |
| 1136 | + PixelAvgWidthEq8_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | |
| 1137 | + } else if (iWidth == 4) { | |
| 1138 | + McHorVer20WidthEq4_AArch64_neon (pSrc + iSrcStride, iSrcStride, pHorTmp, 16, iHeight); | |
| 1139 | + McHorVer02WidthEq4_AArch64_neon (pSrc + 1, iSrcStride, pVerTmp, 16, iHeight); | |
| 1140 | + PixelAvgWidthEq4_AArch64_neon (pDst, iDstStride, pHorTmp, 16, pVerTmp, 16, iHeight); | |
| 1141 | + } | |
| 1142 | +} | |
| 1143 | + | |
| 1144 | +void McLuma_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 1145 | + int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) { | |
| 1146 | + static PWelsMcWidthHeightFunc pWelsMcFunc[4][4] = { //[x][y] | |
| 1147 | + {McCopy_AArch64_neon, McHorVer01_AArch64_neon, McHorVer02_AArch64_neon, McHorVer03_AArch64_neon}, | |
| 1148 | + {McHorVer10_AArch64_neon, McHorVer11_AArch64_neon, McHorVer12_AArch64_neon, McHorVer13_AArch64_neon}, | |
| 1149 | + {McHorVer20_AArch64_neon, McHorVer21_AArch64_neon, McHorVer22_AArch64_neon, McHorVer23_AArch64_neon}, | |
| 1150 | + {McHorVer30_AArch64_neon, McHorVer31_AArch64_neon, McHorVer32_AArch64_neon, McHorVer33_AArch64_neon}, | |
| 1151 | + }; | |
| 941 | 1152 | // pSrc += (iMvY >> 2) * iSrcStride + (iMvX >> 2); |
| 942 | − pWelsMcFunc[iMvX&0x03][iMvY&0x03](pSrc, iSrcStride, pDst, iDstStride, iWidth, iHeight); | |
| 1153 | + pWelsMcFunc[iMvX & 0x03][iMvY & 0x03] (pSrc, iSrcStride, pDst, iDstStride, iWidth, iHeight); | |
| 943 | 1154 | } |
| 944 | −void McChroma_neon(const uint8_t *pSrc, int32_t iSrcStride, uint8_t *pDst, int32_t iDstStride, | |
| 945 | − int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) | |
| 946 | −{ | |
| 947 | − if (0 == iMvX && 0 == iMvY) | |
| 948 | − { | |
| 949 | − if(8 == iWidth) | |
| 950 | − McCopyWidthEq8_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 951 | − else if(iWidth == 4) | |
| 952 | − McCopyWidthEq4_neon(pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 953 | − else //here iWidth == 2 | |
| 954 | − McCopyWidthEq2_c(pSrc,iSrcStride,pDst,iDstStride,iHeight); | |
| 955 | − } | |
| 956 | − else | |
| 957 | − { | |
| 958 | − const int32_t kiD8x = iMvX & 0x07; | |
| 959 | − const int32_t kiD8y = iMvY & 0x07; | |
| 960 | − if(8 == iWidth) | |
| 961 | − McChromaWidthEq8_neon(pSrc, iSrcStride, pDst, iDstStride, (int32_t*)(g_kuiABCD[kiD8y][kiD8x]), iHeight); | |
| 962 | − else if(4 == iWidth) | |
| 963 | − McChromaWidthEq4_neon(pSrc, iSrcStride, pDst, iDstStride, (int32_t*)(g_kuiABCD[kiD8y][kiD8x]), iHeight); | |
| 964 | − else //here iWidth == 2 | |
| 965 | − McChromaWithFragMv_c(pSrc, iSrcStride, pDst, iDstStride, iMvX, iMvY, iWidth, iHeight); | |
| 966 | − } | |
| 1155 | +void McChroma_AArch64_neon (const uint8_t* pSrc, int32_t iSrcStride, uint8_t* pDst, int32_t iDstStride, | |
| 1156 | + int16_t iMvX, int16_t iMvY, int32_t iWidth, int32_t iHeight) { | |
| 1157 | + if (0 == iMvX && 0 == iMvY) { | |
| 1158 | + if (8 == iWidth) | |
| 1159 | + McCopyWidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 1160 | + else if (iWidth == 4) | |
| 1161 | + McCopyWidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 1162 | + else //here iWidth == 2 | |
| 1163 | + McCopyWidthEq2_c (pSrc, iSrcStride, pDst, iDstStride, iHeight); | |
| 1164 | + } else { | |
| 1165 | + const int32_t kiD8x = iMvX & 0x07; | |
| 1166 | + const int32_t kiD8y = iMvY & 0x07; | |
| 1167 | + if (8 == iWidth) | |
| 1168 | + McChromaWidthEq8_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, (int32_t*) (g_kuiABCD[kiD8y][kiD8x]), iHeight); | |
| 1169 | + else if (4 == iWidth) | |
| 1170 | + McChromaWidthEq4_AArch64_neon (pSrc, iSrcStride, pDst, iDstStride, (int32_t*) (g_kuiABCD[kiD8y][kiD8x]), iHeight); | |
| 1171 | + else //here iWidth == 2 | |
| 1172 | + McChromaWithFragMv_c (pSrc, iSrcStride, pDst, iDstStride, iMvX, iMvY, iWidth, iHeight); | |
| 1173 | + } | |
| 967 | 1174 | } |
| 968 | 1175 | #endif |
| 1176 | + | |
| 969 | 1177 | void InitMcFunc (SMcFunc* pMcFunc, int32_t iCpu) { |
| 970 | 1178 | pMcFunc->pMcLumaFunc = McLuma_c; |
| 971 | 1179 | pMcFunc->pMcChromaFunc = McChroma_c; |
| 972 | 1180 | |
| 973 | 1181 | #ifdef HAVE_NEON |
| 974 | − if ( iCpu & WELS_CPU_NEON ) { | |
| 975 | − pMcFunc->pMcLumaFunc = McLuma_neon; | |
| 976 | − pMcFunc->pMcChromaFunc = McChroma_neon; | |
| 977 | − } | |
| 1182 | + if (iCpu & WELS_CPU_NEON) { | |
| 1183 | + pMcFunc->pMcLumaFunc = McLuma_neon; | |
| 1184 | + pMcFunc->pMcChromaFunc = McChroma_neon; | |
| 1185 | + } | |
| 1186 | +#endif | |
| 1187 | +#ifdef HAVE_NEON_AARCH64 | |
| 1188 | + if (iCpu & WELS_CPU_NEON) { | |
| 1189 | + pMcFunc->pMcLumaFunc = McLuma_AArch64_neon; | |
| 1190 | + pMcFunc->pMcChromaFunc = McChroma_AArch64_neon; | |
| 1191 | + } | |
| 978 | 1192 | #endif |
| 979 | − | |
| 980 | 1193 | #if defined (X86_ASM) |
| 981 | 1194 | if (iCpu & WELS_CPU_SSE2) { |
| 982 | − pMcFunc->pMcLumaFunc = McLuma_sse2; | |
| 983 | − pMcFunc->pMcChromaFunc = McChroma_sse2; | |
| 1195 | + pMcFunc->pMcLumaFunc = McLuma_sse2; | |
| 1196 | + pMcFunc->pMcChromaFunc = McChroma_sse2; | |
| 984 | 1197 | } |
| 985 | 1198 | #endif //(X86_ASM) |
| 986 | 1199 | } |