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 #include "libavutil/log.h"
00032 #include "libavutil/pixfmt.h"
00033
00034 #define LIBSWSCALE_VERSION_MAJOR 2
00035 #define LIBSWSCALE_VERSION_MINOR 1
00036 #define LIBSWSCALE_VERSION_MICRO 0
00037
00038 #define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
00039 LIBSWSCALE_VERSION_MINOR, \
00040 LIBSWSCALE_VERSION_MICRO)
00041 #define LIBSWSCALE_VERSION AV_VERSION(LIBSWSCALE_VERSION_MAJOR, \
00042 LIBSWSCALE_VERSION_MINOR, \
00043 LIBSWSCALE_VERSION_MICRO)
00044 #define LIBSWSCALE_BUILD LIBSWSCALE_VERSION_INT
00045
00046 #define LIBSWSCALE_IDENT "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION)
00047
00052 #ifndef FF_API_SWS_GETCONTEXT
00053 #define FF_API_SWS_GETCONTEXT (LIBSWSCALE_VERSION_MAJOR < 3)
00054 #endif
00055 #ifndef FF_API_SWS_CPU_CAPS
00056 #define FF_API_SWS_CPU_CAPS (LIBSWSCALE_VERSION_MAJOR < 3)
00057 #endif
00058
00062 unsigned swscale_version(void);
00063
00067 const char *swscale_configuration(void);
00068
00072 const char *swscale_license(void);
00073
00074
00075 #define SWS_FAST_BILINEAR 1
00076 #define SWS_BILINEAR 2
00077 #define SWS_BICUBIC 4
00078 #define SWS_X 8
00079 #define SWS_POINT 0x10
00080 #define SWS_AREA 0x20
00081 #define SWS_BICUBLIN 0x40
00082 #define SWS_GAUSS 0x80
00083 #define SWS_SINC 0x100
00084 #define SWS_LANCZOS 0x200
00085 #define SWS_SPLINE 0x400
00086
00087 #define SWS_SRC_V_CHR_DROP_MASK 0x30000
00088 #define SWS_SRC_V_CHR_DROP_SHIFT 16
00089
00090 #define SWS_PARAM_DEFAULT 123456
00091
00092 #define SWS_PRINT_INFO 0x1000
00093
00094
00095
00096 #define SWS_FULL_CHR_H_INT 0x2000
00097
00098 #define SWS_FULL_CHR_H_INP 0x4000
00099 #define SWS_DIRECT_BGR 0x8000
00100 #define SWS_ACCURATE_RND 0x40000
00101 #define SWS_BITEXACT 0x80000
00102
00103 #if FF_API_SWS_CPU_CAPS
00104
00108 #define SWS_CPU_CAPS_MMX 0x80000000
00109 #define SWS_CPU_CAPS_MMX2 0x20000000
00110 #define SWS_CPU_CAPS_3DNOW 0x40000000
00111 #define SWS_CPU_CAPS_ALTIVEC 0x10000000
00112 #define SWS_CPU_CAPS_BFIN 0x01000000
00113 #define SWS_CPU_CAPS_SSE2 0x02000000
00114 #endif
00115
00116 #define SWS_MAX_REDUCE_CUTOFF 0.002
00117
00118 #define SWS_CS_ITU709 1
00119 #define SWS_CS_FCC 4
00120 #define SWS_CS_ITU601 5
00121 #define SWS_CS_ITU624 5
00122 #define SWS_CS_SMPTE170M 5
00123 #define SWS_CS_SMPTE240M 7
00124 #define SWS_CS_DEFAULT 5
00125
00133 const int *sws_getCoefficients(int colorspace);
00134
00135
00136
00137 typedef struct {
00138 double *coeff;
00139 int length;
00140 } SwsVector;
00141
00142
00143 typedef struct {
00144 SwsVector *lumH;
00145 SwsVector *lumV;
00146 SwsVector *chrH;
00147 SwsVector *chrV;
00148 } SwsFilter;
00149
00150 struct SwsContext;
00151
00156 int sws_isSupportedInput(enum PixelFormat pix_fmt);
00157
00162 int sws_isSupportedOutput(enum PixelFormat pix_fmt);
00163
00169 struct SwsContext *sws_alloc_context(void);
00170
00177 int sws_init_context(struct SwsContext *sws_context, SwsFilter *srcFilter, SwsFilter *dstFilter);
00178
00183 void sws_freeContext(struct SwsContext *swsContext);
00184
00185 #if FF_API_SWS_GETCONTEXT
00186
00202 struct SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
00203 int dstW, int dstH, enum PixelFormat dstFormat,
00204 int flags, SwsFilter *srcFilter,
00205 SwsFilter *dstFilter, const double *param);
00206 #endif
00207
00234 int sws_scale(struct SwsContext *c, const uint8_t *const srcSlice[],
00235 const int srcStride[], int srcSliceY, int srcSliceH,
00236 uint8_t *const dst[], const int dstStride[]);
00237
00242 int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
00243 int srcRange, const int table[4], int dstRange,
00244 int brightness, int contrast, int saturation);
00245
00249 int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table,
00250 int *srcRange, int **table, int *dstRange,
00251 int *brightness, int *contrast, int *saturation);
00252
00256 SwsVector *sws_allocVec(int length);
00257
00262 SwsVector *sws_getGaussianVec(double variance, double quality);
00263
00268 SwsVector *sws_getConstVec(double c, int length);
00269
00274 SwsVector *sws_getIdentityVec(void);
00275
00279 void sws_scaleVec(SwsVector *a, double scalar);
00280
00284 void sws_normalizeVec(SwsVector *a, double height);
00285 void sws_convVec(SwsVector *a, SwsVector *b);
00286 void sws_addVec(SwsVector *a, SwsVector *b);
00287 void sws_subVec(SwsVector *a, SwsVector *b);
00288 void sws_shiftVec(SwsVector *a, int shift);
00289
00294 SwsVector *sws_cloneVec(SwsVector *a);
00295
00300 void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level);
00301
00302 void sws_freeVec(SwsVector *a);
00303
00304 SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
00305 float lumaSharpen, float chromaSharpen,
00306 float chromaHShift, float chromaVShift,
00307 int verbose);
00308 void sws_freeFilter(SwsFilter *filter);
00309
00322 struct SwsContext *sws_getCachedContext(struct SwsContext *context,
00323 int srcW, int srcH, enum PixelFormat srcFormat,
00324 int dstW, int dstH, enum PixelFormat dstFormat,
00325 int flags, SwsFilter *srcFilter,
00326 SwsFilter *dstFilter, const double *param);
00327
00338 void sws_convertPalette8ToPacked32(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette);
00339
00350 void sws_convertPalette8ToPacked24(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette);
00351
00358 const AVClass *sws_get_class(void);
00359
00360 #endif