35 0x0200020002000200LL,};
39 0x0004000400040004LL,};
58 #if HAVE_MMXEXT_INLINE
60 #undef COMPILE_TEMPLATE_MMXEXT
61 #define COMPILE_TEMPLATE_MMXEXT 1
62 #define RENAME(a) a ## _mmxext
68 const int dstH=
c->dstH;
71 SwsPlane *lumPlane = &
c->slice[
c->numSlice-2].plane[0];
72 SwsPlane *chrUPlane = &
c->slice[
c->numSlice-2].plane[1];
73 SwsPlane *alpPlane = &
c->slice[
c->numSlice-2].plane[3];
75 int hasAlpha =
c->needAlpha;
85 const int chrDstY=
dstY>>
c->chrDstVSubSample;
96 const int16_t **lumSrcPtr = (
const int16_t **)(
void*) lumPlane->
line + firstLumSrcY - lumPlane->
sliceY;
97 const int16_t **chrUSrcPtr = (
const int16_t **)(
void*) chrUPlane->
line + firstChrSrcY - chrUPlane->
sliceY;
98 const int16_t **alpSrcPtr = (CONFIG_SWSCALE_ALPHA && hasAlpha) ? (
const int16_t **)(
void*) alpPlane->
line + firstLumSrcY - alpPlane->
sliceY :
NULL;
101 if (firstLumSrcY < 0 || firstLumSrcY + vLumFilterSize >
c->srcH) {
102 const int16_t **tmpY = (
const int16_t **) lumPlane->
tmp;
105 for (
i = 0;
i < neg;
i++)
106 tmpY[
i] = lumSrcPtr[neg];
107 for ( ;
i < end;
i++)
108 tmpY[
i] = lumSrcPtr[
i];
114 const int16_t **tmpA = (
const int16_t **) alpPlane->
tmp;
116 tmpA[
i] = alpSrcPtr[neg];
117 for ( ;
i < end;
i++)
118 tmpA[
i] = alpSrcPtr[
i];
120 tmpA[
i] = tmpA[
i - 1];
124 if (firstChrSrcY < 0 || firstChrSrcY + vChrFilterSize >
c->chrSrcH) {
125 const int16_t **tmpU = (
const int16_t **) chrUPlane->
tmp;
127 for (
i = 0;
i < neg;
i++) {
128 tmpU[
i] = chrUSrcPtr[neg];
130 for ( ;
i < end;
i++) {
131 tmpU[
i] = chrUSrcPtr[
i];
134 tmpU[
i] = tmpU[
i - 1];
147 if (CONFIG_SWSCALE_ALPHA && hasAlpha) {
167 if (CONFIG_SWSCALE_ALPHA && hasAlpha) {
184 #define YUV2YUVX_FUNC_MMX(opt, step) \
185 void ff_yuv2yuvX_ ##opt(const int16_t *filter, int filterSize, int srcOffset, \
186 uint8_t *dest, int dstW, \
187 const uint8_t *dither, int offset); \
188 static void yuv2yuvX_ ##opt(const int16_t *filter, int filterSize, \
189 const int16_t **src, uint8_t *dest, int dstW, \
190 const uint8_t *dither, int offset) \
193 ff_yuv2yuvX_ ##opt(filter, filterSize - 1, 0, dest - offset, dstW + offset, dither, offset); \
197 #define YUV2YUVX_FUNC(opt, step) \
198 void ff_yuv2yuvX_ ##opt(const int16_t *filter, int filterSize, int srcOffset, \
199 uint8_t *dest, int dstW, \
200 const uint8_t *dither, int offset); \
201 static void yuv2yuvX_ ##opt(const int16_t *filter, int filterSize, \
202 const int16_t **src, uint8_t *dest, int dstW, \
203 const uint8_t *dither, int offset) \
205 int remainder = (dstW % step); \
206 int pixelsProcessed = dstW - remainder; \
207 if(((uintptr_t)dest) & 15){ \
208 yuv2yuvX_mmxext(filter, filterSize, src, dest, dstW, dither, offset); \
211 if(pixelsProcessed > 0) \
212 ff_yuv2yuvX_ ##opt(filter, filterSize - 1, 0, dest - offset, pixelsProcessed + offset, dither, offset); \
214 ff_yuv2yuvX_mmxext(filter, filterSize - 1, pixelsProcessed, dest - offset, pixelsProcessed + remainder + offset, dither, offset); \
219 #if HAVE_MMXEXT_EXTERNAL
222 #if HAVE_SSE3_EXTERNAL
225 #if HAVE_AVX2_EXTERNAL
229 #define SCALE_FUNC(filter_n, from_bpc, to_bpc, opt) \
230 void ff_hscale ## from_bpc ## to ## to_bpc ## _ ## filter_n ## _ ## opt( \
231 SwsContext *c, int16_t *data, \
232 int dstW, const uint8_t *src, \
233 const int16_t *filter, \
234 const int32_t *filterPos, int filterSize)
236 #define SCALE_FUNCS(filter_n, opt) \
237 SCALE_FUNC(filter_n, 8, 15, opt); \
238 SCALE_FUNC(filter_n, 9, 15, opt); \
239 SCALE_FUNC(filter_n, 10, 15, opt); \
240 SCALE_FUNC(filter_n, 12, 15, opt); \
241 SCALE_FUNC(filter_n, 14, 15, opt); \
242 SCALE_FUNC(filter_n, 16, 15, opt); \
243 SCALE_FUNC(filter_n, 8, 19, opt); \
244 SCALE_FUNC(filter_n, 9, 19, opt); \
245 SCALE_FUNC(filter_n, 10, 19, opt); \
246 SCALE_FUNC(filter_n, 12, 19, opt); \
247 SCALE_FUNC(filter_n, 14, 19, opt); \
248 SCALE_FUNC(filter_n, 16, 19, opt)
250 #define SCALE_FUNCS_MMX(opt) \
251 SCALE_FUNCS(4, opt); \
252 SCALE_FUNCS(8, opt); \
255 #define SCALE_FUNCS_SSE(opt) \
256 SCALE_FUNCS(4, opt); \
257 SCALE_FUNCS(8, opt); \
258 SCALE_FUNCS(X4, opt); \
268 #define VSCALEX_FUNC(size, opt) \
269 void ff_yuv2planeX_ ## size ## _ ## opt(const int16_t *filter, int filterSize, \
270 const int16_t **src, uint8_t *dest, int dstW, \
271 const uint8_t *dither, int offset)
272 #define VSCALEX_FUNCS(opt) \
273 VSCALEX_FUNC(8, opt); \
274 VSCALEX_FUNC(9, opt); \
275 VSCALEX_FUNC(10, opt)
283 #define VSCALE_FUNC(size, opt) \
284 void ff_yuv2plane1_ ## size ## _ ## opt(const int16_t *src, uint8_t *dst, int dstW, \
285 const uint8_t *dither, int offset)
286 #define VSCALE_FUNCS(opt1, opt2) \
287 VSCALE_FUNC(8, opt1); \
288 VSCALE_FUNC(9, opt2); \
289 VSCALE_FUNC(10, opt2); \
290 VSCALE_FUNC(16, opt1)
296 #define INPUT_Y_FUNC(fmt, opt) \
297 void ff_ ## fmt ## ToY_ ## opt(uint8_t *dst, const uint8_t *src, \
298 const uint8_t *unused1, const uint8_t *unused2, \
299 int w, uint32_t *unused, void *opq)
300 #define INPUT_UV_FUNC(fmt, opt) \
301 void ff_ ## fmt ## ToUV_ ## opt(uint8_t *dstU, uint8_t *dstV, \
302 const uint8_t *unused0, \
303 const uint8_t *src1, \
304 const uint8_t *src2, \
305 int w, uint32_t *unused, void *opq)
306 #define INPUT_FUNC(fmt, opt) \
307 INPUT_Y_FUNC(fmt, opt); \
308 INPUT_UV_FUNC(fmt, opt)
309 #define INPUT_FUNCS(opt) \
310 INPUT_FUNC(uyvy, opt); \
311 INPUT_FUNC(yuyv, opt); \
312 INPUT_UV_FUNC(nv12, opt); \
313 INPUT_UV_FUNC(nv21, opt); \
314 INPUT_FUNC(rgba, opt); \
315 INPUT_FUNC(bgra, opt); \
316 INPUT_FUNC(argb, opt); \
317 INPUT_FUNC(abgr, opt); \
318 INPUT_FUNC(rgb24, opt); \
319 INPUT_FUNC(bgr24, opt)
326 #define YUV2NV_DECL(fmt, opt) \
327 void ff_yuv2 ## fmt ## cX_ ## opt(enum AVPixelFormat format, const uint8_t *dither, \
328 const int16_t *filter, int filterSize, \
329 const int16_t **u, const int16_t **v, \
330 uint8_t *dst, int dstWidth)
332 YUV2NV_DECL(nv12, avx2);
333 YUV2NV_DECL(nv21, avx2);
335 #define YUV2GBRP_FN_DECL(fmt, opt) \
336 void ff_yuv2##fmt##_full_X_ ##opt(SwsContext *c, const int16_t *lumFilter, \
337 const int16_t **lumSrcx, int lumFilterSize, \
338 const int16_t *chrFilter, const int16_t **chrUSrcx, \
339 const int16_t **chrVSrcx, int chrFilterSize, \
340 const int16_t **alpSrcx, uint8_t **dest, \
343 #define YUV2GBRP_DECL(opt) \
344 YUV2GBRP_FN_DECL(gbrp, opt); \
345 YUV2GBRP_FN_DECL(gbrap, opt); \
346 YUV2GBRP_FN_DECL(gbrp9le, opt); \
347 YUV2GBRP_FN_DECL(gbrp10le, opt); \
348 YUV2GBRP_FN_DECL(gbrap10le, opt); \
349 YUV2GBRP_FN_DECL(gbrp12le, opt); \
350 YUV2GBRP_FN_DECL(gbrap12le, opt); \
351 YUV2GBRP_FN_DECL(gbrp14le, opt); \
352 YUV2GBRP_FN_DECL(gbrp16le, opt); \
353 YUV2GBRP_FN_DECL(gbrap16le, opt); \
354 YUV2GBRP_FN_DECL(gbrpf32le, opt); \
355 YUV2GBRP_FN_DECL(gbrapf32le, opt); \
356 YUV2GBRP_FN_DECL(gbrp9be, opt); \
357 YUV2GBRP_FN_DECL(gbrp10be, opt); \
358 YUV2GBRP_FN_DECL(gbrap10be, opt); \
359 YUV2GBRP_FN_DECL(gbrp12be, opt); \
360 YUV2GBRP_FN_DECL(gbrap12be, opt); \
361 YUV2GBRP_FN_DECL(gbrp14be, opt); \
362 YUV2GBRP_FN_DECL(gbrp16be, opt); \
363 YUV2GBRP_FN_DECL(gbrap16be, opt); \
364 YUV2GBRP_FN_DECL(gbrpf32be, opt); \
365 YUV2GBRP_FN_DECL(gbrapf32be, opt)
371 #define INPUT_PLANAR_RGB_Y_FN_DECL(fmt, opt) \
372 void ff_planar_##fmt##_to_y_##opt(uint8_t *dst, \
373 const uint8_t *src[4], int w, int32_t *rgb2yuv, \
376 #define INPUT_PLANAR_RGB_UV_FN_DECL(fmt, opt) \
377 void ff_planar_##fmt##_to_uv_##opt(uint8_t *dstU, uint8_t *dstV, \
378 const uint8_t *src[4], int w, int32_t *rgb2yuv, \
381 #define INPUT_PLANAR_RGB_A_FN_DECL(fmt, opt) \
382 void ff_planar_##fmt##_to_a_##opt(uint8_t *dst, \
383 const uint8_t *src[4], int w, int32_t *rgb2yuv, \
387 #define INPUT_PLANAR_RGBXX_A_DECL(fmt, opt) \
388 INPUT_PLANAR_RGB_A_FN_DECL(fmt##le, opt); \
389 INPUT_PLANAR_RGB_A_FN_DECL(fmt##be, opt)
391 #define INPUT_PLANAR_RGBXX_Y_DECL(fmt, opt) \
392 INPUT_PLANAR_RGB_Y_FN_DECL(fmt##le, opt); \
393 INPUT_PLANAR_RGB_Y_FN_DECL(fmt##be, opt)
395 #define INPUT_PLANAR_RGBXX_UV_DECL(fmt, opt) \
396 INPUT_PLANAR_RGB_UV_FN_DECL(fmt##le, opt); \
397 INPUT_PLANAR_RGB_UV_FN_DECL(fmt##be, opt)
399 #define INPUT_PLANAR_RGBXX_YUVA_DECL(fmt, opt) \
400 INPUT_PLANAR_RGBXX_Y_DECL(fmt, opt); \
401 INPUT_PLANAR_RGBXX_UV_DECL(fmt, opt); \
402 INPUT_PLANAR_RGBXX_A_DECL(fmt, opt)
404 #define INPUT_PLANAR_RGBXX_YUV_DECL(fmt, opt) \
405 INPUT_PLANAR_RGBXX_Y_DECL(fmt, opt); \
406 INPUT_PLANAR_RGBXX_UV_DECL(fmt, opt)
408 #define INPUT_PLANAR_RGBXX_UVA_DECL(fmt, opt) \
409 INPUT_PLANAR_RGBXX_UV_DECL(fmt, opt); \
410 INPUT_PLANAR_RGBXX_A_DECL(fmt, opt)
412 #define INPUT_PLANAR_RGB_A_ALL_DECL(opt) \
413 INPUT_PLANAR_RGB_A_FN_DECL(rgb, opt); \
414 INPUT_PLANAR_RGBXX_A_DECL(rgb10, opt); \
415 INPUT_PLANAR_RGBXX_A_DECL(rgb12, opt); \
416 INPUT_PLANAR_RGBXX_A_DECL(rgb16, opt); \
417 INPUT_PLANAR_RGBXX_A_DECL(rgbf32, opt)
419 #define INPUT_PLANAR_RGB_Y_ALL_DECL(opt) \
420 INPUT_PLANAR_RGB_Y_FN_DECL(rgb, opt); \
421 INPUT_PLANAR_RGBXX_Y_DECL(rgb9, opt); \
422 INPUT_PLANAR_RGBXX_Y_DECL(rgb10, opt); \
423 INPUT_PLANAR_RGBXX_Y_DECL(rgb12, opt); \
424 INPUT_PLANAR_RGBXX_Y_DECL(rgb14, opt); \
425 INPUT_PLANAR_RGBXX_Y_DECL(rgb16, opt); \
426 INPUT_PLANAR_RGBXX_Y_DECL(rgbf32, opt)
428 #define INPUT_PLANAR_RGB_UV_ALL_DECL(opt) \
429 INPUT_PLANAR_RGB_UV_FN_DECL(rgb, opt); \
430 INPUT_PLANAR_RGBXX_UV_DECL(rgb9, opt); \
431 INPUT_PLANAR_RGBXX_UV_DECL(rgb10, opt); \
432 INPUT_PLANAR_RGBXX_UV_DECL(rgb12, opt); \
433 INPUT_PLANAR_RGBXX_UV_DECL(rgb14, opt); \
434 INPUT_PLANAR_RGBXX_UV_DECL(rgb16, opt); \
435 INPUT_PLANAR_RGBXX_UV_DECL(rgbf32, opt)
437 INPUT_PLANAR_RGBXX_Y_DECL(rgbf32, sse2);
438 INPUT_PLANAR_RGB_UV_ALL_DECL(sse2);
439 INPUT_PLANAR_RGB_A_ALL_DECL(sse2);
441 INPUT_PLANAR_RGB_Y_ALL_DECL(sse4);
442 INPUT_PLANAR_RGB_UV_ALL_DECL(sse4);
443 INPUT_PLANAR_RGBXX_A_DECL(rgbf32, sse4);
445 INPUT_PLANAR_RGB_Y_ALL_DECL(avx2);
446 INPUT_PLANAR_RGB_UV_ALL_DECL(avx2);
447 INPUT_PLANAR_RGB_A_ALL_DECL(avx2);
454 #if HAVE_MMXEXT_INLINE
456 sws_init_swscale_mmxext(
c);
459 #if HAVE_MMXEXT_EXTERNAL
461 c->yuv2planeX = yuv2yuvX_mmxext;
463 #if HAVE_SSE3_EXTERNAL
465 c->yuv2planeX = yuv2yuvX_sse3;
467 #if HAVE_AVX2_EXTERNAL
469 c->yuv2planeX = yuv2yuvX_avx2;
472 #if ARCH_X86_32 && !HAVE_ALIGNED_STACK
476 if (
c->dstBpc == 8 && !
c->use_mmx_vfilter)
477 c->yuv2planeX = ff_yuv2planeX_8_mmxext;
481 #define ASSIGN_SCALE_FUNC2(hscalefn, filtersize, opt1, opt2) do { \
482 if (c->srcBpc == 8) { \
483 hscalefn = c->dstBpc <= 14 ? ff_hscale8to15_ ## filtersize ## _ ## opt2 : \
484 ff_hscale8to19_ ## filtersize ## _ ## opt1; \
485 } else if (c->srcBpc == 9) { \
486 hscalefn = c->dstBpc <= 14 ? ff_hscale9to15_ ## filtersize ## _ ## opt2 : \
487 ff_hscale9to19_ ## filtersize ## _ ## opt1; \
488 } else if (c->srcBpc == 10) { \
489 hscalefn = c->dstBpc <= 14 ? ff_hscale10to15_ ## filtersize ## _ ## opt2 : \
490 ff_hscale10to19_ ## filtersize ## _ ## opt1; \
491 } else if (c->srcBpc == 12) { \
492 hscalefn = c->dstBpc <= 14 ? ff_hscale12to15_ ## filtersize ## _ ## opt2 : \
493 ff_hscale12to19_ ## filtersize ## _ ## opt1; \
494 } else if (c->srcBpc == 14 || ((c->srcFormat==AV_PIX_FMT_PAL8||isAnyRGB(c->srcFormat)) && av_pix_fmt_desc_get(c->srcFormat)->comp[0].depth<16)) { \
495 hscalefn = c->dstBpc <= 14 ? ff_hscale14to15_ ## filtersize ## _ ## opt2 : \
496 ff_hscale14to19_ ## filtersize ## _ ## opt1; \
498 av_assert0(c->srcBpc == 16);\
499 hscalefn = c->dstBpc <= 14 ? ff_hscale16to15_ ## filtersize ## _ ## opt2 : \
500 ff_hscale16to19_ ## filtersize ## _ ## opt1; \
503 #define ASSIGN_VSCALEX_FUNC(vscalefn, opt, do_16_case, condition_8bit) \
505 case 16: do_16_case; break; \
506 case 10: if (!isBE(c->dstFormat) && !isSemiPlanarYUV(c->dstFormat)) vscalefn = ff_yuv2planeX_10_ ## opt; break; \
507 case 9: if (!isBE(c->dstFormat)) vscalefn = ff_yuv2planeX_9_ ## opt; break; \
508 case 8: if ((condition_8bit) && !c->use_mmx_vfilter) vscalefn = ff_yuv2planeX_8_ ## opt; break; \
510 #define ASSIGN_VSCALE_FUNC(vscalefn, opt) \
512 case 16: if (!isBE(c->dstFormat)) vscalefn = ff_yuv2plane1_16_ ## opt; break; \
513 case 10: if (!isBE(c->dstFormat) && !isSemiPlanarYUV(c->dstFormat)) vscalefn = ff_yuv2plane1_10_ ## opt; break; \
514 case 9: if (!isBE(c->dstFormat)) vscalefn = ff_yuv2plane1_9_ ## opt; break; \
515 case 8: vscalefn = ff_yuv2plane1_8_ ## opt; break; \
516 default: av_assert0(c->dstBpc>8); \
518 #define case_rgb(x, X, opt) \
519 case AV_PIX_FMT_ ## X: \
520 c->lumToYV12 = ff_ ## x ## ToY_ ## opt; \
521 if (!c->chrSrcHSubSample) \
522 c->chrToYV12 = ff_ ## x ## ToUV_ ## opt; \
524 #define ASSIGN_SSE_SCALE_FUNC(hscalefn, filtersize, opt1, opt2) \
525 switch (filtersize) { \
526 case 4: ASSIGN_SCALE_FUNC2(hscalefn, 4, opt1, opt2); break; \
527 case 8: ASSIGN_SCALE_FUNC2(hscalefn, 8, opt1, opt2); break; \
528 default: if (filtersize & 4) ASSIGN_SCALE_FUNC2(hscalefn, X4, opt1, opt2); \
529 else ASSIGN_SCALE_FUNC2(hscalefn, X8, opt1, opt2); \
536 HAVE_ALIGNED_STACK || ARCH_X86_64);
540 switch (
c->srcFormat) {
542 c->lumToYV12 = ff_yuyvToY_sse2;
544 c->alpToYV12 = ff_uyvyToY_sse2;
547 c->lumToYV12 = ff_yuyvToY_sse2;
548 c->chrToYV12 = ff_yuyvToUV_sse2;
551 c->lumToYV12 = ff_uyvyToY_sse2;
552 c->chrToYV12 = ff_uyvyToUV_sse2;
555 c->chrToYV12 = ff_nv12ToUV_sse2;
558 c->chrToYV12 = ff_nv21ToUV_sse2;
573 switch (
c->srcFormat) {
585 if (!
isBE(
c->dstFormat))
c->yuv2planeX = ff_yuv2planeX_16_sse4,
586 HAVE_ALIGNED_STACK || ARCH_X86_64);
588 c->yuv2plane1 = ff_yuv2plane1_16_sse4;
593 HAVE_ALIGNED_STACK || ARCH_X86_64);
597 switch (
c->srcFormat) {
599 c->chrToYV12 = ff_yuyvToUV_avx;
602 c->chrToYV12 = ff_uyvyToUV_avx;
605 c->chrToYV12 = ff_nv12ToUV_avx;
608 c->chrToYV12 = ff_nv21ToUV_avx;
622 #define ASSIGN_AVX2_SCALE_FUNC(hscalefn, filtersize) \
623 switch (filtersize) { \
624 case 4: hscalefn = ff_hscale8to15_4_avx2; break; \
625 default: hscalefn = ff_hscale8to15_X4_avx2; break; \
630 if ((
c->srcBpc == 8) && (
c->dstBpc <= 14)) {
631 ASSIGN_AVX2_SCALE_FUNC(
c->hcScale,
c->hChrFilterSize);
632 ASSIGN_AVX2_SCALE_FUNC(
c->hyScale,
c->hLumFilterSize);
637 switch (
c->dstFormat) {
640 c->yuv2nv12cX = ff_yuv2nv12cX_avx2;
644 c->yuv2nv12cX = ff_yuv2nv21cX_avx2;
652 #define INPUT_PLANER_RGB_A_FUNC_CASE(fmt, name, opt) \
654 c->readAlpPlanar = ff_planar_##name##_to_a_##opt;
656 #define INPUT_PLANER_RGBA_YUV_FUNC_CASE(rgb_fmt, rgba_fmt, name, opt) \
659 c->readLumPlanar = ff_planar_##name##_to_y_##opt; \
660 c->readChrPlanar = ff_planar_##name##_to_uv_##opt; \
663 #define INPUT_PLANER_RGB_YUV_FUNC_CASE(fmt, name, opt) \
665 c->readLumPlanar = ff_planar_##name##_to_y_##opt; \
666 c->readChrPlanar = ff_planar_##name##_to_uv_##opt; \
669 #define INPUT_PLANER_RGB_UV_FUNC_CASE(fmt, name, opt) \
671 c->readChrPlanar = ff_planar_##name##_to_uv_##opt; \
674 #define INPUT_PLANER_RGBAXX_YUVA_FUNC_CASE(rgb_fmt, rgba_fmt, name, opt) \
675 INPUT_PLANER_RGB_A_FUNC_CASE(rgba_fmt##LE, name##le, opt) \
676 INPUT_PLANER_RGB_YUV_FUNC_CASE(rgb_fmt##LE, name##le, opt) \
677 INPUT_PLANER_RGB_A_FUNC_CASE(rgba_fmt##BE, name##be, opt) \
678 INPUT_PLANER_RGB_YUV_FUNC_CASE(rgb_fmt##BE, name##be, opt)
680 #define INPUT_PLANER_RGBAXX_UVA_FUNC_CASE(rgb_fmt, rgba_fmt, name, opt) \
681 INPUT_PLANER_RGB_A_FUNC_CASE(rgba_fmt##LE, name##le, opt) \
682 INPUT_PLANER_RGB_UV_FUNC_CASE(rgb_fmt##LE, name##le, opt) \
683 INPUT_PLANER_RGB_A_FUNC_CASE(rgba_fmt##BE, name##be, opt) \
684 INPUT_PLANER_RGB_UV_FUNC_CASE(rgb_fmt##BE, name##be, opt)
686 #define INPUT_PLANER_RGBAXX_YUV_FUNC_CASE(rgb_fmt, rgba_fmt, name, opt) \
687 INPUT_PLANER_RGBA_YUV_FUNC_CASE(rgb_fmt##LE, rgba_fmt##LE, name##le, opt) \
688 INPUT_PLANER_RGBA_YUV_FUNC_CASE(rgb_fmt##BE, rgba_fmt##BE, name##be, opt)
690 #define INPUT_PLANER_RGBXX_YUV_FUNC_CASE(rgb_fmt, name, opt) \
691 INPUT_PLANER_RGB_YUV_FUNC_CASE(rgb_fmt##LE, name##le, opt) \
692 INPUT_PLANER_RGB_YUV_FUNC_CASE(rgb_fmt##BE, name##be, opt)
694 #define INPUT_PLANER_RGBXX_UV_FUNC_CASE(rgb_fmt, name, opt) \
695 INPUT_PLANER_RGB_UV_FUNC_CASE(rgb_fmt##LE, name##le, opt) \
696 INPUT_PLANER_RGB_UV_FUNC_CASE(rgb_fmt##BE, name##be, opt)
698 #define INPUT_PLANER_RGB_YUVA_ALL_CASES(opt) \
699 INPUT_PLANER_RGB_A_FUNC_CASE( AV_PIX_FMT_GBRAP, rgb, opt) \
700 INPUT_PLANER_RGB_YUV_FUNC_CASE( AV_PIX_FMT_GBRP, rgb, opt) \
701 INPUT_PLANER_RGBXX_YUV_FUNC_CASE( AV_PIX_FMT_GBRP9, rgb9, opt) \
702 INPUT_PLANER_RGBAXX_YUVA_FUNC_CASE(AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRAP10, rgb10, opt) \
703 INPUT_PLANER_RGBAXX_YUVA_FUNC_CASE(AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRAP12, rgb12, opt) \
704 INPUT_PLANER_RGBXX_YUV_FUNC_CASE( AV_PIX_FMT_GBRP14, rgb14, opt) \
705 INPUT_PLANER_RGBAXX_YUVA_FUNC_CASE(AV_PIX_FMT_GBRP16, AV_PIX_FMT_GBRAP16, rgb16, opt) \
706 INPUT_PLANER_RGBAXX_YUVA_FUNC_CASE(AV_PIX_FMT_GBRPF32, AV_PIX_FMT_GBRAPF32, rgbf32, opt)
710 switch (
c->srcFormat) {
725 switch (
c->srcFormat) {
740 switch (
c->srcFormat) {
741 INPUT_PLANER_RGB_YUVA_ALL_CASES(avx2)
753 #define YUV2ANYX_FUNC_CASE(fmt, name, opt) \
755 c->yuv2anyX = ff_yuv2##name##_full_X_##opt; \
758 #define YUV2ANYX_GBRAP_CASES(opt) \
759 YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRP, gbrp, opt) \
760 YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRAP, gbrap, opt) \
761 YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRP9LE, gbrp9le, opt) \
762 YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRP10LE, gbrp10le, opt) \
763 YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRAP10LE, gbrap10le, opt) \
764 YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRP12LE, gbrp12le, opt) \
765 YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRAP12LE, gbrap12le, opt) \
766 YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRP14LE, gbrp14le, opt) \
767 YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRP16LE, gbrp16le, opt) \
768 YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRAP16LE, gbrap16le, opt) \
769 YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRPF32LE, gbrpf32le, opt) \
770 YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRAPF32LE, gbrapf32le, opt) \
771 YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRP9BE, gbrp9be, opt) \
772 YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRP10BE, gbrp10be, opt) \
773 YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRAP10BE, gbrap10be, opt) \
774 YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRP12BE, gbrp12be, opt) \
775 YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRAP12BE, gbrap12be, opt) \
776 YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRP14BE, gbrp14be, opt) \
777 YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRP16BE, gbrp16be, opt) \
778 YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRAP16BE, gbrap16be, opt) \
779 YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRPF32BE, gbrpf32be, opt) \
780 YUV2ANYX_FUNC_CASE(AV_PIX_FMT_GBRAPF32BE, gbrapf32be, opt)
783 switch (
c->dstFormat) {
784 YUV2ANYX_GBRAP_CASES(sse2)
791 switch (
c->dstFormat) {
792 YUV2ANYX_GBRAP_CASES(sse4)
799 switch (
c->dstFormat) {
800 YUV2ANYX_GBRAP_CASES(avx2)