History

avutil/pixfmt: add XV48 pixel format

Much like XV30 and XV36 in d75c4693fef51e8f0a1b88798530f4c5147ea906, XV48 is added to support 16bit 4:4:4 as defined by Microsoft.

James Almer committed 2 years ago

Commit e02a3b41 parent e1bacfb8 files · +47 −2Browse files

Unified · Split

8 files
  1. doc/APIchanges +3 −0
  2. libavutil/pixdesc.c +25 −0
  3. libavutil/pixfmt.h +4 −0
  4. libavutil/tests/pixfmt_best.c +2 −0
  5. libavutil/version.h +1 −1
  6. tests/ref/fate/imgutils +4 −0
  7. tests/ref/fate/pixfmt_best +1 −1
  8. tests/ref/fate/sws-pixdesc-query +7 −0
doc/APIchanges+3−0
@@ -2,6 +2,9 @@ The last version increases of all libraries were on 2024-03-07 · 1 unmodified line
22
33 API changes, most recent first:
44
5+2024-10-26 - xxxxxxxxxx - lavu 59.46.100 - pixfmt.h
6+ Add AV_PIX_FMT_XV48.
7+
58 2024-10-23 - xxxxxxxxxx - lsws 8.9.100 - swscale.h
69 Add sws_is_noop().
710
libavutil/pixdesc.c+25−0
@@ -2771,6 +2771,31 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { · 2770 unmodified lines
27712771 },
27722772 .flags = AV_PIX_FMT_FLAG_BE,
27732773 },
2774+ [AV_PIX_FMT_XV48LE] = {
2775+ .name = "xv48le",
2776+ .nb_components = 3,
2777+ .log2_chroma_w = 0,
2778+ .log2_chroma_h = 0,
2779+ .comp = {
2780+ { 0, 8, 2, 0, 16 }, /* Y */
2781+ { 0, 8, 0, 0, 16 }, /* U */
2782+ { 0, 8, 4, 0, 16 }, /* V */
2783+ { 0, 8, 6, 0, 16 }, /* X */
2784+ },
2785+ },
2786+ [AV_PIX_FMT_XV48BE] = {
2787+ .name = "xv48be",
2788+ .nb_components = 3,
2789+ .log2_chroma_w = 0,
2790+ .log2_chroma_h = 0,
2791+ .comp = {
2792+ { 0, 8, 2, 0, 16 }, /* Y */
2793+ { 0, 8, 0, 0, 16 }, /* U */
2794+ { 0, 8, 4, 0, 16 }, /* V */
2795+ { 0, 8, 6, 0, 16 }, /* X */
2796+ },
2797+ .flags = AV_PIX_FMT_FLAG_BE,
2798+ },
27742799 [AV_PIX_FMT_V30XLE] = {
27752800 .name = "v30xle",
27762801 .nb_components = 3,
libavutil/pixfmt.h+4−0
@@ -460,6 +460,9 @@ enum AVPixelFormat { · 459 unmodified lines
460460 AV_PIX_FMT_Y216BE, ///< packed YUV 4:2:2 like YUYV422, 32bpp, big-endian
461461 AV_PIX_FMT_Y216LE, ///< packed YUV 4:2:2 like YUYV422, 32bpp, little-endian
462462
463+ AV_PIX_FMT_XV48BE, ///< packed XVYU 4:4:4, 64bpp, big-endian, variant of Y416 where alpha channel is left undefined
464+ AV_PIX_FMT_XV48LE, ///< packed XVYU 4:4:4, 64bpp, little-endian, variant of Y416 where alpha channel is left undefined
465+
463466 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
464467 };
465468
@@ -555,6 +558,7 @@ enum AVPixelFormat { · 89 unmodified lines
555558 #define AV_PIX_FMT_Y216 AV_PIX_FMT_NE(Y216BE, Y216LE)
556559 #define AV_PIX_FMT_XV30 AV_PIX_FMT_NE(XV30BE, XV30LE)
557560 #define AV_PIX_FMT_XV36 AV_PIX_FMT_NE(XV36BE, XV36LE)
561+#define AV_PIX_FMT_XV48 AV_PIX_FMT_NE(XV48BE, XV48LE)
558562 #define AV_PIX_FMT_V30X AV_PIX_FMT_NE(V30XBE, V30XLE)
559563 #define AV_PIX_FMT_X2RGB10 AV_PIX_FMT_NE(X2RGB10BE, X2RGB10LE)
560564 #define AV_PIX_FMT_X2BGR10 AV_PIX_FMT_NE(X2BGR10BE, X2BGR10LE)
libavutil/tests/pixfmt_best.c+2−0
@@ -47,6 +47,7 @@ static const enum AVPixelFormat semiplanar_list[] = { · 46 unmodified lines
4747 };
4848
4949 static const enum AVPixelFormat packed_list[] = {
50+ AV_PIX_FMT_XV48,
5051 AV_PIX_FMT_XV36,
5152 AV_PIX_FMT_XV30,
5253 AV_PIX_FMT_VUYX,
@@ -208,6 +209,7 @@ int main(void) · 155 unmodified lines
208209 TEST_PACKED(AV_PIX_FMT_YUV444P, AV_PIX_FMT_VUYX);
209210 TEST_PACKED(AV_PIX_FMT_YUV444P10, AV_PIX_FMT_XV30);
210211 TEST_PACKED(AV_PIX_FMT_YUV444P12, AV_PIX_FMT_XV36);
212+ TEST_PACKED(AV_PIX_FMT_YUV444P16, AV_PIX_FMT_XV48);
211213 TEST_PACKED(AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUYV422);
212214 TEST_PACKED(AV_PIX_FMT_YUV422P10, AV_PIX_FMT_Y210);
213215 TEST_PACKED(AV_PIX_FMT_YUV422P12, AV_PIX_FMT_Y212);
libavutil/version.h+1−1
@@ -79,7 +79,7 @@ · 78 unmodified lines
7979 */
8080
8181 #define LIBAVUTIL_VERSION_MAJOR 59
82−#define LIBAVUTIL_VERSION_MINOR 45
82+#define LIBAVUTIL_VERSION_MINOR 46
8383 #define LIBAVUTIL_VERSION_MICRO 100
8484
8585 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
tests/ref/fate/imgutils+4−0
@@ -282,6 +282,8 @@ rgb96be planes: 1, linesizes: 768 0 0 0, plane_sizes: 36864 0 · 281 unmodified lines
282282 rgb96le planes: 1, linesizes: 768 0 0 0, plane_sizes: 36864 0 0 0, plane_offsets: 0 0 0, total_size: 36864
283283 y216be planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288
284284 y216le planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288
285+xv48be planes: 1, linesizes: 512 0 0 0, plane_sizes: 24576 0 0 0, plane_offsets: 0 0 0, total_size: 24576
286+xv48le planes: 1, linesizes: 512 0 0 0, plane_sizes: 24576 0 0 0, plane_offsets: 0 0 0, total_size: 24576
285287
286288 image_fill_black tests
287289 yuv420p total_size: 4608, black_unknown_crc: 0xd00f6cc6, black_tv_crc: 0xd00f6cc6, black_pc_crc: 0x234969af
@@ -511,3 +513,5 @@ rgb96be total_size: 36864, black_unknown_crc: 0x00000000, black_tv_cr · 223 unmodified lines
511513 rgb96le total_size: 36864, black_unknown_crc: 0x00000000, black_tv_crc: 0x00000000, black_pc_crc: 0x00000000
512514 y216be total_size: 12288, black_unknown_crc: 0x5483d935, black_tv_crc: 0x5483d935, black_pc_crc: 0x06397bf3
513515 y216le total_size: 12288, black_unknown_crc: 0x5d8e1cf6, black_tv_crc: 0x5d8e1cf6, black_pc_crc: 0x8fceec45
516+xv48be total_size: 24576, black_unknown_crc: 0x6ba828bd, black_tv_crc: 0x6ba828bd, black_pc_crc: 0x5f450f41
517+xv48le total_size: 24576, black_unknown_crc: 0xc3794950, black_tv_crc: 0xc3794950, black_pc_crc: 0x40874939
tests/ref/fate/pixfmt_best+1−1
@@ -1 +1 @@
1−111 tests passed, 0 tests failed.
1+113 tests passed, 0 tests failed.
tests/ref/fate/sws-pixdesc-query+7−0
@@ -25,6 +25,8 @@ is16BPS: · 24 unmodified lines
2525 rgbaf16le
2626 rgbf16be
2727 rgbf16le
28+ xv48be
29+ xv48le
2830 y216be
2931 y216le
3032 ya16be
@@ -194,6 +196,7 @@ isBE: · 163 unmodified lines
194196 x2rgb10be
195197 xv30be
196198 xv36be
199+ xv48be
197200 xyz12be
198201 y210be
199202 y212be
@@ -269,6 +272,8 @@ isYUV: · 69 unmodified lines
269272 xv30le
270273 xv36be
271274 xv36le
275+ xv48be
276+ xv48le
272277 xyz12be
273278 xyz12le
274279 y210be
@@ -875,6 +880,8 @@ Packed: · 600 unmodified lines
875880 xv30le
876881 xv36be
877882 xv36le
883+ xv48be
884+ xv48le
878885 xyz12be
879886 xyz12le
880887 y210be

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t