]> git.sesse.net Git - ffmpeg/blobdiff - postproc/swscale.c
fixing "internal error in orderYUV" bug
[ffmpeg] / postproc / swscale.c
index c5319f9bd1e9d03654ffbba1e5f51bf2383a2728..b0dac620b4589725b765a31950aef0e96d581518 100644 (file)
@@ -68,14 +68,6 @@ untested special converters
 #include "../libvo/img_format.h"
 #include "rgb2rgb.h"
 #include "../libvo/fastmemcpy.h"
-#include "../mp_msg.h"
-
-#define MSG_WARN(args...) mp_msg(MSGT_SWS,MSGL_WARN, ##args )
-#define MSG_FATAL(args...) mp_msg(MSGT_SWS,MSGL_FATAL, ##args )
-#define MSG_ERR(args...) mp_msg(MSGT_SWS,MSGL_ERR, ##args )
-#define MSG_V(args...) mp_msg(MSGT_SWS,MSGL_V, ##args )
-#define MSG_DBG2(args...) mp_msg(MSGT_SWS,MSGL_DBG2, ##args )
-#define MSG_INFO(args...) mp_msg(MSGT_SWS,MSGL_INFO, ##args )
 
 #undef MOVNTQ
 #undef PAVGB
@@ -1272,10 +1264,6 @@ static void initMMX2HScaler(int dstW, int xInc, uint8_t *funnyCode, int16_t *fil
 }
 #endif // ARCH_X86
 
-//FIXME remove
-void SwScale_Init(){
-}
-
 static void globalInit(){
     // generating tables:
     int i;
@@ -1478,7 +1466,7 @@ static inline void sws_orderYUV(int format, uint8_t * sortedP[], int sortedStrid
                sortedStride[1]= stride[2];
                sortedStride[2]= stride[1];
        }
-       else if(isPacked(format) || isGray(format))
+       else if(isPacked(format) || isGray(format) || format == IMGFMT_Y8)
        {
                sortedP[0]= p[0];
                sortedP[1]= 
@@ -1712,6 +1700,7 @@ SwsContext *sws_getContext(int srcW, int srcH, int origSrcFormat, int dstW, int
 #endif
 #endif
        if(clip_table[512] != 255) globalInit();
+       if(rgb15to16 == NULL) sws_rgb2rgb_init(flags);
 
        /* avoid dupplicate Formats, so we dont need to check to much */
        srcFormat = remove_dup_fourcc(origSrcFormat);
@@ -2107,6 +2096,7 @@ int sws_scale(SwsContext *c, uint8_t* srcParam[], int srcStrideParam[], int srcS
        sws_orderYUV(c->origSrcFormat, src, srcStride, srcParam, srcStrideParam);
        sws_orderYUV(c->origDstFormat, dst, dstStride, dstParam, dstStrideParam);
 //printf("sws: slice %d %d\n", srcSliceY, srcSliceH);
+
        return c->swScale(c, src, srcStride, srcSliceY, srcSliceH, dst, dstStride);
 }