FFmpeg
|
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include "libavutil/avutil.h"
#include "libavutil/bswap.h"
#include "libavutil/cpu.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "libavutil/pixdesc.h"
#include "libavutil/avassert.h"
#include "config.h"
#include "rgb2rgb.h"
#include "swscale.h"
#include "swscale_internal.h"
Go to the source code of this file.
Macros | |
#define | input_pixel(pos) (isBE(origin) ? AV_RB16(pos) : AV_RL16(pos)) |
#define | r ((origin == AV_PIX_FMT_BGR48BE || origin == AV_PIX_FMT_BGR48LE || origin == AV_PIX_FMT_BGRA64BE || origin == AV_PIX_FMT_BGRA64LE) ? b_r : r_b) |
#define | b ((origin == AV_PIX_FMT_BGR48BE || origin == AV_PIX_FMT_BGR48LE || origin == AV_PIX_FMT_BGRA64BE || origin == AV_PIX_FMT_BGRA64LE) ? r_b : b_r) |
#define | rgb64funcs(pattern, BE_LE, origin) |
#define | rgb48funcs(pattern, BE_LE, origin) |
#define | input_pixel(i) |
#define | rgb16_32_wrapper(fmt, name, shr, shg, shb, shp, maskr,maskg, maskb, rsh, gsh, bsh, S) |
#define | input_pixel(pos) (isBE(origin) ? AV_RB16(pos) : AV_RL16(pos)) |
#define | rdpx(src) is_be ? AV_RB16(src) : AV_RL16(src) |
#define | rgb9plus_planar_funcs_endian(nbits, endian_name, endian) |
#define | rgb9plus_planar_funcs(nbits) |
Functions | |
static av_always_inline void | rgb64ToY_c_template (uint16_t *dst, const uint16_t *src, int width, enum AVPixelFormat origin, int32_t *rgb2yuv) |
static av_always_inline void | rgb64ToUV_c_template (uint16_t *dstU, uint16_t *dstV, const uint16_t *src1, const uint16_t *src2, int width, enum AVPixelFormat origin, int32_t *rgb2yuv) |
static av_always_inline void | rgb64ToUV_half_c_template (uint16_t *dstU, uint16_t *dstV, const uint16_t *src1, const uint16_t *src2, int width, enum AVPixelFormat origin, int32_t *rgb2yuv) |
rgb64funcs (rgb64funcs(rgb, rgb64funcs(LE, AV_PIX_FMT_RGBA64LE) | |
static av_always_inline void | rgb48ToUV_c_template (uint16_t *dstU, uint16_t *dstV, const uint16_t *src1, const uint16_t *src2, int width, enum AVPixelFormat origin, int32_t *rgb2yuv) |
static av_always_inline void | rgb48ToUV_half_c_template (uint16_t *dstU, uint16_t *dstV, const uint16_t *src1, const uint16_t *src2, int width, enum AVPixelFormat origin, int32_t *rgb2yuv) |
rgb48funcs (rgb48funcs(rgb, rgb48funcs(LE, AV_PIX_FMT_RGB48LE) | |
static av_always_inline void | rgb16_32ToUV_c_template (int16_t *dstU, int16_t *dstV, const uint8_t *src, int width, enum AVPixelFormat origin, int shr, int shg, int shb, int shp, int maskr, int maskg, int maskb, int rsh, int gsh, int bsh, int S, int32_t *rgb2yuv) |
static av_always_inline void | rgb16_32ToUV_half_c_template (int16_t *dstU, int16_t *dstV, const uint8_t *src, int width, enum AVPixelFormat origin, int shr, int shg, int shb, int shp, int maskr, int maskg, int maskb, int rsh, int gsh, int bsh, int S, int32_t *rgb2yuv) |
rgb16_32_wrapper (AV_PIX_FMT_BGR32, bgr32, 16, 0, 0, 0, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8, RGB2YUV_SHIFT+8) rgb16_32_wrapper(AV_PIX_FMT_BGR32_1 | |
RGB2YUV_SHIFT | rgb16_32_wrapper (AV_PIX_FMT_RGB32, rgb32, 0, 0, 16, 0, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8, RGB2YUV_SHIFT+8) rgb16_32_wrapper(AV_PIX_FMT_RGB32_1 |
RGB2YUV_SHIFT RGB2YUV_SHIFT | rgb16_32_wrapper (AV_PIX_FMT_BGR565LE, bgr16le, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0, RGB2YUV_SHIFT+8) rgb16_32_wrapper(AV_PIX_FMT_BGR555LE |
RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT | rgb16_32_wrapper (AV_PIX_FMT_BGR444LE, bgr12le, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0, RGB2YUV_SHIFT+4) rgb16_32_wrapper(AV_PIX_FMT_RGB565LE |
RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT | rgb16_32_wrapper (AV_PIX_FMT_RGB555LE, rgb15le, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT+7) rgb16_32_wrapper(AV_PIX_FMT_RGB444LE |
RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT | rgb16_32_wrapper (AV_PIX_FMT_BGR565BE, bgr16be, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0, RGB2YUV_SHIFT+8) rgb16_32_wrapper(AV_PIX_FMT_BGR555BE |
RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT | rgb16_32_wrapper (AV_PIX_FMT_BGR444BE, bgr12be, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0, RGB2YUV_SHIFT+4) rgb16_32_wrapper(AV_PIX_FMT_RGB565BE |
RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT | rgb16_32_wrapper (AV_PIX_FMT_RGB555BE, rgb15be, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT+7) rgb16_32_wrapper(AV_PIX_FMT_RGB444BE |
RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT static RGB2YUV_SHIFT void | gbr24pToUV_half_c (uint8_t *_dstU, uint8_t *_dstV, const uint8_t *gsrc, const uint8_t *bsrc, const uint8_t *rsrc, int width, uint32_t *rgb2yuv) |
static void | rgba64ToA_c (uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused) |
static void | abgrToA_c (uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused) |
static void | rgbaToA_c (uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused) |
static void | palToA_c (uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *pal) |
static void | palToY_c (uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *pal) |
static void | palToUV_c (uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *pal) |
static void | monowhite2Y_c (uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused) |
static void | monoblack2Y_c (uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused) |
static void | yuy2ToY_c (uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused) |
static void | yuy2ToUV_c (uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused) |
static void | yvy2ToUV_c (uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused) |
static void | bswap16Y_c (uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused) |
static void | bswap16UV_c (uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *_src1, const uint8_t *_src2, int width, uint32_t *unused) |
static void | read_ya16le_gray_c (uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused) |
static void | read_ya16le_alpha_c (uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused) |
static void | read_ya16be_gray_c (uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused) |
static void | read_ya16be_alpha_c (uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused) |
static void | uyvyToY_c (uint8_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused) |
static void | uyvyToUV_c (uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused) |
static av_always_inline void | nvXXtoUV_c (uint8_t *dst1, uint8_t *dst2, const uint8_t *src, int width) |
static void | nv12ToUV_c (uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused) |
static void | nv21ToUV_c (uint8_t *dstU, uint8_t *dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *unused) |
static void | bgr24ToY_c (uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *rgb2yuv) |
static void | bgr24ToUV_c (uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *rgb2yuv) |
static void | bgr24ToUV_half_c (uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *rgb2yuv) |
static void | rgb24ToY_c (uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *rgb2yuv) |
static void | rgb24ToUV_c (uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *rgb2yuv) |
static void | rgb24ToUV_half_c (uint8_t *_dstU, uint8_t *_dstV, const uint8_t *unused0, const uint8_t *src1, const uint8_t *src2, int width, uint32_t *rgb2yuv) |
static void | planar_rgb_to_y (uint8_t *_dst, const uint8_t *src[4], int width, int32_t *rgb2yuv) |
static void | planar_rgb_to_a (uint8_t *_dst, const uint8_t *src[4], int width, int32_t *unused) |
static void | planar_rgb_to_uv (uint8_t *_dstU, uint8_t *_dstV, const uint8_t *src[4], int width, int32_t *rgb2yuv) |
static av_always_inline void | planar_rgb16_to_y (uint8_t *_dst, const uint8_t *_src[4], int width, int bpc, int is_be, int32_t *rgb2yuv) |
static av_always_inline void | planar_rgb16_to_uv (uint8_t *_dstU, uint8_t *_dstV, const uint8_t *_src[4], int width, int bpc, int is_be, int32_t *rgb2yuv) |
rgb9plus_planar_funcs (9) | |
Definition at line 645 of file input.c.
Referenced by rgb16_32ToUV_c_template(), rgb16_32ToUV_half_c_template(), rgb48funcs(), rgb48ToUV_c_template(), rgb48ToUV_half_c_template(), rgb64funcs(), rgb64ToUV_c_template(), rgb64ToUV_half_c_template(), and rgb64ToY_c_template().
#define r ((origin == AV_PIX_FMT_BGR48BE || origin == AV_PIX_FMT_BGR48LE || origin == AV_PIX_FMT_BGRA64BE || origin == AV_PIX_FMT_BGRA64LE) ? b_r : r_b) |
Definition at line 40 of file input.c.
Referenced by bgr24ToUV_c(), bgr24ToUV_half_c(), bgr24ToY_c(), gbr24pToUV_half_c(), planar_rgb16_to_uv(), planar_rgb16_to_y(), planar_rgb_to_uv(), planar_rgb_to_y(), rgb16_32ToUV_c_template(), rgb16_32ToUV_half_c_template(), rgb24ToUV_c(), rgb24ToUV_half_c(), rgb24ToY_c(), rgb48funcs(), rgb48ToUV_c_template(), rgb48ToUV_half_c_template(), rgb64funcs(), rgb64ToUV_c_template(), rgb64ToUV_half_c_template(), and rgb64ToY_c_template().
#define b ((origin == AV_PIX_FMT_BGR48BE || origin == AV_PIX_FMT_BGR48LE || origin == AV_PIX_FMT_BGRA64BE || origin == AV_PIX_FMT_BGRA64LE) ? r_b : b_r) |
Definition at line 41 of file input.c.
Referenced by bgr24ToUV_c(), bgr24ToUV_half_c(), bgr24ToY_c(), gbr24pToUV_half_c(), planar_rgb16_to_uv(), planar_rgb16_to_y(), planar_rgb_to_uv(), planar_rgb_to_y(), rgb16_32ToUV_c_template(), rgb16_32ToUV_half_c_template(), rgb24ToUV_c(), rgb24ToUV_half_c(), rgb24ToY_c(), rgb48funcs(), rgb48ToUV_c_template(), rgb48ToUV_half_c_template(), rgb64funcs(), rgb64ToUV_c_template(), rgb64ToUV_half_c_template(), and rgb64ToY_c_template().
#define rgb64funcs | ( | pattern, | |
BE_LE, | |||
origin | |||
) |
#define input_pixel | ( | i | ) |
Definition at line 792 of file input.c.
Referenced by planar_rgb16_to_uv(), and planar_rgb16_to_y().
#define rgb9plus_planar_funcs_endian | ( | nbits, | |
endian_name, | |||
endian | |||
) |
#define rgb9plus_planar_funcs | ( | nbits | ) |
|
static |
|
static |
|
static |
rgb64funcs | ( | rgb64funcs( | rgb, |
rgb64funcs( | LE, | ||
AV_PIX_FMT_RGBA64LE | |||
) |
|
static |
|
static |
rgb48funcs | ( | rgb48funcs( | rgb, |
rgb48funcs( | LE, | ||
AV_PIX_FMT_RGB48LE | |||
) |
|
static |
|
static |
rgb16_32_wrapper | ( | AV_PIX_FMT_BGR32 | , |
bgr32 | , | ||
16 | , | ||
0 | , | ||
0 | , | ||
0 | , | ||
0xFF0000 | , | ||
0xFF00 | , | ||
0x00FF | , | ||
8 | , | ||
0 | , | ||
8 | , | ||
RGB2YUV_SHIFT+ | 8 | ||
) |
RGB2YUV_SHIFT rgb16_32_wrapper | ( | AV_PIX_FMT_RGB32 | , |
rgb32 | , | ||
0 | , | ||
0 | , | ||
16 | , | ||
0 | , | ||
0x00FF | , | ||
0xFF00 | , | ||
0xFF0000 | , | ||
8 | , | ||
0 | , | ||
8 | , | ||
RGB2YUV_SHIFT+ | 8 | ||
) |
RGB2YUV_SHIFT RGB2YUV_SHIFT rgb16_32_wrapper | ( | AV_PIX_FMT_BGR565LE | , |
bgr16le | , | ||
0 | , | ||
0 | , | ||
0 | , | ||
0 | , | ||
0x001F | , | ||
0x07E0 | , | ||
0xF800 | , | ||
11 | , | ||
5 | , | ||
0 | , | ||
RGB2YUV_SHIFT+ | 8 | ||
) |
RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT rgb16_32_wrapper | ( | AV_PIX_FMT_BGR444LE | , |
bgr12le | , | ||
0 | , | ||
0 | , | ||
0 | , | ||
0 | , | ||
0x000F | , | ||
0x00F0 | , | ||
0x0F00 | , | ||
8 | , | ||
4 | , | ||
0 | , | ||
RGB2YUV_SHIFT+ | 4 | ||
) |
RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT rgb16_32_wrapper | ( | AV_PIX_FMT_RGB555LE | , |
rgb15le | , | ||
0 | , | ||
0 | , | ||
0 | , | ||
0 | , | ||
0x7C00 | , | ||
0x03E0 | , | ||
0x001F | , | ||
0 | , | ||
5 | , | ||
10 | , | ||
RGB2YUV_SHIFT+ | 7 | ||
) |
RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT rgb16_32_wrapper | ( | AV_PIX_FMT_BGR565BE | , |
bgr16be | , | ||
0 | , | ||
0 | , | ||
0 | , | ||
0 | , | ||
0x001F | , | ||
0x07E0 | , | ||
0xF800 | , | ||
11 | , | ||
5 | , | ||
0 | , | ||
RGB2YUV_SHIFT+ | 8 | ||
) |
RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT rgb16_32_wrapper | ( | AV_PIX_FMT_BGR444BE | , |
bgr12be | , | ||
0 | , | ||
0 | , | ||
0 | , | ||
0 | , | ||
0x000F | , | ||
0x00F0 | , | ||
0x0F00 | , | ||
8 | , | ||
4 | , | ||
0 | , | ||
RGB2YUV_SHIFT+ | 4 | ||
) |
RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT rgb16_32_wrapper | ( | AV_PIX_FMT_RGB555BE | , |
rgb15be | , | ||
0 | , | ||
0 | , | ||
0 | , | ||
0 | , | ||
0x7C00 | , | ||
0x03E0 | , | ||
0x001F | , | ||
0 | , | ||
5 | , | ||
10 | , | ||
RGB2YUV_SHIFT+ | 7 | ||
) |
|
static |
Definition at line 395 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 415 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 425 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 434 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 443 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 454 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 465 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 481 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 498 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 515 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 523 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 534 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 545 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 555 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 568 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 576 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 584 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 592 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 602 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 610 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 621 of file input.c.
Referenced by nv12ToUV_c(), and nv21ToUV_c().
|
static |
Definition at line 631 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 638 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 647 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 662 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 681 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 700 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 715 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 734 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 753 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 767 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
Definition at line 775 of file input.c.
Referenced by rgb9plus_planar_funcs().
|
static |
RGB2YUV_SHIFT rgb321 |
RGB2YUV_SHIFT RGB2YUV_SHIFT bgr15le |
RGB2YUV_SHIFT RGB2YUV_SHIFT RGB2YUV_SHIFT rgb16le |