diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2011-06-08 19:16:39 -0700 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-06-10 15:12:24 -0400 |
commit | 103278f7b0b037a4a6184865ca9b8d021ec9be85 (patch) | |
tree | a725bb6fb0be7b20a9498cdf960e6db16c0feeab /libswscale | |
parent | c149843b5a484e73baffa0e070cfa08fe05943dd (diff) | |
download | ffmpeg-103278f7b0b037a4a6184865ca9b8d021ec9be85.tar.gz |
libavutil/swscale: YUV444P10/YUV444P9 support.
Also add missing glue code for recently added YUV422P10 formats
to swscale.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/swscale.c | 14 | ||||
-rw-r--r-- | libswscale/swscale_internal.h | 12 | ||||
-rw-r--r-- | libswscale/utils.c | 6 |
3 files changed, 31 insertions, 1 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c index bc076dd3f2..ba89a0f4be 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -1821,7 +1821,7 @@ find_c_packed_planar_out_funcs(SwsContext *c, } else if (is16BPS(dstFormat)) { *yuv2yuvX = isBE(dstFormat) ? yuv2yuvX16BE_c : yuv2yuvX16LE_c; } else if (is9_OR_10BPS(dstFormat)) { - if (dstFormat == PIX_FMT_YUV420P9BE || dstFormat == PIX_FMT_YUV420P9LE) { + if (av_pix_fmt_descriptors[dstFormat].comp[0].depth_minus1 == 8) { *yuv2yuvX = isBE(dstFormat) ? yuv2yuvX9BE_c : yuv2yuvX9LE_c; } else { *yuv2yuvX = isBE(dstFormat) ? yuv2yuvX10BE_c : yuv2yuvX10LE_c; @@ -2161,9 +2161,15 @@ static av_cold void sws_init_swScale_c(SwsContext *c) case PIX_FMT_PAL8 : case PIX_FMT_BGR4_BYTE: case PIX_FMT_RGB4_BYTE: c->chrToYV12 = palToUV_c; break; + case PIX_FMT_YUV444P9BE: case PIX_FMT_YUV420P9BE: c->chrToYV12 = BE9ToUV_c; break; + case PIX_FMT_YUV444P9LE: case PIX_FMT_YUV420P9LE: c->chrToYV12 = LE9ToUV_c; break; + case PIX_FMT_YUV444P10BE: + case PIX_FMT_YUV422P10BE: case PIX_FMT_YUV420P10BE: c->chrToYV12 = BE10ToUV_c; break; + case PIX_FMT_YUV422P10LE: + case PIX_FMT_YUV444P10LE: case PIX_FMT_YUV420P10LE: c->chrToYV12 = LE10ToUV_c; break; case PIX_FMT_YUV420P16BE: case PIX_FMT_YUV422P16BE: @@ -2219,9 +2225,15 @@ static av_cold void sws_init_swScale_c(SwsContext *c) c->lumToYV12 = NULL; c->alpToYV12 = NULL; switch (srcFormat) { + case PIX_FMT_YUV444P9BE: case PIX_FMT_YUV420P9BE: c->lumToYV12 = BE9ToY_c; break; + case PIX_FMT_YUV444P9LE: case PIX_FMT_YUV420P9LE: c->lumToYV12 = LE9ToY_c; break; + case PIX_FMT_YUV444P10BE: + case PIX_FMT_YUV422P10BE: case PIX_FMT_YUV420P10BE: c->lumToYV12 = BE10ToY_c; break; + case PIX_FMT_YUV444P10LE: + case PIX_FMT_YUV422P10LE: case PIX_FMT_YUV420P10LE: c->lumToYV12 = LE10ToY_c; break; case PIX_FMT_YUYV422 : case PIX_FMT_YUV420P16BE: diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 013eef9e31..483842e866 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -355,6 +355,12 @@ const char *sws_format_name(enum PixelFormat format); #define is9_OR_10BPS(x) ( \ (x)==PIX_FMT_YUV420P9LE \ || (x)==PIX_FMT_YUV420P9BE \ + || (x)==PIX_FMT_YUV444P9BE \ + || (x)==PIX_FMT_YUV444P9LE \ + || (x)==PIX_FMT_YUV422P10BE \ + || (x)==PIX_FMT_YUV422P10LE \ + || (x)==PIX_FMT_YUV444P10BE \ + || (x)==PIX_FMT_YUV444P10LE \ || (x)==PIX_FMT_YUV420P10LE \ || (x)==PIX_FMT_YUV420P10BE \ ) @@ -373,12 +379,18 @@ const char *sws_format_name(enum PixelFormat format); #define isPlanarYUV(x) ( \ isPlanar8YUV(x) \ || (x)==PIX_FMT_YUV420P9LE \ + || (x)==PIX_FMT_YUV444P9LE \ || (x)==PIX_FMT_YUV420P10LE \ + || (x)==PIX_FMT_YUV422P10LE \ + || (x)==PIX_FMT_YUV444P10LE \ || (x)==PIX_FMT_YUV420P16LE \ || (x)==PIX_FMT_YUV422P16LE \ || (x)==PIX_FMT_YUV444P16LE \ || (x)==PIX_FMT_YUV420P9BE \ + || (x)==PIX_FMT_YUV444P9BE \ || (x)==PIX_FMT_YUV420P10BE \ + || (x)==PIX_FMT_YUV422P10BE \ + || (x)==PIX_FMT_YUV444P10BE \ || (x)==PIX_FMT_YUV420P16BE \ || (x)==PIX_FMT_YUV422P16BE \ || (x)==PIX_FMT_YUV444P16BE \ diff --git a/libswscale/utils.c b/libswscale/utils.c index d552330ec5..213bf3a043 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -110,12 +110,18 @@ const char *swscale_license(void) || (x)==PIX_FMT_MONOWHITE \ || (x)==PIX_FMT_MONOBLACK \ || (x)==PIX_FMT_YUV420P9LE \ + || (x)==PIX_FMT_YUV444P9LE \ || (x)==PIX_FMT_YUV420P10LE \ + || (x)==PIX_FMT_YUV422P10LE \ + || (x)==PIX_FMT_YUV444P10LE \ || (x)==PIX_FMT_YUV420P16LE \ || (x)==PIX_FMT_YUV422P16LE \ || (x)==PIX_FMT_YUV444P16LE \ || (x)==PIX_FMT_YUV420P9BE \ + || (x)==PIX_FMT_YUV444P9BE \ || (x)==PIX_FMT_YUV420P10BE \ + || (x)==PIX_FMT_YUV444P10BE \ + || (x)==PIX_FMT_YUV422P10BE \ || (x)==PIX_FMT_YUV420P16BE \ || (x)==PIX_FMT_YUV422P16BE \ || (x)==PIX_FMT_YUV444P16BE \ |