Commit e1197b9e authored by Stefano Sabatini's avatar Stefano Sabatini

swscale: remove sws_format_name()

Use av_get_pix_fmt_name() instead.
parent 2c10ee23
...@@ -197,7 +197,7 @@ SwsFunc ff_yuv2rgb_get_func_ptr_bfin(SwsContext *c) ...@@ -197,7 +197,7 @@ SwsFunc ff_yuv2rgb_get_func_ptr_bfin(SwsContext *c)
} }
av_log(c, AV_LOG_INFO, "BlackFin accelerated color space converter %s\n", av_log(c, AV_LOG_INFO, "BlackFin accelerated color space converter %s\n",
sws_format_name (c->dstFormat)); av_get_pix_fmt_name(c->dstFormat));
return f; return f;
} }
...@@ -718,7 +718,7 @@ ff_yuv2packedX_altivec(SwsContext *c, const int16_t *lumFilter, ...@@ -718,7 +718,7 @@ ff_yuv2packedX_altivec(SwsContext *c, const int16_t *lumFilter,
static int printed_error_message; static int printed_error_message;
if (!printed_error_message) { if (!printed_error_message) {
av_log(c, AV_LOG_ERROR, "altivec_yuv2packedX doesn't support %s output\n", av_log(c, AV_LOG_ERROR, "altivec_yuv2packedX doesn't support %s output\n",
sws_format_name(c->dstFormat)); av_get_pix_fmt_name(c->dstFormat));
printed_error_message=1; printed_error_message=1;
} }
return; return;
...@@ -793,7 +793,7 @@ ff_yuv2packedX_altivec(SwsContext *c, const int16_t *lumFilter, ...@@ -793,7 +793,7 @@ ff_yuv2packedX_altivec(SwsContext *c, const int16_t *lumFilter,
default: default:
/* Unreachable, I think. */ /* Unreachable, I think. */
av_log(c, AV_LOG_ERROR, "altivec_yuv2packedX doesn't support %s output\n", av_log(c, AV_LOG_ERROR, "altivec_yuv2packedX doesn't support %s output\n",
sws_format_name(c->dstFormat)); av_get_pix_fmt_name(c->dstFormat));
return; return;
} }
......
...@@ -1492,7 +1492,7 @@ static int palToRgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], ...@@ -1492,7 +1492,7 @@ static int palToRgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[],
if (!conv) if (!conv)
av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n", av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n",
sws_format_name(srcFormat), sws_format_name(dstFormat)); av_get_pix_fmt_name(srcFormat), av_get_pix_fmt_name(dstFormat));
else { else {
for (i=0; i<srcSliceH; i++) { for (i=0; i<srcSliceH; i++) {
conv(srcPtr, dstPtr, c->srcW, (uint8_t *) c->pal_rgb); conv(srcPtr, dstPtr, c->srcW, (uint8_t *) c->pal_rgb);
...@@ -1579,7 +1579,7 @@ static int rgbToRgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[], ...@@ -1579,7 +1579,7 @@ static int rgbToRgbWrapper(SwsContext *c, const uint8_t* src[], int srcStride[],
if (!conv) { if (!conv) {
av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n", av_log(c, AV_LOG_ERROR, "internal error %s -> %s converter\n",
sws_format_name(srcFormat), sws_format_name(dstFormat)); av_get_pix_fmt_name(srcFormat), av_get_pix_fmt_name(dstFormat));
} else { } else {
const uint8_t *srcPtr= src[0]; const uint8_t *srcPtr= src[0];
uint8_t *dstPtr= dst[0]; uint8_t *dstPtr= dst[0];
......
...@@ -345,8 +345,6 @@ void ff_yuv2packedX_altivec(SwsContext *c, const int16_t *lumFilter, ...@@ -345,8 +345,6 @@ void ff_yuv2packedX_altivec(SwsContext *c, const int16_t *lumFilter,
const int16_t **chrVSrc, int chrFilterSize, const int16_t **chrVSrc, int chrFilterSize,
uint8_t *dest, int dstW, int dstY); uint8_t *dest, int dstW, int dstY);
const char *sws_format_name(enum PixelFormat format);
//FIXME replace this with something faster //FIXME replace this with something faster
#define is16BPS(x) ( \ #define is16BPS(x) ( \
(x)==PIX_FMT_GRAY16BE \ (x)==PIX_FMT_GRAY16BE \
......
...@@ -165,14 +165,6 @@ int sws_isSupportedOutput(enum PixelFormat pix_fmt) ...@@ -165,14 +165,6 @@ int sws_isSupportedOutput(enum PixelFormat pix_fmt)
extern const int32_t ff_yuv2rgb_coeffs[8][4]; extern const int32_t ff_yuv2rgb_coeffs[8][4];
const char *sws_format_name(enum PixelFormat format)
{
if ((unsigned)format < PIX_FMT_NB && av_pix_fmt_descriptors[format].name)
return av_pix_fmt_descriptors[format].name;
else
return "Unknown format";
}
static double getSplineCoeff(double a, double b, double c, double d, double dist) static double getSplineCoeff(double a, double b, double c, double d, double dist)
{ {
if (dist<=1.0) return ((d*dist + c)*dist + b)*dist +a; if (dist<=1.0) return ((d*dist + c)*dist + b)*dist +a;
...@@ -766,11 +758,11 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter) ...@@ -766,11 +758,11 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter)
unscaled = (srcW == dstW && srcH == dstH); unscaled = (srcW == dstW && srcH == dstH);
if (!isSupportedIn(srcFormat)) { if (!isSupportedIn(srcFormat)) {
av_log(NULL, AV_LOG_ERROR, "swScaler: %s is not supported as input pixel format\n", sws_format_name(srcFormat)); av_log(NULL, AV_LOG_ERROR, "swScaler: %s is not supported as input pixel format\n", av_get_pix_fmt_name(srcFormat));
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
if (!isSupportedOut(dstFormat)) { if (!isSupportedOut(dstFormat)) {
av_log(NULL, AV_LOG_ERROR, "swScaler: %s is not supported as output pixel format\n", sws_format_name(dstFormat)); av_log(NULL, AV_LOG_ERROR, "swScaler: %s is not supported as output pixel format\n", av_get_pix_fmt_name(dstFormat));
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
...@@ -845,7 +837,7 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter) ...@@ -845,7 +837,7 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter)
if (c->swScale) { if (c->swScale) {
if (flags&SWS_PRINT_INFO) if (flags&SWS_PRINT_INFO)
av_log(c, AV_LOG_INFO, "using unscaled %s -> %s special converter\n", av_log(c, AV_LOG_INFO, "using unscaled %s -> %s special converter\n",
sws_format_name(srcFormat), sws_format_name(dstFormat)); av_get_pix_fmt_name(srcFormat), av_get_pix_fmt_name(dstFormat));
return 0; return 0;
} }
} }
...@@ -1042,7 +1034,7 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter) ...@@ -1042,7 +1034,7 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter)
else av_log(c, AV_LOG_INFO, "ehh flags invalid?! "); else av_log(c, AV_LOG_INFO, "ehh flags invalid?! ");
av_log(c, AV_LOG_INFO, "from %s to %s%s ", av_log(c, AV_LOG_INFO, "from %s to %s%s ",
sws_format_name(srcFormat), av_get_pix_fmt_name(srcFormat),
#ifdef DITHER1XBPP #ifdef DITHER1XBPP
dstFormat == PIX_FMT_BGR555 || dstFormat == PIX_FMT_BGR565 || dstFormat == PIX_FMT_BGR555 || dstFormat == PIX_FMT_BGR565 ||
dstFormat == PIX_FMT_RGB444BE || dstFormat == PIX_FMT_RGB444LE || dstFormat == PIX_FMT_RGB444BE || dstFormat == PIX_FMT_RGB444LE ||
...@@ -1050,7 +1042,7 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter) ...@@ -1050,7 +1042,7 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter)
#else #else
"", "",
#endif #endif
sws_format_name(dstFormat)); av_get_pix_fmt_name(dstFormat));
if (HAVE_MMX2 && cpu_flags & AV_CPU_FLAG_MMX2) av_log(c, AV_LOG_INFO, "using MMX2\n"); if (HAVE_MMX2 && cpu_flags & AV_CPU_FLAG_MMX2) av_log(c, AV_LOG_INFO, "using MMX2\n");
else if (HAVE_AMD3DNOW && cpu_flags & AV_CPU_FLAG_3DNOW) av_log(c, AV_LOG_INFO, "using 3DNOW\n"); else if (HAVE_AMD3DNOW && cpu_flags & AV_CPU_FLAG_3DNOW) av_log(c, AV_LOG_INFO, "using 3DNOW\n");
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include "swscale_internal.h" #include "swscale_internal.h"
#include "libavutil/cpu.h" #include "libavutil/cpu.h"
#include "libavutil/bswap.h" #include "libavutil/bswap.h"
#include "libavutil/pixdesc.h"
extern const uint8_t dither_4x4_16[4][8]; extern const uint8_t dither_4x4_16[4][8];
extern const uint8_t dither_8x8_32[8][8]; extern const uint8_t dither_8x8_32[8][8];
...@@ -521,7 +522,8 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c) ...@@ -521,7 +522,8 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c)
if (t) if (t)
return t; return t;
av_log(c, AV_LOG_WARNING, "No accelerated colorspace conversion found from %s to %s.\n", sws_format_name(c->srcFormat), sws_format_name(c->dstFormat)); av_log(c, AV_LOG_WARNING, "No accelerated colorspace conversion found from %s to %s.\n",
av_get_pix_fmt_name(c->srcFormat), av_get_pix_fmt_name(c->dstFormat));
switch (c->dstFormat) { switch (c->dstFormat) {
case PIX_FMT_BGR48BE: case PIX_FMT_BGR48BE:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment