summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-01-26 08:03:28 +0000
committermichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-01-26 08:03:28 +0000
commit156399b7aa25e5a8c39563fc6435de21f41dd655 (patch)
tree73f9629987893c64e22e411ad39dcf0fb4f6c660
parent60b76a958faee93d45e33b68b2ac9914448aa04a (diff)
downloadmpv-156399b7aa25e5a8c39563fc6435de21f41dd655.tar.bz2
mpv-156399b7aa25e5a8c39563fc6435de21f41dd655.tar.xz
Use isAnyRGB() where possible
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30435 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libswscale/swscale.c13
-rw-r--r--libswscale/swscale_template.c2
-rw-r--r--libswscale/utils.c9
3 files changed, 11 insertions, 13 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 4a3d48d3a6..a75b84c99f 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -90,8 +90,7 @@ untested special converters
(x)==PIX_FMT_PAL8 \
|| (x)==PIX_FMT_YUYV422 \
|| (x)==PIX_FMT_UYVY422 \
- || isRGBinInt(x) \
- || isBGRinInt(x) \
+ || isAnyRGB(x) \
)
#define usePal(x) (av_pix_fmt_descriptors[x].flags & PIX_FMT_PAL)
@@ -1660,16 +1659,16 @@ void ff_get_unscaled_swscale(SwsContext *c)
const int dstH = c->dstH;
int needsDither;
- needsDither= (isBGRinInt(dstFormat) || isRGBinInt(dstFormat))
+ needsDither= isAnyRGB(dstFormat)
&& c->dstFormatBpp < 24
- && (c->dstFormatBpp < c->srcFormatBpp || (!(isRGBinInt(srcFormat) || isBGRinInt(srcFormat))));
+ && (c->dstFormatBpp < c->srcFormatBpp || (!isAnyRGB(srcFormat)));
/* yv12_to_nv12 */
if ((srcFormat == PIX_FMT_YUV420P || srcFormat == PIX_FMT_YUVA420P) && (dstFormat == PIX_FMT_NV12 || dstFormat == PIX_FMT_NV21)) {
c->swScale= PlanarToNV12Wrapper;
}
/* yuv2bgr */
- if ((srcFormat==PIX_FMT_YUV420P || srcFormat==PIX_FMT_YUV422P || srcFormat==PIX_FMT_YUVA420P) && (isBGRinInt(dstFormat) || isRGBinInt(dstFormat))
+ if ((srcFormat==PIX_FMT_YUV420P || srcFormat==PIX_FMT_YUV422P || srcFormat==PIX_FMT_YUVA420P) && isAnyRGB(dstFormat)
&& !(flags & SWS_ACCURATE_RND) && !(dstH&1)) {
c->swScale= ff_yuv2rgb_get_func_ptr(c);
}
@@ -1683,8 +1682,8 @@ void ff_get_unscaled_swscale(SwsContext *c)
c->swScale= bgr24toyv12Wrapper;
/* RGB/BGR -> RGB/BGR (no dither needed forms) */
- if ( (isBGRinInt(srcFormat) || isRGBinInt(srcFormat))
- && (isBGRinInt(dstFormat) || isRGBinInt(dstFormat))
+ if ( isAnyRGB(srcFormat)
+ && isAnyRGB(dstFormat)
&& srcFormat != PIX_FMT_BGR8 && dstFormat != PIX_FMT_BGR8
&& srcFormat != PIX_FMT_RGB8 && dstFormat != PIX_FMT_RGB8
&& srcFormat != PIX_FMT_BGR4 && dstFormat != PIX_FMT_BGR4
diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c
index 1f45c30beb..b682c11d42 100644
--- a/libswscale/swscale_template.c
+++ b/libswscale/swscale_template.c
@@ -3048,7 +3048,7 @@ static void RENAME(sws_init_swScale)(SwsContext *c)
break;
}
- if (c->srcRange != c->dstRange && !(isRGBinInt(c->dstFormat) || isBGRinInt(c->dstFormat))) {
+ if (c->srcRange != c->dstRange && !isAnyRGB(c->dstFormat)) {
if (c->srcRange) {
c->lumConvertRange = RENAME(lumRangeFromJpeg);
c->chrConvertRange = RENAME(chrRangeFromJpeg);
diff --git a/libswscale/utils.c b/libswscale/utils.c
index b1e38720eb..95edcb42a7 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -121,8 +121,7 @@ int sws_isSupportedInput(enum PixelFormat pix_fmt)
|| (x)==PIX_FMT_YUV444P \
|| (x)==PIX_FMT_YUV422P \
|| (x)==PIX_FMT_YUV411P \
- || isRGBinInt(x) \
- || isBGRinInt(x) \
+ || isAnyRGB(x) \
|| (x)==PIX_FMT_NV12 \
|| (x)==PIX_FMT_NV21 \
|| (x)==PIX_FMT_GRAY16BE \
@@ -872,14 +871,14 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
getSubSampleFactors(&c->chrDstHSubSample, &c->chrDstVSubSample, dstFormat);
// reuse chroma for 2 pixels RGB/BGR unless user wants full chroma interpolation
- if ((isBGRinInt(dstFormat) || isRGBinInt(dstFormat)) && !(flags&SWS_FULL_CHR_H_INT)) c->chrDstHSubSample=1;
+ if (isAnyRGB(dstFormat) && !(flags&SWS_FULL_CHR_H_INT)) c->chrDstHSubSample=1;
// drop some chroma lines if the user wants it
c->vChrDrop= (flags&SWS_SRC_V_CHR_DROP_MASK)>>SWS_SRC_V_CHR_DROP_SHIFT;
c->chrSrcVSubSample+= c->vChrDrop;
// drop every other pixel for chroma calculation unless user wants full chroma
- if ((isBGRinInt(srcFormat) || isRGBinInt(srcFormat)) && !(flags&SWS_FULL_CHR_H_INP)
+ if (isAnyRGB(srcFormat) && !(flags&SWS_FULL_CHR_H_INP)
&& srcFormat!=PIX_FMT_RGB8 && srcFormat!=PIX_FMT_BGR8
&& srcFormat!=PIX_FMT_RGB4 && srcFormat!=PIX_FMT_BGR4
&& srcFormat!=PIX_FMT_RGB4_BYTE && srcFormat!=PIX_FMT_BGR4_BYTE
@@ -903,7 +902,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat,
sws_setColorspaceDetails(c, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT], srcRange, ff_yuv2rgb_coeffs[SWS_CS_DEFAULT] /* FIXME*/, dstRange, 0, 1<<16, 1<<16);
/* unscaled special cases */
- if (unscaled && !usesHFilter && !usesVFilter && (srcRange == dstRange || isBGRinInt(dstFormat) || isRGBinInt(dstFormat))) {
+ if (unscaled && !usesHFilter && !usesVFilter && (srcRange == dstRange || isAnyRGB(dstFormat))) {
ff_get_unscaled_swscale(c);
if (c->swScale) {