22#ifndef SWSCALE_SWSCALE_H
23#define SWSCALE_SWSCALE_H
38#ifndef HAVE_AV_CONFIG_H
362#define SWS_SRC_V_CHR_DROP_MASK 0x30000
363#define SWS_SRC_V_CHR_DROP_SHIFT 16
365#define SWS_PARAM_DEFAULT 123456
367#define SWS_MAX_REDUCE_CUTOFF 0.002
369#define SWS_CS_ITU709 1
371#define SWS_CS_ITU601 5
372#define SWS_CS_ITU624 5
373#define SWS_CS_SMPTE170M 5
374#define SWS_CS_SMPTE240M 7
375#define SWS_CS_DEFAULT 5
376#define SWS_CS_BT2020 9
465 SwsFilter *dstFilter,
const double *param);
495 const int srcStride[],
int srcSliceY,
int srcSliceH,
496 uint8_t *
const dst[],
const int dstStride[]);
550 unsigned int slice_height);
570 unsigned int slice_height);
597 int srcRange,
const int table[4],
int dstRange,
598 int brightness,
int contrast,
int saturation);
605 int *srcRange,
int **table,
int *dstRange,
606 int *brightness,
int *contrast,
int *saturation);
632 float lumaSharpen,
float chromaSharpen,
633 float chromaHShift,
float chromaVShift,
653 const double *param);
#define av_warn_unused_result
Convenience header that includes libavutil's core.
static enum AVPixelFormat pix_fmt
reference-counted frame API
int sws_test_transfer(enum AVColorTransferCharacteristic trc, int output)
Test if a given color transfer function is supported.
void sws_freeFilter(SwsFilter *filter)
int sws_receive_slice(SwsContext *c, 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...
int sws_getColorspaceDetails(SwsContext *c, int **inv_table, int *srcRange, int **table, int *dstRange, int *brightness, int *contrast, int *saturation)
av_warn_unused_result int sws_init_context(SwsContext *sws_context, SwsFilter *srcFilter, SwsFilter *dstFilter)
Initialize the swscaler context sws_context.
int sws_test_colorspace(enum AVColorSpace colorspace, int output)
Test if a given color space is supported.
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.
int sws_scale_frame(SwsContext *c, AVFrame *dst, const AVFrame *src)
Scale source data from src and write the output to dst.
int sws_send_slice(SwsContext *c, unsigned int slice_start, unsigned int slice_height)
Indicate that a horizontal slice of input data is available in the source frame previously provided t...
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.
int sws_test_primaries(enum AVColorPrimaries primaries, int output)
Test if a given set of color primaries is supported.
int sws_is_noop(const AVFrame *dst, const AVFrame *src)
Check if a given conversion is a noop.
void sws_freeVec(SwsVector *a)
const char * swscale_license(void)
Return the libswscale license.
SwsFilter * sws_getDefaultFilter(float lumaGBlur, float chromaGBlur, float lumaSharpen, float chromaSharpen, float chromaHShift, float chromaVShift, int verbose)
int sws_isSupportedEndiannessConversion(enum AVPixelFormat pix_fmt)
int sws_isSupportedOutput(enum AVPixelFormat pix_fmt)
Return a positive value if pix_fmt is a supported output format, 0 otherwise.
SwsContext * sws_alloc_context(void)
Allocate an empty SwsContext and set its fields to default values.
unsigned int sws_receive_slice_alignment(const SwsContext *c)
Get the alignment required for slices.
void sws_free_context(SwsContext **ctx)
Free the context and everything associated with it, and write NULL to the provided pointer.
SwsVector * sws_allocVec(int length)
Allocate and return an uninitialized vector with length coefficients.
SwsVector * sws_getGaussianVec(double variance, double quality)
Return a normalized Gaussian curve used to filter stuff quality = 3 is high quality,...
const int * sws_getCoefficients(int colorspace)
Return a pointer to yuv<->rgb coefficients for the given colorspace suitable for sws_setColorspaceDet...
SwsContext * sws_getCachedContext(SwsContext *context, int srcW, int srcH, enum AVPixelFormat srcFormat, int dstW, int dstH, enum AVPixelFormat dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param)
Check if context can be reused, otherwise reallocate a new one.
const AVClass * sws_get_class(void)
Get the AVClass for SwsContext.
int sws_scale(SwsContext *c, const uint8_t *const srcSlice[], const int srcStride[], int srcSliceY, int srcSliceH, uint8_t *const dst[], const int dstStride[])
Scale the image slice in srcSlice and put the resulting scaled slice in the image in dst.
int sws_test_frame(const AVFrame *frame, int output)
Helper function to run all sws_test_* against a frame, as well as testing the basic frame properties ...
const char * swscale_configuration(void)
Return the libswscale build-time configuration.
void sws_normalizeVec(SwsVector *a, double height)
Scale all the coefficients of a so that their sum equals height.
int sws_isSupportedInput(enum AVPixelFormat pix_fmt)
Return a positive value if pix_fmt is a supported input format, 0 otherwise.
int sws_test_format(enum AVPixelFormat format, int output)
Test if a given pixel format is supported.
int sws_frame_setup(SwsContext *ctx, const AVFrame *dst, const AVFrame *src)
Like sws_scale_frame, but without actually scaling.
unsigned swscale_version(void)
SwsContext * sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat, int dstW, int dstH, enum AVPixelFormat dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param)
Allocate and return an SwsContext.
void sws_frame_end(SwsContext *c)
Finish the scaling process for a pair of source/destination frames previously submitted with sws_fram...
void sws_freeContext(SwsContext *swsContext)
Free the swscaler context swsContext.
int sws_frame_start(SwsContext *c, AVFrame *dst, const AVFrame *src)
Initialize the scaling process for a given pair of source/destination frames.
void sws_scaleVec(SwsVector *a, double scalar)
Scale all the coefficients of a by the scalar value.
int sws_setColorspaceDetails(SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation)
@ SWS_INTENT_PERCEPTUAL
Perceptual tone mapping.
@ SWS_INTENT_ABSOLUTE_COLORIMETRIC
Absolute colorimetric clipping.
@ SWS_INTENT_RELATIVE_COLORIMETRIC
Relative colorimetric clipping.
@ SWS_INTENT_SATURATION
Saturation mapping.
@ SWS_INTENT_NB
not part of the ABI
@ SWS_ALPHA_BLEND_UNIFORM
@ SWS_ALPHA_BLEND_CHECKERBOARD
@ SWS_PRINT_INFO
Emit verbose log of scaling parameters.
@ SWS_SPLINE
cubic Keys spline
@ SWS_BICUBIC
2-tap cubic B-spline
@ SWS_STRICT
Return an error on underspecified conversions.
@ SWS_BICUBLIN
bicubic luma, bilinear chroma
@ SWS_ERROR_DIFFUSION
Set SwsContext.dither instead.
@ SWS_BILINEAR
bilinear filtering
@ SWS_FULL_CHR_H_INP
Perform full chroma interpolation when downscaling RGB sources.
@ SWS_SINC
unwindowed sinc
@ SWS_LANCZOS
3-tap sinc/sinc
@ SWS_DIRECT_BGR
Deprecated flags.
@ SWS_GAUSS
gaussian approximation
@ SWS_FAST_BILINEAR
Scaler selection options.
@ SWS_ACCURATE_RND
Force bit-exact output.
@ SWS_POINT
nearest neighbor
@ SWS_FULL_CHR_H_INT
Perform full chroma upsampling when upscaling to RGB.
AVPixelFormat
Pixel format.
AVColorPrimaries
Chromaticity coordinates of the source primaries.
AVColorTransferCharacteristic
Color Transfer Characteristic.
AVColorSpace
YUV colorspace type.
Describe the class of an AVClass context structure.
This structure describes decoded (raw) audio or video data.
Main external API structure.
int src_h
Width and height of the source frame.
int dst_format
Destination pixel format.
int intent
Desired ICC intent for color space conversions.
int gamma_flag
Use gamma correct scaling.
int threads
How many threads to use for processing, or 0 for automatic selection.
int dst_h
Width and height of the destination frame.
SwsAlphaBlend alpha_blend
Alpha blending mode.
int dst_h_chr_pos
Destination horizontal chroma position.
void * opaque
Private data of the user, can be used to carry app specific stuff.
int src_w
Deprecated frame property overrides, for the legacy API only.
int src_format
Source pixel format.
int src_v_chr_pos
Source vertical chroma position in luma grid / 256.
int dst_v_chr_pos
Destination vertical chroma position.
SwsDither dither
Dither mode.
int dst_range
Destination is full range.
double scaler_params[2]
Extra parameters for fine-tuning certain scalers.
unsigned flags
Bitmask of SWS_*.
int src_range
Source is full range.
int src_h_chr_pos
Source horizontal chroma position.
double * coeff
pointer to the list of coefficients
int length
number of coefficients in the vector