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
00035 #include <stdint.h>
00036
00037 #include "libavutil/avutil.h"
00038 #include "libavutil/log.h"
00039 #include "libavutil/pixfmt.h"
00040 #include "version.h"
00041
00045 unsigned swscale_version(void);
00046
00050 const char *swscale_configuration(void);
00051
00055 const char *swscale_license(void);
00056
00057
00058 #define SWS_FAST_BILINEAR 1
00059 #define SWS_BILINEAR 2
00060 #define SWS_BICUBIC 4
00061 #define SWS_X 8
00062 #define SWS_POINT 0x10
00063 #define SWS_AREA 0x20
00064 #define SWS_BICUBLIN 0x40
00065 #define SWS_GAUSS 0x80
00066 #define SWS_SINC 0x100
00067 #define SWS_LANCZOS 0x200
00068 #define SWS_SPLINE 0x400
00069
00070 #define SWS_SRC_V_CHR_DROP_MASK 0x30000
00071 #define SWS_SRC_V_CHR_DROP_SHIFT 16
00072
00073 #define SWS_PARAM_DEFAULT 123456
00074
00075 #define SWS_PRINT_INFO 0x1000
00076
00077
00078
00079 #define SWS_FULL_CHR_H_INT 0x2000
00080
00081 #define SWS_FULL_CHR_H_INP 0x4000
00082 #define SWS_DIRECT_BGR 0x8000
00083 #define SWS_ACCURATE_RND 0x40000
00084 #define SWS_BITEXACT 0x80000
00085
00086 #if FF_API_SWS_CPU_CAPS
00087
00091 #define SWS_CPU_CAPS_MMX 0x80000000
00092 #define SWS_CPU_CAPS_MMXEXT 0x20000000
00093 #define SWS_CPU_CAPS_MMX2 0x20000000
00094 #define SWS_CPU_CAPS_3DNOW 0x40000000
00095 #define SWS_CPU_CAPS_ALTIVEC 0x10000000
00096 #define SWS_CPU_CAPS_BFIN 0x01000000
00097 #define SWS_CPU_CAPS_SSE2 0x02000000
00098 #endif
00099
00100 #define SWS_MAX_REDUCE_CUTOFF 0.002
00101
00102 #define SWS_CS_ITU709 1
00103 #define SWS_CS_FCC 4
00104 #define SWS_CS_ITU601 5
00105 #define SWS_CS_ITU624 5
00106 #define SWS_CS_SMPTE170M 5
00107 #define SWS_CS_SMPTE240M 7
00108 #define SWS_CS_DEFAULT 5
00109
00117 const int *sws_getCoefficients(int colorspace);
00118
00119
00120
00121 typedef struct SwsVector {
00122 double *coeff;
00123 int length;
00124 } SwsVector;
00125
00126
00127 typedef struct SwsFilter {
00128 SwsVector *lumH;
00129 SwsVector *lumV;
00130 SwsVector *chrH;
00131 SwsVector *chrV;
00132 } SwsFilter;
00133
00134 struct SwsContext;
00135
00140 int sws_isSupportedInput(enum AVPixelFormat pix_fmt);
00141
00146 int sws_isSupportedOutput(enum AVPixelFormat pix_fmt);
00147
00153 struct SwsContext *sws_alloc_context(void);
00154
00161 int sws_init_context(struct SwsContext *sws_context, SwsFilter *srcFilter, SwsFilter *dstFilter);
00162
00167 void sws_freeContext(struct SwsContext *swsContext);
00168
00169 #if FF_API_SWS_GETCONTEXT
00170
00186 struct SwsContext *sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat,
00187 int dstW, int dstH, enum AVPixelFormat dstFormat,
00188 int flags, SwsFilter *srcFilter,
00189 SwsFilter *dstFilter, const double *param);
00190 #endif
00191
00218 int sws_scale(struct SwsContext *c, const uint8_t *const srcSlice[],
00219 const int srcStride[], int srcSliceY, int srcSliceH,
00220 uint8_t *const dst[], const int dstStride[]);
00221
00232 int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
00233 int srcRange, const int table[4], int dstRange,
00234 int brightness, int contrast, int saturation);
00235
00239 int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table,
00240 int *srcRange, int **table, int *dstRange,
00241 int *brightness, int *contrast, int *saturation);
00242
00246 SwsVector *sws_allocVec(int length);
00247
00252 SwsVector *sws_getGaussianVec(double variance, double quality);
00253
00258 SwsVector *sws_getConstVec(double c, int length);
00259
00264 SwsVector *sws_getIdentityVec(void);
00265
00269 void sws_scaleVec(SwsVector *a, double scalar);
00270
00274 void sws_normalizeVec(SwsVector *a, double height);
00275 void sws_convVec(SwsVector *a, SwsVector *b);
00276 void sws_addVec(SwsVector *a, SwsVector *b);
00277 void sws_subVec(SwsVector *a, SwsVector *b);
00278 void sws_shiftVec(SwsVector *a, int shift);
00279
00284 SwsVector *sws_cloneVec(SwsVector *a);
00285
00290 void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level);
00291
00292 void sws_freeVec(SwsVector *a);
00293
00294 SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
00295 float lumaSharpen, float chromaSharpen,
00296 float chromaHShift, float chromaVShift,
00297 int verbose);
00298 void sws_freeFilter(SwsFilter *filter);
00299
00312 struct SwsContext *sws_getCachedContext(struct SwsContext *context,
00313 int srcW, int srcH, enum AVPixelFormat srcFormat,
00314 int dstW, int dstH, enum AVPixelFormat dstFormat,
00315 int flags, SwsFilter *srcFilter,
00316 SwsFilter *dstFilter, const double *param);
00317
00328 void sws_convertPalette8ToPacked32(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette);
00329
00340 void sws_convertPalette8ToPacked24(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette);
00341
00348 const AVClass *sws_get_class(void);
00349
00354 #endif