Libav
|
#include <inttypes.h>
#include <string.h>
#include <math.h>
#include <stdio.h>
#include "config.h"
#include <assert.h>
#include "swscale.h"
#include "swscale_internal.h"
#include "rgb2rgb.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/cpu.h"
#include "libavutil/avutil.h"
#include "libavutil/mathematics.h"
#include "libavutil/bswap.h"
#include "libavutil/pixdesc.h"
Go to the source code of this file.
Macros | |
#define | RGB2YUV_SHIFT 15 |
#define | BY ( (int) (0.114 * 219 / 255 * (1 << RGB2YUV_SHIFT) + 0.5)) |
#define | BV (-(int) (0.081 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5)) |
#define | BU ( (int) (0.500 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5)) |
#define | GY ( (int) (0.587 * 219 / 255 * (1 << RGB2YUV_SHIFT) + 0.5)) |
#define | GV (-(int) (0.419 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5)) |
#define | GU (-(int) (0.331 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5)) |
#define | RY ( (int) (0.299 * 219 / 255 * (1 << RGB2YUV_SHIFT) + 0.5)) |
#define | RV ( (int) (0.500 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5)) |
#define | RU (-(int) (0.169 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5)) |
#define | FILL8TO9_OR_10(wfunc) |
#define | isRGBA32(x) |
#define | IS_NOT_NE(bpp, desc) |
#define | CONV_IS(src, dst) (srcFormat == AV_PIX_FMT_##src && dstFormat == AV_PIX_FMT_##dst) |
#define | clip9(x) av_clip_uintp2(x, 9) |
#define | clip10(x) av_clip_uintp2(x, 10) |
#define | DITHER_COPY(dst, dstStride, wfunc, src, srcStride, rfunc, dithers, shift, clip) |
#define | COPY9_OR_10TO16(rfunc, wfunc) |
#define | COPY9_OR_10TO9_OR_10(loop) |
#define | COPY9_OR_10TO9_OR_10_2(rfunc, wfunc) |
#define | W8(a, b) { *(a) = (b); } |
#define | COPY9_OR_10TO8(rfunc) |
#define | COPY16TO9_OR_10(rfunc, wfunc) |
#define | COPY8TO9_OR_10(wfunc) |
#define | COPY16TO8(rfunc) |
#define | IS_DIFFERENT_ENDIANESS(src_fmt, dst_fmt, pix_fmt) |
#define | isByteRGB(f) |
Typedefs | |
typedef void(* | rgbConvFn )(const uint8_t *, uint8_t *, int) |
Functions | |
static void | fillPlane (uint8_t *plane, int stride, int width, int height, int y, uint8_t val) |
static void | fill_plane9or10 (uint8_t *plane, int stride, int width, int height, int y, uint8_t val, const int dst_depth, const int big_endian) |
static void | copyPlane (const uint8_t *src, int srcStride, int srcSliceY, int srcSliceH, int width, uint8_t *dst, int dstStride) |
static int | planarToNv12Wrapper (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dstParam[], int dstStride[]) |
static int | nv12ToPlanarWrapper (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dstParam[], int dstStride[]) |
static int | planarToYuy2Wrapper (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dstParam[], int dstStride[]) |
static int | planarToUyvyWrapper (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dstParam[], int dstStride[]) |
static int | yuv422pToYuy2Wrapper (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dstParam[], int dstStride[]) |
static int | yuv422pToUyvyWrapper (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dstParam[], int dstStride[]) |
static int | yuyvToYuv420Wrapper (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dstParam[], int dstStride[]) |
static int | yuyvToYuv422Wrapper (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dstParam[], int dstStride[]) |
static int | uyvyToYuv420Wrapper (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dstParam[], int dstStride[]) |
static int | uyvyToYuv422Wrapper (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dstParam[], int dstStride[]) |
static void | gray8aToPacked32 (const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette) |
static void | gray8aToPacked32_1 (const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette) |
static void | gray8aToPacked24 (const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette) |
static int | packed_16bpc_bswap (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]) |
static int | palToRgbWrapper (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]) |
static void | gbr24ptopacked24 (const uint8_t *src[], int srcStride[], uint8_t *dst, int dstStride, int srcSliceH, int width) |
static void | gbr24ptopacked32 (const uint8_t *src[], int srcStride[], uint8_t *dst, int dstStride, int srcSliceH, int alpha_first, int width) |
static int | planarRgbToRgbWrapper (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]) |
static void | packedtogbr24p (const uint8_t *src, int srcStride, uint8_t *dst[], int dstStride[], int srcSliceH, int alpha_first, int inc_size, int width) |
static int | rgbToPlanarRgbWrapper (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]) |
static rgbConvFn | findRgbConvFn (SwsContext *c) |
static int | rgbToRgbWrapper (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]) |
static int | bgr24ToYv12Wrapper (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]) |
static int | yvu9ToYv12Wrapper (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]) |
static int | packedCopyWrapper (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]) |
static int | planarCopyWrapper (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]) |
void | ff_get_unscaled_swscale (SwsContext *c) |
Set c->swscale to an unscaled converter if one exists for the specific source and destination formats, bit depths, flags, etc. | |
static void | reset_ptr (const uint8_t *src[], int format) |
static int | check_image_pointers (uint8_t *data[4], enum AVPixelFormat pix_fmt, const int linesizes[4]) |
int attribute_align_arg | sws_scale (struct SwsContext *c, const uint8_t *const srcSlice[], const int srcStride[], int srcSliceY, int srcSliceH, uint8_t *const dst[], const int dstStride[]) |
swscale wrapper, so we don't need to export the SwsContext. | |
void | sws_convertPalette8ToPacked32 (const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette) |
Convert an 8-bit paletted frame into a frame with a color depth of 32 bits. | |
void | sws_convertPalette8ToPacked24 (const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette) |
Convert an 8-bit paletted frame into a frame with a color depth of 24 bits. |
Variables | |
static const uint8_t | dither_8x8_1 [8][8] |
static const uint8_t | dither_8x8_3 [8][8] |
static const uint8_t | dither_8x8_64 [8][8] |
static const uint8_t | dither_8x8_256 [8][8] |
#define RGB2YUV_SHIFT 15 |
Definition at line 78 of file swscale_unscaled.c.
Referenced by sws_scale().
#define BY ( (int) (0.114 * 219 / 255 * (1 << RGB2YUV_SHIFT) + 0.5)) |
Definition at line 79 of file swscale_unscaled.c.
Referenced by sws_scale().
#define BV (-(int) (0.081 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5)) |
Definition at line 80 of file swscale_unscaled.c.
Referenced by sws_scale().
#define BU ( (int) (0.500 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5)) |
Definition at line 81 of file swscale_unscaled.c.
Referenced by sws_scale().
#define GY ( (int) (0.587 * 219 / 255 * (1 << RGB2YUV_SHIFT) + 0.5)) |
Definition at line 82 of file swscale_unscaled.c.
Referenced by sws_scale().
#define GV (-(int) (0.419 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5)) |
Definition at line 83 of file swscale_unscaled.c.
Referenced by sws_scale().
#define GU (-(int) (0.331 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5)) |
Definition at line 84 of file swscale_unscaled.c.
Referenced by sws_scale().
#define RY ( (int) (0.299 * 219 / 255 * (1 << RGB2YUV_SHIFT) + 0.5)) |
Definition at line 85 of file swscale_unscaled.c.
Referenced by sws_scale().
#define RV ( (int) (0.500 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5)) |
Definition at line 86 of file swscale_unscaled.c.
Referenced by sws_scale().
#define RU (-(int) (0.169 * 224 / 255 * (1 << RGB2YUV_SHIFT) + 0.5)) |
Definition at line 87 of file swscale_unscaled.c.
Referenced by sws_scale().
#define FILL8TO9_OR_10 | ( | wfunc | ) |
#define isRGBA32 | ( | x | ) |
Definition at line 565 of file swscale_unscaled.c.
Referenced by findRgbConvFn(), and rgbToRgbWrapper().
#define IS_NOT_NE | ( | bpp, | |
desc | |||
) |
Referenced by findRgbConvFn().
#define CONV_IS | ( | src, | |
dst | |||
) | (srcFormat == AV_PIX_FMT_##src && dstFormat == AV_PIX_FMT_##dst) |
Referenced by findRgbConvFn().
#define clip9 | ( | x | ) | av_clip_uintp2(x, 9) |
Definition at line 755 of file swscale_unscaled.c.
#define clip10 | ( | x | ) | av_clip_uintp2(x, 10) |
Definition at line 756 of file swscale_unscaled.c.
#define DITHER_COPY | ( | dst, | |
dstStride, | |||
wfunc, | |||
src, | |||
srcStride, | |||
rfunc, | |||
dithers, | |||
shift, | |||
clip | |||
) |
Definition at line 757 of file swscale_unscaled.c.
#define COPY9_OR_10TO16 | ( | rfunc, | |
wfunc | |||
) |
Referenced by planarCopyWrapper().
#define COPY9_OR_10TO9_OR_10 | ( | loop | ) |
#define COPY9_OR_10TO9_OR_10_2 | ( | rfunc, | |
wfunc | |||
) |
Referenced by planarCopyWrapper().
#define COPY9_OR_10TO8 | ( | rfunc | ) |
Referenced by planarCopyWrapper().
#define COPY16TO9_OR_10 | ( | rfunc, | |
wfunc | |||
) |
Referenced by planarCopyWrapper().
#define COPY8TO9_OR_10 | ( | wfunc | ) |
Referenced by planarCopyWrapper().
#define COPY16TO8 | ( | rfunc | ) |
Referenced by planarCopyWrapper().
#define IS_DIFFERENT_ENDIANESS | ( | src_fmt, | |
dst_fmt, | |||
pix_fmt | |||
) |
#define isByteRGB | ( | f | ) |
Referenced by ff_get_unscaled_swscale().
Definition at line 573 of file swscale_unscaled.c.
|
static |
Definition at line 89 of file swscale_unscaled.c.
Referenced by bgr24ToYv12Wrapper(), planarCopyWrapper(), uyvyToYuv420Wrapper(), yuyvToYuv420Wrapper(), and yvu9ToYv12Wrapper().
|
static |
Definition at line 100 of file swscale_unscaled.c.
Referenced by planarCopyWrapper().
|
static |
Definition at line 121 of file swscale_unscaled.c.
Referenced by nv12ToPlanarWrapper(), planarToNv12Wrapper(), and yvu9ToYv12Wrapper().
|
static |
Definition at line 138 of file swscale_unscaled.c.
Referenced by ff_get_unscaled_swscale().
|
static |
Definition at line 158 of file swscale_unscaled.c.
Referenced by ff_get_unscaled_swscale().
|
static |
Definition at line 179 of file swscale_unscaled.c.
Referenced by ff_get_unscaled_swscale().
|
static |
Definition at line 191 of file swscale_unscaled.c.
Referenced by ff_get_unscaled_swscale().
|
static |
Definition at line 203 of file swscale_unscaled.c.
Referenced by ff_get_unscaled_swscale().
|
static |
Definition at line 215 of file swscale_unscaled.c.
Referenced by ff_get_unscaled_swscale().
|
static |
Definition at line 227 of file swscale_unscaled.c.
Referenced by ff_get_unscaled_swscale().
|
static |
Definition at line 244 of file swscale_unscaled.c.
Referenced by ff_get_unscaled_swscale().
|
static |
Definition at line 258 of file swscale_unscaled.c.
Referenced by ff_get_unscaled_swscale().
|
static |
Definition at line 275 of file swscale_unscaled.c.
Referenced by ff_get_unscaled_swscale().
|
static |
Definition at line 289 of file swscale_unscaled.c.
Referenced by palToRgbWrapper().
|
static |
Definition at line 297 of file swscale_unscaled.c.
Referenced by palToRgbWrapper().
|
static |
Definition at line 306 of file swscale_unscaled.c.
Referenced by palToRgbWrapper().
|
static |
Definition at line 320 of file swscale_unscaled.c.
Referenced by ff_get_unscaled_swscale().
|
static |
Definition at line 342 of file swscale_unscaled.c.
Referenced by ff_get_unscaled_swscale().
|
static |
Definition at line 388 of file swscale_unscaled.c.
Referenced by planarRgbToRgbWrapper().
|
static |
Definition at line 406 of file swscale_unscaled.c.
Referenced by planarRgbToRgbWrapper().
|
static |
Definition at line 435 of file swscale_unscaled.c.
Referenced by ff_get_unscaled_swscale().
|
static |
Definition at line 491 of file swscale_unscaled.c.
Referenced by rgbToPlanarRgbWrapper().
|
static |
Definition at line 520 of file swscale_unscaled.c.
Referenced by ff_get_unscaled_swscale().
|
static |
Definition at line 574 of file swscale_unscaled.c.
Referenced by ff_get_unscaled_swscale(), and rgbToRgbWrapper().
|
static |
Definition at line 652 of file swscale_unscaled.c.
Referenced by ff_get_unscaled_swscale().
|
static |
Definition at line 695 of file swscale_unscaled.c.
Referenced by ff_get_unscaled_swscale().
|
static |
Definition at line 711 of file swscale_unscaled.c.
Referenced by ff_get_unscaled_swscale().
|
static |
Definition at line 728 of file swscale_unscaled.c.
Referenced by ff_get_unscaled_swscale().
|
static |
Definition at line 776 of file swscale_unscaled.c.
Referenced by ff_get_unscaled_swscale().
void ff_get_unscaled_swscale | ( | SwsContext * | c | ) |
Set c->swscale to an unscaled converter if one exists for the specific source and destination formats, bit depths, flags, etc.
Definition at line 988 of file swscale_unscaled.c.
Referenced by sws_init_context().
Definition at line 1124 of file swscale_unscaled.c.
Referenced by sws_scale().
|
static |
Definition at line 1136 of file swscale_unscaled.c.
Referenced by sws_scale().
|
static |
Definition at line 37 of file swscale_unscaled.c.
|
static |
Definition at line 47 of file swscale_unscaled.c.
|
static |
Definition at line 57 of file swscale_unscaled.c.
|
static |
Definition at line 67 of file swscale_unscaled.c.