FFmpeg
|
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include "libavutil/avassert.h"
#include "libavutil/bswap.h"
#include "libavutil/common.h"
#include "libavutil/cpu.h"
#include "libavutil/emms.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "libavutil/mem_internal.h"
#include "libavutil/pixdesc.h"
#include "config.h"
#include "swscale_internal.h"
#include "swscale.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_SWSCALE_BUFFERS 0 |
#define | DEBUG_BUFFERS(...) |
#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 | VALIDATE(field, min, max) |
Functions | |
static av_always_inline void | fillPlane (uint8_t *plane, int stride, int width, int height, int y, uint8_t val) |
static void | hScale16To19_c (SwsInternal *c, int16_t *_dst, int dstW, const uint8_t *_src, const int16_t *filter, const int32_t *filterPos, int filterSize) |
static void | hScale16To15_c (SwsInternal *c, int16_t *dst, int dstW, const uint8_t *_src, const int16_t *filter, const int32_t *filterPos, int filterSize) |
static void | hScale8To15_c (SwsInternal *c, int16_t *dst, int dstW, const uint8_t *src, const int16_t *filter, const int32_t *filterPos, int filterSize) |
static void | hScale8To19_c (SwsInternal *c, int16_t *_dst, int dstW, const uint8_t *src, const int16_t *filter, const int32_t *filterPos, int filterSize) |
static void | chrRangeToJpeg_c (int16_t *dstU, int16_t *dstV, int width, uint32_t _coeff, int64_t _offset) |
static void | chrRangeFromJpeg_c (int16_t *dstU, int16_t *dstV, int width, uint32_t _coeff, int64_t _offset) |
static void | lumRangeToJpeg_c (int16_t *dst, int width, uint32_t _coeff, int64_t _offset) |
static void | lumRangeFromJpeg_c (int16_t *dst, int width, uint32_t _coeff, int64_t _offset) |
static void | chrRangeToJpeg16_c (int16_t *_dstU, int16_t *_dstV, int width, uint32_t coeff, int64_t offset) |
static void | chrRangeFromJpeg16_c (int16_t *_dstU, int16_t *_dstV, int width, uint32_t coeff, int64_t offset) |
static void | lumRangeToJpeg16_c (int16_t *_dst, int width, uint32_t coeff, int64_t offset) |
static void | lumRangeFromJpeg16_c (int16_t *_dst, int width, uint32_t coeff, int64_t offset) |
int | ff_swscale (SwsInternal *c, const uint8_t *const src[], const int srcStride[], int srcSliceY, int srcSliceH, uint8_t *const dst[], const int dstStride[], int dstSliceY, int dstSliceH) |
static void | solve_range_convert (uint16_t src_min, uint16_t src_max, uint16_t dst_min, uint16_t dst_max, int src_bits, int src_shift, int mult_shift, uint32_t *coeff, int64_t *offset) |
static void | init_range_convert_constants (SwsInternal *c) |
av_cold void | ff_sws_init_range_convert (SwsInternal *c) |
static av_cold void | sws_init_swscale (SwsInternal *c) |
void | ff_sws_init_scale (SwsInternal *c) |
static void | reset_ptr (const uint8_t *src[], enum AVPixelFormat format) |
static int | check_image_pointers (const uint8_t *const data[4], enum AVPixelFormat pix_fmt, const int linesizes[4]) |
void | ff_xyz12Torgb48 (const SwsInternal *c, uint8_t *dst, int dst_stride, const uint8_t *src, int src_stride, int w, int h) |
void | ff_rgb48Toxyz12 (const SwsInternal *c, uint8_t *dst, int dst_stride, const uint8_t *src, int src_stride, int w, int h) |
void | ff_update_palette (SwsInternal *c, const uint32_t *pal) |
static int | scale_internal (SwsContext *sws, const uint8_t *const srcSlice[], const int srcStride[], int srcSliceY, int srcSliceH, uint8_t *const dstSlice[], const int dstStride[], int dstSliceY, int dstSliceH) |
static int | scale_gamma (SwsInternal *c, const uint8_t *const srcSlice[], const int srcStride[], int srcSliceY, int srcSliceH, uint8_t *const dstSlice[], const int dstStride[], int dstSliceY, int dstSliceH) |
static int | scale_cascaded (SwsInternal *c, const uint8_t *const srcSlice[], const int srcStride[], int srcSliceY, int srcSliceH, uint8_t *const dstSlice[], const int dstStride[], int dstSliceY, int dstSliceH) |
void | sws_frame_end (SwsContext *sws) |
Finish the scaling process for a pair of source/destination frames previously submitted with sws_frame_start(). More... | |
int | sws_frame_start (SwsContext *sws, AVFrame *dst, const AVFrame *src) |
Initialize the scaling process for a given pair of source/destination frames. More... | |
int | sws_send_slice (SwsContext *sws, unsigned int slice_start, unsigned int slice_height) |
Indicate that a horizontal slice of input data is available in the source frame previously provided to sws_frame_start(). More... | |
unsigned int | sws_receive_slice_alignment (const SwsContext *sws) |
Get the alignment required for slices. More... | |
int | sws_receive_slice (SwsContext *sws, unsigned int slice_start, unsigned int slice_height) |
Request a horizontal slice of the output data to be written into the frame previously provided to sws_frame_start(). More... | |
static void | get_frame_pointers (const AVFrame *frame, uint8_t *data[4], int linesize[4], int field) |
static int | frame_ref (AVFrame *dst, const AVFrame *src) |
int | sws_scale_frame (SwsContext *sws, AVFrame *dst, const AVFrame *src) |
Scale source data from src and write the output to dst . More... | |
static int | validate_params (SwsContext *ctx) |
int | sws_frame_setup (SwsContext *ctx, const AVFrame *dst, const AVFrame *src) |
Like sws_scale_frame , but without actually scaling. More... | |
int attribute_align_arg | sws_scale (SwsContext *sws, 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. More... | |
void | ff_sws_slice_worker (void *priv, int jobnr, int threadnr, int nb_jobs, int nb_threads) |
Variables | |
const uint8_t | ff_dither_8x8_128 [9][8] |
static const uint8_t | sws_pb_64 [8] |
#define DEBUG_BUFFERS | ( | ... | ) |
#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)) |
|
static |
Definition at line 54 of file swscale.c.
Referenced by ff_swscale().
|
static |
Definition at line 65 of file swscale.c.
Referenced by sws_init_swscale().
|
static |
Definition at line 95 of file swscale.c.
Referenced by sws_init_swscale().
|
static |
Definition at line 124 of file swscale.c.
Referenced by sws_init_swscale().
|
static |
Definition at line 140 of file swscale.c.
Referenced by sws_init_swscale().
|
static |
Definition at line 159 of file swscale.c.
Referenced by ff_sws_init_range_convert().
|
static |
Definition at line 173 of file swscale.c.
Referenced by ff_sws_init_range_convert().
|
static |
Definition at line 185 of file swscale.c.
Referenced by ff_sws_init_range_convert().
|
static |
Definition at line 197 of file swscale.c.
Referenced by ff_sws_init_range_convert().
|
static |
Definition at line 207 of file swscale.c.
Referenced by ff_sws_init_range_convert().
|
static |
Definition at line 221 of file swscale.c.
Referenced by ff_sws_init_range_convert().
|
static |
Definition at line 233 of file swscale.c.
Referenced by ff_sws_init_range_convert().
|
static |
Definition at line 244 of file swscale.c.
Referenced by ff_sws_init_range_convert().
int ff_swscale | ( | SwsInternal * | c, |
const uint8_t *const | src[], | ||
const int | srcStride[], | ||
int | srcSliceY, | ||
int | srcSliceH, | ||
uint8_t *const | dst[], | ||
const int | dstStride[], | ||
int | dstSliceY, | ||
int | dstSliceH | ||
) |
Definition at line 259 of file swscale.c.
Referenced by run_legacy_swscale(), and scale_internal().
|
static |
Definition at line 574 of file swscale.c.
Referenced by init_range_convert_constants().
|
static |
Definition at line 587 of file swscale.c.
Referenced by ff_sws_init_range_convert().
av_cold void ff_sws_init_range_convert | ( | SwsInternal * | c | ) |
Definition at line 622 of file swscale.c.
Referenced by sws_init_swscale(), and sws_setColorspaceDetails().
|
static |
Definition at line 658 of file swscale.c.
Referenced by ff_sws_init_scale().
void ff_sws_init_scale | ( | SwsInternal * | c | ) |
Definition at line 691 of file swscale.c.
Referenced by check_chrConvertRange(), check_hscale(), check_input_planar_rgb_to_a(), check_input_planar_rgb_to_uv(), check_input_planar_rgb_to_y(), check_lumConvertRange(), check_output_yuv2gbrp(), check_rgb_to_uv(), check_rgb_to_y(), check_yuv2yuv1(), check_yuv2yuvX(), and ff_sws_init_single_context().
|
static |
Definition at line 710 of file swscale.c.
Referenced by scale_internal().
|
static |
Definition at line 722 of file swscale.c.
Referenced by scale_internal().
void ff_xyz12Torgb48 | ( | const SwsInternal * | c, |
uint8_t * | dst, | ||
int | dst_stride, | ||
const uint8_t * | src, | ||
int | src_stride, | ||
int | w, | ||
int | h | ||
) |
Definition at line 739 of file swscale.c.
Referenced by run_xyz2rgb(), and scale_internal().
void ff_rgb48Toxyz12 | ( | const SwsInternal * | c, |
uint8_t * | dst, | ||
int | dst_stride, | ||
const uint8_t * | src, | ||
int | src_stride, | ||
int | w, | ||
int | h | ||
) |
Definition at line 798 of file swscale.c.
Referenced by run_rgb2xyz(), and scale_internal().
void ff_update_palette | ( | SwsInternal * | c, |
const uint32_t * | pal | ||
) |
Definition at line 857 of file swscale.c.
Referenced by scale_internal(), and setup_legacy_swscale().
|
static |
Definition at line 991 of file swscale.c.
Referenced by ff_sws_slice_worker(), scale_cascaded(), scale_gamma(), sws_receive_slice(), and sws_scale().
|
static |
Definition at line 938 of file swscale.c.
Referenced by scale_internal().
|
static |
Definition at line 972 of file swscale.c.
Referenced by scale_internal().
|
static |
Definition at line 1302 of file swscale.c.
Referenced by sws_scale_frame().
Definition at line 1331 of file swscale.c.
Referenced by sws_scale_frame().
|
static |
Definition at line 1408 of file swscale.c.
Referenced by sws_frame_setup().
void ff_sws_slice_worker | ( | void * | priv, |
int | jobnr, | ||
int | threadnr, | ||
int | nb_jobs, | ||
int | nb_threads | ||
) |
Definition at line 1523 of file swscale.c.
Referenced by context_init_threaded().
const uint8_t ff_dither_8x8_128[9][8] |
Definition at line 38 of file swscale.c.
Referenced by ff_swscale().
|
static |
Definition at line 50 of file swscale.c.
Referenced by ff_swscale().