#define SWS_X 8
#define SWS_POINT 0x10
#define SWS_AREA 0x20
+#define SWS_BICUBLIN 0x40
+#define SWS_GAUSS 0x80
+#define SWS_SINC 0x100
+#define SWS_LANCZOS 0x200
+#define SWS_SPLINE 0x400
-//the following 4 flags are not completly implemented
+#define SWS_SRC_V_CHR_DROP_MASK 0x30000
+#define SWS_SRC_V_CHR_DROP_SHIFT 16
+
+#define SWS_PARAM_MASK 0x3FC0000
+#define SWS_PARAM_SHIFT 18
+
+#define SWS_PRINT_INFO 0x1000
+
+//the following 3 flags are not completly implemented
//internal chrominace subsamling info
-#define SWS_FULL_CHR_V 0x100
-#define SWS_FULL_CHR_H_INT 0x200
+#define SWS_FULL_CHR_H_INT 0x2000
//input subsampling info
-#define SWS_FULL_CHR_H_INP 0x400
-#define SWS_DIRECT_BGR 0x800
+#define SWS_FULL_CHR_H_INP 0x4000
+#define SWS_DIRECT_BGR 0x8000
-#define SWS_PRINT_INFO 0x1000
#define SWS_MAX_REDUCE_CUTOFF 0.002
/* this struct should be aligned on at least 32-byte boundary */
-typedef struct{
+typedef struct SwsContext{
int srcW, srcH, dstW, dstH;
int chrSrcW, chrSrcH, chrDstW, chrDstH;
int lumXInc, chrXInc;
int lumYInc, chrYInc;
int dstFormat, srcFormat;
+ int chrSrcHSubSample, chrSrcVSubSample;
+ int chrIntHSubSample, chrIntVSubSample;
+ int chrDstHSubSample, chrDstVSubSample;
+ int vChrDrop;
int16_t **lumPixBuf;
int16_t **chrPixBuf;
uint8_t __attribute__((aligned(32))) funnyYCode[10000];
uint8_t __attribute__((aligned(32))) funnyUVCode[10000];
+ int32_t *lumMmx2FilterPos;
+ int32_t *chrMmx2FilterPos;
+ int16_t *lumMmx2Filter;
+ int16_t *chrMmx2Filter;
int canMMX2BeUsed;
int chrBufIndex;
int dstY;
int flags;
+ void * yuvTable;
+ void * table_rV[256];
+ void * table_gU[256];
+ int table_gV[256];
+ void * table_bU[256];
+
+ void (*swScale)(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
+ int srcSliceH, uint8_t* dst[], int dstStride[]);
} SwsContext;
//FIXME check init (where 0)
SwsContext *getSwsContextFromCmdLine(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat);
SwsContext *getSwsContext(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags,
SwsFilter *srcFilter, SwsFilter *dstFilter);
-
-extern void (*swScale)(SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
- int srcSliceH, uint8_t* dst[], int dstStride[]);
+void swsGetFlagsAndFilterFromCmdLine(int *flags, SwsFilter **srcFilterParam, SwsFilter **dstFilterParam);
SwsVector *getGaussianVec(double variance, double quality);
SwsVector *getConstVec(double c, int length);