aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale/x86
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-06-08 03:56:36 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-06-08 05:25:28 +0200
commitd552f616a26623e5b593e4d3474c61563f3939fd (patch)
treef5f3791b58abe6ea8895709b7d2be272afc493ab /libswscale/x86
parent7d89f7cbf3ccd98f9a5f58db97effa9afd2d571a (diff)
parentac4a8548110bc180cb67bea6eaf8b8e1081370cf (diff)
downloadffmpeg-d552f616a26623e5b593e4d3474c61563f3939fd.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: (28 commits) Remove some non-compiling debug messages. ffplay: Fix non-compiling debug printf and replace it by av_dlog. H264: x86 predict init cosmetics. ac3enc: Fix linking of AC-3 encoder without the E-AC-3 encoder. Move E-AC-3 encoder functions to a separate eac3enc.c file. ac3enc: remove convenience macro, #define DEBUG ac3enc: remove unused #define vc1: re-initialize tables after width/height change. APIchanges: fill-in git commit hash for av_get_bytes_per_sample() addition samplefmt: add av_get_bytes_per_sample() iirfilter: fix biquad filter coefficients. swscale: remove duplicate conversion routine in swScale(). swscale: add yuv2planar/packed function typedefs. swscale: integrate yuv2nv12X_C into yuv2yuvX() function pointers. swscale: reindent x86 init code. swscale: extract SWS_FULL_CHR_H_INT conditional into init code. swscale: cosmetics. swscale: remove alp/chr/lumSrcOffset. swscale: un-special-case yuv2yuvX16_c(). shorten: Remove stray DEBUG #define and corresponding av_dlog statement. ... Conflicts: doc/APIchanges libavcodec/ac3enc.c libavutil/avutil.h libavutil/samplefmt.c libswscale/swscale.c libswscale/swscale_internal.h libswscale/x86/swscale_template.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale/x86')
-rw-r--r--libswscale/x86/swscale_template.c72
1 files changed, 40 insertions, 32 deletions
diff --git a/libswscale/x86/swscale_template.c b/libswscale/x86/swscale_template.c
index 58c6bdeee4..27cb41c4c4 100644
--- a/libswscale/x86/swscale_template.c
+++ b/libswscale/x86/swscale_template.c
@@ -2351,56 +2351,64 @@ static inline void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *d
static void RENAME(sws_init_swScale)(SwsContext *c)
{
- enum PixelFormat srcFormat = c->srcFormat;
-
- if (!(c->flags & SWS_BITEXACT)) {
- if (c->flags & SWS_ACCURATE_RND) {
- c->yuv2yuv1 = RENAME(yuv2yuv1_ar );
- c->yuv2yuvX = RENAME(yuv2yuvX_ar );
- switch (c->dstFormat) {
- case PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X_ar); break;
- case PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X_ar); break;
- case PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X_ar); break;
- case PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X_ar); break;
- case PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X_ar); break;
- default: break;
+ enum PixelFormat srcFormat = c->srcFormat,
+ dstFormat = c->dstFormat;
+
+ if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) && dstFormat != PIX_FMT_NV12
+ && dstFormat != PIX_FMT_NV21 && !(c->flags & SWS_BITEXACT)) {
+ if (c->flags & SWS_ACCURATE_RND) {
+ c->yuv2yuv1 = RENAME(yuv2yuv1_ar );
+ c->yuv2yuvX = RENAME(yuv2yuvX_ar );
+ if (!(c->flags & SWS_FULL_CHR_H_INT)) {
+ switch (c->dstFormat) {
+ case PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X_ar); break;
+ case PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X_ar); break;
+ case PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X_ar); break;
+ case PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X_ar); break;
+ case PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X_ar); break;
+ default: break;
+ }
+ }
+ } else {
+ int should_dither= isNBPS(c->srcFormat) || is16BPS(c->srcFormat);
+ c->yuv2yuv1 = should_dither ? RENAME(yuv2yuv1_ar ) : RENAME(yuv2yuv1 );
+ c->yuv2yuvX = RENAME(yuv2yuvX );
+ if (!(c->flags & SWS_FULL_CHR_H_INT)) {
+ switch (c->dstFormat) {
+ case PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X); break;
+ case PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X); break;
+ case PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X); break;
+ case PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X); break;
+ case PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X); break;
+ default: break;
+ }
+ }
}
- } else {
- int should_dither= isNBPS(c->srcFormat) || is16BPS(c->srcFormat);
- c->yuv2yuv1 = should_dither ? RENAME(yuv2yuv1_ar ) : RENAME(yuv2yuv1 );
- c->yuv2yuvX = RENAME(yuv2yuvX );
+ if (!(c->flags & SWS_FULL_CHR_H_INT)) {
switch (c->dstFormat) {
- case PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X); break;
- case PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X); break;
- case PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X); break;
- case PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X); break;
- case PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X); break;
- default: break;
- }
- }
- switch (c->dstFormat) {
- case PIX_FMT_RGB32:
+ case PIX_FMT_RGB32:
c->yuv2packed1 = RENAME(yuv2rgb32_1);
c->yuv2packed2 = RENAME(yuv2rgb32_2);
break;
- case PIX_FMT_BGR24:
+ case PIX_FMT_BGR24:
c->yuv2packed1 = RENAME(yuv2bgr24_1);
c->yuv2packed2 = RENAME(yuv2bgr24_2);
break;
- case PIX_FMT_RGB555:
+ case PIX_FMT_RGB555:
c->yuv2packed1 = RENAME(yuv2rgb555_1);
c->yuv2packed2 = RENAME(yuv2rgb555_2);
break;
- case PIX_FMT_RGB565:
+ case PIX_FMT_RGB565:
c->yuv2packed1 = RENAME(yuv2rgb565_1);
c->yuv2packed2 = RENAME(yuv2rgb565_2);
break;
- case PIX_FMT_YUYV422:
+ case PIX_FMT_YUYV422:
c->yuv2packed1 = RENAME(yuv2yuyv422_1);
c->yuv2packed2 = RENAME(yuv2yuyv422_2);
break;
- default:
+ default:
break;
+ }
}
}