]> git.sesse.net Git - ffmpeg/blobdiff - postproc/swscale.h
using fewer registers (fixes compilation bug hopefully)
[ffmpeg] / postproc / swscale.h
index 1440745078870cc0ff21cfcf5d1d001f7b62fb7c..54f8c71ba0d9a46427d3c6377e23e22b41252b52 100644 (file)
 #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;
@@ -69,6 +84,10 @@ typedef struct{
 
        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;
 
@@ -78,6 +97,14 @@ typedef struct{
        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)
 
@@ -115,9 +142,7 @@ void freeSwsContext(SwsContext *swsContext);
 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);