00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef FFMPEG_SWSCALE_H
00022 #define FFMPEG_SWSCALE_H
00023
00024
00025
00026
00027
00028
00029
00030 #include "libavutil/avutil.h"
00031
00032 #define LIBSWSCALE_VERSION_MAJOR 0
00033 #define LIBSWSCALE_VERSION_MINOR 5
00034 #define LIBSWSCALE_VERSION_MICRO 1
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
00046
00047 #define SWS_FAST_BILINEAR 1
00048 #define SWS_BILINEAR 2
00049 #define SWS_BICUBIC 4
00050 #define SWS_X 8
00051 #define SWS_POINT 0x10
00052 #define SWS_AREA 0x20
00053 #define SWS_BICUBLIN 0x40
00054 #define SWS_GAUSS 0x80
00055 #define SWS_SINC 0x100
00056 #define SWS_LANCZOS 0x200
00057 #define SWS_SPLINE 0x400
00058
00059 #define SWS_SRC_V_CHR_DROP_MASK 0x30000
00060 #define SWS_SRC_V_CHR_DROP_SHIFT 16
00061
00062 #define SWS_PARAM_DEFAULT 123456
00063
00064 #define SWS_PRINT_INFO 0x1000
00065
00066
00067
00068 #define SWS_FULL_CHR_H_INT 0x2000
00069
00070 #define SWS_FULL_CHR_H_INP 0x4000
00071 #define SWS_DIRECT_BGR 0x8000
00072 #define SWS_ACCURATE_RND 0x40000
00073
00074 #define SWS_CPU_CAPS_MMX 0x80000000
00075 #define SWS_CPU_CAPS_MMX2 0x20000000
00076 #define SWS_CPU_CAPS_3DNOW 0x40000000
00077 #define SWS_CPU_CAPS_ALTIVEC 0x10000000
00078 #define SWS_CPU_CAPS_BFIN 0x01000000
00079
00080 #define SWS_MAX_REDUCE_CUTOFF 0.002
00081
00082 #define SWS_CS_ITU709 1
00083 #define SWS_CS_FCC 4
00084 #define SWS_CS_ITU601 5
00085 #define SWS_CS_ITU624 5
00086 #define SWS_CS_SMPTE170M 5
00087 #define SWS_CS_SMPTE240M 7
00088 #define SWS_CS_DEFAULT 5
00089
00090
00091
00092
00093
00094 typedef struct {
00095 double *coeff;
00096 int length;
00097 } SwsVector;
00098
00099
00100 typedef struct {
00101 SwsVector *lumH;
00102 SwsVector *lumV;
00103 SwsVector *chrH;
00104 SwsVector *chrV;
00105 } SwsFilter;
00106
00107 struct SwsContext;
00108
00109 void sws_freeContext(struct SwsContext *swsContext);
00110
00111 struct SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags,
00112 SwsFilter *srcFilter, SwsFilter *dstFilter, double *param);
00113 int sws_scale(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
00114 int srcSliceH, uint8_t* dst[], int dstStride[]);
00115 int sws_scale_ordered(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
00116 int srcSliceH, uint8_t* dst[], int dstStride[]) attribute_deprecated;
00117
00118
00119 int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], int srcRange, const int table[4], int dstRange, int brightness, int contrast, int saturation);
00120 int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table, int *srcRange, int **table, int *dstRange, int *brightness, int *contrast, int *saturation);
00121 SwsVector *sws_getGaussianVec(double variance, double quality);
00122 SwsVector *sws_getConstVec(double c, int length);
00123 SwsVector *sws_getIdentityVec(void);
00124 void sws_scaleVec(SwsVector *a, double scalar);
00125 void sws_normalizeVec(SwsVector *a, double height);
00126 void sws_convVec(SwsVector *a, SwsVector *b);
00127 void sws_addVec(SwsVector *a, SwsVector *b);
00128 void sws_subVec(SwsVector *a, SwsVector *b);
00129 void sws_shiftVec(SwsVector *a, int shift);
00130 SwsVector *sws_cloneVec(SwsVector *a);
00131
00132 void sws_printVec(SwsVector *a);
00133 void sws_freeVec(SwsVector *a);
00134
00135 SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
00136 float lumaSarpen, float chromaSharpen,
00137 float chromaHShift, float chromaVShift,
00138 int verbose);
00139 void sws_freeFilter(SwsFilter *filter);
00140
00141 struct SwsContext *sws_getCachedContext(struct SwsContext *context,
00142 int srcW, int srcH, int srcFormat,
00143 int dstW, int dstH, int dstFormat, int flags,
00144 SwsFilter *srcFilter, SwsFilter *dstFilter, double *param);
00145
00146 #endif