printf to mp_msg

Originally committed as revision 5938 to svn://svn.mplayerhq.hu/mplayer/trunk/postproc
pull/126/head
Alban Bedel 23 years ago
parent ef5b1b5a7e
commit 4a53a912af
  1. 95
      postproc/swscale.c
  2. 2
      postproc/swscale_template.c
  3. 15
      postproc/yuv2rgb.c

@ -62,6 +62,7 @@ untested special converters
#include "../libvo/img_format.h" #include "../libvo/img_format.h"
#include "rgb2rgb.h" #include "rgb2rgb.h"
#include "../libvo/fastmemcpy.h" #include "../libvo/fastmemcpy.h"
#include "../mp_msg.h"
#undef MOVNTQ #undef MOVNTQ
#undef PAVGB #undef PAVGB
@ -936,8 +937,8 @@ static inline void initFilter(int16_t **outFilter, int16_t **filterPos, int *out
filter= (double*)memalign(8, filterSize*dstW*sizeof(double)); filter= (double*)memalign(8, filterSize*dstW*sizeof(double));
*outFilterSize= filterSize; *outFilterSize= filterSize;
if((flags&SWS_PRINT_INFO) && verbose) if(flags&SWS_PRINT_INFO)
printf("SwScaler: reducing / aligning filtersize %d -> %d\n", filter2Size, filterSize); mp_msg(MSGT_SWS,MSGL_V,"SwScaler: reducing / aligning filtersize %d -> %d\n", filter2Size, filterSize);
/* try to reduce the filter-size (step2 reduce it) */ /* try to reduce the filter-size (step2 reduce it) */
for(i=0; i<dstW; i++) for(i=0; i<dstW; i++)
{ {
@ -1452,19 +1453,19 @@ SwsContext *getSwsContext(int srcW, int srcH, int srcFormat, int dstW, int dstH,
if(!isSupportedIn(srcFormat)) if(!isSupportedIn(srcFormat))
{ {
fprintf(stderr, "swScaler: %s is not supported as input format\n", vo_format_name(srcFormat)); mp_msg(MSGT_SWS,MSGL_ERR,"swScaler: %s is not supported as input format\n", vo_format_name(srcFormat));
return NULL; return NULL;
} }
if(!isSupportedOut(dstFormat)) if(!isSupportedOut(dstFormat))
{ {
fprintf(stderr, "swScaler: %s is not supported as output format\n", vo_format_name(dstFormat)); mp_msg(MSGT_SWS,MSGL_ERR,"swScaler: %s is not supported as output format\n", vo_format_name(dstFormat));
return NULL; return NULL;
} }
/* sanity check */ /* sanity check */
if(srcW<4 || srcH<1 || dstW<8 || dstH<1) //FIXME check if these are enough and try to lowwer them after fixing the relevant parts of the code if(srcW<4 || srcH<1 || dstW<8 || dstH<1) //FIXME check if these are enough and try to lowwer them after fixing the relevant parts of the code
{ {
fprintf(stderr, "swScaler: %dx%d -> %dx%d is invalid scaling dimension\n", mp_msg(MSGT_SWS,MSGL_ERR,"swScaler: %dx%d -> %dx%d is invalid scaling dimension\n",
srcW, srcH, dstW, dstH); srcW, srcH, dstW, dstH);
return NULL; return NULL;
} }
@ -1513,7 +1514,7 @@ SwsContext *getSwsContext(int srcW, int srcH, int srcFormat, int dstW, int dstH,
c->swScale= planarYuvToBgr; c->swScale= planarYuvToBgr;
if(flags&SWS_PRINT_INFO) if(flags&SWS_PRINT_INFO)
printf("SwScaler: using unscaled %s -> %s special converter\n", mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using unscaled %s -> %s special converter\n",
vo_format_name(srcFormat), vo_format_name(dstFormat)); vo_format_name(srcFormat), vo_format_name(dstFormat));
return c; return c;
} }
@ -1524,7 +1525,7 @@ SwsContext *getSwsContext(int srcW, int srcH, int srcFormat, int dstW, int dstH,
c->swScale= simpleCopy; c->swScale= simpleCopy;
if(flags&SWS_PRINT_INFO) if(flags&SWS_PRINT_INFO)
printf("SwScaler: using unscaled %s -> %s special converter\n", mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using unscaled %s -> %s special converter\n",
vo_format_name(srcFormat), vo_format_name(dstFormat)); vo_format_name(srcFormat), vo_format_name(dstFormat));
return c; return c;
} }
@ -1536,7 +1537,7 @@ SwsContext *getSwsContext(int srcW, int srcH, int srcFormat, int dstW, int dstH,
c->swScale= bgr32to24Wrapper; c->swScale= bgr32to24Wrapper;
if(flags&SWS_PRINT_INFO) if(flags&SWS_PRINT_INFO)
printf("SwScaler: using unscaled %s -> %s special converter\n", mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using unscaled %s -> %s special converter\n",
vo_format_name(srcFormat), vo_format_name(dstFormat)); vo_format_name(srcFormat), vo_format_name(dstFormat));
return c; return c;
} }
@ -1548,7 +1549,7 @@ SwsContext *getSwsContext(int srcW, int srcH, int srcFormat, int dstW, int dstH,
c->swScale= bgr24to32Wrapper; c->swScale= bgr24to32Wrapper;
if(flags&SWS_PRINT_INFO) if(flags&SWS_PRINT_INFO)
printf("SwScaler: using unscaled %s -> %s special converter\n", mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using unscaled %s -> %s special converter\n",
vo_format_name(srcFormat), vo_format_name(dstFormat)); vo_format_name(srcFormat), vo_format_name(dstFormat));
return c; return c;
} }
@ -1559,7 +1560,7 @@ SwsContext *getSwsContext(int srcW, int srcH, int srcFormat, int dstW, int dstH,
c->swScale= bgr15to16Wrapper; c->swScale= bgr15to16Wrapper;
if(flags&SWS_PRINT_INFO) if(flags&SWS_PRINT_INFO)
printf("SwScaler: using unscaled %s -> %s special converter\n", mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using unscaled %s -> %s special converter\n",
vo_format_name(srcFormat), vo_format_name(dstFormat)); vo_format_name(srcFormat), vo_format_name(dstFormat));
return c; return c;
} }
@ -1570,7 +1571,7 @@ SwsContext *getSwsContext(int srcW, int srcH, int srcFormat, int dstW, int dstH,
c->swScale= bgr24toyv12Wrapper; c->swScale= bgr24toyv12Wrapper;
if(flags&SWS_PRINT_INFO) if(flags&SWS_PRINT_INFO)
printf("SwScaler: using unscaled %s -> %s special converter\n", mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using unscaled %s -> %s special converter\n",
vo_format_name(srcFormat), vo_format_name(dstFormat)); vo_format_name(srcFormat), vo_format_name(dstFormat));
return c; return c;
} }
@ -1582,7 +1583,7 @@ SwsContext *getSwsContext(int srcW, int srcH, int srcFormat, int dstW, int dstH,
if(!c->canMMX2BeUsed && dstW >=srcW && (srcW&15)==0 && (flags&SWS_FAST_BILINEAR)) if(!c->canMMX2BeUsed && dstW >=srcW && (srcW&15)==0 && (flags&SWS_FAST_BILINEAR))
{ {
if(flags&SWS_PRINT_INFO) if(flags&SWS_PRINT_INFO)
fprintf(stderr, "SwScaler: output Width is not a multiple of 32 -> no MMX2 scaler\n"); mp_msg(MSGT_SWS,MSGL_WARN,"SwScaler: output Width is not a multiple of 32 -> no MMX2 scaler\n");
} }
} }
else else
@ -1720,35 +1721,35 @@ SwsContext *getSwsContext(int srcW, int srcH, int srcFormat, int dstW, int dstH,
char *dither= ""; char *dither= "";
#endif #endif
if(flags&SWS_FAST_BILINEAR) if(flags&SWS_FAST_BILINEAR)
fprintf(stderr, "\nSwScaler: FAST_BILINEAR scaler, "); mp_msg(MSGT_SWS,MSGL_INFO,"\nSwScaler: FAST_BILINEAR scaler, ");
else if(flags&SWS_BILINEAR) else if(flags&SWS_BILINEAR)
fprintf(stderr, "\nSwScaler: BILINEAR scaler, "); mp_msg(MSGT_SWS,MSGL_INFO,"\nSwScaler: BILINEAR scaler, ");
else if(flags&SWS_BICUBIC) else if(flags&SWS_BICUBIC)
fprintf(stderr, "\nSwScaler: BICUBIC scaler, "); mp_msg(MSGT_SWS,MSGL_INFO,"\nSwScaler: BICUBIC scaler, ");
else if(flags&SWS_X) else if(flags&SWS_X)
fprintf(stderr, "\nSwScaler: Experimental scaler, "); mp_msg(MSGT_SWS,MSGL_INFO,"\nSwScaler: Experimental scaler, ");
else if(flags&SWS_POINT) else if(flags&SWS_POINT)
fprintf(stderr, "\nSwScaler: Nearest Neighbor / POINT scaler, "); mp_msg(MSGT_SWS,MSGL_INFO,"\nSwScaler: Nearest Neighbor / POINT scaler, ");
else if(flags&SWS_AREA) else if(flags&SWS_AREA)
fprintf(stderr, "\nSwScaler: Area Averageing scaler, "); mp_msg(MSGT_SWS,MSGL_INFO,"\nSwScaler: Area Averageing scaler, ");
else else
fprintf(stderr, "\nSwScaler: ehh flags invalid?! "); mp_msg(MSGT_SWS,MSGL_INFO,"\nSwScaler: ehh flags invalid?! ");
if(dstFormat==IMGFMT_BGR15 || dstFormat==IMGFMT_BGR16) if(dstFormat==IMGFMT_BGR15 || dstFormat==IMGFMT_BGR16)
fprintf(stderr, "from %s to%s %s ", mp_msg(MSGT_SWS,MSGL_INFO,"from %s to%s %s ",
vo_format_name(srcFormat), dither, vo_format_name(dstFormat)); vo_format_name(srcFormat), dither, vo_format_name(dstFormat));
else else
fprintf(stderr, "from %s to %s ", mp_msg(MSGT_SWS,MSGL_INFO,"from %s to %s ",
vo_format_name(srcFormat), vo_format_name(dstFormat)); vo_format_name(srcFormat), vo_format_name(dstFormat));
if(cpuCaps.hasMMX2) if(cpuCaps.hasMMX2)
fprintf(stderr, "using MMX2\n"); mp_msg(MSGT_SWS,MSGL_INFO,"using MMX2\n");
else if(cpuCaps.has3DNow) else if(cpuCaps.has3DNow)
fprintf(stderr, "using 3DNOW\n"); mp_msg(MSGT_SWS,MSGL_INFO,"using 3DNOW\n");
else if(cpuCaps.hasMMX) else if(cpuCaps.hasMMX)
fprintf(stderr, "using MMX\n"); mp_msg(MSGT_SWS,MSGL_INFO,"using MMX\n");
else else
fprintf(stderr, "using C\n"); mp_msg(MSGT_SWS,MSGL_INFO,"using C\n");
} }
if((flags & SWS_PRINT_INFO) && verbose) if((flags & SWS_PRINT_INFO) && verbose)
@ -1756,70 +1757,70 @@ SwsContext *getSwsContext(int srcW, int srcH, int srcFormat, int dstW, int dstH,
if(cpuCaps.hasMMX) if(cpuCaps.hasMMX)
{ {
if(c->canMMX2BeUsed && (flags&SWS_FAST_BILINEAR)) if(c->canMMX2BeUsed && (flags&SWS_FAST_BILINEAR))
printf("SwScaler: using FAST_BILINEAR MMX2 scaler for horizontal scaling\n"); mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using FAST_BILINEAR MMX2 scaler for horizontal scaling\n");
else else
{ {
if(c->hLumFilterSize==4) if(c->hLumFilterSize==4)
printf("SwScaler: using 4-tap MMX scaler for horizontal luminance scaling\n"); mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using 4-tap MMX scaler for horizontal luminance scaling\n");
else if(c->hLumFilterSize==8) else if(c->hLumFilterSize==8)
printf("SwScaler: using 8-tap MMX scaler for horizontal luminance scaling\n"); mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using 8-tap MMX scaler for horizontal luminance scaling\n");
else else
printf("SwScaler: using n-tap MMX scaler for horizontal luminance scaling\n"); mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using n-tap MMX scaler for horizontal luminance scaling\n");
if(c->hChrFilterSize==4) if(c->hChrFilterSize==4)
printf("SwScaler: using 4-tap MMX scaler for horizontal chrominance scaling\n"); mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using 4-tap MMX scaler for horizontal chrominance scaling\n");
else if(c->hChrFilterSize==8) else if(c->hChrFilterSize==8)
printf("SwScaler: using 8-tap MMX scaler for horizontal chrominance scaling\n"); mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using 8-tap MMX scaler for horizontal chrominance scaling\n");
else else
printf("SwScaler: using n-tap MMX scaler for horizontal chrominance scaling\n"); mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using n-tap MMX scaler for horizontal chrominance scaling\n");
} }
} }
else else
{ {
#ifdef ARCH_X86 #ifdef ARCH_X86
printf("SwScaler: using X86-Asm scaler for horizontal scaling\n"); mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using X86-Asm scaler for horizontal scaling\n");
#else #else
if(flags & SWS_FAST_BILINEAR) if(flags & SWS_FAST_BILINEAR)
printf("SwScaler: using FAST_BILINEAR C scaler for horizontal scaling\n"); mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using FAST_BILINEAR C scaler for horizontal scaling\n");
else else
printf("SwScaler: using C scaler for horizontal scaling\n"); mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using C scaler for horizontal scaling\n");
#endif #endif
} }
if(isPlanarYUV(dstFormat)) if(isPlanarYUV(dstFormat))
{ {
if(c->vLumFilterSize==1) if(c->vLumFilterSize==1)
printf("SwScaler: using 1-tap %s \"scaler\" for vertical scaling (YV12 like)\n", cpuCaps.hasMMX ? "MMX" : "C"); mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using 1-tap %s \"scaler\" for vertical scaling (YV12 like)\n", cpuCaps.hasMMX ? "MMX" : "C");
else else
printf("SwScaler: using n-tap %s scaler for vertical scaling (YV12 like)\n", cpuCaps.hasMMX ? "MMX" : "C"); mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using n-tap %s scaler for vertical scaling (YV12 like)\n", cpuCaps.hasMMX ? "MMX" : "C");
} }
else else
{ {
if(c->vLumFilterSize==1 && c->vChrFilterSize==2) if(c->vLumFilterSize==1 && c->vChrFilterSize==2)
printf("SwScaler: using 1-tap %s \"scaler\" for vertical luminance scaling (BGR)\n" mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using 1-tap %s \"scaler\" for vertical luminance scaling (BGR)\n"
"SwScaler: 2-tap scaler for vertical chrominance scaling (BGR)\n",cpuCaps.hasMMX ? "MMX" : "C"); "SwScaler: 2-tap scaler for vertical chrominance scaling (BGR)\n",cpuCaps.hasMMX ? "MMX" : "C");
else if(c->vLumFilterSize==2 && c->vChrFilterSize==2) else if(c->vLumFilterSize==2 && c->vChrFilterSize==2)
printf("SwScaler: using 2-tap linear %s scaler for vertical scaling (BGR)\n", cpuCaps.hasMMX ? "MMX" : "C"); mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using 2-tap linear %s scaler for vertical scaling (BGR)\n", cpuCaps.hasMMX ? "MMX" : "C");
else else
printf("SwScaler: using n-tap %s scaler for vertical scaling (BGR)\n", cpuCaps.hasMMX ? "MMX" : "C"); mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using n-tap %s scaler for vertical scaling (BGR)\n", cpuCaps.hasMMX ? "MMX" : "C");
} }
if(dstFormat==IMGFMT_BGR24) if(dstFormat==IMGFMT_BGR24)
printf("SwScaler: using %s YV12->BGR24 Converter\n", mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using %s YV12->BGR24 Converter\n",
cpuCaps.hasMMX2 ? "MMX2" : (cpuCaps.hasMMX ? "MMX" : "C")); cpuCaps.hasMMX2 ? "MMX2" : (cpuCaps.hasMMX ? "MMX" : "C"));
else if(dstFormat==IMGFMT_BGR32) else if(dstFormat==IMGFMT_BGR32)
printf("SwScaler: using %s YV12->BGR32 Converter\n", cpuCaps.hasMMX ? "MMX" : "C"); mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using %s YV12->BGR32 Converter\n", cpuCaps.hasMMX ? "MMX" : "C");
else if(dstFormat==IMGFMT_BGR16) else if(dstFormat==IMGFMT_BGR16)
printf("SwScaler: using %s YV12->BGR16 Converter\n", cpuCaps.hasMMX ? "MMX" : "C"); mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using %s YV12->BGR16 Converter\n", cpuCaps.hasMMX ? "MMX" : "C");
else if(dstFormat==IMGFMT_BGR15) else if(dstFormat==IMGFMT_BGR15)
printf("SwScaler: using %s YV12->BGR15 Converter\n", cpuCaps.hasMMX ? "MMX" : "C"); mp_msg(MSGT_SWS,MSGL_V,"SwScaler: using %s YV12->BGR15 Converter\n", cpuCaps.hasMMX ? "MMX" : "C");
printf("SwScaler: %dx%d -> %dx%d\n", srcW, srcH, dstW, dstH); mp_msg(MSGT_SWS,MSGL_V,"SwScaler: %dx%d -> %dx%d\n", srcW, srcH, dstW, dstH);
} }
if((flags & SWS_PRINT_INFO) && verbose>1) if((flags & SWS_PRINT_INFO) && verbose>1)
{ {
printf("SwScaler:Lum srcW=%d srcH=%d dstW=%d dstH=%d xInc=%d yInc=%d\n", mp_msg(MSGT_SWS,MSGL_DBG2,"SwScaler:Lum srcW=%d srcH=%d dstW=%d dstH=%d xInc=%d yInc=%d\n",
c->srcW, c->srcH, c->dstW, c->dstH, c->lumXInc, c->lumYInc); c->srcW, c->srcH, c->dstW, c->dstH, c->lumXInc, c->lumYInc);
printf("SwScaler:Chr srcW=%d srcH=%d dstW=%d dstH=%d xInc=%d yInc=%d\n", mp_msg(MSGT_SWS,MSGL_DBG2,"SwScaler:Chr srcW=%d srcH=%d dstW=%d dstH=%d xInc=%d yInc=%d\n",
c->chrSrcW, c->chrSrcH, c->chrDstW, c->chrDstH, c->chrXInc, c->chrYInc); c->chrSrcW, c->chrSrcH, c->chrDstW, c->chrDstH, c->chrXInc, c->chrYInc);
} }

@ -2667,7 +2667,7 @@ static void RENAME(swScale)(SwsContext *c, uint8_t* srcParam[], int srcStridePar
static int firstTime=1; //FIXME move this into the context perhaps static int firstTime=1; //FIXME move this into the context perhaps
if(flags & SWS_PRINT_INFO && firstTime) if(flags & SWS_PRINT_INFO && firstTime)
{ {
fprintf(stderr, "SwScaler: Warning: dstStride is not aligned!\n" mp_msg(MSGT_SWS,MSGL_WARN,"SwScaler: Warning: dstStride is not aligned!\n"
"SwScaler: ->cannot do aligned memory acesses anymore\n"); "SwScaler: ->cannot do aligned memory acesses anymore\n");
firstTime=0; firstTime=0;
} }

@ -37,6 +37,7 @@
#include "rgb2rgb.h" #include "rgb2rgb.h"
#include "../cpudetect.h" #include "../cpudetect.h"
#include "../mangle.h" #include "../mangle.h"
#include "../mp_msg.h"
#ifdef HAVE_MLIB #ifdef HAVE_MLIB
#include "yuv2rgb_mlib.c" #include "yuv2rgb_mlib.c"
@ -157,9 +158,9 @@ void yuv2rgb_init (int bpp, int mode)
if (yuv2rgb == NULL /*&& (config.flags & VO_MMX_ENABLE)*/) { if (yuv2rgb == NULL /*&& (config.flags & VO_MMX_ENABLE)*/) {
yuv2rgb = yuv2rgb_init_MMX2 (bpp, mode); yuv2rgb = yuv2rgb_init_MMX2 (bpp, mode);
if (yuv2rgb != NULL) if (yuv2rgb != NULL)
printf ("Using MMX2 for colorspace transform\n"); mp_msg(MSGT_SWS,MSGL_INFO,"Using MMX2 for colorspace transform\n");
else else
printf ("Cannot init MMX2 colorspace transform\n"); mp_msg(MSGT_SWS,MSGL_WARN,"Cannot init MMX2 colorspace transform\n");
} }
} }
else if(gCpuCaps.hasMMX) else if(gCpuCaps.hasMMX)
@ -167,9 +168,9 @@ void yuv2rgb_init (int bpp, int mode)
if (yuv2rgb == NULL /*&& (config.flags & VO_MMX_ENABLE)*/) { if (yuv2rgb == NULL /*&& (config.flags & VO_MMX_ENABLE)*/) {
yuv2rgb = yuv2rgb_init_MMX (bpp, mode); yuv2rgb = yuv2rgb_init_MMX (bpp, mode);
if (yuv2rgb != NULL) if (yuv2rgb != NULL)
printf ("Using MMX for colorspace transform\n"); mp_msg(MSGT_SWS,MSGL_INFO,"Using MMX for colorspace transform\n");
else else
printf ("Cannot init MMX colorspace transform\n"); mp_msg(MSGT_SWS,MSGL_WARN,"Cannot init MMX colorspace transform\n");
} }
} }
#endif #endif
@ -177,11 +178,11 @@ void yuv2rgb_init (int bpp, int mode)
if (yuv2rgb == NULL /*&& (config.flags & VO_MLIB_ENABLE)*/) { if (yuv2rgb == NULL /*&& (config.flags & VO_MLIB_ENABLE)*/) {
yuv2rgb = yuv2rgb_init_mlib (bpp, mode); yuv2rgb = yuv2rgb_init_mlib (bpp, mode);
if (yuv2rgb != NULL) if (yuv2rgb != NULL)
printf ("Using mlib for colorspace transform\n"); mp_msg(MSGT_SWS,MSGL_INFO,"Using mlib for colorspace transform\n");
} }
#endif #endif
if (yuv2rgb == NULL) { if (yuv2rgb == NULL) {
printf ("No accelerated colorspace conversion found\n"); mp_msg(MSGT_SWS,MSGL_INFO,"No accelerated colorspace conversion found\n");
yuv2rgb_c_init (bpp, mode); yuv2rgb_c_init (bpp, mode);
yuv2rgb = (yuv2rgb_fun)yuv2rgb_c; yuv2rgb = (yuv2rgb_fun)yuv2rgb_c;
} }
@ -489,7 +490,7 @@ static void yuv2rgb_c_init (int bpp, int mode)
break; break;
default: default:
printf ("%ibpp not supported by yuv2rgb\n", bpp); mp_msg(MSGT_SWS,MSGL_ERR,"%ibpp not supported by yuv2rgb\n", bpp);
//exit (1); //exit (1);
} }

Loading…
Cancel
Save