00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef SWSCALE_SWSCALE_H
00022 #define SWSCALE_SWSCALE_H
00023
00030 #include "libavutil/avutil.h"
00031
00032 #define LIBSWSCALE_VERSION_MAJOR 0
00033 #define LIBSWSCALE_VERSION_MINOR 12
00034 #define LIBSWSCALE_VERSION_MICRO 0
00035
00036 #define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
00037 LIBSWSCALE_VERSION_MINOR, \
00038 LIBSWSCALE_VERSION_MICRO)
00039 #define LIBSWSCALE_VERSION AV_VERSION(LIBSWSCALE_VERSION_MAJOR, \
00040 LIBSWSCALE_VERSION_MINOR, \
00041 LIBSWSCALE_VERSION_MICRO)
00042 #define LIBSWSCALE_BUILD LIBSWSCALE_VERSION_INT
00043
00044 #define LIBSWSCALE_IDENT "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION)
00045
00050 #ifndef FF_API_SWS_GETCONTEXT
00051 #define FF_API_SWS_GETCONTEXT (LIBSWSCALE_VERSION_MAJOR < 1)
00052 #endif
00053
00057 unsigned swscale_version(void);
00058
00062 const char *swscale_configuration(void);
00063
00067 const char *swscale_license(void);
00068
00069
00070 #define SWS_FAST_BILINEAR 1
00071 #define SWS_BILINEAR 2
00072 #define SWS_BICUBIC 4
00073 #define SWS_X 8
00074 #define SWS_POINT 0x10
00075 #define SWS_AREA 0x20
00076 #define SWS_BICUBLIN 0x40
00077 #define SWS_GAUSS 0x80
00078 #define SWS_SINC 0x100
00079 #define SWS_LANCZOS 0x200
00080 #define SWS_SPLINE 0x400
00081
00082 #define SWS_SRC_V_CHR_DROP_MASK 0x30000
00083 #define SWS_SRC_V_CHR_DROP_SHIFT 16
00084
00085 #define SWS_PARAM_DEFAULT 123456
00086
00087 #define SWS_PRINT_INFO 0x1000
00088
00089
00090
00091 #define SWS_FULL_CHR_H_INT 0x2000
00092
00093 #define SWS_FULL_CHR_H_INP 0x4000
00094 #define SWS_DIRECT_BGR 0x8000
00095 #define SWS_ACCURATE_RND 0x40000
00096 #define SWS_BITEXACT 0x80000
00097
00098 #define SWS_CPU_CAPS_MMX 0x80000000
00099 #define SWS_CPU_CAPS_MMX2 0x20000000
00100 #define SWS_CPU_CAPS_3DNOW 0x40000000
00101 #define SWS_CPU_CAPS_ALTIVEC 0x10000000
00102 #define SWS_CPU_CAPS_BFIN 0x01000000
00103 #define SWS_CPU_CAPS_SSE2 0x02000000
00104
00105 #define SWS_MAX_REDUCE_CUTOFF 0.002
00106
00107 #define SWS_CS_ITU709 1
00108 #define SWS_CS_FCC 4
00109 #define SWS_CS_ITU601 5
00110 #define SWS_CS_ITU624 5
00111 #define SWS_CS_SMPTE170M 5
00112 #define SWS_CS_SMPTE240M 7
00113 #define SWS_CS_DEFAULT 5
00114
00122 const int *sws_getCoefficients(int colorspace);
00123
00124
00125
00126
00127 typedef struct {
00128 double *coeff;
00129 int length;
00130 } SwsVector;
00131
00132
00133 typedef struct {
00134 SwsVector *lumH;
00135 SwsVector *lumV;
00136 SwsVector *chrH;
00137 SwsVector *chrV;
00138 } SwsFilter;
00139
00140 struct SwsContext;
00141
00146 int sws_isSupportedInput(enum PixelFormat pix_fmt);
00147
00152 int sws_isSupportedOutput(enum PixelFormat pix_fmt);
00153
00159 struct SwsContext *sws_alloc_context(void);
00160
00167 int sws_init_context(struct SwsContext *sws_context, SwsFilter *srcFilter, SwsFilter *dstFilter);
00168
00173 void sws_freeContext(struct SwsContext *swsContext);
00174
00175 #if FF_API_SWS_GETCONTEXT
00176
00190 attribute_deprecated
00191 struct SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
00192 int dstW, int dstH, enum PixelFormat dstFormat,
00193 int flags, SwsFilter *srcFilter,
00194 SwsFilter *dstFilter, const double *param);
00195 #endif
00196
00223 int sws_scale(struct SwsContext *context, const uint8_t* const srcSlice[], const int srcStride[],
00224 int srcSliceY, int srcSliceH, uint8_t* const dst[], const int dstStride[]);
00225
00226 #if LIBSWSCALE_VERSION_MAJOR < 1
00227
00230 int sws_scale_ordered(struct SwsContext *context, const uint8_t* const src[],
00231 int srcStride[], int srcSliceY, int srcSliceH,
00232 uint8_t* dst[], int dstStride[]) attribute_deprecated;
00233 #endif
00234
00240 int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
00241 int srcRange, const int table[4], int dstRange,
00242 int brightness, int contrast, int saturation);
00243
00247 int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table,
00248 int *srcRange, int **table, int *dstRange,
00249 int *brightness, int *contrast, int *saturation);
00250
00254 SwsVector *sws_allocVec(int length);
00255
00260 SwsVector *sws_getGaussianVec(double variance, double quality);
00261
00266 SwsVector *sws_getConstVec(double c, int length);
00267
00272 SwsVector *sws_getIdentityVec(void);
00273
00277 void sws_scaleVec(SwsVector *a, double scalar);
00278
00282 void sws_normalizeVec(SwsVector *a, double height);
00283 void sws_convVec(SwsVector *a, SwsVector *b);
00284 void sws_addVec(SwsVector *a, SwsVector *b);
00285 void sws_subVec(SwsVector *a, SwsVector *b);
00286 void sws_shiftVec(SwsVector *a, int shift);
00287
00292 SwsVector *sws_cloneVec(SwsVector *a);
00293
00294 #if LIBSWSCALE_VERSION_MAJOR < 1
00295
00298 attribute_deprecated void sws_printVec(SwsVector *a);
00299 #endif
00300
00305 void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level);
00306
00307 void sws_freeVec(SwsVector *a);
00308
00309 SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
00310 float lumaSharpen, float chromaSharpen,
00311 float chromaHShift, float chromaVShift,
00312 int verbose);
00313 void sws_freeFilter(SwsFilter *filter);
00314
00328 struct SwsContext *sws_getCachedContext(struct SwsContext *context,
00329 int srcW, int srcH, enum PixelFormat srcFormat,
00330 int dstW, int dstH, enum PixelFormat dstFormat,
00331 int flags, SwsFilter *srcFilter,
00332 SwsFilter *dstFilter, const double *param);
00333
00344 void sws_convertPalette8ToPacked32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
00345
00356 void sws_convertPalette8ToPacked24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette);
00357
00358
00359 #endif