diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-08-29 19:46:10 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-08-29 20:04:34 +0400 |
commit | 1c66807636ed8da5cf81d75cc8bb2726c6d6bc21 (patch) | |
tree | dbb5d2fafe49a56ce5d608c74ae32929c08a4405 /libswscale | |
parent | 85c830331c36502144e1cc9cf8aa7bd177e1d79d (diff) | |
parent | d488c3bcbaf7ddda42597e014deb661a7e9e2112 (diff) |
Merge commit 'd488c3bcbaf7ddda42597e014deb661a7e9e2112'
* commit 'd488c3bcbaf7ddda42597e014deb661a7e9e2112':
configure: support Bitrig OS
yuv2rgb: handle line widths that are not a multiple of 4.
graph2dot: Use the fallback getopt implementation if needed
tools: Include io.h for open/read/write/close if unistd.h doesn't exist
testprogs: Remove unused includes
qt-faststart: Use other seek/tell functions on MSVC than on mingw
ismindex: Include direct.h for _mkdir on windows
sdp: Use static const char arrays instead of pointers to strings
x86: avcodec: Drop silly "_mmx" suffixes from filenames
x86: avcodec: Drop silly "_sse" suffixes from filenames
sdp: Include profile-level-id for H264
utvideoenc: use ff_huff_gen_len_table
huffman: add ff_huff_gen_len_table
cllc: simplify/fix swapped data buffer allocation.
rtpdec_h264: Don't set the pixel format
h264: Check that the codec isn't null before accessing it
audio_frame_queue: Define af_queue_log_state before using it
Conflicts:
libavcodec/audio_frame_queue.c
libavcodec/h264.c
libavcodec/huffman.h
libavcodec/huffyuv.c
libavcodec/utvideoenc.c
libavcodec/x86/Makefile
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/colorspace-test.c | 1 | ||||
-rw-r--r-- | libswscale/yuv2rgb.c | 64 |
2 files changed, 48 insertions, 17 deletions
diff --git a/libswscale/colorspace-test.c b/libswscale/colorspace-test.c index 962861c0cc..42a915bfe6 100644 --- a/libswscale/colorspace-test.c +++ b/libswscale/colorspace-test.c @@ -20,7 +20,6 @@ #include <stdio.h> #include <string.h> /* for memset() */ -#include <unistd.h> #include <stdlib.h> #include <inttypes.h> diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c index 67cf19ec03..073fa665cf 100644 --- a/libswscale/yuv2rgb.c +++ b/libswscale/yuv2rgb.c @@ -149,15 +149,15 @@ const int *sws_getCoefficients(int colorspace) while (h_size--) { \ int av_unused U, V, Y; \ -#define ENDYUV2RGBLINE(dst_delta) \ - pu += 4; \ - pv += 4; \ - py_1 += 8; \ - py_2 += 8; \ - dst_1 += dst_delta; \ - dst_2 += dst_delta; \ +#define ENDYUV2RGBLINE(dst_delta, ss) \ + pu += 4 >> ss; \ + pv += 4 >> ss; \ + py_1 += 8 >> ss; \ + py_2 += 8 >> ss; \ + dst_1 += dst_delta >> ss; \ + dst_2 += dst_delta >> ss; \ } \ - if (c->dstW & 4) { \ + if (c->dstW & (4 >> ss)) { \ int av_unused Y, U, V; \ #define ENDYUV2RGBFUNC() \ @@ -167,7 +167,7 @@ const int *sws_getCoefficients(int colorspace) } #define CLOSEYUV2RGBFUNC(dst_delta) \ - ENDYUV2RGBLINE(dst_delta) \ + ENDYUV2RGBLINE(dst_delta, 0) \ ENDYUV2RGBFUNC() YUV2RGBFUNC(yuv2rgb_c_48, uint8_t, 0) @@ -186,7 +186,7 @@ YUV2RGBFUNC(yuv2rgb_c_48, uint8_t, 0) LOADCHROMA(3); PUTRGB48(dst_2, py_2, 3); PUTRGB48(dst_1, py_1, 3); -ENDYUV2RGBLINE(48) +ENDYUV2RGBLINE(48, 0) LOADCHROMA(0); PUTRGB48(dst_1, py_1, 0); PUTRGB48(dst_2, py_2, 0); @@ -194,6 +194,10 @@ ENDYUV2RGBLINE(48) LOADCHROMA(1); PUTRGB48(dst_2, py_2, 1); PUTRGB48(dst_1, py_1, 1); +ENDYUV2RGBLINE(48, 1) + LOADCHROMA(0); + PUTRGB48(dst_1, py_1, 0); + PUTRGB48(dst_2, py_2, 0); ENDYUV2RGBFUNC() YUV2RGBFUNC(yuv2rgb_c_bgr48, uint8_t, 0) @@ -212,7 +216,7 @@ YUV2RGBFUNC(yuv2rgb_c_bgr48, uint8_t, 0) LOADCHROMA(3); PUTBGR48(dst_2, py_2, 3); PUTBGR48(dst_1, py_1, 3); -ENDYUV2RGBLINE(48) +ENDYUV2RGBLINE(48, 0) LOADCHROMA(0); PUTBGR48(dst_1, py_1, 0); PUTBGR48(dst_2, py_2, 0); @@ -220,6 +224,10 @@ ENDYUV2RGBLINE(48) LOADCHROMA(1); PUTBGR48(dst_2, py_2, 1); PUTBGR48(dst_1, py_1, 1); +ENDYUV2RGBLINE(48, 1) + LOADCHROMA(0); + PUTBGR48(dst_1, py_1, 0); + PUTBGR48(dst_2, py_2, 0); ENDYUV2RGBFUNC() YUV2RGBFUNC(yuv2rgb_c_32, uint32_t, 0) @@ -238,7 +246,7 @@ YUV2RGBFUNC(yuv2rgb_c_32, uint32_t, 0) LOADCHROMA(3); PUTRGB(dst_2, py_2, 3); PUTRGB(dst_1, py_1, 3); -ENDYUV2RGBLINE(8) +ENDYUV2RGBLINE(8, 0) LOADCHROMA(0); PUTRGB(dst_1, py_1, 0); PUTRGB(dst_2, py_2, 0); @@ -246,6 +254,10 @@ ENDYUV2RGBLINE(8) LOADCHROMA(1); PUTRGB(dst_2, py_2, 1); PUTRGB(dst_1, py_1, 1); +ENDYUV2RGBLINE(8, 1) + LOADCHROMA(0); + PUTRGB(dst_1, py_1, 0); + PUTRGB(dst_2, py_2, 0); ENDYUV2RGBFUNC() YUV2RGBFUNC(yuva2rgba_c, uint32_t, 1) @@ -266,7 +278,7 @@ YUV2RGBFUNC(yuva2rgba_c, uint32_t, 1) PUTRGBA(dst_1, py_1, pa_2, 3, 24); pa_1 += 8; \ pa_2 += 8; \ -ENDYUV2RGBLINE(8) +ENDYUV2RGBLINE(8, 0) LOADCHROMA(0); PUTRGBA(dst_1, py_1, pa_1, 0, 24); PUTRGBA(dst_2, py_2, pa_2, 0, 24); @@ -274,6 +286,12 @@ ENDYUV2RGBLINE(8) LOADCHROMA(1); PUTRGBA(dst_2, py_2, pa_1, 1, 24); PUTRGBA(dst_1, py_1, pa_2, 1, 24); + pa_1 += 4; \ + pa_2 += 4; \ +ENDYUV2RGBLINE(8, 1) + LOADCHROMA(0); + PUTRGBA(dst_1, py_1, pa_1, 0, 24); + PUTRGBA(dst_2, py_2, pa_2, 0, 24); ENDYUV2RGBFUNC() YUV2RGBFUNC(yuva2argb_c, uint32_t, 1) @@ -294,7 +312,7 @@ YUV2RGBFUNC(yuva2argb_c, uint32_t, 1) PUTRGBA(dst_1, py_1, pa_1, 3, 0); pa_1 += 8; \ pa_2 += 8; \ -ENDYUV2RGBLINE(8) +ENDYUV2RGBLINE(8, 0) LOADCHROMA(0); PUTRGBA(dst_1, py_1, pa_1, 0, 0); PUTRGBA(dst_2, py_2, pa_2, 0, 0); @@ -302,6 +320,12 @@ ENDYUV2RGBLINE(8) LOADCHROMA(1); PUTRGBA(dst_2, py_2, pa_2, 1, 0); PUTRGBA(dst_1, py_1, pa_1, 1, 0); + pa_1 += 4; \ + pa_2 += 4; \ +ENDYUV2RGBLINE(8, 1) + LOADCHROMA(0); + PUTRGBA(dst_1, py_1, pa_1, 0, 0); + PUTRGBA(dst_2, py_2, pa_2, 0, 0); ENDYUV2RGBFUNC() YUV2RGBFUNC(yuv2rgb_c_24_rgb, uint8_t, 0) @@ -320,7 +344,7 @@ YUV2RGBFUNC(yuv2rgb_c_24_rgb, uint8_t, 0) LOADCHROMA(3); PUTRGB24(dst_2, py_2, 3); PUTRGB24(dst_1, py_1, 3); -ENDYUV2RGBLINE(24) +ENDYUV2RGBLINE(24, 0) LOADCHROMA(0); PUTRGB24(dst_1, py_1, 0); PUTRGB24(dst_2, py_2, 0); @@ -328,6 +352,10 @@ ENDYUV2RGBLINE(24) LOADCHROMA(1); PUTRGB24(dst_2, py_2, 1); PUTRGB24(dst_1, py_1, 1); +ENDYUV2RGBLINE(24, 1) + LOADCHROMA(0); + PUTRGB24(dst_1, py_1, 0); + PUTRGB24(dst_2, py_2, 0); ENDYUV2RGBFUNC() // only trivial mods from yuv2rgb_c_24_rgb @@ -347,7 +375,7 @@ YUV2RGBFUNC(yuv2rgb_c_24_bgr, uint8_t, 0) LOADCHROMA(3); PUTBGR24(dst_2, py_2, 3); PUTBGR24(dst_1, py_1, 3); -ENDYUV2RGBLINE(24) +ENDYUV2RGBLINE(24, 0) LOADCHROMA(0); PUTBGR24(dst_1, py_1, 0); PUTBGR24(dst_2, py_2, 0); @@ -355,6 +383,10 @@ ENDYUV2RGBLINE(24) LOADCHROMA(1); PUTBGR24(dst_2, py_2, 1); PUTBGR24(dst_1, py_1, 1); +ENDYUV2RGBLINE(24, 1) + LOADCHROMA(0); + PUTBGR24(dst_1, py_1, 0); + PUTBGR24(dst_2, py_2, 0); ENDYUV2RGBFUNC() YUV2RGBFUNC(yuv2rgb_c_16_ordered_dither, uint16_t, 0) |