diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-02-16 02:39:58 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2009-02-16 02:39:58 +0200 |
commit | 0bf2bd91ec69dfd908d78557a17f38e0904a52e7 (patch) | |
tree | bf9e5e145ff802e7b5ff7b9ab387bfc3ba0331d7 /libswscale | |
parent | 738f66b1bc98073d74af7031c4454322157a15ec (diff) | |
parent | eacf4421f4fe16674aefe8b628321188c4912521 (diff) | |
download | mpv-0bf2bd91ec69dfd908d78557a17f38e0904a52e7.tar.bz2 mpv-0bf2bd91ec69dfd908d78557a17f38e0904a52e7.tar.xz |
Merge svn changes up to r28610
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/swscale.c | 19 | ||||
-rw-r--r-- | libswscale/swscale.h | 23 | ||||
-rw-r--r-- | libswscale/swscale_altivec_template.c | 10 | ||||
-rw-r--r-- | libswscale/swscale_template.c | 5 |
4 files changed, 41 insertions, 16 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 586715eacd..6ba56bcb96 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -2396,6 +2396,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d #ifdef COMPILE_ALTIVEC if ((c->flags & SWS_CPU_CAPS_ALTIVEC) && + !(c->flags & SWS_BITEXACT) && srcFormat == PIX_FMT_YUV420P) { // unscaled YV12 -> packed YUV, we want speed if (dstFormat == PIX_FMT_YUYV422) @@ -2879,8 +2880,8 @@ SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur, sws_normalizeVec(filter->lumH, 1.0); sws_normalizeVec(filter->lumV, 1.0); - if (verbose) sws_printVec(filter->chrH); - if (verbose) sws_printVec(filter->lumH); + if (verbose) sws_printVec2(filter->chrH, NULL, AV_LOG_DEBUG); + if (verbose) sws_printVec2(filter->lumH, NULL, AV_LOG_DEBUG); return filter; } @@ -3067,7 +3068,7 @@ SwsVector *sws_cloneVec(SwsVector *a){ return vec; } -void sws_printVec(SwsVector *a){ +void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level){ int i; double max=0; double min=0; @@ -3084,12 +3085,18 @@ void sws_printVec(SwsVector *a){ for (i=0; i<a->length; i++) { int x= (int)((a->coeff[i]-min)*60.0/range +0.5); - av_log(NULL, AV_LOG_DEBUG, "%1.3f ", a->coeff[i]); - for (;x>0; x--) av_log(NULL, AV_LOG_DEBUG, " "); - av_log(NULL, AV_LOG_DEBUG, "|\n"); + av_log(log_ctx, log_level, "%1.3f ", a->coeff[i]); + for (;x>0; x--) av_log(log_ctx, log_level, " "); + av_log(log_ctx, log_level, "|\n"); } } +#if LIBSWSCALE_VERSION_MAJOR < 1 +void sws_printVec(SwsVector *a){ + sws_printVec2(a, NULL, AV_LOG_DEBUG); +} +#endif + void sws_freeVec(SwsVector *a){ if (!a) return; av_freep(&a->coeff); diff --git a/libswscale/swscale.h b/libswscale/swscale.h index 35db84cdef..b29244da03 100644 --- a/libswscale/swscale.h +++ b/libswscale/swscale.h @@ -30,8 +30,8 @@ #include "libavutil/avutil.h" #define LIBSWSCALE_VERSION_MAJOR 0 -#define LIBSWSCALE_VERSION_MINOR 6 -#define LIBSWSCALE_VERSION_MICRO 2 +#define LIBSWSCALE_VERSION_MINOR 7 +#define LIBSWSCALE_VERSION_MICRO 0 #define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \ LIBSWSCALE_VERSION_MINOR, \ @@ -165,6 +165,11 @@ SwsVector *sws_getIdentityVec(void); * Scales all the coefficients of \p a by the \p scalar value. */ void sws_scaleVec(SwsVector *a, double scalar); + +/** + * Scales all the coefficients of \p a so that their sum equals \p + * height." + */ void sws_normalizeVec(SwsVector *a, double height); void sws_convVec(SwsVector *a, SwsVector *b); void sws_addVec(SwsVector *a, SwsVector *b); @@ -177,7 +182,19 @@ void sws_shiftVec(SwsVector *a, int shift); */ SwsVector *sws_cloneVec(SwsVector *a); -void sws_printVec(SwsVector *a); +#if LIBSWSCALE_VERSION_MAJOR < 1 +/** + * @deprecated Use sws_printVec2() instead. + */ +attribute_deprecated void sws_printVec(SwsVector *a); +#endif + +/** + * Prints with av_log() a textual representation of the vector \p a + * if \p log_level <= av_log_level. + */ +void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level); + void sws_freeVec(SwsVector *a); SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur, diff --git a/libswscale/swscale_altivec_template.c b/libswscale/swscale_altivec_template.c index 2111cec410..a008b966e8 100644 --- a/libswscale/swscale_altivec_template.c +++ b/libswscale/swscale_altivec_template.c @@ -220,7 +220,7 @@ static inline void hScale_altivec_real(int16_t *dst, int dstW, uint8_t *src, int for (j=0; j<filterSize; j++) { val += ((int)src[srcPos + j])*filter[filterSize*i + j]; } - dst[i] = av_clip(val>>7, 0, (1<<15)-1); + dst[i] = FFMIN(val>>7, (1<<15)-1); } } else @@ -259,7 +259,7 @@ static inline void hScale_altivec_real(int16_t *dst, int dstW, uint8_t *src, int val_vEven = vec_mule(src_v, filter_v); val_s = vec_sums(val_vEven, vzero); vec_st(val_s, 0, tempo); - dst[i] = av_clip(tempo[3]>>7, 0, (1<<15)-1); + dst[i] = FFMIN(tempo[3]>>7, (1<<15)-1); } } break; @@ -286,7 +286,7 @@ static inline void hScale_altivec_real(int16_t *dst, int dstW, uint8_t *src, int val_v = vec_msums(src_v, filter_v, (vector signed int)vzero); val_s = vec_sums(val_v, vzero); vec_st(val_s, 0, tempo); - dst[i] = av_clip(tempo[3]>>7, 0, (1<<15)-1); + dst[i] = FFMIN(tempo[3]>>7, (1<<15)-1); } } break; @@ -315,7 +315,7 @@ static inline void hScale_altivec_real(int16_t *dst, int dstW, uint8_t *src, int vector signed int val_s = vec_sums(val_v, vzero); vec_st(val_s, 0, tempo); - dst[i] = av_clip(tempo[3]>>7, 0, (1<<15)-1); + dst[i] = FFMIN(tempo[3]>>7, (1<<15)-1); } } break; @@ -377,7 +377,7 @@ static inline void hScale_altivec_real(int16_t *dst, int dstW, uint8_t *src, int val_s = vec_sums(val_v, vzero); vec_st(val_s, 0, tempo); - dst[i] = av_clip(tempo[3]>>7, 0, (1<<15)-1); + dst[i] = FFMIN(tempo[3]>>7, (1<<15)-1); } } diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index c0e680ca4a..1f5a10de41 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -1136,9 +1136,10 @@ static inline void RENAME(yuv2packedX)(SwsContext *c, int16_t *lumFilter, int16_ #if HAVE_ALTIVEC /* The following list of supported dstFormat values should match what's found in the body of altivec_yuv2packedX() */ - if (c->dstFormat==PIX_FMT_ABGR || c->dstFormat==PIX_FMT_BGRA || + if (!(c->flags & SWS_BITEXACT) && + (c->dstFormat==PIX_FMT_ABGR || c->dstFormat==PIX_FMT_BGRA || c->dstFormat==PIX_FMT_BGR24 || c->dstFormat==PIX_FMT_RGB24 || - c->dstFormat==PIX_FMT_RGBA || c->dstFormat==PIX_FMT_ARGB) + c->dstFormat==PIX_FMT_RGBA || c->dstFormat==PIX_FMT_ARGB)) altivec_yuv2packedX (c, lumFilter, lumSrc, lumFilterSize, chrFilter, chrSrc, chrFilterSize, dest, dstW, dstY); |