| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2001-2003 Michael Niedermayer <michaelni@gmx.at> | 2 * Copyright (C) 2001-2003 Michael Niedermayer <michaelni@gmx.at> |
| 3 * | 3 * |
| 4 * This file is part of FFmpeg. | 4 * This file is part of FFmpeg. |
| 5 * | 5 * |
| 6 * FFmpeg is free software; you can redistribute it and/or | 6 * FFmpeg is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Lesser General Public | 7 * modify it under the terms of the GNU Lesser General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2.1 of the License, or (at your option) any later version. | 9 * version 2.1 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 ) | 378 ) |
| 379 #define isGray(x) ( \ | 379 #define isGray(x) ( \ |
| 380 (x)==PIX_FMT_GRAY8 \ | 380 (x)==PIX_FMT_GRAY8 \ |
| 381 || (x)==PIX_FMT_GRAY16BE \ | 381 || (x)==PIX_FMT_GRAY16BE \ |
| 382 || (x)==PIX_FMT_GRAY16LE \ | 382 || (x)==PIX_FMT_GRAY16LE \ |
| 383 ) | 383 ) |
| 384 #define isGray16(x) ( \ | 384 #define isGray16(x) ( \ |
| 385 (x)==PIX_FMT_GRAY16BE \ | 385 (x)==PIX_FMT_GRAY16BE \ |
| 386 || (x)==PIX_FMT_GRAY16LE \ | 386 || (x)==PIX_FMT_GRAY16LE \ |
| 387 ) | 387 ) |
| 388 #define isRGB(x) ( \ | 388 #define isRGBinInt(x) ( \ |
| 389 (x)==PIX_FMT_RGB48BE \ | 389 (x)==PIX_FMT_RGB48BE \ |
| 390 || (x)==PIX_FMT_RGB48LE \ | 390 || (x)==PIX_FMT_RGB48LE \ |
| 391 || (x)==PIX_FMT_RGB32 \ | 391 || (x)==PIX_FMT_RGB32 \ |
| 392 || (x)==PIX_FMT_RGB32_1 \ | 392 || (x)==PIX_FMT_RGB32_1 \ |
| 393 || (x)==PIX_FMT_RGB24 \ | 393 || (x)==PIX_FMT_RGB24 \ |
| 394 || (x)==PIX_FMT_RGB565 \ | 394 || (x)==PIX_FMT_RGB565BE \ |
| 395 || (x)==PIX_FMT_RGB555 \ | 395 || (x)==PIX_FMT_RGB565LE \ |
| 396 || (x)==PIX_FMT_RGB555BE \ |
| 397 || (x)==PIX_FMT_RGB555LE \ |
| 398 || (x)==PIX_FMT_RGB444BE \ |
| 399 || (x)==PIX_FMT_RGB444LE \ |
| 396 || (x)==PIX_FMT_RGB8 \ | 400 || (x)==PIX_FMT_RGB8 \ |
| 397 || (x)==PIX_FMT_RGB4 \ | 401 || (x)==PIX_FMT_RGB4 \ |
| 398 || (x)==PIX_FMT_RGB4_BYTE \ | 402 || (x)==PIX_FMT_RGB4_BYTE \ |
| 399 || (x)==PIX_FMT_MONOBLACK \ | 403 || (x)==PIX_FMT_MONOBLACK \ |
| 400 || (x)==PIX_FMT_MONOWHITE \ | 404 || (x)==PIX_FMT_MONOWHITE \ |
| 401 ) | 405 ) |
| 402 #define isBGR(x) ( \ | 406 #define isBGRinInt(x) ( \ |
| 403 (x)==PIX_FMT_BGR32 \ | 407 (x)==PIX_FMT_BGR32 \ |
| 404 || (x)==PIX_FMT_BGR32_1 \ | 408 || (x)==PIX_FMT_BGR32_1 \ |
| 405 || (x)==PIX_FMT_BGR24 \ | 409 || (x)==PIX_FMT_BGR24 \ |
| 406 || (x)==PIX_FMT_BGR565 \ | 410 || (x)==PIX_FMT_BGR565BE \ |
| 407 || (x)==PIX_FMT_BGR555 \ | 411 || (x)==PIX_FMT_BGR565LE \ |
| 412 || (x)==PIX_FMT_BGR555BE \ |
| 413 || (x)==PIX_FMT_BGR555LE \ |
| 414 || (x)==PIX_FMT_BGR444BE \ |
| 415 || (x)==PIX_FMT_BGR444LE \ |
| 408 || (x)==PIX_FMT_BGR8 \ | 416 || (x)==PIX_FMT_BGR8 \ |
| 409 || (x)==PIX_FMT_BGR4 \ | 417 || (x)==PIX_FMT_BGR4 \ |
| 410 || (x)==PIX_FMT_BGR4_BYTE \ | 418 || (x)==PIX_FMT_BGR4_BYTE \ |
| 411 || (x)==PIX_FMT_MONOBLACK \ | 419 || (x)==PIX_FMT_MONOBLACK \ |
| 412 || (x)==PIX_FMT_MONOWHITE \ | 420 || (x)==PIX_FMT_MONOWHITE \ |
| 413 ) | 421 ) |
| 422 #define isRGBinBytes(x) ( \ |
| 423 (x)==PIX_FMT_RGB48BE \ |
| 424 || (x)==PIX_FMT_RGB48LE \ |
| 425 || (x)==PIX_FMT_RGBA \ |
| 426 || (x)==PIX_FMT_ARGB \ |
| 427 || (x)==PIX_FMT_RGB24 \ |
| 428 ) |
| 429 #define isBGRinBytes(x) ( \ |
| 430 (x)==PIX_FMT_BGRA \ |
| 431 || (x)==PIX_FMT_ABGR \ |
| 432 || (x)==PIX_FMT_BGR24 \ |
| 433 ) |
| 434 #define isAnyRGB(x) ( \ |
| 435 isRGBinInt(x) \ |
| 436 || isBGRinInt(x) \ |
| 437 ) |
| 414 #define isALPHA(x) ( \ | 438 #define isALPHA(x) ( \ |
| 415 (x)==PIX_FMT_BGR32 \ | 439 (x)==PIX_FMT_BGR32 \ |
| 416 || (x)==PIX_FMT_BGR32_1 \ | 440 || (x)==PIX_FMT_BGR32_1 \ |
| 417 || (x)==PIX_FMT_RGB32 \ | 441 || (x)==PIX_FMT_RGB32 \ |
| 418 || (x)==PIX_FMT_RGB32_1 \ | 442 || (x)==PIX_FMT_RGB32_1 \ |
| 419 || (x)==PIX_FMT_YUVA420P \ | 443 || (x)==PIX_FMT_YUVA420P \ |
| 420 ) | 444 ) |
| 445 #define usePal(x) (av_pix_fmt_descriptors[x].flags & PIX_FMT_PAL) |
| 421 | 446 |
| 422 extern const uint64_t ff_dither4[2]; | 447 extern const uint64_t ff_dither4[2]; |
| 423 extern const uint64_t ff_dither8[2]; | 448 extern const uint64_t ff_dither8[2]; |
| 424 | 449 |
| 425 extern const AVClass sws_context_class; | 450 extern const AVClass sws_context_class; |
| 426 | 451 |
| 427 /** | 452 /** |
| 428 * Sets c->swScale to an unscaled converter if one exists for the specific | 453 * Sets c->swScale to an unscaled converter if one exists for the specific |
| 429 * source and destination formats, bit depths, flags, etc. | 454 * source and destination formats, bit depths, flags, etc. |
| 430 */ | 455 */ |
| 431 void ff_get_unscaled_swscale(SwsContext *c); | 456 void ff_get_unscaled_swscale(SwsContext *c); |
| 432 | 457 |
| 433 /** | 458 /** |
| 434 * Returns the SWS_CPU_CAPS for the optimized code compiled into swscale. | 459 * Returns the SWS_CPU_CAPS for the optimized code compiled into swscale. |
| 435 */ | 460 */ |
| 436 int ff_hardcodedcpuflags(void); | 461 int ff_hardcodedcpuflags(void); |
| 437 | 462 |
| 438 /** | 463 /** |
| 439 * Returns function pointer to fastest main scaler path function depending | 464 * Returns function pointer to fastest main scaler path function depending |
| 440 * on architecture and available optimizations. | 465 * on architecture and available optimizations. |
| 441 */ | 466 */ |
| 442 SwsFunc ff_getSwsFunc(SwsContext *c); | 467 SwsFunc ff_getSwsFunc(SwsContext *c); |
| 443 | 468 |
| 444 #endif /* SWSCALE_SWSCALE_INTERNAL_H */ | 469 #endif /* SWSCALE_SWSCALE_INTERNAL_H */ |
| OLD | NEW |