Commit 85406e7a authored by Luca Barbato's avatar Luca Barbato

pixfmt: Add yuv420p12 pixel format

parent 2b5b1e1e
...@@ -1174,6 +1174,30 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { ...@@ -1174,6 +1174,30 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
}, },
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR, .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
}, },
[AV_PIX_FMT_YUV420P12LE] = {
.name = "yuv420p12le",
.nb_components = 3,
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
{ 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
{ 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
{ 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_PLANAR,
},
[AV_PIX_FMT_YUV420P12BE] = {
.name = "yuv420p12be",
.nb_components = 3,
.log2_chroma_w = 1,
.log2_chroma_h = 1,
.comp = {
{ 0, 2, 0, 0, 12, 1, 11, 1 }, /* Y */
{ 1, 2, 0, 0, 12, 1, 11, 1 }, /* U */
{ 2, 2, 0, 0, 12, 1, 11, 1 }, /* V */
},
.flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_PLANAR,
},
[AV_PIX_FMT_YUV420P16LE] = { [AV_PIX_FMT_YUV420P16LE] = {
.name = "yuv420p16le", .name = "yuv420p16le",
.nb_components = 3, .nb_components = 3,
...@@ -1842,6 +1866,7 @@ enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt) ...@@ -1842,6 +1866,7 @@ enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt)
PIX_FMT_SWAP_ENDIANNESS(YUV420P10); PIX_FMT_SWAP_ENDIANNESS(YUV420P10);
PIX_FMT_SWAP_ENDIANNESS(YUV422P10); PIX_FMT_SWAP_ENDIANNESS(YUV422P10);
PIX_FMT_SWAP_ENDIANNESS(YUV444P10); PIX_FMT_SWAP_ENDIANNESS(YUV444P10);
PIX_FMT_SWAP_ENDIANNESS(YUV420P12);
PIX_FMT_SWAP_ENDIANNESS(YUV420P16); PIX_FMT_SWAP_ENDIANNESS(YUV420P16);
PIX_FMT_SWAP_ENDIANNESS(YUV422P16); PIX_FMT_SWAP_ENDIANNESS(YUV422P16);
PIX_FMT_SWAP_ENDIANNESS(YUV444P16); PIX_FMT_SWAP_ENDIANNESS(YUV444P16);
......
...@@ -230,6 +230,9 @@ enum AVPixelFormat { ...@@ -230,6 +230,9 @@ enum AVPixelFormat {
AV_PIX_FMT_P010LE, ///< like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, little-endian AV_PIX_FMT_P010LE, ///< like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, little-endian
AV_PIX_FMT_P010BE, ///< like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, big-endian AV_PIX_FMT_P010BE, ///< like NV12, with 10bpp per component, data in the high bits, zeros in the low bits, big-endian
AV_PIX_FMT_YUV420P12BE, ///< planar YUV 4:2:0, 18bpp, (1 Cr & Cb sample per 2x2 Y), big-endian
AV_PIX_FMT_YUV420P12LE, ///< planar YUV 4:2:0, 18bpp, (1 Cr & Cb sample per 2x2 Y), little-endian
AV_PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions AV_PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
}; };
...@@ -263,6 +266,7 @@ enum AVPixelFormat { ...@@ -263,6 +266,7 @@ enum AVPixelFormat {
#define AV_PIX_FMT_YUV420P10 AV_PIX_FMT_NE(YUV420P10BE, YUV420P10LE) #define AV_PIX_FMT_YUV420P10 AV_PIX_FMT_NE(YUV420P10BE, YUV420P10LE)
#define AV_PIX_FMT_YUV422P10 AV_PIX_FMT_NE(YUV422P10BE, YUV422P10LE) #define AV_PIX_FMT_YUV422P10 AV_PIX_FMT_NE(YUV422P10BE, YUV422P10LE)
#define AV_PIX_FMT_YUV444P10 AV_PIX_FMT_NE(YUV444P10BE, YUV444P10LE) #define AV_PIX_FMT_YUV444P10 AV_PIX_FMT_NE(YUV444P10BE, YUV444P10LE)
#define AV_PIX_FMT_YUV420P12 AV_PIX_FMT_NE(YUV420P12BE, YUV420P12LE)
#define AV_PIX_FMT_YUV420P16 AV_PIX_FMT_NE(YUV420P16BE, YUV420P16LE) #define AV_PIX_FMT_YUV420P16 AV_PIX_FMT_NE(YUV420P16BE, YUV420P16LE)
#define AV_PIX_FMT_YUV422P16 AV_PIX_FMT_NE(YUV422P16BE, YUV422P16LE) #define AV_PIX_FMT_YUV422P16 AV_PIX_FMT_NE(YUV422P16BE, YUV422P16LE)
#define AV_PIX_FMT_YUV444P16 AV_PIX_FMT_NE(YUV444P16BE, YUV444P16LE) #define AV_PIX_FMT_YUV444P16 AV_PIX_FMT_NE(YUV444P16BE, YUV444P16LE)
......
...@@ -815,6 +815,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) ...@@ -815,6 +815,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_YUV420P10LE: case AV_PIX_FMT_YUV420P10LE:
case AV_PIX_FMT_YUV422P10LE: case AV_PIX_FMT_YUV422P10LE:
case AV_PIX_FMT_YUV444P10LE: case AV_PIX_FMT_YUV444P10LE:
case AV_PIX_FMT_YUV420P12LE:
case AV_PIX_FMT_YUV420P16LE: case AV_PIX_FMT_YUV420P16LE:
case AV_PIX_FMT_YUV422P16LE: case AV_PIX_FMT_YUV422P16LE:
case AV_PIX_FMT_YUV444P16LE: case AV_PIX_FMT_YUV444P16LE:
...@@ -836,6 +837,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) ...@@ -836,6 +837,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_YUV420P10BE: case AV_PIX_FMT_YUV420P10BE:
case AV_PIX_FMT_YUV422P10BE: case AV_PIX_FMT_YUV422P10BE:
case AV_PIX_FMT_YUV444P10BE: case AV_PIX_FMT_YUV444P10BE:
case AV_PIX_FMT_YUV420P12BE:
case AV_PIX_FMT_YUV420P16BE: case AV_PIX_FMT_YUV420P16BE:
case AV_PIX_FMT_YUV422P16BE: case AV_PIX_FMT_YUV422P16BE:
case AV_PIX_FMT_YUV444P16BE: case AV_PIX_FMT_YUV444P16BE:
...@@ -1033,6 +1035,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) ...@@ -1033,6 +1035,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_YUV420P10LE: case AV_PIX_FMT_YUV420P10LE:
case AV_PIX_FMT_YUV422P10LE: case AV_PIX_FMT_YUV422P10LE:
case AV_PIX_FMT_YUV444P10LE: case AV_PIX_FMT_YUV444P10LE:
case AV_PIX_FMT_YUV420P12LE:
case AV_PIX_FMT_YUV420P16LE: case AV_PIX_FMT_YUV420P16LE:
case AV_PIX_FMT_YUV422P16LE: case AV_PIX_FMT_YUV422P16LE:
case AV_PIX_FMT_YUV444P16LE: case AV_PIX_FMT_YUV444P16LE:
...@@ -1058,6 +1061,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) ...@@ -1058,6 +1061,7 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
case AV_PIX_FMT_YUV420P10BE: case AV_PIX_FMT_YUV420P10BE:
case AV_PIX_FMT_YUV422P10BE: case AV_PIX_FMT_YUV422P10BE:
case AV_PIX_FMT_YUV444P10BE: case AV_PIX_FMT_YUV444P10BE:
case AV_PIX_FMT_YUV420P12BE:
case AV_PIX_FMT_YUV420P16BE: case AV_PIX_FMT_YUV420P16BE:
case AV_PIX_FMT_YUV422P16BE: case AV_PIX_FMT_YUV422P16BE:
case AV_PIX_FMT_YUV444P16BE: case AV_PIX_FMT_YUV444P16BE:
......
...@@ -231,6 +231,8 @@ yuv2NBPS( 9, BE, 1, 10, int16_t) ...@@ -231,6 +231,8 @@ yuv2NBPS( 9, BE, 1, 10, int16_t)
yuv2NBPS( 9, LE, 0, 10, int16_t) yuv2NBPS( 9, LE, 0, 10, int16_t)
yuv2NBPS(10, BE, 1, 10, int16_t) yuv2NBPS(10, BE, 1, 10, int16_t)
yuv2NBPS(10, LE, 0, 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, BE, 1, 16, int32_t)
yuv2NBPS(16, LE, 0, 16, int32_t) yuv2NBPS(16, LE, 0, 16, int32_t)
...@@ -1368,9 +1370,14 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, ...@@ -1368,9 +1370,14 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c,
if (desc->comp[0].depth == 9) { if (desc->comp[0].depth == 9) {
*yuv2planeX = isBE(dstFormat) ? yuv2planeX_9BE_c : yuv2planeX_9LE_c; *yuv2planeX = isBE(dstFormat) ? yuv2planeX_9BE_c : yuv2planeX_9LE_c;
*yuv2plane1 = isBE(dstFormat) ? yuv2plane1_9BE_c : yuv2plane1_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; *yuv2planeX = isBE(dstFormat) ? yuv2planeX_10BE_c : yuv2planeX_10LE_c;
*yuv2plane1 = isBE(dstFormat) ? yuv2plane1_10BE_c : yuv2plane1_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 { } else {
*yuv2plane1 = yuv2plane1_8_c; *yuv2plane1 = yuv2plane1_8_c;
......
...@@ -1157,8 +1157,10 @@ void ff_get_unscaled_swscale(SwsContext *c) ...@@ -1157,8 +1157,10 @@ void ff_get_unscaled_swscale(SwsContext *c)
c->chrDstVSubSample == c->chrSrcVSubSample && c->chrDstVSubSample == c->chrSrcVSubSample &&
dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21 && dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21 &&
dstFormat != AV_PIX_FMT_P010LE && dstFormat != AV_PIX_FMT_P010BE && 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_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)) if (isPacked(c->srcFormat))
c->swscale = packedCopyWrapper; c->swscale = packedCopyWrapper;
......
...@@ -165,6 +165,8 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = { ...@@ -165,6 +165,8 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = {
[AV_PIX_FMT_YUV420P9LE] = { 1, 1 }, [AV_PIX_FMT_YUV420P9LE] = { 1, 1 },
[AV_PIX_FMT_YUV420P10BE] = { 1, 1 }, [AV_PIX_FMT_YUV420P10BE] = { 1, 1 },
[AV_PIX_FMT_YUV420P10LE] = { 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_YUV422P9BE] = { 1, 1 },
[AV_PIX_FMT_YUV422P9LE] = { 1, 1 }, [AV_PIX_FMT_YUV422P9LE] = { 1, 1 },
[AV_PIX_FMT_YUV422P10BE] = { 1, 1 }, [AV_PIX_FMT_YUV422P10BE] = { 1, 1 },
......
pixdesc-yuv420p12be 6d665168703a982178ac395de9be422f
pixdesc-yuv420p12le 0898b89cc0e0aec143fea7d3ecec991b
...@@ -43,6 +43,8 @@ yuv411p fc2f303b20ae610dce86dae4a6671881 ...@@ -43,6 +43,8 @@ yuv411p fc2f303b20ae610dce86dae4a6671881
yuv420p a2117c3c5d4533dca311dc94a3d157bc yuv420p a2117c3c5d4533dca311dc94a3d157bc
yuv420p10be 7756ef359f79d63ef6f983caeaba5c51 yuv420p10be 7756ef359f79d63ef6f983caeaba5c51
yuv420p10le aa8abcc05010b4b0df7d924fd5887291 yuv420p10le aa8abcc05010b4b0df7d924fd5887291
yuv420p12be f93fea0e8e10e9f2d006e8f8be5b8938
yuv420p12le 5d2810e2112328dd88ffddfb486df060
yuv420p16be 7a708532d8ac26d598ac7332e38dd2de yuv420p16be 7a708532d8ac26d598ac7332e38dd2de
yuv420p16le 6b868d3b0c44c6b04f39415890d6ee0b yuv420p16le 6b868d3b0c44c6b04f39415890d6ee0b
yuv420p9be 11ffb289661f4f55347d60e99dcef632 yuv420p9be 11ffb289661f4f55347d60e99dcef632
......
...@@ -43,6 +43,8 @@ yuv411p fc2f303b20ae610dce86dae4a6671881 ...@@ -43,6 +43,8 @@ yuv411p fc2f303b20ae610dce86dae4a6671881
yuv420p a2117c3c5d4533dca311dc94a3d157bc yuv420p a2117c3c5d4533dca311dc94a3d157bc
yuv420p10be 7756ef359f79d63ef6f983caeaba5c51 yuv420p10be 7756ef359f79d63ef6f983caeaba5c51
yuv420p10le aa8abcc05010b4b0df7d924fd5887291 yuv420p10le aa8abcc05010b4b0df7d924fd5887291
yuv420p12be f93fea0e8e10e9f2d006e8f8be5b8938
yuv420p12le 5d2810e2112328dd88ffddfb486df060
yuv420p16be 7a708532d8ac26d598ac7332e38dd2de yuv420p16be 7a708532d8ac26d598ac7332e38dd2de
yuv420p16le 6b868d3b0c44c6b04f39415890d6ee0b yuv420p16le 6b868d3b0c44c6b04f39415890d6ee0b
yuv420p9be 11ffb289661f4f55347d60e99dcef632 yuv420p9be 11ffb289661f4f55347d60e99dcef632
......
...@@ -43,6 +43,8 @@ yuv411p 091777fdfffa2dccbfd75769d1a402c7 ...@@ -43,6 +43,8 @@ yuv411p 091777fdfffa2dccbfd75769d1a402c7
yuv420p 4f0105b3f2008bff284de251fe61ce06 yuv420p 4f0105b3f2008bff284de251fe61ce06
yuv420p10be caaee5d071cccf50cc51c70f7a233024 yuv420p10be caaee5d071cccf50cc51c70f7a233024
yuv420p10le 06c47286459599c62b25466e2ee3c91d yuv420p10le 06c47286459599c62b25466e2ee3c91d
yuv420p12be b549289c041b852f0fec07d2cca5fb16
yuv420p12le df151f2b0a8bb7062d35b515cdffca3b
yuv420p16be 10ba255f3901b5d47d3ac803fb787bcf yuv420p16be 10ba255f3901b5d47d3ac803fb787bcf
yuv420p16le 38c42f658cad8546bfc465b72f6312ab yuv420p16le 38c42f658cad8546bfc465b72f6312ab
yuv420p9be 17cd0ca2d12fd972045271e06a14b711 yuv420p9be 17cd0ca2d12fd972045271e06a14b711
......
...@@ -43,6 +43,8 @@ yuv411p a97d81c8a515965209127cfdc718f899 ...@@ -43,6 +43,8 @@ yuv411p a97d81c8a515965209127cfdc718f899
yuv420p daed3fd5e1980ccc4d4409320f16fbf6 yuv420p daed3fd5e1980ccc4d4409320f16fbf6
yuv420p10be f434af8526dcda2988f15a08cdc4bf98 yuv420p10be f434af8526dcda2988f15a08cdc4bf98
yuv420p10le 9dcbdb0206713a90fd03b313d99e9ff9 yuv420p10le 9dcbdb0206713a90fd03b313d99e9ff9
yuv420p12be 5c3b2cbbb97c38b763f3da61ba5152d2
yuv420p12le 88e20b45556294e7ca64b323cf115ceb
yuv420p16be b8f1a0e4ef98903e2ef8dbce7bc812e2 yuv420p16be b8f1a0e4ef98903e2ef8dbce7bc812e2
yuv420p16le 3be4223322a9d904caa2ad7d4ccf3c6a yuv420p16le 3be4223322a9d904caa2ad7d4ccf3c6a
yuv420p9be 34346f74216be11c38cdaeffaba250cc yuv420p9be 34346f74216be11c38cdaeffaba250cc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment