aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamiro Polla <ramiro.polla@gmail.com>2009-08-17 02:06:00 +0000
committerRamiro Polla <ramiro.polla@gmail.com>2009-08-17 02:06:00 +0000
commit6b052ba88fd04c214eeb930e8088ca430dfa3a9e (patch)
tree31ab3be0e0e70aa576f97234aa107181b8076577
parent0cc4701a3af131a1deb21e3a81985887f72c88b1 (diff)
downloadffmpeg-6b052ba88fd04c214eeb930e8088ca430dfa3a9e.tar.gz
swscale-example: Make selection of dstW, dstH, and flags more clear.
Originally committed as revision 29527 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
-rw-r--r--libswscale/swscale-example.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/libswscale/swscale-example.c b/libswscale/swscale-example.c
index 7ea4f51de8..a3d9357a02 100644
--- a/libswscale/swscale-example.c
+++ b/libswscale/swscale-example.c
@@ -182,12 +182,18 @@ static int doTest(uint8_t *ref[4], int refStride[4], int w, int h, int srcFormat
static void selfTest(uint8_t *src[4], int stride[4], int w, int h)
{
+ const int flags[] = { SWS_FAST_BILINEAR,
+ SWS_BILINEAR, SWS_BICUBIC,
+ SWS_X , SWS_POINT , SWS_AREA, 0 };
+ const int srcW = w;
+ const int srcH = h;
+ const int dstW[] = { srcW - srcW/3, srcW, srcW + srcW/3, 0 };
+ const int dstH[] = { srcH - srcH/3, srcH, srcH + srcH/3, 0 };
enum PixelFormat srcFormat, dstFormat;
- int srcW, srcH, dstW, dstH;
- int flags;
for (srcFormat = 0; srcFormat < PIX_FMT_NB; srcFormat++) {
for (dstFormat = 0; dstFormat < PIX_FMT_NB; dstFormat++) {
+ int i, j, k;
int res = 0;
printf("%s -> %s\n",
@@ -195,13 +201,11 @@ static void selfTest(uint8_t *src[4], int stride[4], int w, int h)
sws_format_name(dstFormat));
fflush(stdout);
- srcW= w;
- srcH= h;
- for (dstW=w - w/3; !res && dstW<= 4*w/3; dstW+= w/3)
- for (dstH=h - h/3; !res && dstH<= 4*h/3; dstH+= h/3)
- for (flags=1; !res && flags<33; flags*=2)
+ for (i = 0; dstW[i] && !res; i++)
+ for (j = 0; dstH[j] && !res; j++)
+ for (k = 0; flags[k] && !res; k++)
res = doTest(src, stride, w, h, srcFormat, dstFormat,
- srcW, srcH, dstW, dstH, flags);
+ srcW, srcH, dstW[i], dstH[j], flags[k]);
}
}
}