diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-12 15:52:55 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-12 15:57:28 +0200 |
commit | a9bd51b1e647d7ec0b7661e19b87ade86098b38c (patch) | |
tree | 37682f77a88bc8e09eb97fbc923192292a1abbe4 /libswscale/swscale-test.c | |
parent | a33ed6bc74b6b8ada925c76c4084afcf8870a048 (diff) | |
parent | 9953ff3cd844eb5f6d8dfce98cad94b78a0fc7dc (diff) | |
download | ffmpeg-a9bd51b1e647d7ec0b7661e19b87ade86098b38c.tar.gz |
Merge commit '9953ff3cd844eb5f6d8dfce98cad94b78a0fc7dc'
* commit '9953ff3cd844eb5f6d8dfce98cad94b78a0fc7dc':
mpegvideo: fix indentation
sws: do not use av_pix_fmt_descriptors directly.
Conflicts:
libavcodec/mpegvideo.c
libswscale/swscale_internal.h
libswscale/swscale_unscaled.c
libswscale/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale/swscale-test.c')
-rw-r--r-- | libswscale/swscale-test.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/libswscale/swscale-test.c b/libswscale/swscale-test.c index 3056ea54af..085aecb5fd 100644 --- a/libswscale/swscale-test.c +++ b/libswscale/swscale-test.c @@ -81,6 +81,9 @@ static int doTest(uint8_t *ref[4], int refStride[4], int w, int h, int srcW, int srcH, int dstW, int dstH, int flags, struct Results *r) { + const AVPixFmtDescriptor *desc_yuva420p = av_pix_fmt_desc_get(AV_PIX_FMT_YUVA420P); + const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(srcFormat); + const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(dstFormat); static enum AVPixelFormat cur_srcFormat; static int cur_srcW, cur_srcH; static uint8_t *src[4]; @@ -116,8 +119,8 @@ static int doTest(uint8_t *ref[4], int refStride[4], int w, int h, srcFormat, SWS_BILINEAR, NULL, NULL, NULL); if (!srcContext) { fprintf(stderr, "Failed to get %s ---> %s\n", - av_pix_fmt_descriptors[AV_PIX_FMT_YUVA420P].name, - av_pix_fmt_descriptors[srcFormat].name); + desc_yuva420p->name, + desc_src->name); res = -1; goto end; } @@ -152,15 +155,14 @@ static int doTest(uint8_t *ref[4], int refStride[4], int w, int h, flags, NULL, NULL, NULL); if (!dstContext) { fprintf(stderr, "Failed to get %s ---> %s\n", - av_pix_fmt_descriptors[srcFormat].name, - av_pix_fmt_descriptors[dstFormat].name); + desc_src->name, desc_dst->name); res = -1; goto end; } printf(" %s %dx%d -> %s %3dx%3d flags=%2d", - av_pix_fmt_descriptors[srcFormat].name, srcW, srcH, - av_pix_fmt_descriptors[dstFormat].name, dstW, dstH, + desc_src->name, srcW, srcH, + desc_dst->name, dstW, dstH, flags); fflush(stdout); @@ -191,8 +193,8 @@ static int doTest(uint8_t *ref[4], int refStride[4], int w, int h, NULL, NULL, NULL); if (!outContext) { fprintf(stderr, "Failed to get %s ---> %s\n", - av_pix_fmt_descriptors[dstFormat].name, - av_pix_fmt_descriptors[AV_PIX_FMT_YUVA420P].name); + desc_dst->name, + desc_yuva420p->name); res = -1; goto end; } @@ -245,6 +247,7 @@ static void selfTest(uint8_t *ref[4], int refStride[4], int w, int h, const int dstW[] = { srcW - srcW / 3, srcW, srcW + srcW / 3, 0 }; const int dstH[] = { srcH - srcH / 3, srcH, srcH + srcH / 3, 0 }; enum AVPixelFormat srcFormat, dstFormat; + const AVPixFmtDescriptor *desc_src, *desc_dst; for (srcFormat = srcFormat_in != AV_PIX_FMT_NONE ? srcFormat_in : 0; srcFormat < AV_PIX_FMT_NB; srcFormat++) { @@ -252,6 +255,8 @@ static void selfTest(uint8_t *ref[4], int refStride[4], int w, int h, !sws_isSupportedOutput(srcFormat)) continue; + desc_src = av_pix_fmt_desc_get(srcFormat); + for (dstFormat = dstFormat_in != AV_PIX_FMT_NONE ? dstFormat_in : 0; dstFormat < AV_PIX_FMT_NB; dstFormat++) { int i, j, k; @@ -261,9 +266,9 @@ static void selfTest(uint8_t *ref[4], int refStride[4], int w, int h, !sws_isSupportedOutput(dstFormat)) continue; - printf("%s -> %s\n", - av_pix_fmt_descriptors[srcFormat].name, - av_pix_fmt_descriptors[dstFormat].name); + desc_dst = av_pix_fmt_desc_get(dstFormat); + + printf("%s -> %s\n", desc_src->name, desc_dst->name); fflush(stdout); for (k = 0; flags[k] && !res; k++) |