| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * Copyright (C) 2001-2011 Michael Niedermayer <michaelni@gmx.at> | ||
| 3 | * | ||
| 4 | * This file is part of FFmpeg. | ||
| 5 | * | ||
| 6 | * FFmpeg is free software; you can redistribute it and/or | ||
| 7 | * modify it under the terms of the GNU Lesser General Public | ||
| 8 | * License as published by the Free Software Foundation; either | ||
| 9 | * version 2.1 of the License, or (at your option) any later version. | ||
| 10 | * | ||
| 11 | * FFmpeg is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 14 | * Lesser General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU Lesser General Public | ||
| 17 | * License along with FFmpeg; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
| 19 | */ | ||
| 20 | |||
| 21 | #include <inttypes.h> | ||
| 22 | #include "config.h" | ||
| 23 | #include "libswscale/swscale.h" | ||
| 24 | #include "libswscale/swscale_internal.h" | ||
| 25 | #include "libavutil/attributes.h" | ||
| 26 | #include "libavutil/avassert.h" | ||
| 27 | #include "libavutil/intreadwrite.h" | ||
| 28 | #include "libavutil/x86/cpu.h" | ||
| 29 | #include "libavutil/cpu.h" | ||
| 30 | #include "libavutil/mem_internal.h" | ||
| 31 | #include "libavutil/pixdesc.h" | ||
| 32 | |||
| 33 | const DECLARE_ALIGNED(8, uint64_t, ff_dither4)[2] = { | ||
| 34 | 0x0103010301030103LL, | ||
| 35 | 0x0200020002000200LL,}; | ||
| 36 | |||
| 37 | const DECLARE_ALIGNED(8, uint64_t, ff_dither8)[2] = { | ||
| 38 | 0x0602060206020602LL, | ||
| 39 | 0x0004000400040004LL,}; | ||
| 40 | |||
| 41 | #if HAVE_INLINE_ASM | ||
| 42 | |||
| 43 | DECLARE_ASM_CONST(8, uint64_t, bF8)= 0xF8F8F8F8F8F8F8F8LL; | ||
| 44 | DECLARE_ASM_CONST(8, uint64_t, bFC)= 0xFCFCFCFCFCFCFCFCLL; | ||
| 45 | |||
| 46 | DECLARE_ASM_CONST(8, uint64_t, M24A) = 0x00FF0000FF0000FFLL; | ||
| 47 | DECLARE_ASM_CONST(8, uint64_t, M24B) = 0xFF0000FF0000FF00LL; | ||
| 48 | DECLARE_ASM_CONST(8, uint64_t, M24C) = 0x0000FF0000FF0000LL; | ||
| 49 | |||
| 50 | // MMXEXT versions | ||
| 51 | #if HAVE_MMXEXT_INLINE | ||
| 52 | #undef RENAME | ||
| 53 | #undef COMPILE_TEMPLATE_MMXEXT | ||
| 54 | #define COMPILE_TEMPLATE_MMXEXT 1 | ||
| 55 | #define RENAME(a) a ## _mmxext | ||
| 56 | #include "swscale_template.c" | ||
| 57 | #endif | ||
| 58 | #endif /* HAVE_INLINE_ASM */ | ||
| 59 | |||
| 60 | 29640316 | void ff_updateMMXDitherTables(SwsInternal *c, int dstY) | |
| 61 | { | ||
| 62 | 29640316 | const int dstH= c->opts.dst_h; | |
| 63 | 29640316 | const int flags= c->opts.flags; | |
| 64 | |||
| 65 | 29640316 | SwsPlane *lumPlane = &c->slice[c->numSlice-2].plane[0]; | |
| 66 | 29640316 | SwsPlane *chrUPlane = &c->slice[c->numSlice-2].plane[1]; | |
| 67 | 29640316 | SwsPlane *alpPlane = &c->slice[c->numSlice-2].plane[3]; | |
| 68 | |||
| 69 | 29640316 | int hasAlpha = c->needAlpha; | |
| 70 | 29640316 | int32_t *vLumFilterPos= c->vLumFilterPos; | |
| 71 | 29640316 | int32_t *vChrFilterPos= c->vChrFilterPos; | |
| 72 | 29640316 | int16_t *vLumFilter= c->vLumFilter; | |
| 73 | 29640316 | int16_t *vChrFilter= c->vChrFilter; | |
| 74 | 29640316 | int32_t *lumMmxFilter= c->lumMmxFilter; | |
| 75 | 29640316 | int32_t *chrMmxFilter= c->chrMmxFilter; | |
| 76 | 29640316 | av_unused int32_t *alpMmxFilter= c->alpMmxFilter; | |
| 77 | 29640316 | const int vLumFilterSize= c->vLumFilterSize; | |
| 78 | 29640316 | const int vChrFilterSize= c->vChrFilterSize; | |
| 79 | 29640316 | const int chrDstY= dstY>>c->chrDstVSubSample; | |
| 80 | 29640316 | const int firstLumSrcY= vLumFilterPos[dstY]; //First line needed as input | |
| 81 | 29640316 | const int firstChrSrcY= vChrFilterPos[chrDstY]; //First line needed as input | |
| 82 | |||
| 83 | 29640316 | c->blueDither= ff_dither8[dstY&1]; | |
| 84 |
4/4✓ Branch 0 taken 29413324 times.
✓ Branch 1 taken 226992 times.
✓ Branch 2 taken 55948 times.
✓ Branch 3 taken 29357376 times.
|
29640316 | if (c->opts.dst_format == AV_PIX_FMT_RGB555 || c->opts.dst_format == AV_PIX_FMT_BGR555) |
| 85 | 282940 | c->greenDither= ff_dither8[dstY&1]; | |
| 86 | else | ||
| 87 | 29357376 | c->greenDither= ff_dither4[dstY&1]; | |
| 88 | 29640316 | c->redDither= ff_dither8[(dstY+1)&1]; | |
| 89 |
2/2✓ Branch 0 taken 29420044 times.
✓ Branch 1 taken 220272 times.
|
29640316 | if (dstY < dstH - 2) { |
| 90 | 29420044 | const int16_t **lumSrcPtr = (const int16_t **)(void*) lumPlane->line + firstLumSrcY - lumPlane->sliceY; | |
| 91 | 29420044 | const int16_t **chrUSrcPtr = (const int16_t **)(void*) chrUPlane->line + firstChrSrcY - chrUPlane->sliceY; | |
| 92 |
2/2✓ Branch 0 taken 488190 times.
✓ Branch 1 taken 28931854 times.
|
29420044 | const int16_t **alpSrcPtr = (CONFIG_SWSCALE_ALPHA && hasAlpha) ? (const int16_t **)(void*) alpPlane->line + firstLumSrcY - alpPlane->sliceY : NULL; |
| 93 | |||
| 94 | int i; | ||
| 95 |
2/4✓ Branch 0 taken 29420044 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 29420044 times.
|
29420044 | if (firstLumSrcY < 0 || firstLumSrcY + vLumFilterSize > c->opts.src_h) { |
| 96 | ✗ | const int16_t **tmpY = (const int16_t **) lumPlane->tmp; | |
| 97 | |||
| 98 | ✗ | int neg = -firstLumSrcY, i, end = FFMIN(c->opts.src_h - firstLumSrcY, vLumFilterSize); | |
| 99 | ✗ | for (i = 0; i < neg; i++) | |
| 100 | ✗ | tmpY[i] = lumSrcPtr[neg]; | |
| 101 | ✗ | for ( ; i < end; i++) | |
| 102 | ✗ | tmpY[i] = lumSrcPtr[i]; | |
| 103 | ✗ | for ( ; i < vLumFilterSize; i++) | |
| 104 | ✗ | tmpY[i] = tmpY[i-1]; | |
| 105 | ✗ | lumSrcPtr = tmpY; | |
| 106 | |||
| 107 | ✗ | if (alpSrcPtr) { | |
| 108 | ✗ | const int16_t **tmpA = (const int16_t **) alpPlane->tmp; | |
| 109 | ✗ | for (i = 0; i < neg; i++) | |
| 110 | ✗ | tmpA[i] = alpSrcPtr[neg]; | |
| 111 | ✗ | for ( ; i < end; i++) | |
| 112 | ✗ | tmpA[i] = alpSrcPtr[i]; | |
| 113 | ✗ | for ( ; i < vLumFilterSize; i++) | |
| 114 | ✗ | tmpA[i] = tmpA[i - 1]; | |
| 115 | ✗ | alpSrcPtr = tmpA; | |
| 116 | } | ||
| 117 | } | ||
| 118 |
2/4✓ Branch 0 taken 29420044 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 29420044 times.
|
29420044 | if (firstChrSrcY < 0 || firstChrSrcY + vChrFilterSize > c->chrSrcH) { |
| 119 | ✗ | const int16_t **tmpU = (const int16_t **) chrUPlane->tmp; | |
| 120 | ✗ | int neg = -firstChrSrcY, i, end = FFMIN(c->chrSrcH - firstChrSrcY, vChrFilterSize); | |
| 121 | ✗ | for (i = 0; i < neg; i++) { | |
| 122 | ✗ | tmpU[i] = chrUSrcPtr[neg]; | |
| 123 | } | ||
| 124 | ✗ | for ( ; i < end; i++) { | |
| 125 | ✗ | tmpU[i] = chrUSrcPtr[i]; | |
| 126 | } | ||
| 127 | ✗ | for ( ; i < vChrFilterSize; i++) { | |
| 128 | ✗ | tmpU[i] = tmpU[i - 1]; | |
| 129 | } | ||
| 130 | ✗ | chrUSrcPtr = tmpU; | |
| 131 | } | ||
| 132 | |||
| 133 |
2/2✓ Branch 0 taken 28704058 times.
✓ Branch 1 taken 715986 times.
|
29420044 | if (flags & SWS_ACCURATE_RND) { |
| 134 | 28704058 | int s= APCK_SIZE / 8; | |
| 135 |
2/2✓ Branch 0 taken 30610756 times.
✓ Branch 1 taken 28704058 times.
|
59314814 | for (i=0; i<vLumFilterSize; i+=2) { |
| 136 | 30610756 | *(const void**)&lumMmxFilter[s*i ]= lumSrcPtr[i ]; | |
| 137 | 30610756 | *(const void**)&lumMmxFilter[s*i+APCK_PTR2/4 ]= lumSrcPtr[i+(vLumFilterSize>1)]; | |
| 138 | 30610756 | lumMmxFilter[s*i+APCK_COEF/4 ]= | |
| 139 | 61221512 | lumMmxFilter[s*i+APCK_COEF/4+1]= vLumFilter[dstY*vLumFilterSize + i ] | |
| 140 |
2/2✓ Branch 0 taken 5227064 times.
✓ Branch 1 taken 25383692 times.
|
30610756 | + (vLumFilterSize>1 ? vLumFilter[dstY*vLumFilterSize + i + 1] * (1 << 16) : 0); |
| 141 |
2/2✓ Branch 0 taken 533300 times.
✓ Branch 1 taken 30077456 times.
|
30610756 | if (CONFIG_SWSCALE_ALPHA && hasAlpha) { |
| 142 | 533300 | *(const void**)&alpMmxFilter[s*i ]= alpSrcPtr[i ]; | |
| 143 | 533300 | *(const void**)&alpMmxFilter[s*i+APCK_PTR2/4 ]= alpSrcPtr[i+(vLumFilterSize>1)]; | |
| 144 | 533300 | alpMmxFilter[s*i+APCK_COEF/4 ]= | |
| 145 | 533300 | alpMmxFilter[s*i+APCK_COEF/4+1]= lumMmxFilter[s*i+APCK_COEF/4 ]; | |
| 146 | } | ||
| 147 | } | ||
| 148 |
2/2✓ Branch 0 taken 48528060 times.
✓ Branch 1 taken 28704058 times.
|
77232118 | for (i=0; i<vChrFilterSize; i+=2) { |
| 149 | 48528060 | *(const void**)&chrMmxFilter[s*i ]= chrUSrcPtr[i ]; | |
| 150 | 48528060 | *(const void**)&chrMmxFilter[s*i+APCK_PTR2/4 ]= chrUSrcPtr[i+(vChrFilterSize>1)]; | |
| 151 | 48528060 | chrMmxFilter[s*i+APCK_COEF/4 ]= | |
| 152 | 97056120 | chrMmxFilter[s*i+APCK_COEF/4+1]= vChrFilter[chrDstY*vChrFilterSize + i ] | |
| 153 |
2/2✓ Branch 0 taken 33150654 times.
✓ Branch 1 taken 15377406 times.
|
48528060 | + (vChrFilterSize>1 ? vChrFilter[chrDstY*vChrFilterSize + i + 1] * (1 << 16) : 0); |
| 154 | } | ||
| 155 | } else { | ||
| 156 |
2/2✓ Branch 0 taken 1602607 times.
✓ Branch 1 taken 715986 times.
|
2318593 | for (i=0; i<vLumFilterSize; i++) { |
| 157 | 1602607 | *(const void**)&lumMmxFilter[4*i+0]= lumSrcPtr[i]; | |
| 158 | 1602607 | lumMmxFilter[4*i+2]= | |
| 159 | 1602607 | lumMmxFilter[4*i+3]= | |
| 160 | 1602607 | ((uint16_t)vLumFilter[dstY*vLumFilterSize + i])*0x10001U; | |
| 161 |
2/2✓ Branch 0 taken 29525 times.
✓ Branch 1 taken 1573082 times.
|
1602607 | if (CONFIG_SWSCALE_ALPHA && hasAlpha) { |
| 162 | 29525 | *(const void**)&alpMmxFilter[4*i+0]= alpSrcPtr[i]; | |
| 163 | 29525 | alpMmxFilter[4*i+2]= | |
| 164 | 29525 | alpMmxFilter[4*i+3]= lumMmxFilter[4*i+2]; | |
| 165 | } | ||
| 166 | } | ||
| 167 |
2/2✓ Branch 0 taken 2154819 times.
✓ Branch 1 taken 715986 times.
|
2870805 | for (i=0; i<vChrFilterSize; i++) { |
| 168 | 2154819 | *(const void**)&chrMmxFilter[4*i+0]= chrUSrcPtr[i]; | |
| 169 | 2154819 | chrMmxFilter[4*i+2]= | |
| 170 | 2154819 | chrMmxFilter[4*i+3]= | |
| 171 | 2154819 | ((uint16_t)vChrFilter[chrDstY*vChrFilterSize + i])*0x10001U; | |
| 172 | } | ||
| 173 | } | ||
| 174 | } | ||
| 175 | 29640316 | } | |
| 176 | |||
| 177 | #define YUV2YUVX_FUNC(opt, step) \ | ||
| 178 | void ff_yuv2yuvX_ ##opt(const int16_t *filter, int filterSize, int srcOffset, \ | ||
| 179 | uint8_t *dest, int dstW, \ | ||
| 180 | const uint8_t *dither, int offset); \ | ||
| 181 | static void yuv2yuvX_ ##opt(const int16_t *filter, int filterSize, \ | ||
| 182 | const int16_t **src, uint8_t *dest, int dstW, \ | ||
| 183 | const uint8_t *dither, int offset) \ | ||
| 184 | { \ | ||
| 185 | int remainder = (dstW % step); \ | ||
| 186 | int pixelsProcessed = dstW - remainder; \ | ||
| 187 | if(((uintptr_t)dest) & 15){ \ | ||
| 188 | yuv2yuvX_sse2(filter, filterSize, src, dest, dstW, dither, offset); \ | ||
| 189 | return; \ | ||
| 190 | } \ | ||
| 191 | if(pixelsProcessed > 0) \ | ||
| 192 | ff_yuv2yuvX_ ##opt(filter, filterSize - 1, 0, dest - offset, pixelsProcessed + offset, dither, offset); \ | ||
| 193 | if(remainder > 0){ \ | ||
| 194 | ff_yuv2yuvX_sse2(filter, filterSize - 1, pixelsProcessed, dest - offset, pixelsProcessed + remainder + offset, dither, offset); \ | ||
| 195 | } \ | ||
| 196 | return; \ | ||
| 197 | } | ||
| 198 | |||
| 199 | #if HAVE_SSE2_EXTERNAL | ||
| 200 | void ff_yuv2yuvX_sse2(const int16_t *filter, int filterSize, int srcOffset, | ||
| 201 | uint8_t *dest, int dstW, | ||
| 202 | const uint8_t *dither, int offset); | ||
| 203 | 76 | static void yuv2yuvX_sse2(const int16_t *filter, int filterSize, | |
| 204 | const int16_t **src, uint8_t *dest, int dstW, | ||
| 205 | const uint8_t *dither, int offset) | ||
| 206 | { | ||
| 207 |
1/2✓ Branch 0 taken 76 times.
✗ Branch 1 not taken.
|
76 | if (dstW > 0) |
| 208 | 76 | ff_yuv2yuvX_sse2(filter, filterSize - 1, 0, dest - offset, dstW + offset, dither, offset); | |
| 209 | 76 | return; | |
| 210 | } | ||
| 211 | #if HAVE_SSE3_EXTERNAL | ||
| 212 |
5/6✗ Branch 0 not taken.
✓ Branch 1 taken 76 times.
✓ Branch 3 taken 64 times.
✓ Branch 4 taken 12 times.
✓ Branch 6 taken 44 times.
✓ Branch 7 taken 32 times.
|
76 | YUV2YUVX_FUNC(sse3, 32) |
| 213 | #endif | ||
| 214 | #if HAVE_AVX2_EXTERNAL | ||
| 215 |
5/6✗ Branch 0 not taken.
✓ Branch 1 taken 76 times.
✓ Branch 3 taken 64 times.
✓ Branch 4 taken 12 times.
✓ Branch 6 taken 60 times.
✓ Branch 7 taken 16 times.
|
76 | YUV2YUVX_FUNC(avx2, 64) |
| 216 | #endif | ||
| 217 | #endif | ||
| 218 | |||
| 219 | #define SCALE_FUNC(filter_n, from_bpc, to_bpc, opt) \ | ||
| 220 | void ff_hscale ## from_bpc ## to ## to_bpc ## _ ## filter_n ## _ ## opt( \ | ||
| 221 | SwsInternal *c, int16_t *data, \ | ||
| 222 | int dstW, const uint8_t *src, \ | ||
| 223 | const int16_t *filter, \ | ||
| 224 | const int32_t *filterPos, int filterSize) | ||
| 225 | |||
| 226 | #define SCALE_FUNCS(filter_n, opt) \ | ||
| 227 | SCALE_FUNC(filter_n, 8, 15, opt); \ | ||
| 228 | SCALE_FUNC(filter_n, 9, 15, opt); \ | ||
| 229 | SCALE_FUNC(filter_n, 10, 15, opt); \ | ||
| 230 | SCALE_FUNC(filter_n, 12, 15, opt); \ | ||
| 231 | SCALE_FUNC(filter_n, 14, 15, opt); \ | ||
| 232 | SCALE_FUNC(filter_n, 16, 15, opt); \ | ||
| 233 | SCALE_FUNC(filter_n, 8, 19, opt); \ | ||
| 234 | SCALE_FUNC(filter_n, 9, 19, opt); \ | ||
| 235 | SCALE_FUNC(filter_n, 10, 19, opt); \ | ||
| 236 | SCALE_FUNC(filter_n, 12, 19, opt); \ | ||
| 237 | SCALE_FUNC(filter_n, 14, 19, opt); \ | ||
| 238 | SCALE_FUNC(filter_n, 16, 19, opt) | ||
| 239 | |||
| 240 | #define SCALE_FUNCS_MMX(opt) \ | ||
| 241 | SCALE_FUNCS(4, opt); \ | ||
| 242 | SCALE_FUNCS(8, opt); \ | ||
| 243 | SCALE_FUNCS(X, opt) | ||
| 244 | |||
| 245 | #define SCALE_FUNCS_SSE(opt) \ | ||
| 246 | SCALE_FUNCS(4, opt); \ | ||
| 247 | SCALE_FUNCS(8, opt); \ | ||
| 248 | SCALE_FUNCS(X4, opt); \ | ||
| 249 | SCALE_FUNCS(X8, opt) | ||
| 250 | |||
| 251 | SCALE_FUNCS_SSE(sse2); | ||
| 252 | SCALE_FUNCS_SSE(ssse3); | ||
| 253 | SCALE_FUNCS_SSE(sse4); | ||
| 254 | |||
| 255 | SCALE_FUNC(4, 8, 15, avx2); | ||
| 256 | SCALE_FUNC(X4, 8, 15, avx2); | ||
| 257 | |||
| 258 | #define VSCALEX_FUNC(size, opt) \ | ||
| 259 | void ff_yuv2planeX_ ## size ## _ ## opt(const int16_t *filter, int filterSize, \ | ||
| 260 | const int16_t **src, uint8_t *dest, int dstW, \ | ||
| 261 | const uint8_t *dither, int offset) | ||
| 262 | #define VSCALEX_FUNCS(opt) \ | ||
| 263 | VSCALEX_FUNC(8, opt); \ | ||
| 264 | VSCALEX_FUNC(9, opt); \ | ||
| 265 | VSCALEX_FUNC(10, opt) | ||
| 266 | |||
| 267 | VSCALEX_FUNCS(sse2); | ||
| 268 | VSCALEX_FUNCS(sse4); | ||
| 269 | VSCALEX_FUNC(16, sse4); | ||
| 270 | VSCALEX_FUNCS(avx); | ||
| 271 | |||
| 272 | #define VSCALE_FUNC(size, opt) \ | ||
| 273 | void ff_yuv2plane1_ ## size ## _ ## opt(const int16_t *src, uint8_t *dst, int dstW, \ | ||
| 274 | const uint8_t *dither, int offset) | ||
| 275 | #define VSCALE_FUNCS(opt1, opt2) \ | ||
| 276 | VSCALE_FUNC(8, opt1); \ | ||
| 277 | VSCALE_FUNC(9, opt2); \ | ||
| 278 | VSCALE_FUNC(10, opt2); \ | ||
| 279 | VSCALE_FUNC(16, opt1) | ||
| 280 | |||
| 281 | VSCALE_FUNCS(sse2, sse2); | ||
| 282 | VSCALE_FUNC(16, sse4); | ||
| 283 | VSCALE_FUNCS(avx, avx); | ||
| 284 | |||
| 285 | #define INPUT_Y_FUNC(fmt, opt) \ | ||
| 286 | void ff_ ## fmt ## ToY_ ## opt(uint8_t *dst, const uint8_t *src, \ | ||
| 287 | const uint8_t *unused1, const uint8_t *unused2, \ | ||
| 288 | int w, uint32_t *unused, void *opq) | ||
| 289 | #define INPUT_UV_FUNC(fmt, opt) \ | ||
| 290 | void ff_ ## fmt ## ToUV_ ## opt(uint8_t *dstU, uint8_t *dstV, \ | ||
| 291 | const uint8_t *unused0, \ | ||
| 292 | const uint8_t *src1, \ | ||
| 293 | const uint8_t *src2, \ | ||
| 294 | int w, uint32_t *unused, void *opq) | ||
| 295 | #define INPUT_FUNC(fmt, opt) \ | ||
| 296 | INPUT_Y_FUNC(fmt, opt); \ | ||
| 297 | INPUT_UV_FUNC(fmt, opt) | ||
| 298 | #define INPUT_FUNCS(opt) \ | ||
| 299 | INPUT_FUNC(uyvy, opt); \ | ||
| 300 | INPUT_FUNC(yuyv, opt); \ | ||
| 301 | INPUT_UV_FUNC(nv12, opt); \ | ||
| 302 | INPUT_UV_FUNC(nv21, opt); \ | ||
| 303 | INPUT_FUNC(rgba, opt); \ | ||
| 304 | INPUT_FUNC(bgra, opt); \ | ||
| 305 | INPUT_FUNC(argb, opt); \ | ||
| 306 | INPUT_FUNC(abgr, opt); \ | ||
| 307 | INPUT_FUNC(rgb24, opt); \ | ||
| 308 | INPUT_FUNC(bgr24, opt) | ||
| 309 | |||
| 310 | INPUT_FUNCS(sse2); | ||
| 311 | INPUT_FUNCS(ssse3); | ||
| 312 | INPUT_FUNCS(avx); | ||
| 313 | INPUT_FUNC(rgba, avx2); | ||
| 314 | INPUT_FUNC(bgra, avx2); | ||
| 315 | INPUT_FUNC(argb, avx2); | ||
| 316 | INPUT_FUNC(abgr, avx2); | ||
| 317 | INPUT_FUNC(rgb24, avx2); | ||
| 318 | INPUT_FUNC(bgr24, avx2); | ||
| 319 | |||
| 320 | #if ARCH_X86_64 | ||
| 321 | #define YUV2NV_DECL(fmt, opt) \ | ||
| 322 | void ff_yuv2 ## fmt ## cX_ ## opt(enum AVPixelFormat format, const uint8_t *dither, \ | ||
| 323 | const int16_t *filter, int filterSize, \ | ||
| 324 | const int16_t **u, const int16_t **v, \ | ||
| 325 | uint8_t *dst, int dstWidth) | ||
| 326 | |||
| 327 | YUV2NV_DECL(nv12, avx2); | ||
| 328 | YUV2NV_DECL(nv21, avx2); | ||
| 329 | |||
| 330 | #define YUV2GBRP_FN_DECL(fmt, opt) \ | ||
| 331 | void ff_yuv2##fmt##_full_X_ ##opt(SwsInternal *c, const int16_t *lumFilter, \ | ||
| 332 | const int16_t **lumSrcx, int lumFilterSize, \ | ||
| 333 | const int16_t *chrFilter, const int16_t **chrUSrcx, \ | ||
| 334 | const int16_t **chrVSrcx, int chrFilterSize, \ | ||
| 335 | const int16_t **alpSrcx, uint8_t **dest, \ | ||
| 336 | int dstW, int y) | ||
| 337 | |||
| 338 | #define YUV2GBRP_DECL(opt) \ | ||
| 339 | YUV2GBRP_FN_DECL(gbrp, opt); \ | ||
| 340 | YUV2GBRP_FN_DECL(gbrap, opt); \ | ||
| 341 | YUV2GBRP_FN_DECL(gbrp9le, opt); \ | ||
| 342 | YUV2GBRP_FN_DECL(gbrp10le, opt); \ | ||
| 343 | YUV2GBRP_FN_DECL(gbrap10le, opt); \ | ||
| 344 | YUV2GBRP_FN_DECL(gbrp12le, opt); \ | ||
| 345 | YUV2GBRP_FN_DECL(gbrap12le, opt); \ | ||
| 346 | YUV2GBRP_FN_DECL(gbrp14le, opt); \ | ||
| 347 | YUV2GBRP_FN_DECL(gbrp16le, opt); \ | ||
| 348 | YUV2GBRP_FN_DECL(gbrap16le, opt); \ | ||
| 349 | YUV2GBRP_FN_DECL(gbrpf32le, opt); \ | ||
| 350 | YUV2GBRP_FN_DECL(gbrapf32le, opt); \ | ||
| 351 | YUV2GBRP_FN_DECL(gbrp9be, opt); \ | ||
| 352 | YUV2GBRP_FN_DECL(gbrp10be, opt); \ | ||
| 353 | YUV2GBRP_FN_DECL(gbrap10be, opt); \ | ||
| 354 | YUV2GBRP_FN_DECL(gbrp12be, opt); \ | ||
| 355 | YUV2GBRP_FN_DECL(gbrap12be, opt); \ | ||
| 356 | YUV2GBRP_FN_DECL(gbrp14be, opt); \ | ||
| 357 | YUV2GBRP_FN_DECL(gbrp16be, opt); \ | ||
| 358 | YUV2GBRP_FN_DECL(gbrap16be, opt); \ | ||
| 359 | YUV2GBRP_FN_DECL(gbrpf32be, opt); \ | ||
| 360 | YUV2GBRP_FN_DECL(gbrapf32be, opt) | ||
| 361 | |||
| 362 | YUV2GBRP_DECL(sse2); | ||
| 363 | YUV2GBRP_DECL(sse4); | ||
| 364 | YUV2GBRP_DECL(avx2); | ||
| 365 | |||
| 366 | #define INPUT_PLANAR_RGB_Y_FN_DECL(fmt, opt) \ | ||
| 367 | void ff_planar_##fmt##_to_y_##opt(uint8_t *dst, \ | ||
| 368 | const uint8_t *src[4], int w, int32_t *rgb2yuv, \ | ||
| 369 | void *opq) | ||
| 370 | |||
| 371 | #define INPUT_PLANAR_RGB_UV_FN_DECL(fmt, opt) \ | ||
| 372 | void ff_planar_##fmt##_to_uv_##opt(uint8_t *dstU, uint8_t *dstV, \ | ||
| 373 | const uint8_t *src[4], int w, int32_t *rgb2yuv, \ | ||
| 374 | void *opq) | ||
| 375 | |||
| 376 | #define INPUT_PLANAR_RGB_A_FN_DECL(fmt, opt) \ | ||
| 377 | void ff_planar_##fmt##_to_a_##opt(uint8_t *dst, \ | ||
| 378 | const uint8_t *src[4], int w, int32_t *rgb2yuv, \ | ||
| 379 | void *opq) | ||
| 380 | |||
| 381 | |||
| 382 | #define INPUT_PLANAR_RGBXX_A_DECL(fmt, opt) \ | ||
| 383 | INPUT_PLANAR_RGB_A_FN_DECL(fmt##le, opt); \ | ||
| 384 | INPUT_PLANAR_RGB_A_FN_DECL(fmt##be, opt) | ||
| 385 | |||
| 386 | #define INPUT_PLANAR_RGBXX_Y_DECL(fmt, opt) \ | ||
| 387 | INPUT_PLANAR_RGB_Y_FN_DECL(fmt##le, opt); \ | ||
| 388 | INPUT_PLANAR_RGB_Y_FN_DECL(fmt##be, opt) | ||
| 389 | |||
| 390 | #define INPUT_PLANAR_RGBXX_UV_DECL(fmt, opt) \ | ||
| 391 | INPUT_PLANAR_RGB_UV_FN_DECL(fmt##le, opt); \ | ||
| 392 | INPUT_PLANAR_RGB_UV_FN_DECL(fmt##be, opt) | ||
| 393 | |||
| 394 | #define INPUT_PLANAR_RGBXX_YUVA_DECL(fmt, opt) \ | ||
| 395 | INPUT_PLANAR_RGBXX_Y_DECL(fmt, opt); \ | ||
| 396 | INPUT_PLANAR_RGBXX_UV_DECL(fmt, opt); \ | ||
| 397 | INPUT_PLANAR_RGBXX_A_DECL(fmt, opt) | ||
| 398 | |||
| 399 | #define INPUT_PLANAR_RGBXX_YUV_DECL(fmt, opt) \ | ||
| 400 | INPUT_PLANAR_RGBXX_Y_DECL(fmt, opt); \ | ||
| 401 | INPUT_PLANAR_RGBXX_UV_DECL(fmt, opt) | ||
| 402 | |||
| 403 | #define INPUT_PLANAR_RGBXX_UVA_DECL(fmt, opt) \ | ||
| 404 | INPUT_PLANAR_RGBXX_UV_DECL(fmt, opt); \ | ||
| 405 | INPUT_PLANAR_RGBXX_A_DECL(fmt, opt) | ||
| 406 | |||
| 407 | #define INPUT_PLANAR_RGB_A_ALL_DECL(opt) \ | ||
| 408 | INPUT_PLANAR_RGB_A_FN_DECL(rgb, opt); \ | ||
| 409 | INPUT_PLANAR_RGBXX_A_DECL(rgb10, opt); \ | ||
| 410 | INPUT_PLANAR_RGBXX_A_DECL(rgb12, opt); \ | ||
| 411 | INPUT_PLANAR_RGBXX_A_DECL(rgb16, opt); \ | ||
| 412 | INPUT_PLANAR_RGBXX_A_DECL(rgbf32, opt) | ||
| 413 | |||
| 414 | #define INPUT_PLANAR_RGB_Y_ALL_DECL(opt) \ | ||
| 415 | INPUT_PLANAR_RGB_Y_FN_DECL(rgb, opt); \ | ||
| 416 | INPUT_PLANAR_RGBXX_Y_DECL(rgb9, opt); \ | ||
| 417 | INPUT_PLANAR_RGBXX_Y_DECL(rgb10, opt); \ | ||
| 418 | INPUT_PLANAR_RGBXX_Y_DECL(rgb12, opt); \ | ||
| 419 | INPUT_PLANAR_RGBXX_Y_DECL(rgb14, opt); \ | ||
| 420 | INPUT_PLANAR_RGBXX_Y_DECL(rgb16, opt); \ | ||
| 421 | INPUT_PLANAR_RGBXX_Y_DECL(rgbf32, opt) | ||
| 422 | |||
| 423 | #define INPUT_PLANAR_RGB_UV_ALL_DECL(opt) \ | ||
| 424 | INPUT_PLANAR_RGB_UV_FN_DECL(rgb, opt); \ | ||
| 425 | INPUT_PLANAR_RGBXX_UV_DECL(rgb9, opt); \ | ||
| 426 | INPUT_PLANAR_RGBXX_UV_DECL(rgb10, opt); \ | ||
| 427 | INPUT_PLANAR_RGBXX_UV_DECL(rgb12, opt); \ | ||
| 428 | INPUT_PLANAR_RGBXX_UV_DECL(rgb14, opt); \ | ||
| 429 | INPUT_PLANAR_RGBXX_UV_DECL(rgb16, opt); \ | ||
| 430 | INPUT_PLANAR_RGBXX_UV_DECL(rgbf32, opt) | ||
| 431 | |||
| 432 | INPUT_PLANAR_RGBXX_Y_DECL(rgbf32, sse2); | ||
| 433 | INPUT_PLANAR_RGB_UV_ALL_DECL(sse2); | ||
| 434 | INPUT_PLANAR_RGB_A_ALL_DECL(sse2); | ||
| 435 | |||
| 436 | INPUT_PLANAR_RGB_Y_ALL_DECL(sse4); | ||
| 437 | INPUT_PLANAR_RGB_UV_ALL_DECL(sse4); | ||
| 438 | INPUT_PLANAR_RGBXX_A_DECL(rgbf32, sse4); | ||
| 439 | |||
| 440 | INPUT_PLANAR_RGB_Y_ALL_DECL(avx2); | ||
| 441 | INPUT_PLANAR_RGB_UV_ALL_DECL(avx2); | ||
| 442 | INPUT_PLANAR_RGB_A_ALL_DECL(avx2); | ||
| 443 | #endif | ||
| 444 | |||
| 445 | #define RANGE_CONVERT_FUNCS(opt, bpc) do { \ | ||
| 446 | if (c->opts.src_range) { \ | ||
| 447 | c->lumConvertRange = ff_lumRangeFromJpeg##bpc##_##opt; \ | ||
| 448 | c->chrConvertRange = ff_chrRangeFromJpeg##bpc##_##opt; \ | ||
| 449 | } else { \ | ||
| 450 | c->lumConvertRange = ff_lumRangeToJpeg##bpc##_##opt; \ | ||
| 451 | c->chrConvertRange = ff_chrRangeToJpeg##bpc##_##opt; \ | ||
| 452 | } \ | ||
| 453 | } while (0) | ||
| 454 | |||
| 455 | #define RANGE_CONVERT_FUNCS_DECL(opt, bpc) \ | ||
| 456 | void ff_lumRangeFromJpeg##bpc##_##opt(int16_t *dst, int width, \ | ||
| 457 | uint32_t coeff, int64_t offset); \ | ||
| 458 | void ff_chrRangeFromJpeg##bpc##_##opt(int16_t *dstU, int16_t *dstV, int width, \ | ||
| 459 | uint32_t coeff, int64_t offset); \ | ||
| 460 | void ff_lumRangeToJpeg##bpc##_##opt(int16_t *dst, int width, \ | ||
| 461 | uint32_t coeff, int64_t offset); \ | ||
| 462 | void ff_chrRangeToJpeg##bpc##_##opt(int16_t *dstU, int16_t *dstV, int width, \ | ||
| 463 | uint32_t coeff, int64_t offset); \ | ||
| 464 | |||
| 465 | RANGE_CONVERT_FUNCS_DECL(sse2, 8) | ||
| 466 | RANGE_CONVERT_FUNCS_DECL(sse4, 16) | ||
| 467 | RANGE_CONVERT_FUNCS_DECL(avx2, 8) | ||
| 468 | RANGE_CONVERT_FUNCS_DECL(avx2, 16) | ||
| 469 | |||
| 470 | 9743 | av_cold void ff_sws_init_range_convert_x86(SwsInternal *c) | |
| 471 | { | ||
| 472 | 9743 | int cpu_flags = av_get_cpu_flags(); | |
| 473 |
3/4✓ Branch 0 taken 4494 times.
✓ Branch 1 taken 5249 times.
✓ Branch 2 taken 4494 times.
✗ Branch 3 not taken.
|
9743 | if (EXTERNAL_AVX2_FAST(cpu_flags)) { |
| 474 |
2/2✓ Branch 0 taken 4416 times.
✓ Branch 1 taken 78 times.
|
4494 | if (c->dstBpc <= 14) { |
| 475 |
2/2✓ Branch 0 taken 4120 times.
✓ Branch 1 taken 296 times.
|
4416 | RANGE_CONVERT_FUNCS(avx2, 8); |
| 476 | } else { | ||
| 477 |
2/2✓ Branch 0 taken 32 times.
✓ Branch 1 taken 46 times.
|
78 | RANGE_CONVERT_FUNCS(avx2, 16); |
| 478 | } | ||
| 479 |
4/4✓ Branch 0 taken 216 times.
✓ Branch 1 taken 5033 times.
✓ Branch 2 taken 180 times.
✓ Branch 3 taken 36 times.
|
5249 | } else if (EXTERNAL_SSE2(cpu_flags) && c->dstBpc <= 14) { |
| 480 |
2/2✓ Branch 0 taken 90 times.
✓ Branch 1 taken 90 times.
|
180 | RANGE_CONVERT_FUNCS(sse2, 8); |
| 481 |
3/4✓ Branch 0 taken 24 times.
✓ Branch 1 taken 5045 times.
✓ Branch 2 taken 24 times.
✗ Branch 3 not taken.
|
5069 | } else if (EXTERNAL_SSE4(cpu_flags) && c->dstBpc > 14) { |
| 482 |
2/2✓ Branch 0 taken 12 times.
✓ Branch 1 taken 12 times.
|
24 | RANGE_CONVERT_FUNCS(sse4, 16); |
| 483 | } | ||
| 484 | 9743 | } | |
| 485 | |||
| 486 | 57173 | av_cold void ff_sws_init_swscale_x86(SwsInternal *c) | |
| 487 | { | ||
| 488 | 57173 | int cpu_flags = av_get_cpu_flags(); | |
| 489 | 57173 | enum AVPixelFormat dst_format = c->opts.dst_format; | |
| 490 | |||
| 491 | 57173 | c->use_mmx_vfilter = 0; | |
| 492 | |||
| 493 |
2/2✓ Branch 0 taken 29283 times.
✓ Branch 1 taken 27890 times.
|
57173 | if (X86_MMXEXT(cpu_flags)) { |
| 494 |
6/6✓ Branch 1 taken 23285 times.
✓ Branch 2 taken 5998 times.
✓ Branch 4 taken 18431 times.
✓ Branch 5 taken 4854 times.
✓ Branch 7 taken 18158 times.
✓ Branch 8 taken 273 times.
|
29283 | if (!is16BPS(dst_format) && !isNBPS(dst_format) && !isSemiPlanarYUV(dst_format) |
| 495 |
4/4✓ Branch 0 taken 18147 times.
✓ Branch 1 taken 11 times.
✓ Branch 2 taken 18136 times.
✓ Branch 3 taken 11 times.
|
18158 | && dst_format != AV_PIX_FMT_GRAYF32BE && dst_format != AV_PIX_FMT_GRAYF32LE |
| 496 |
2/2✓ Branch 0 taken 3173 times.
✓ Branch 1 taken 14963 times.
|
18136 | && !(c->opts.flags & SWS_BITEXACT)) { |
| 497 |
2/2✓ Branch 0 taken 24 times.
✓ Branch 1 taken 3149 times.
|
3173 | if (c->opts.flags & SWS_ACCURATE_RND) { |
| 498 | #if HAVE_MMXEXT_INLINE | ||
| 499 |
1/2✓ Branch 0 taken 24 times.
✗ Branch 1 not taken.
|
24 | if (!(c->opts.flags & SWS_FULL_CHR_H_INT)) { |
| 500 |
1/6✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 24 times.
|
24 | switch (c->opts.dst_format) { |
| 501 | ✗ | case AV_PIX_FMT_RGB32: c->yuv2packedX = yuv2rgb32_X_ar_mmxext; break; | |
| 502 | #if HAVE_6REGS | ||
| 503 | ✗ | case AV_PIX_FMT_BGR24: c->yuv2packedX = yuv2bgr24_X_ar_mmxext; break; | |
| 504 | #endif | ||
| 505 | ✗ | case AV_PIX_FMT_RGB555: c->yuv2packedX = yuv2rgb555_X_ar_mmxext; break; | |
| 506 | ✗ | case AV_PIX_FMT_RGB565: c->yuv2packedX = yuv2rgb565_X_ar_mmxext; break; | |
| 507 | ✗ | case AV_PIX_FMT_YUYV422: c->yuv2packedX = yuv2yuyv422_X_ar_mmxext; break; | |
| 508 | 24 | default: break; | |
| 509 | } | ||
| 510 | } | ||
| 511 | #endif | ||
| 512 | } else { | ||
| 513 | #if HAVE_SSE2_EXTERNAL | ||
| 514 |
2/2✓ Branch 0 taken 2705 times.
✓ Branch 1 taken 444 times.
|
3149 | if (EXTERNAL_SSE2(cpu_flags)) { |
| 515 | 2705 | c->use_mmx_vfilter = 1; | |
| 516 | 2705 | c->yuv2planeX = yuv2yuvX_sse2; | |
| 517 | #if HAVE_SSE3_EXTERNAL | ||
| 518 |
2/2✓ Branch 0 taken 2483 times.
✓ Branch 1 taken 222 times.
|
2705 | if (EXTERNAL_SSE3(cpu_flags)) |
| 519 | 2483 | c->yuv2planeX = yuv2yuvX_sse3; | |
| 520 | #endif | ||
| 521 | #if HAVE_AVX2_EXTERNAL | ||
| 522 |
3/4✓ Branch 0 taken 707 times.
✓ Branch 1 taken 1998 times.
✓ Branch 2 taken 707 times.
✗ Branch 3 not taken.
|
2705 | if (EXTERNAL_AVX2_FAST(cpu_flags)) |
| 523 | 707 | c->yuv2planeX = yuv2yuvX_avx2; | |
| 524 | #endif | ||
| 525 | } | ||
| 526 | #endif /* HAVE_SSE2_EXTERNAL */ | ||
| 527 | #if HAVE_MMXEXT_INLINE | ||
| 528 |
2/2✓ Branch 0 taken 1175 times.
✓ Branch 1 taken 1974 times.
|
3149 | if (!(c->opts.flags & SWS_FULL_CHR_H_INT)) { |
| 529 |
3/7✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 10 times.
✓ Branch 4 taken 10 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 1155 times.
|
1175 | switch (c->opts.dst_format) { |
| 530 | ✗ | case AV_PIX_FMT_RGB32: c->yuv2packedX = yuv2rgb32_X_mmxext; break; | |
| 531 | ✗ | case AV_PIX_FMT_BGR32: c->yuv2packedX = yuv2bgr32_X_mmxext; break; | |
| 532 | #if HAVE_6REGS | ||
| 533 | ✗ | case AV_PIX_FMT_BGR24: c->yuv2packedX = yuv2bgr24_X_mmxext; break; | |
| 534 | #endif | ||
| 535 | 10 | case AV_PIX_FMT_RGB555: c->yuv2packedX = yuv2rgb555_X_mmxext; break; | |
| 536 | 10 | case AV_PIX_FMT_RGB565: c->yuv2packedX = yuv2rgb565_X_mmxext; break; | |
| 537 | ✗ | case AV_PIX_FMT_YUYV422: c->yuv2packedX = yuv2yuyv422_X_mmxext; break; | |
| 538 | 1155 | default: break; | |
| 539 | } | ||
| 540 | } | ||
| 541 | #endif | ||
| 542 | } | ||
| 543 | #if HAVE_MMXEXT_INLINE | ||
| 544 |
2/2✓ Branch 0 taken 1199 times.
✓ Branch 1 taken 1974 times.
|
3173 | if (!(c->opts.flags & SWS_FULL_CHR_H_INT)) { |
| 545 |
3/6✗ Branch 0 not taken.
✗ Branch 1 not taken.
✓ Branch 2 taken 10 times.
✓ Branch 3 taken 10 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 1179 times.
|
1199 | switch (c->opts.dst_format) { |
| 546 | ✗ | case AV_PIX_FMT_RGB32: | |
| 547 | ✗ | c->yuv2packed1 = yuv2rgb32_1_mmxext; | |
| 548 | ✗ | c->yuv2packed2 = yuv2rgb32_2_mmxext; | |
| 549 | ✗ | break; | |
| 550 | ✗ | case AV_PIX_FMT_BGR24: | |
| 551 | ✗ | c->yuv2packed1 = yuv2bgr24_1_mmxext; | |
| 552 | ✗ | c->yuv2packed2 = yuv2bgr24_2_mmxext; | |
| 553 | ✗ | break; | |
| 554 | 10 | case AV_PIX_FMT_RGB555: | |
| 555 | 10 | c->yuv2packed1 = yuv2rgb555_1_mmxext; | |
| 556 | 10 | c->yuv2packed2 = yuv2rgb555_2_mmxext; | |
| 557 | 10 | break; | |
| 558 | 10 | case AV_PIX_FMT_RGB565: | |
| 559 | 10 | c->yuv2packed1 = yuv2rgb565_1_mmxext; | |
| 560 | 10 | c->yuv2packed2 = yuv2rgb565_2_mmxext; | |
| 561 | 10 | break; | |
| 562 | ✗ | case AV_PIX_FMT_YUYV422: | |
| 563 | ✗ | c->yuv2packed1 = yuv2yuyv422_1_mmxext; | |
| 564 | ✗ | c->yuv2packed2 = yuv2yuyv422_2_mmxext; | |
| 565 | ✗ | break; | |
| 566 | 1179 | default: | |
| 567 | 1179 | break; | |
| 568 | } | ||
| 569 | } | ||
| 570 | #endif | ||
| 571 | } | ||
| 572 | #if HAVE_MMXEXT_INLINE | ||
| 573 |
4/4✓ Branch 0 taken 14471 times.
✓ Branch 1 taken 14812 times.
✓ Branch 2 taken 13566 times.
✓ Branch 3 taken 905 times.
|
29283 | if (c->srcBpc == 8 && c->dstBpc <= 14) { |
| 574 | // Use the new MMX scaler if the MMXEXT one can't be used (it is faster than the x86 ASM one). | ||
| 575 |
1/4✗ Branch 0 not taken.
✓ Branch 1 taken 13566 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
|
13566 | if (c->opts.flags & SWS_FAST_BILINEAR && c->canMMXEXTBeUsed) { |
| 576 | ✗ | c->hyscale_fast = ff_hyscale_fast_mmxext; | |
| 577 | ✗ | c->hcscale_fast = ff_hcscale_fast_mmxext; | |
| 578 | } else { | ||
| 579 | 13566 | c->hyscale_fast = NULL; | |
| 580 | 13566 | c->hcscale_fast = NULL; | |
| 581 | } | ||
| 582 | } | ||
| 583 | #endif | ||
| 584 | } | ||
| 585 | |||
| 586 | #define ASSIGN_SCALE_FUNC2(hscalefn, filtersize, opt1, opt2) do { \ | ||
| 587 | if (c->srcBpc == 8) { \ | ||
| 588 | hscalefn = c->dstBpc <= 14 ? ff_hscale8to15_ ## filtersize ## _ ## opt2 : \ | ||
| 589 | ff_hscale8to19_ ## filtersize ## _ ## opt1; \ | ||
| 590 | } else if (c->srcBpc == 9) { \ | ||
| 591 | hscalefn = c->dstBpc <= 14 ? ff_hscale9to15_ ## filtersize ## _ ## opt2 : \ | ||
| 592 | ff_hscale9to19_ ## filtersize ## _ ## opt1; \ | ||
| 593 | } else if (c->srcBpc == 10) { \ | ||
| 594 | hscalefn = c->dstBpc <= 14 ? ff_hscale10to15_ ## filtersize ## _ ## opt2 : \ | ||
| 595 | ff_hscale10to19_ ## filtersize ## _ ## opt1; \ | ||
| 596 | } else if (c->srcBpc == 12) { \ | ||
| 597 | hscalefn = c->dstBpc <= 14 ? ff_hscale12to15_ ## filtersize ## _ ## opt2 : \ | ||
| 598 | ff_hscale12to19_ ## filtersize ## _ ## opt1; \ | ||
| 599 | } else if (c->srcBpc == 14 || ((c->opts.src_format==AV_PIX_FMT_PAL8||isAnyRGB(c->opts.src_format)) && av_pix_fmt_desc_get(c->opts.src_format)->comp[0].depth<16)) { \ | ||
| 600 | hscalefn = c->dstBpc <= 14 ? ff_hscale14to15_ ## filtersize ## _ ## opt2 : \ | ||
| 601 | ff_hscale14to19_ ## filtersize ## _ ## opt1; \ | ||
| 602 | } else { /* c->srcBpc == 16 */ \ | ||
| 603 | av_assert0(c->srcBpc == 16);\ | ||
| 604 | hscalefn = c->dstBpc <= 14 ? ff_hscale16to15_ ## filtersize ## _ ## opt2 : \ | ||
| 605 | ff_hscale16to19_ ## filtersize ## _ ## opt1; \ | ||
| 606 | } \ | ||
| 607 | } while (0) | ||
| 608 | #define ASSIGN_VSCALEX_FUNC(vscalefn, opt, do_16_case) \ | ||
| 609 | switch(c->dstBpc){ \ | ||
| 610 | case 16: do_16_case; break; \ | ||
| 611 | case 10: if (!isBE(c->opts.dst_format) && !isSemiPlanarYUV(c->opts.dst_format) && !isDataInHighBits(c->opts.dst_format)) vscalefn = ff_yuv2planeX_10_ ## opt; break; \ | ||
| 612 | case 9: if (!isBE(c->opts.dst_format)) vscalefn = ff_yuv2planeX_9_ ## opt; break; \ | ||
| 613 | case 8: if (!c->use_mmx_vfilter) vscalefn = ff_yuv2planeX_8_ ## opt; break; \ | ||
| 614 | } | ||
| 615 | #define ASSIGN_VSCALE_FUNC(vscalefn, opt) \ | ||
| 616 | switch(c->dstBpc){ \ | ||
| 617 | case 16: if (!isBE(c->opts.dst_format)) vscalefn = ff_yuv2plane1_16_ ## opt; break; \ | ||
| 618 | case 10: if (!isBE(c->opts.dst_format) && !isSemiPlanarYUV(c->opts.dst_format) && !isDataInHighBits(c->opts.dst_format)) vscalefn = ff_yuv2plane1_10_ ## opt; break; \ | ||
| 619 | case 9: if (!isBE(c->opts.dst_format)) vscalefn = ff_yuv2plane1_9_ ## opt; break; \ | ||
| 620 | case 8: vscalefn = ff_yuv2plane1_8_ ## opt; break; \ | ||
| 621 | default: av_assert0(c->dstBpc>8); \ | ||
| 622 | } | ||
| 623 | #define case_rgb(x, X, opt) \ | ||
| 624 | case AV_PIX_FMT_ ## X: \ | ||
| 625 | c->lumToYV12 = ff_ ## x ## ToY_ ## opt; \ | ||
| 626 | if (!c->chrSrcHSubSample) \ | ||
| 627 | c->chrToYV12 = ff_ ## x ## ToUV_ ## opt; \ | ||
| 628 | break | ||
| 629 | #define ASSIGN_SSE_SCALE_FUNC(hscalefn, filtersize, opt1, opt2) \ | ||
| 630 | switch (filtersize) { \ | ||
| 631 | case 4: ASSIGN_SCALE_FUNC2(hscalefn, 4, opt1, opt2); break; \ | ||
| 632 | case 8: ASSIGN_SCALE_FUNC2(hscalefn, 8, opt1, opt2); break; \ | ||
| 633 | default: if (filtersize & 4) ASSIGN_SCALE_FUNC2(hscalefn, X4, opt1, opt2); \ | ||
| 634 | else ASSIGN_SCALE_FUNC2(hscalefn, X8, opt1, opt2); \ | ||
| 635 | break; \ | ||
| 636 | } | ||
| 637 |
2/2✓ Branch 0 taken 27117 times.
✓ Branch 1 taken 30056 times.
|
57173 | if (EXTERNAL_SSE2(cpu_flags)) { |
| 638 |
56/125✓ Branch 0 taken 17595 times.
✓ Branch 1 taken 121 times.
✓ Branch 2 taken 9401 times.
✓ Branch 3 taken 2831 times.
✓ Branch 4 taken 14764 times.
✓ Branch 5 taken 2394 times.
✓ Branch 6 taken 437 times.
✓ Branch 7 taken 321 times.
✓ Branch 8 taken 14443 times.
✓ Branch 9 taken 296 times.
✓ Branch 10 taken 25 times.
✓ Branch 11 taken 1128 times.
✓ Branch 12 taken 13315 times.
✓ Branch 13 taken 1022 times.
✓ Branch 14 taken 106 times.
✓ Branch 15 taken 1128 times.
✓ Branch 16 taken 12187 times.
✓ Branch 17 taken 1022 times.
✓ Branch 18 taken 106 times.
✓ Branch 19 taken 11886 times.
✓ Branch 20 taken 301 times.
✓ Branch 21 taken 11886 times.
✗ Branch 22 not taken.
✓ Branch 24 taken 9939 times.
✓ Branch 25 taken 1947 times.
✓ Branch 27 taken 7219 times.
✓ Branch 28 taken 2720 times.
✓ Branch 29 taken 7315 times.
✓ Branch 30 taken 205 times.
✗ Branch 31 not taken.
✓ Branch 32 taken 4667 times.
✓ Branch 35 taken 4453 times.
✓ Branch 36 taken 214 times.
✓ Branch 37 taken 120 times.
✓ Branch 38 taken 1 times.
✓ Branch 39 taken 60 times.
✓ Branch 40 taken 60 times.
✗ Branch 41 not taken.
✓ Branch 42 taken 1 times.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✓ Branch 46 taken 1 times.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✓ Branch 49 taken 1 times.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
✓ Branch 52 taken 1 times.
✗ Branch 53 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 56 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✗ Branch 64 not taken.
✗ Branch 65 not taken.
✗ Branch 66 not taken.
✗ Branch 69 not taken.
✗ Branch 70 not taken.
✓ Branch 71 taken 120 times.
✓ Branch 72 taken 9281 times.
✓ Branch 73 taken 120 times.
✗ Branch 74 not taken.
✓ Branch 75 taken 60 times.
✓ Branch 76 taken 60 times.
✗ Branch 77 not taken.
✗ Branch 78 not taken.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✗ Branch 81 not taken.
✗ Branch 82 not taken.
✗ Branch 83 not taken.
✗ Branch 84 not taken.
✗ Branch 85 not taken.
✗ Branch 86 not taken.
✗ Branch 87 not taken.
✗ Branch 88 not taken.
✗ Branch 89 not taken.
✗ Branch 90 not taken.
✗ Branch 91 not taken.
✗ Branch 92 not taken.
✗ Branch 94 not taken.
✗ Branch 95 not taken.
✗ Branch 97 not taken.
✗ Branch 98 not taken.
✗ Branch 99 not taken.
✗ Branch 100 not taken.
✗ Branch 101 not taken.
✗ Branch 102 not taken.
✗ Branch 105 not taken.
✗ Branch 106 not taken.
✓ Branch 107 taken 9280 times.
✓ Branch 108 taken 1 times.
✓ Branch 109 taken 9060 times.
✓ Branch 110 taken 220 times.
✗ Branch 111 not taken.
✓ Branch 112 taken 1 times.
✗ Branch 113 not taken.
✗ Branch 114 not taken.
✗ Branch 115 not taken.
✓ Branch 116 taken 1 times.
✗ Branch 117 not taken.
✗ Branch 118 not taken.
✗ Branch 119 not taken.
✓ Branch 120 taken 1 times.
✗ Branch 121 not taken.
✗ Branch 122 not taken.
✓ Branch 123 taken 1 times.
✗ Branch 124 not taken.
✓ Branch 125 taken 1 times.
✗ Branch 126 not taken.
✓ Branch 128 taken 1 times.
✗ Branch 129 not taken.
✓ Branch 131 taken 1 times.
✗ Branch 132 not taken.
✓ Branch 133 taken 1 times.
✗ Branch 134 not taken.
✗ Branch 135 not taken.
✗ Branch 136 not taken.
✗ Branch 139 not taken.
✗ Branch 140 not taken.
|
27237 | ASSIGN_SSE_SCALE_FUNC(c->hyScale, c->hLumFilterSize, sse2, sse2); |
| 639 |
65/125✓ Branch 0 taken 17483 times.
✓ Branch 1 taken 233 times.
✓ Branch 2 taken 9401 times.
✓ Branch 3 taken 2803 times.
✓ Branch 4 taken 14680 times.
✓ Branch 5 taken 2366 times.
✓ Branch 6 taken 437 times.
✓ Branch 7 taken 321 times.
✓ Branch 8 taken 14359 times.
✓ Branch 9 taken 296 times.
✓ Branch 10 taken 25 times.
✓ Branch 11 taken 1100 times.
✓ Branch 12 taken 13259 times.
✓ Branch 13 taken 994 times.
✓ Branch 14 taken 106 times.
✓ Branch 15 taken 1100 times.
✓ Branch 16 taken 12159 times.
✓ Branch 17 taken 994 times.
✓ Branch 18 taken 106 times.
✓ Branch 19 taken 11858 times.
✓ Branch 20 taken 301 times.
✓ Branch 21 taken 11858 times.
✗ Branch 22 not taken.
✓ Branch 24 taken 9939 times.
✓ Branch 25 taken 1919 times.
✓ Branch 27 taken 7219 times.
✓ Branch 28 taken 2720 times.
✓ Branch 29 taken 7315 times.
✓ Branch 30 taken 205 times.
✗ Branch 31 not taken.
✓ Branch 32 taken 4639 times.
✓ Branch 35 taken 4425 times.
✓ Branch 36 taken 214 times.
✓ Branch 37 taken 148 times.
✓ Branch 38 taken 85 times.
✓ Branch 39 taken 88 times.
✓ Branch 40 taken 60 times.
✗ Branch 41 not taken.
✓ Branch 42 taken 85 times.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✓ Branch 45 taken 28 times.
✓ Branch 46 taken 57 times.
✓ Branch 47 taken 28 times.
✗ Branch 48 not taken.
✓ Branch 49 taken 29 times.
✓ Branch 50 taken 28 times.
✓ Branch 51 taken 28 times.
✓ Branch 52 taken 1 times.
✓ Branch 53 taken 28 times.
✗ Branch 54 not taken.
✓ Branch 55 taken 28 times.
✗ Branch 56 not taken.
✗ Branch 58 not taken.
✓ Branch 59 taken 28 times.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✗ Branch 64 not taken.
✗ Branch 65 not taken.
✓ Branch 66 taken 28 times.
✓ Branch 69 taken 28 times.
✗ Branch 70 not taken.
✓ Branch 71 taken 120 times.
✓ Branch 72 taken 9281 times.
✓ Branch 73 taken 120 times.
✗ Branch 74 not taken.
✓ Branch 75 taken 60 times.
✓ Branch 76 taken 60 times.
✗ Branch 77 not taken.
✗ Branch 78 not taken.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✗ Branch 81 not taken.
✗ Branch 82 not taken.
✗ Branch 83 not taken.
✗ Branch 84 not taken.
✗ Branch 85 not taken.
✗ Branch 86 not taken.
✗ Branch 87 not taken.
✗ Branch 88 not taken.
✗ Branch 89 not taken.
✗ Branch 90 not taken.
✗ Branch 91 not taken.
✗ Branch 92 not taken.
✗ Branch 94 not taken.
✗ Branch 95 not taken.
✗ Branch 97 not taken.
✗ Branch 98 not taken.
✗ Branch 99 not taken.
✗ Branch 100 not taken.
✗ Branch 101 not taken.
✗ Branch 102 not taken.
✗ Branch 105 not taken.
✗ Branch 106 not taken.
✓ Branch 107 taken 9280 times.
✓ Branch 108 taken 1 times.
✓ Branch 109 taken 9060 times.
✓ Branch 110 taken 220 times.
✗ Branch 111 not taken.
✓ Branch 112 taken 1 times.
✗ Branch 113 not taken.
✗ Branch 114 not taken.
✗ Branch 115 not taken.
✓ Branch 116 taken 1 times.
✗ Branch 117 not taken.
✗ Branch 118 not taken.
✗ Branch 119 not taken.
✓ Branch 120 taken 1 times.
✗ Branch 121 not taken.
✗ Branch 122 not taken.
✓ Branch 123 taken 1 times.
✗ Branch 124 not taken.
✓ Branch 125 taken 1 times.
✗ Branch 126 not taken.
✓ Branch 128 taken 1 times.
✗ Branch 129 not taken.
✓ Branch 131 taken 1 times.
✗ Branch 132 not taken.
✓ Branch 133 taken 1 times.
✗ Branch 134 not taken.
✗ Branch 135 not taken.
✗ Branch 136 not taken.
✗ Branch 139 not taken.
✗ Branch 140 not taken.
|
27237 | ASSIGN_SSE_SCALE_FUNC(c->hcScale, c->hChrFilterSize, sse2, sse2); |
| 640 |
15/15✓ Branch 0 taken 974 times.
✓ Branch 1 taken 517 times.
✓ Branch 2 taken 162 times.
✓ Branch 3 taken 23989 times.
✓ Branch 4 taken 1475 times.
✓ Branch 6 taken 303 times.
✓ Branch 7 taken 214 times.
✓ Branch 9 taken 179 times.
✓ Branch 10 taken 124 times.
✓ Branch 12 taken 156 times.
✓ Branch 13 taken 23 times.
✓ Branch 15 taken 102 times.
✓ Branch 16 taken 60 times.
✓ Branch 17 taken 22078 times.
✓ Branch 18 taken 1911 times.
|
27117 | ASSIGN_VSCALEX_FUNC(c->yuv2planeX, sse2, ); |
| 641 |
2/2✓ Branch 0 taken 11932 times.
✓ Branch 1 taken 15185 times.
|
27117 | if (!(c->opts.flags & SWS_ACCURATE_RND)) |
| 642 |
16/17✓ Branch 0 taken 710 times.
✓ Branch 1 taken 483 times.
✓ Branch 2 taken 138 times.
✓ Branch 3 taken 9190 times.
✓ Branch 4 taken 1411 times.
✓ Branch 6 taken 379 times.
✓ Branch 7 taken 331 times.
✓ Branch 9 taken 284 times.
✓ Branch 10 taken 199 times.
✓ Branch 12 taken 161 times.
✓ Branch 13 taken 123 times.
✓ Branch 15 taken 139 times.
✓ Branch 16 taken 22 times.
✓ Branch 18 taken 90 times.
✓ Branch 19 taken 48 times.
✗ Branch 20 not taken.
✓ Branch 21 taken 1411 times.
|
11932 | ASSIGN_VSCALE_FUNC(c->yuv2plane1, sse2); |
| 643 | |||
| 644 |
8/12✓ Branch 0 taken 140 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 181 times.
✓ Branch 6 taken 171 times.
✓ Branch 7 taken 323 times.
✓ Branch 8 taken 323 times.
✓ Branch 9 taken 322 times.
✓ Branch 10 taken 322 times.
✓ Branch 11 taken 25335 times.
|
27117 | switch (c->opts.src_format) { |
| 645 | 140 | case AV_PIX_FMT_YA8: | |
| 646 | 140 | c->lumToYV12 = ff_yuyvToY_sse2; | |
| 647 |
2/2✓ Branch 0 taken 130 times.
✓ Branch 1 taken 10 times.
|
140 | if (c->needAlpha) |
| 648 | 130 | c->alpToYV12 = ff_uyvyToY_sse2; | |
| 649 | 140 | break; | |
| 650 | ✗ | case AV_PIX_FMT_YUYV422: | |
| 651 | ✗ | c->lumToYV12 = ff_yuyvToY_sse2; | |
| 652 | ✗ | c->chrToYV12 = ff_yuyvToUV_sse2; | |
| 653 | ✗ | break; | |
| 654 | ✗ | case AV_PIX_FMT_UYVY422: | |
| 655 | ✗ | c->lumToYV12 = ff_uyvyToY_sse2; | |
| 656 | ✗ | c->chrToYV12 = ff_uyvyToUV_sse2; | |
| 657 | ✗ | break; | |
| 658 | ✗ | case AV_PIX_FMT_NV12: | |
| 659 | ✗ | c->chrToYV12 = ff_nv12ToUV_sse2; | |
| 660 | ✗ | break; | |
| 661 | ✗ | case AV_PIX_FMT_NV21: | |
| 662 | ✗ | c->chrToYV12 = ff_nv21ToUV_sse2; | |
| 663 | ✗ | break; | |
| 664 |
2/2✓ Branch 0 taken 151 times.
✓ Branch 1 taken 30 times.
|
181 | case_rgb(rgb24, RGB24, sse2); |
| 665 |
2/2✓ Branch 0 taken 151 times.
✓ Branch 1 taken 20 times.
|
171 | case_rgb(bgr24, BGR24, sse2); |
| 666 |
2/2✓ Branch 0 taken 303 times.
✓ Branch 1 taken 20 times.
|
323 | case_rgb(bgra, BGRA, sse2); |
| 667 |
2/2✓ Branch 0 taken 303 times.
✓ Branch 1 taken 20 times.
|
323 | case_rgb(rgba, RGBA, sse2); |
| 668 |
2/2✓ Branch 0 taken 302 times.
✓ Branch 1 taken 20 times.
|
322 | case_rgb(abgr, ABGR, sse2); |
| 669 |
2/2✓ Branch 0 taken 302 times.
✓ Branch 1 taken 20 times.
|
322 | case_rgb(argb, ARGB, sse2); |
| 670 | 25335 | default: | |
| 671 | 25335 | break; | |
| 672 | } | ||
| 673 | } | ||
| 674 |
2/2✓ Branch 0 taken 24951 times.
✓ Branch 1 taken 32222 times.
|
57173 | if (EXTERNAL_SSSE3(cpu_flags)) { |
| 675 |
56/125✓ Branch 0 taken 17333 times.
✓ Branch 1 taken 97 times.
✓ Branch 2 taken 7521 times.
✓ Branch 3 taken 2615 times.
✓ Branch 4 taken 14718 times.
✓ Branch 5 taken 2238 times.
✓ Branch 6 taken 377 times.
✓ Branch 7 taken 321 times.
✓ Branch 8 taken 14397 times.
✓ Branch 9 taken 296 times.
✓ Branch 10 taken 25 times.
✓ Branch 11 taken 1128 times.
✓ Branch 12 taken 13269 times.
✓ Branch 13 taken 1022 times.
✓ Branch 14 taken 106 times.
✓ Branch 15 taken 1128 times.
✓ Branch 16 taken 12141 times.
✓ Branch 17 taken 1022 times.
✓ Branch 18 taken 106 times.
✓ Branch 19 taken 11840 times.
✓ Branch 20 taken 301 times.
✓ Branch 21 taken 11840 times.
✗ Branch 22 not taken.
✓ Branch 24 taken 9893 times.
✓ Branch 25 taken 1947 times.
✓ Branch 27 taken 7173 times.
✓ Branch 28 taken 2720 times.
✓ Branch 29 taken 7269 times.
✓ Branch 30 taken 205 times.
✗ Branch 31 not taken.
✓ Branch 32 taken 4667 times.
✓ Branch 35 taken 4453 times.
✓ Branch 36 taken 214 times.
✓ Branch 37 taken 96 times.
✓ Branch 38 taken 1 times.
✓ Branch 39 taken 48 times.
✓ Branch 40 taken 48 times.
✗ Branch 41 not taken.
✓ Branch 42 taken 1 times.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✓ Branch 46 taken 1 times.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✓ Branch 49 taken 1 times.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
✓ Branch 52 taken 1 times.
✗ Branch 53 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 56 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✗ Branch 64 not taken.
✗ Branch 65 not taken.
✗ Branch 66 not taken.
✗ Branch 69 not taken.
✗ Branch 70 not taken.
✓ Branch 71 taken 96 times.
✓ Branch 72 taken 7425 times.
✓ Branch 73 taken 96 times.
✗ Branch 74 not taken.
✓ Branch 75 taken 48 times.
✓ Branch 76 taken 48 times.
✗ Branch 77 not taken.
✗ Branch 78 not taken.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✗ Branch 81 not taken.
✗ Branch 82 not taken.
✗ Branch 83 not taken.
✗ Branch 84 not taken.
✗ Branch 85 not taken.
✗ Branch 86 not taken.
✗ Branch 87 not taken.
✗ Branch 88 not taken.
✗ Branch 89 not taken.
✗ Branch 90 not taken.
✗ Branch 91 not taken.
✗ Branch 92 not taken.
✗ Branch 94 not taken.
✗ Branch 95 not taken.
✗ Branch 97 not taken.
✗ Branch 98 not taken.
✗ Branch 99 not taken.
✗ Branch 100 not taken.
✗ Branch 101 not taken.
✗ Branch 102 not taken.
✗ Branch 105 not taken.
✗ Branch 106 not taken.
✓ Branch 107 taken 7424 times.
✓ Branch 108 taken 1 times.
✓ Branch 109 taken 7248 times.
✓ Branch 110 taken 176 times.
✗ Branch 111 not taken.
✓ Branch 112 taken 1 times.
✗ Branch 113 not taken.
✗ Branch 114 not taken.
✗ Branch 115 not taken.
✓ Branch 116 taken 1 times.
✗ Branch 117 not taken.
✗ Branch 118 not taken.
✗ Branch 119 not taken.
✓ Branch 120 taken 1 times.
✗ Branch 121 not taken.
✗ Branch 122 not taken.
✓ Branch 123 taken 1 times.
✗ Branch 124 not taken.
✓ Branch 125 taken 1 times.
✗ Branch 126 not taken.
✓ Branch 128 taken 1 times.
✗ Branch 129 not taken.
✓ Branch 131 taken 1 times.
✗ Branch 132 not taken.
✓ Branch 133 taken 1 times.
✗ Branch 134 not taken.
✗ Branch 135 not taken.
✗ Branch 136 not taken.
✗ Branch 139 not taken.
✗ Branch 140 not taken.
|
25047 | ASSIGN_SSE_SCALE_FUNC(c->hyScale, c->hLumFilterSize, ssse3, ssse3); |
| 676 |
65/125✓ Branch 0 taken 17221 times.
✓ Branch 1 taken 209 times.
✓ Branch 2 taken 7521 times.
✓ Branch 3 taken 2587 times.
✓ Branch 4 taken 14634 times.
✓ Branch 5 taken 2210 times.
✓ Branch 6 taken 377 times.
✓ Branch 7 taken 321 times.
✓ Branch 8 taken 14313 times.
✓ Branch 9 taken 296 times.
✓ Branch 10 taken 25 times.
✓ Branch 11 taken 1100 times.
✓ Branch 12 taken 13213 times.
✓ Branch 13 taken 994 times.
✓ Branch 14 taken 106 times.
✓ Branch 15 taken 1100 times.
✓ Branch 16 taken 12113 times.
✓ Branch 17 taken 994 times.
✓ Branch 18 taken 106 times.
✓ Branch 19 taken 11812 times.
✓ Branch 20 taken 301 times.
✓ Branch 21 taken 11812 times.
✗ Branch 22 not taken.
✓ Branch 24 taken 9893 times.
✓ Branch 25 taken 1919 times.
✓ Branch 27 taken 7173 times.
✓ Branch 28 taken 2720 times.
✓ Branch 29 taken 7269 times.
✓ Branch 30 taken 205 times.
✗ Branch 31 not taken.
✓ Branch 32 taken 4639 times.
✓ Branch 35 taken 4425 times.
✓ Branch 36 taken 214 times.
✓ Branch 37 taken 124 times.
✓ Branch 38 taken 85 times.
✓ Branch 39 taken 76 times.
✓ Branch 40 taken 48 times.
✗ Branch 41 not taken.
✓ Branch 42 taken 85 times.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✓ Branch 45 taken 28 times.
✓ Branch 46 taken 57 times.
✓ Branch 47 taken 28 times.
✗ Branch 48 not taken.
✓ Branch 49 taken 29 times.
✓ Branch 50 taken 28 times.
✓ Branch 51 taken 28 times.
✓ Branch 52 taken 1 times.
✓ Branch 53 taken 28 times.
✗ Branch 54 not taken.
✓ Branch 55 taken 28 times.
✗ Branch 56 not taken.
✗ Branch 58 not taken.
✓ Branch 59 taken 28 times.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✗ Branch 64 not taken.
✗ Branch 65 not taken.
✓ Branch 66 taken 28 times.
✓ Branch 69 taken 28 times.
✗ Branch 70 not taken.
✓ Branch 71 taken 96 times.
✓ Branch 72 taken 7425 times.
✓ Branch 73 taken 96 times.
✗ Branch 74 not taken.
✓ Branch 75 taken 48 times.
✓ Branch 76 taken 48 times.
✗ Branch 77 not taken.
✗ Branch 78 not taken.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✗ Branch 81 not taken.
✗ Branch 82 not taken.
✗ Branch 83 not taken.
✗ Branch 84 not taken.
✗ Branch 85 not taken.
✗ Branch 86 not taken.
✗ Branch 87 not taken.
✗ Branch 88 not taken.
✗ Branch 89 not taken.
✗ Branch 90 not taken.
✗ Branch 91 not taken.
✗ Branch 92 not taken.
✗ Branch 94 not taken.
✗ Branch 95 not taken.
✗ Branch 97 not taken.
✗ Branch 98 not taken.
✗ Branch 99 not taken.
✗ Branch 100 not taken.
✗ Branch 101 not taken.
✗ Branch 102 not taken.
✗ Branch 105 not taken.
✗ Branch 106 not taken.
✓ Branch 107 taken 7424 times.
✓ Branch 108 taken 1 times.
✓ Branch 109 taken 7248 times.
✓ Branch 110 taken 176 times.
✗ Branch 111 not taken.
✓ Branch 112 taken 1 times.
✗ Branch 113 not taken.
✗ Branch 114 not taken.
✗ Branch 115 not taken.
✓ Branch 116 taken 1 times.
✗ Branch 117 not taken.
✗ Branch 118 not taken.
✗ Branch 119 not taken.
✓ Branch 120 taken 1 times.
✗ Branch 121 not taken.
✗ Branch 122 not taken.
✓ Branch 123 taken 1 times.
✗ Branch 124 not taken.
✓ Branch 125 taken 1 times.
✗ Branch 126 not taken.
✓ Branch 128 taken 1 times.
✗ Branch 129 not taken.
✓ Branch 131 taken 1 times.
✗ Branch 132 not taken.
✓ Branch 133 taken 1 times.
✗ Branch 134 not taken.
✗ Branch 135 not taken.
✗ Branch 136 not taken.
✗ Branch 139 not taken.
✗ Branch 140 not taken.
|
25047 | ASSIGN_SSE_SCALE_FUNC(c->hcScale, c->hChrFilterSize, ssse3, ssse3); |
| 677 |
3/3✓ Branch 0 taken 173 times.
✓ Branch 1 taken 165 times.
✓ Branch 2 taken 24613 times.
|
24951 | switch (c->opts.src_format) { |
| 678 |
2/2✓ Branch 0 taken 149 times.
✓ Branch 1 taken 24 times.
|
173 | case_rgb(rgb24, RGB24, ssse3); |
| 679 |
2/2✓ Branch 0 taken 149 times.
✓ Branch 1 taken 16 times.
|
165 | case_rgb(bgr24, BGR24, ssse3); |
| 680 | 24613 | default: | |
| 681 | 24613 | break; | |
| 682 | } | ||
| 683 | } | ||
| 684 |
2/2✓ Branch 0 taken 23868 times.
✓ Branch 1 taken 33305 times.
|
57173 | if (EXTERNAL_SSE4(cpu_flags)) { |
| 685 | /* Xto15 don't need special sse4 functions */ | ||
| 686 |
56/125✓ Branch 0 taken 17202 times.
✓ Branch 1 taken 85 times.
✓ Branch 2 taken 6581 times.
✓ Branch 3 taken 2507 times.
✓ Branch 4 taken 14695 times.
✓ Branch 5 taken 2160 times.
✓ Branch 6 taken 347 times.
✓ Branch 7 taken 321 times.
✓ Branch 8 taken 14374 times.
✓ Branch 9 taken 296 times.
✓ Branch 10 taken 25 times.
✓ Branch 11 taken 1128 times.
✓ Branch 12 taken 13246 times.
✓ Branch 13 taken 1022 times.
✓ Branch 14 taken 106 times.
✓ Branch 15 taken 1128 times.
✓ Branch 16 taken 12118 times.
✓ Branch 17 taken 1022 times.
✓ Branch 18 taken 106 times.
✓ Branch 19 taken 11817 times.
✓ Branch 20 taken 301 times.
✓ Branch 21 taken 11817 times.
✗ Branch 22 not taken.
✓ Branch 24 taken 9870 times.
✓ Branch 25 taken 1947 times.
✓ Branch 27 taken 7150 times.
✓ Branch 28 taken 2720 times.
✓ Branch 29 taken 7246 times.
✓ Branch 30 taken 205 times.
✗ Branch 31 not taken.
✓ Branch 32 taken 4667 times.
✓ Branch 35 taken 4453 times.
✓ Branch 36 taken 214 times.
✓ Branch 37 taken 84 times.
✓ Branch 38 taken 1 times.
✓ Branch 39 taken 42 times.
✓ Branch 40 taken 42 times.
✗ Branch 41 not taken.
✓ Branch 42 taken 1 times.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✓ Branch 46 taken 1 times.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✓ Branch 49 taken 1 times.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
✓ Branch 52 taken 1 times.
✗ Branch 53 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 56 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✗ Branch 64 not taken.
✗ Branch 65 not taken.
✗ Branch 66 not taken.
✗ Branch 69 not taken.
✗ Branch 70 not taken.
✓ Branch 71 taken 84 times.
✓ Branch 72 taken 6497 times.
✓ Branch 73 taken 84 times.
✗ Branch 74 not taken.
✓ Branch 75 taken 42 times.
✓ Branch 76 taken 42 times.
✗ Branch 77 not taken.
✗ Branch 78 not taken.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✗ Branch 81 not taken.
✗ Branch 82 not taken.
✗ Branch 83 not taken.
✗ Branch 84 not taken.
✗ Branch 85 not taken.
✗ Branch 86 not taken.
✗ Branch 87 not taken.
✗ Branch 88 not taken.
✗ Branch 89 not taken.
✗ Branch 90 not taken.
✗ Branch 91 not taken.
✗ Branch 92 not taken.
✗ Branch 94 not taken.
✗ Branch 95 not taken.
✗ Branch 97 not taken.
✗ Branch 98 not taken.
✗ Branch 99 not taken.
✗ Branch 100 not taken.
✗ Branch 101 not taken.
✗ Branch 102 not taken.
✗ Branch 105 not taken.
✗ Branch 106 not taken.
✓ Branch 107 taken 6496 times.
✓ Branch 108 taken 1 times.
✓ Branch 109 taken 6342 times.
✓ Branch 110 taken 154 times.
✗ Branch 111 not taken.
✓ Branch 112 taken 1 times.
✗ Branch 113 not taken.
✗ Branch 114 not taken.
✗ Branch 115 not taken.
✓ Branch 116 taken 1 times.
✗ Branch 117 not taken.
✗ Branch 118 not taken.
✗ Branch 119 not taken.
✓ Branch 120 taken 1 times.
✗ Branch 121 not taken.
✗ Branch 122 not taken.
✓ Branch 123 taken 1 times.
✗ Branch 124 not taken.
✓ Branch 125 taken 1 times.
✗ Branch 126 not taken.
✓ Branch 128 taken 1 times.
✗ Branch 129 not taken.
✓ Branch 131 taken 1 times.
✗ Branch 132 not taken.
✓ Branch 133 taken 1 times.
✗ Branch 134 not taken.
✗ Branch 135 not taken.
✗ Branch 136 not taken.
✗ Branch 139 not taken.
✗ Branch 140 not taken.
|
23952 | ASSIGN_SSE_SCALE_FUNC(c->hyScale, c->hLumFilterSize, sse4, ssse3); |
| 687 |
65/125✓ Branch 0 taken 17090 times.
✓ Branch 1 taken 197 times.
✓ Branch 2 taken 6581 times.
✓ Branch 3 taken 2479 times.
✓ Branch 4 taken 14611 times.
✓ Branch 5 taken 2132 times.
✓ Branch 6 taken 347 times.
✓ Branch 7 taken 321 times.
✓ Branch 8 taken 14290 times.
✓ Branch 9 taken 296 times.
✓ Branch 10 taken 25 times.
✓ Branch 11 taken 1100 times.
✓ Branch 12 taken 13190 times.
✓ Branch 13 taken 994 times.
✓ Branch 14 taken 106 times.
✓ Branch 15 taken 1100 times.
✓ Branch 16 taken 12090 times.
✓ Branch 17 taken 994 times.
✓ Branch 18 taken 106 times.
✓ Branch 19 taken 11789 times.
✓ Branch 20 taken 301 times.
✓ Branch 21 taken 11789 times.
✗ Branch 22 not taken.
✓ Branch 24 taken 9870 times.
✓ Branch 25 taken 1919 times.
✓ Branch 27 taken 7150 times.
✓ Branch 28 taken 2720 times.
✓ Branch 29 taken 7246 times.
✓ Branch 30 taken 205 times.
✗ Branch 31 not taken.
✓ Branch 32 taken 4639 times.
✓ Branch 35 taken 4425 times.
✓ Branch 36 taken 214 times.
✓ Branch 37 taken 112 times.
✓ Branch 38 taken 85 times.
✓ Branch 39 taken 70 times.
✓ Branch 40 taken 42 times.
✗ Branch 41 not taken.
✓ Branch 42 taken 85 times.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✓ Branch 45 taken 28 times.
✓ Branch 46 taken 57 times.
✓ Branch 47 taken 28 times.
✗ Branch 48 not taken.
✓ Branch 49 taken 29 times.
✓ Branch 50 taken 28 times.
✓ Branch 51 taken 28 times.
✓ Branch 52 taken 1 times.
✓ Branch 53 taken 28 times.
✗ Branch 54 not taken.
✓ Branch 55 taken 28 times.
✗ Branch 56 not taken.
✗ Branch 58 not taken.
✓ Branch 59 taken 28 times.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✗ Branch 64 not taken.
✗ Branch 65 not taken.
✓ Branch 66 taken 28 times.
✓ Branch 69 taken 28 times.
✗ Branch 70 not taken.
✓ Branch 71 taken 84 times.
✓ Branch 72 taken 6497 times.
✓ Branch 73 taken 84 times.
✗ Branch 74 not taken.
✓ Branch 75 taken 42 times.
✓ Branch 76 taken 42 times.
✗ Branch 77 not taken.
✗ Branch 78 not taken.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✗ Branch 81 not taken.
✗ Branch 82 not taken.
✗ Branch 83 not taken.
✗ Branch 84 not taken.
✗ Branch 85 not taken.
✗ Branch 86 not taken.
✗ Branch 87 not taken.
✗ Branch 88 not taken.
✗ Branch 89 not taken.
✗ Branch 90 not taken.
✗ Branch 91 not taken.
✗ Branch 92 not taken.
✗ Branch 94 not taken.
✗ Branch 95 not taken.
✗ Branch 97 not taken.
✗ Branch 98 not taken.
✗ Branch 99 not taken.
✗ Branch 100 not taken.
✗ Branch 101 not taken.
✗ Branch 102 not taken.
✗ Branch 105 not taken.
✗ Branch 106 not taken.
✓ Branch 107 taken 6496 times.
✓ Branch 108 taken 1 times.
✓ Branch 109 taken 6342 times.
✓ Branch 110 taken 154 times.
✗ Branch 111 not taken.
✓ Branch 112 taken 1 times.
✗ Branch 113 not taken.
✗ Branch 114 not taken.
✗ Branch 115 not taken.
✓ Branch 116 taken 1 times.
✗ Branch 117 not taken.
✗ Branch 118 not taken.
✗ Branch 119 not taken.
✓ Branch 120 taken 1 times.
✗ Branch 121 not taken.
✗ Branch 122 not taken.
✓ Branch 123 taken 1 times.
✗ Branch 124 not taken.
✓ Branch 125 taken 1 times.
✗ Branch 126 not taken.
✓ Branch 128 taken 1 times.
✗ Branch 129 not taken.
✓ Branch 131 taken 1 times.
✗ Branch 132 not taken.
✓ Branch 133 taken 1 times.
✗ Branch 134 not taken.
✗ Branch 135 not taken.
✗ Branch 136 not taken.
✗ Branch 139 not taken.
✗ Branch 140 not taken.
|
23952 | ASSIGN_SSE_SCALE_FUNC(c->hcScale, c->hChrFilterSize, sse4, ssse3); |
| 688 |
17/17✓ Branch 0 taken 890 times.
✓ Branch 1 taken 493 times.
✓ Branch 2 taken 138 times.
✓ Branch 3 taken 21136 times.
✓ Branch 4 taken 1211 times.
✓ Branch 6 taken 463 times.
✓ Branch 7 taken 427 times.
✓ Branch 9 taken 285 times.
✓ Branch 10 taken 208 times.
✓ Branch 12 taken 161 times.
✓ Branch 13 taken 124 times.
✓ Branch 15 taken 138 times.
✓ Branch 16 taken 23 times.
✓ Branch 18 taken 84 times.
✓ Branch 19 taken 54 times.
✓ Branch 20 taken 19675 times.
✓ Branch 21 taken 1461 times.
|
23868 | ASSIGN_VSCALEX_FUNC(c->yuv2planeX, sse4, |
| 689 | if (!isBE(c->opts.dst_format)) c->yuv2planeX = ff_yuv2planeX_16_sse4); | ||
| 690 |
6/6✓ Branch 0 taken 890 times.
✓ Branch 1 taken 22978 times.
✓ Branch 3 taken 463 times.
✓ Branch 4 taken 427 times.
✓ Branch 5 taken 367 times.
✓ Branch 6 taken 96 times.
|
23868 | if (c->dstBpc == 16 && !isBE(c->opts.dst_format) && !(c->opts.flags & SWS_ACCURATE_RND)) |
| 691 | 367 | c->yuv2plane1 = ff_yuv2plane1_16_sse4; | |
| 692 | } | ||
| 693 | |||
| 694 |
2/2✓ Branch 0 taken 19536 times.
✓ Branch 1 taken 37637 times.
|
57173 | if (EXTERNAL_AVX(cpu_flags)) { |
| 695 |
15/15✓ Branch 0 taken 778 times.
✓ Branch 1 taken 461 times.
✓ Branch 2 taken 106 times.
✓ Branch 3 taken 17332 times.
✓ Branch 4 taken 859 times.
✓ Branch 6 taken 261 times.
✓ Branch 7 taken 200 times.
✓ Branch 9 taken 137 times.
✓ Branch 10 taken 124 times.
✓ Branch 12 taken 114 times.
✓ Branch 13 taken 23 times.
✓ Branch 15 taken 60 times.
✓ Branch 16 taken 46 times.
✓ Branch 17 taken 16471 times.
✓ Branch 18 taken 861 times.
|
19536 | ASSIGN_VSCALEX_FUNC(c->yuv2planeX, avx, ); |
| 696 |
2/2✓ Branch 0 taken 5261 times.
✓ Branch 1 taken 14275 times.
|
19536 | if (!(c->opts.flags & SWS_ACCURATE_RND)) |
| 697 |
16/17✓ Branch 0 taken 682 times.
✓ Branch 1 taken 441 times.
✓ Branch 2 taken 96 times.
✓ Branch 3 taken 3219 times.
✓ Branch 4 taken 823 times.
✓ Branch 6 taken 351 times.
✓ Branch 7 taken 331 times.
✓ Branch 9 taken 249 times.
✓ Branch 10 taken 192 times.
✓ Branch 12 taken 126 times.
✓ Branch 13 taken 123 times.
✓ Branch 15 taken 104 times.
✓ Branch 16 taken 22 times.
✓ Branch 18 taken 55 times.
✓ Branch 19 taken 41 times.
✗ Branch 20 not taken.
✓ Branch 21 taken 823 times.
|
5261 | ASSIGN_VSCALE_FUNC(c->yuv2plane1, avx); |
| 698 | |||
| 699 |
7/11✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 153 times.
✓ Branch 5 taken 150 times.
✓ Branch 6 taken 295 times.
✓ Branch 7 taken 295 times.
✓ Branch 8 taken 294 times.
✓ Branch 9 taken 294 times.
✓ Branch 10 taken 18055 times.
|
19536 | switch (c->opts.src_format) { |
| 700 | ✗ | case AV_PIX_FMT_YUYV422: | |
| 701 | ✗ | c->chrToYV12 = ff_yuyvToUV_avx; | |
| 702 | ✗ | break; | |
| 703 | ✗ | case AV_PIX_FMT_UYVY422: | |
| 704 | ✗ | c->chrToYV12 = ff_uyvyToUV_avx; | |
| 705 | ✗ | break; | |
| 706 | ✗ | case AV_PIX_FMT_NV12: | |
| 707 | ✗ | c->chrToYV12 = ff_nv12ToUV_avx; | |
| 708 | ✗ | break; | |
| 709 | ✗ | case AV_PIX_FMT_NV21: | |
| 710 | ✗ | c->chrToYV12 = ff_nv21ToUV_avx; | |
| 711 | ✗ | break; | |
| 712 |
2/2✓ Branch 0 taken 144 times.
✓ Branch 1 taken 9 times.
|
153 | case_rgb(rgb24, RGB24, avx); |
| 713 |
2/2✓ Branch 0 taken 144 times.
✓ Branch 1 taken 6 times.
|
150 | case_rgb(bgr24, BGR24, avx); |
| 714 |
2/2✓ Branch 0 taken 289 times.
✓ Branch 1 taken 6 times.
|
295 | case_rgb(bgra, BGRA, avx); |
| 715 |
2/2✓ Branch 0 taken 289 times.
✓ Branch 1 taken 6 times.
|
295 | case_rgb(rgba, RGBA, avx); |
| 716 |
2/2✓ Branch 0 taken 288 times.
✓ Branch 1 taken 6 times.
|
294 | case_rgb(abgr, ABGR, avx); |
| 717 |
2/2✓ Branch 0 taken 288 times.
✓ Branch 1 taken 6 times.
|
294 | case_rgb(argb, ARGB, avx); |
| 718 | 18055 | default: | |
| 719 | 18055 | break; | |
| 720 | } | ||
| 721 | } | ||
| 722 | |||
| 723 | #if ARCH_X86_64 | ||
| 724 | #define ASSIGN_AVX2_SCALE_FUNC(hscalefn, filtersize) \ | ||
| 725 | switch (filtersize) { \ | ||
| 726 | case 4: hscalefn = ff_hscale8to15_4_avx2; break; \ | ||
| 727 | default: hscalefn = ff_hscale8to15_X4_avx2; break; \ | ||
| 728 | break; \ | ||
| 729 | } | ||
| 730 | |||
| 731 |
5/6✓ Branch 0 taken 17370 times.
✓ Branch 1 taken 39803 times.
✓ Branch 2 taken 17370 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1083 times.
✓ Branch 5 taken 16287 times.
|
57173 | if (EXTERNAL_AVX2_FAST(cpu_flags) && !(cpu_flags & AV_CPU_FLAG_SLOW_GATHER)) { |
| 732 |
4/4✓ Branch 0 taken 1060 times.
✓ Branch 1 taken 23 times.
✓ Branch 2 taken 996 times.
✓ Branch 3 taken 64 times.
|
1083 | if ((c->srcBpc == 8) && (c->dstBpc <= 14)) { |
| 733 |
2/2✓ Branch 0 taken 78 times.
✓ Branch 1 taken 918 times.
|
996 | ASSIGN_AVX2_SCALE_FUNC(c->hcScale, c->hChrFilterSize); |
| 734 |
2/2✓ Branch 0 taken 78 times.
✓ Branch 1 taken 918 times.
|
996 | ASSIGN_AVX2_SCALE_FUNC(c->hyScale, c->hLumFilterSize); |
| 735 | } | ||
| 736 | } | ||
| 737 | |||
| 738 |
3/4✓ Branch 0 taken 17370 times.
✓ Branch 1 taken 39803 times.
✓ Branch 2 taken 17370 times.
✗ Branch 3 not taken.
|
57173 | if (EXTERNAL_AVX2_FAST(cpu_flags)) { |
| 739 | if (ARCH_X86_64) | ||
| 740 |
7/7✓ Branch 0 taken 145 times.
✓ Branch 1 taken 144 times.
✓ Branch 2 taken 287 times.
✓ Branch 3 taken 287 times.
✓ Branch 4 taken 286 times.
✓ Branch 5 taken 286 times.
✓ Branch 6 taken 15935 times.
|
17370 | switch (c->opts.src_format) { |
| 741 |
2/2✓ Branch 0 taken 142 times.
✓ Branch 1 taken 3 times.
|
145 | case_rgb(rgb24, RGB24, avx2); |
| 742 |
2/2✓ Branch 0 taken 142 times.
✓ Branch 1 taken 2 times.
|
144 | case_rgb(bgr24, BGR24, avx2); |
| 743 |
2/2✓ Branch 0 taken 285 times.
✓ Branch 1 taken 2 times.
|
287 | case_rgb(bgra, BGRA, avx2); |
| 744 |
2/2✓ Branch 0 taken 285 times.
✓ Branch 1 taken 2 times.
|
287 | case_rgb(rgba, RGBA, avx2); |
| 745 |
2/2✓ Branch 0 taken 284 times.
✓ Branch 1 taken 2 times.
|
286 | case_rgb(abgr, ABGR, avx2); |
| 746 |
2/2✓ Branch 0 taken 284 times.
✓ Branch 1 taken 2 times.
|
286 | case_rgb(argb, ARGB, avx2); |
| 747 | } | ||
| 748 |
2/2✓ Branch 0 taken 3355 times.
✓ Branch 1 taken 14015 times.
|
17370 | if (!(c->opts.flags & SWS_ACCURATE_RND)) // FIXME |
| 749 |
3/3✓ Branch 0 taken 123 times.
✓ Branch 1 taken 127 times.
✓ Branch 2 taken 3105 times.
|
3355 | switch (c->opts.dst_format) { |
| 750 | 123 | case AV_PIX_FMT_NV12: | |
| 751 | case AV_PIX_FMT_NV24: | ||
| 752 | 123 | c->yuv2nv12cX = ff_yuv2nv12cX_avx2; | |
| 753 | 123 | break; | |
| 754 | 127 | case AV_PIX_FMT_NV21: | |
| 755 | case AV_PIX_FMT_NV42: | ||
| 756 | 127 | c->yuv2nv12cX = ff_yuv2nv21cX_avx2; | |
| 757 | 127 | break; | |
| 758 | 3105 | default: | |
| 759 | 3105 | break; | |
| 760 | } | ||
| 761 | } | ||
| 762 | |||
| 763 | |||
| 764 | #define INPUT_PLANER_RGB_A_FUNC_CASE_NOBREAK(fmt, name, opt) \ | ||
| 765 | case fmt: \ | ||
| 766 | c->readAlpPlanar = ff_planar_##name##_to_a_##opt; | ||
| 767 | |||
| 768 | #define INPUT_PLANER_RGBA_YUV_FUNC_CASE(rgb_fmt, rgba_fmt, name, opt) \ | ||
| 769 | case rgba_fmt: \ | ||
| 770 | case rgb_fmt: \ | ||
| 771 | c->readLumPlanar = ff_planar_##name##_to_y_##opt; \ | ||
| 772 | c->readChrPlanar = ff_planar_##name##_to_uv_##opt; \ | ||
| 773 | break; | ||
| 774 | |||
| 775 | #define INPUT_PLANER_RGB_YUV_FUNC_CASE(fmt, name, opt) \ | ||
| 776 | case fmt: \ | ||
| 777 | c->readLumPlanar = ff_planar_##name##_to_y_##opt; \ | ||
| 778 | c->readChrPlanar = ff_planar_##name##_to_uv_##opt; \ | ||
| 779 | break; | ||
| 780 | |||
| 781 | #define INPUT_PLANER_RGB_UV_FUNC_CASE(fmt, name, opt) \ | ||
| 782 | case fmt: \ | ||
| 783 | c->readChrPlanar = ff_planar_##name##_to_uv_##opt; \ | ||
| 784 | break; | ||
| 785 | |||
| 786 | #define INPUT_PLANER_RGBAXX_YUVA_FUNC_CASE(rgb_fmt, rgba_fmt, name, opt) \ | ||
| 787 | INPUT_PLANER_RGB_A_FUNC_CASE_NOBREAK(rgba_fmt##LE, name##le, opt) \ | ||
| 788 | INPUT_PLANER_RGB_YUV_FUNC_CASE(rgb_fmt##LE, name##le, opt) \ | ||
| 789 | INPUT_PLANER_RGB_A_FUNC_CASE_NOBREAK(rgba_fmt##BE, name##be, opt) \ | ||
| 790 | INPUT_PLANER_RGB_YUV_FUNC_CASE(rgb_fmt##BE, name##be, opt) | ||
| 791 | |||
| 792 | #define INPUT_PLANER_RGBAXX_UVA_FUNC_CASE(rgb_fmt, rgba_fmt, name, opt) \ | ||
| 793 | INPUT_PLANER_RGB_A_FUNC_CASE_NOBREAK(rgba_fmt##LE, name##le, opt) \ | ||
| 794 | INPUT_PLANER_RGB_UV_FUNC_CASE(rgb_fmt##LE, name##le, opt) \ | ||
| 795 | INPUT_PLANER_RGB_A_FUNC_CASE_NOBREAK(rgba_fmt##BE, name##be, opt) \ | ||
| 796 | INPUT_PLANER_RGB_UV_FUNC_CASE(rgb_fmt##BE, name##be, opt) | ||
| 797 | |||
| 798 | #define INPUT_PLANER_RGBAXX_YUV_FUNC_CASE(rgb_fmt, rgba_fmt, name, opt) \ | ||
| 799 | INPUT_PLANER_RGBA_YUV_FUNC_CASE(rgb_fmt##LE, rgba_fmt##LE, name##le, opt) \ | ||
| 800 | INPUT_PLANER_RGBA_YUV_FUNC_CASE(rgb_fmt##BE, rgba_fmt##BE, name##be, opt) | ||
| 801 | |||
| 802 | #define INPUT_PLANER_RGBXX_YUV_FUNC_CASE(rgb_fmt, name, opt) \ | ||
| 803 | INPUT_PLANER_RGB_YUV_FUNC_CASE(rgb_fmt##LE, name##le, opt) \ | ||
| 804 | INPUT_PLANER_RGB_YUV_FUNC_CASE(rgb_fmt##BE, name##be, opt) | ||
| 805 | |||
| 806 | #define INPUT_PLANER_RGBXX_UV_FUNC_CASE(rgb_fmt, name, opt) \ | ||
| 807 | INPUT_PLANER_RGB_UV_FUNC_CASE(rgb_fmt##LE, name##le, opt) \ | ||
| 808 | INPUT_PLANER_RGB_UV_FUNC_CASE(rgb_fmt##BE, name##be, opt) | ||
| 809 | |||
| 810 | #define INPUT_PLANER_RGB_YUVA_ALL_CASES(opt) \ | ||
| 811 | INPUT_PLANER_RGB_A_FUNC_CASE_NOBREAK(AV_PIX_FMT_GBRAP, rgb, opt) \ | ||
| 812 | INPUT_PLANER_RGB_YUV_FUNC_CASE( AV_PIX_FMT_GBRP, rgb, opt) \ | ||
| 813 | INPUT_PLANER_RGBXX_YUV_FUNC_CASE( AV_PIX_FMT_GBRP9, rgb9, opt) \ | ||
| 814 | INPUT_PLANER_RGBAXX_YUVA_FUNC_CASE(AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRAP10, rgb10, opt) \ | ||
| 815 | INPUT_PLANER_RGBAXX_YUVA_FUNC_CASE(AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRAP12, rgb12, opt) \ | ||
| 816 | INPUT_PLANER_RGBXX_YUV_FUNC_CASE( AV_PIX_FMT_GBRP14, rgb14, opt) \ | ||
| 817 | INPUT_PLANER_RGBAXX_YUVA_FUNC_CASE(AV_PIX_FMT_GBRP16, AV_PIX_FMT_GBRAP16, rgb16, opt) \ | ||
| 818 | INPUT_PLANER_RGBAXX_YUVA_FUNC_CASE(AV_PIX_FMT_GBRPF32, AV_PIX_FMT_GBRAPF32, rgbf32, opt) | ||
| 819 | |||
| 820 | |||
| 821 |
2/2✓ Branch 0 taken 27117 times.
✓ Branch 1 taken 30056 times.
|
57173 | if (EXTERNAL_SSE2(cpu_flags)) { |
| 822 |
23/23✓ Branch 0 taken 321 times.
✓ Branch 1 taken 261 times.
✓ Branch 2 taken 259 times.
✓ Branch 3 taken 258 times.
✓ Branch 4 taken 319 times.
✓ Branch 5 taken 259 times.
✓ Branch 6 taken 318 times.
✓ Branch 7 taken 258 times.
✓ Branch 8 taken 319 times.
✓ Branch 9 taken 259 times.
✓ Branch 10 taken 318 times.
✓ Branch 11 taken 258 times.
✓ Branch 12 taken 259 times.
✓ Branch 13 taken 258 times.
✓ Branch 14 taken 319 times.
✓ Branch 15 taken 259 times.
✓ Branch 16 taken 318 times.
✓ Branch 17 taken 258 times.
✓ Branch 18 taken 320 times.
✓ Branch 19 taken 294 times.
✓ Branch 20 taken 320 times.
✓ Branch 21 taken 260 times.
✓ Branch 22 taken 20845 times.
|
27117 | switch (c->opts.src_format) { |
| 823 | 321 | INPUT_PLANER_RGB_A_FUNC_CASE_NOBREAK(AV_PIX_FMT_GBRAP, rgb, sse2); | |
| 824 | 582 | INPUT_PLANER_RGB_UV_FUNC_CASE( AV_PIX_FMT_GBRP, rgb, sse2); | |
| 825 | 517 | INPUT_PLANER_RGBXX_UV_FUNC_CASE( AV_PIX_FMT_GBRP9, rgb9, sse2); | |
| 826 | 1154 | INPUT_PLANER_RGBAXX_UVA_FUNC_CASE( AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRAP10, rgb10, sse2); | |
| 827 | 1154 | INPUT_PLANER_RGBAXX_UVA_FUNC_CASE( AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRAP12, rgb12, sse2); | |
| 828 | 517 | INPUT_PLANER_RGBXX_UV_FUNC_CASE( AV_PIX_FMT_GBRP14, rgb14, sse2); | |
| 829 | 1154 | INPUT_PLANER_RGBAXX_UVA_FUNC_CASE( AV_PIX_FMT_GBRP16, AV_PIX_FMT_GBRAP16, rgb16, sse2); | |
| 830 | 1194 | INPUT_PLANER_RGBAXX_YUVA_FUNC_CASE(AV_PIX_FMT_GBRPF32, AV_PIX_FMT_GBRAPF32, rgbf32, sse2); | |
| 831 | 20845 | default: | |
| 832 | 20845 | break; | |
| 833 | } | ||
| 834 | } | ||
| 835 | |||
| 836 |
2/2✓ Branch 0 taken 23868 times.
✓ Branch 1 taken 33305 times.
|
57173 | if (EXTERNAL_SSE4(cpu_flags)) { |
| 837 |
16/16✓ Branch 0 taken 492 times.
✓ Branch 1 taken 223 times.
✓ Branch 2 taken 222 times.
✓ Branch 3 taken 488 times.
✓ Branch 4 taken 486 times.
✓ Branch 5 taken 488 times.
✓ Branch 6 taken 486 times.
✓ Branch 7 taken 223 times.
✓ Branch 8 taken 222 times.
✓ Branch 9 taken 488 times.
✓ Branch 10 taken 486 times.
✓ Branch 11 taken 266 times.
✓ Branch 12 taken 258 times.
✓ Branch 13 taken 266 times.
✓ Branch 14 taken 224 times.
✓ Branch 15 taken 18550 times.
|
23868 | switch (c->opts.src_format) { |
| 838 | 492 | case AV_PIX_FMT_GBRAP: | |
| 839 | 492 | INPUT_PLANER_RGB_YUV_FUNC_CASE( AV_PIX_FMT_GBRP, rgb, sse4); | |
| 840 | 445 | INPUT_PLANER_RGBXX_YUV_FUNC_CASE( AV_PIX_FMT_GBRP9, rgb9, sse4); | |
| 841 | 974 | INPUT_PLANER_RGBAXX_YUV_FUNC_CASE( AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRAP10, rgb10, sse4); | |
| 842 | 974 | INPUT_PLANER_RGBAXX_YUV_FUNC_CASE( AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRAP12, rgb12, sse4); | |
| 843 | 445 | INPUT_PLANER_RGBXX_YUV_FUNC_CASE( AV_PIX_FMT_GBRP14, rgb14, sse4); | |
| 844 | 974 | INPUT_PLANER_RGBAXX_YUV_FUNC_CASE( AV_PIX_FMT_GBRP16, AV_PIX_FMT_GBRAP16, rgb16, sse4); | |
| 845 | 1014 | INPUT_PLANER_RGBAXX_YUVA_FUNC_CASE(AV_PIX_FMT_GBRPF32, AV_PIX_FMT_GBRAPF32, rgbf32, sse4); | |
| 846 | 18550 | default: | |
| 847 | 18550 | break; | |
| 848 | } | ||
| 849 | } | ||
| 850 | |||
| 851 |
3/4✓ Branch 0 taken 17370 times.
✓ Branch 1 taken 39803 times.
✓ Branch 2 taken 17370 times.
✗ Branch 3 not taken.
|
57173 | if (EXTERNAL_AVX2_FAST(cpu_flags)) { |
| 852 |
23/23✓ Branch 0 taken 159 times.
✓ Branch 1 taken 153 times.
✓ Branch 2 taken 151 times.
✓ Branch 3 taken 150 times.
✓ Branch 4 taken 157 times.
✓ Branch 5 taken 151 times.
✓ Branch 6 taken 156 times.
✓ Branch 7 taken 150 times.
✓ Branch 8 taken 157 times.
✓ Branch 9 taken 151 times.
✓ Branch 10 taken 156 times.
✓ Branch 11 taken 150 times.
✓ Branch 12 taken 151 times.
✓ Branch 13 taken 150 times.
✓ Branch 14 taken 157 times.
✓ Branch 15 taken 151 times.
✓ Branch 16 taken 156 times.
✓ Branch 17 taken 150 times.
✓ Branch 18 taken 158 times.
✓ Branch 19 taken 186 times.
✓ Branch 20 taken 158 times.
✓ Branch 21 taken 152 times.
✓ Branch 22 taken 13960 times.
|
17370 | switch (c->opts.src_format) { |
| 853 | 3410 | INPUT_PLANER_RGB_YUVA_ALL_CASES(avx2) | |
| 854 | 13960 | default: | |
| 855 | 13960 | break; | |
| 856 | } | ||
| 857 | } | ||
| 858 | |||
| 859 |
2/2✓ Branch 0 taken 14371 times.
✓ Branch 1 taken 42802 times.
|
57173 | if(c->opts.flags & SWS_FULL_CHR_H_INT) { |
| 860 | |||
| 861 | #define YUV2ANYX_FUNC_CASE(fmt, name, opt) \ | ||
| 862 | case fmt: \ | ||
| 863 | c->yuv2anyX = ff_yuv2##name##_full_X_##opt; \ | ||
| 864 | break; | ||
| 865 | |||
| 866 | #define YUV2ANYX_GBRAP_CASES(opt) \ | ||
| 867 | YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRP, gbrp, opt) \ | ||
| 868 | YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRAP, gbrap, opt) \ | ||
| 869 | YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRP9LE, gbrp9le, opt) \ | ||
| 870 | YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRP10LE, gbrp10le, opt) \ | ||
| 871 | YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRAP10LE, gbrap10le, opt) \ | ||
| 872 | YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRP12LE, gbrp12le, opt) \ | ||
| 873 | YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRAP12LE, gbrap12le, opt) \ | ||
| 874 | YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRP14LE, gbrp14le, opt) \ | ||
| 875 | YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRP16LE, gbrp16le, opt) \ | ||
| 876 | YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRAP16LE, gbrap16le, opt) \ | ||
| 877 | YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRPF32LE, gbrpf32le, opt) \ | ||
| 878 | YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRAPF32LE, gbrapf32le, opt) \ | ||
| 879 | YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRP9BE, gbrp9be, opt) \ | ||
| 880 | YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRP10BE, gbrp10be, opt) \ | ||
| 881 | YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRAP10BE, gbrap10be, opt) \ | ||
| 882 | YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRP12BE, gbrp12be, opt) \ | ||
| 883 | YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRAP12BE, gbrap12be, opt) \ | ||
| 884 | YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRP14BE, gbrp14be, opt) \ | ||
| 885 | YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRP16BE, gbrp16be, opt) \ | ||
| 886 | YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRAP16BE, gbrap16be, opt) \ | ||
| 887 | YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRPF32BE, gbrpf32be, opt) \ | ||
| 888 | YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRAPF32BE, gbrapf32be, opt) | ||
| 889 | |||
| 890 |
2/2✓ Branch 0 taken 6062 times.
✓ Branch 1 taken 8309 times.
|
14371 | if (EXTERNAL_SSE2(cpu_flags)) { |
| 891 |
23/23✓ Branch 0 taken 252 times.
✓ Branch 1 taken 252 times.
✓ Branch 2 taken 250 times.
✓ Branch 3 taken 250 times.
✓ Branch 4 taken 250 times.
✓ Branch 5 taken 250 times.
✓ Branch 6 taken 250 times.
✓ Branch 7 taken 250 times.
✓ Branch 8 taken 250 times.
✓ Branch 9 taken 250 times.
✓ Branch 10 taken 285 times.
✓ Branch 11 taken 251 times.
✓ Branch 12 taken 249 times.
✓ Branch 13 taken 249 times.
✓ Branch 14 taken 249 times.
✓ Branch 15 taken 249 times.
✓ Branch 16 taken 249 times.
✓ Branch 17 taken 249 times.
✓ Branch 18 taken 249 times.
✓ Branch 19 taken 249 times.
✓ Branch 20 taken 251 times.
✓ Branch 21 taken 251 times.
✓ Branch 22 taken 528 times.
|
6062 | switch (c->opts.dst_format) { |
| 892 | 5534 | YUV2ANYX_GBRAP_CASES(sse2) | |
| 893 | 528 | default: | |
| 894 | 528 | break; | |
| 895 | } | ||
| 896 | } | ||
| 897 | |||
| 898 |
2/2✓ Branch 0 taken 4478 times.
✓ Branch 1 taken 9893 times.
|
14371 | if (EXTERNAL_SSE4(cpu_flags)) { |
| 899 |
23/23✓ Branch 0 taken 180 times.
✓ Branch 1 taken 180 times.
✓ Branch 2 taken 178 times.
✓ Branch 3 taken 178 times.
✓ Branch 4 taken 178 times.
✓ Branch 5 taken 178 times.
✓ Branch 6 taken 178 times.
✓ Branch 7 taken 178 times.
✓ Branch 8 taken 178 times.
✓ Branch 9 taken 178 times.
✓ Branch 10 taken 213 times.
✓ Branch 11 taken 179 times.
✓ Branch 12 taken 177 times.
✓ Branch 13 taken 177 times.
✓ Branch 14 taken 177 times.
✓ Branch 15 taken 177 times.
✓ Branch 16 taken 177 times.
✓ Branch 17 taken 177 times.
✓ Branch 18 taken 177 times.
✓ Branch 19 taken 177 times.
✓ Branch 20 taken 179 times.
✓ Branch 21 taken 179 times.
✓ Branch 22 taken 528 times.
|
4478 | switch (c->opts.dst_format) { |
| 900 | 3950 | YUV2ANYX_GBRAP_CASES(sse4) | |
| 901 | 528 | default: | |
| 902 | 528 | break; | |
| 903 | } | ||
| 904 | } | ||
| 905 | |||
| 906 |
3/4✓ Branch 0 taken 1310 times.
✓ Branch 1 taken 13061 times.
✓ Branch 2 taken 1310 times.
✗ Branch 3 not taken.
|
14371 | if (EXTERNAL_AVX2_FAST(cpu_flags)) { |
| 907 |
23/23✓ Branch 0 taken 36 times.
✓ Branch 1 taken 36 times.
✓ Branch 2 taken 34 times.
✓ Branch 3 taken 34 times.
✓ Branch 4 taken 34 times.
✓ Branch 5 taken 34 times.
✓ Branch 6 taken 34 times.
✓ Branch 7 taken 34 times.
✓ Branch 8 taken 34 times.
✓ Branch 9 taken 34 times.
✓ Branch 10 taken 69 times.
✓ Branch 11 taken 35 times.
✓ Branch 12 taken 33 times.
✓ Branch 13 taken 33 times.
✓ Branch 14 taken 33 times.
✓ Branch 15 taken 33 times.
✓ Branch 16 taken 33 times.
✓ Branch 17 taken 33 times.
✓ Branch 18 taken 33 times.
✓ Branch 19 taken 33 times.
✓ Branch 20 taken 35 times.
✓ Branch 21 taken 35 times.
✓ Branch 22 taken 528 times.
|
1310 | switch (c->opts.dst_format) { |
| 908 | 782 | YUV2ANYX_GBRAP_CASES(avx2) | |
| 909 | 528 | default: | |
| 910 | 528 | break; | |
| 911 | } | ||
| 912 | } | ||
| 913 | } | ||
| 914 | |||
| 915 | #endif | ||
| 916 | 57173 | } | |
| 917 |