diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2016-09-24 22:48:48 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2016-09-27 18:48:30 +0200 |
commit | 85406e7a8d5ad12db15ef9d713d0bc3d870fafee (patch) | |
tree | ceeda1e60bb19383668f30fa0c5a978f1a8aa933 /libswscale | |
parent | 2b5b1e1e9b89063d352e2efed014f9d761b85032 (diff) | |
download | ffmpeg-85406e7a8d5ad12db15ef9d713d0bc3d870fafee.tar.gz |
pixfmt: Add yuv420p12 pixel format
Diffstat (limited to 'libswscale')
-rw-r--r-- | libswscale/input.c | 4 | ||||
-rw-r--r-- | libswscale/output.c | 9 | ||||
-rw-r--r-- | libswscale/swscale_unscaled.c | 4 | ||||
-rw-r--r-- | libswscale/utils.c | 2 |
4 files changed, 17 insertions, 2 deletions
diff --git a/libswscale/input.c b/libswscale/input.c index 69c6729666..9c0a32c4c6 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -815,6 +815,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_YUV420P10LE: case AV_PIX_FMT_YUV422P10LE: case AV_PIX_FMT_YUV444P10LE: + case AV_PIX_FMT_YUV420P12LE: case AV_PIX_FMT_YUV420P16LE: case AV_PIX_FMT_YUV422P16LE: case AV_PIX_FMT_YUV444P16LE: @@ -836,6 +837,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_YUV420P10BE: case AV_PIX_FMT_YUV422P10BE: case AV_PIX_FMT_YUV444P10BE: + case AV_PIX_FMT_YUV420P12BE: case AV_PIX_FMT_YUV420P16BE: case AV_PIX_FMT_YUV422P16BE: case AV_PIX_FMT_YUV444P16BE: @@ -1033,6 +1035,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_YUV420P10LE: case AV_PIX_FMT_YUV422P10LE: case AV_PIX_FMT_YUV444P10LE: + case AV_PIX_FMT_YUV420P12LE: case AV_PIX_FMT_YUV420P16LE: case AV_PIX_FMT_YUV422P16LE: case AV_PIX_FMT_YUV444P16LE: @@ -1058,6 +1061,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) case AV_PIX_FMT_YUV420P10BE: case AV_PIX_FMT_YUV422P10BE: case AV_PIX_FMT_YUV444P10BE: + case AV_PIX_FMT_YUV420P12BE: case AV_PIX_FMT_YUV420P16BE: case AV_PIX_FMT_YUV422P16BE: case AV_PIX_FMT_YUV444P16BE: diff --git a/libswscale/output.c b/libswscale/output.c index 6a51bb9bdf..78ebbc6b4f 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -231,6 +231,8 @@ yuv2NBPS( 9, BE, 1, 10, int16_t) yuv2NBPS( 9, LE, 0, 10, int16_t) yuv2NBPS(10, BE, 1, 10, int16_t) yuv2NBPS(10, LE, 0, 10, int16_t) +yuv2NBPS(12, BE, 1, 10, int16_t) +yuv2NBPS(12, LE, 0, 10, int16_t) yuv2NBPS(16, BE, 1, 16, int32_t) yuv2NBPS(16, LE, 0, 16, int32_t) @@ -1368,9 +1370,14 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, if (desc->comp[0].depth == 9) { *yuv2planeX = isBE(dstFormat) ? yuv2planeX_9BE_c : yuv2planeX_9LE_c; *yuv2plane1 = isBE(dstFormat) ? yuv2plane1_9BE_c : yuv2plane1_9LE_c; - } else { + } else if (desc->comp[0].depth == 10) { *yuv2planeX = isBE(dstFormat) ? yuv2planeX_10BE_c : yuv2planeX_10LE_c; *yuv2plane1 = isBE(dstFormat) ? yuv2plane1_10BE_c : yuv2plane1_10LE_c; + } else if (desc->comp[0].depth == 12) { + *yuv2planeX = isBE(dstFormat) ? yuv2planeX_12BE_c : yuv2planeX_12LE_c; + *yuv2plane1 = isBE(dstFormat) ? yuv2plane1_12BE_c : yuv2plane1_12LE_c; + } else { + assert(0); } } else { *yuv2plane1 = yuv2plane1_8_c; diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c index fbdc2affe1..87331ae818 100644 --- a/libswscale/swscale_unscaled.c +++ b/libswscale/swscale_unscaled.c @@ -1157,8 +1157,10 @@ void ff_get_unscaled_swscale(SwsContext *c) c->chrDstVSubSample == c->chrSrcVSubSample && dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21 && dstFormat != AV_PIX_FMT_P010LE && dstFormat != AV_PIX_FMT_P010BE && + dstFormat != AV_PIX_FMT_YUV420P12LE && dstFormat != AV_PIX_FMT_YUV420P12BE && srcFormat != AV_PIX_FMT_NV12 && srcFormat != AV_PIX_FMT_NV21 && - srcFormat != AV_PIX_FMT_P010LE && srcFormat != AV_PIX_FMT_P010BE)) + srcFormat != AV_PIX_FMT_P010LE && srcFormat != AV_PIX_FMT_P010BE && + srcFormat != AV_PIX_FMT_YUV420P12LE && srcFormat != AV_PIX_FMT_YUV420P12BE)) { if (isPacked(c->srcFormat)) c->swscale = packedCopyWrapper; diff --git a/libswscale/utils.c b/libswscale/utils.c index c4fb7451eb..06b9c1c28b 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -165,6 +165,8 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = { [AV_PIX_FMT_YUV420P9LE] = { 1, 1 }, [AV_PIX_FMT_YUV420P10BE] = { 1, 1 }, [AV_PIX_FMT_YUV420P10LE] = { 1, 1 }, + [AV_PIX_FMT_YUV420P12BE] = { 1, 1 }, + [AV_PIX_FMT_YUV420P12LE] = { 1, 1 }, [AV_PIX_FMT_YUV422P9BE] = { 1, 1 }, [AV_PIX_FMT_YUV422P9LE] = { 1, 1 }, [AV_PIX_FMT_YUV422P10BE] = { 1, 1 }, |