History

lavu/pixfmt: add AV_PIX_FMT_RGBA128

This format is useful for doing certain lossless transforms on images, RCT in particular, which require you to escalate the size from 16 to 32 bits to avoid overflows. APIchanges will be done alongside when comitting.

Lynne committed 2 years ago

Commit 281bba11 parent 9ce63e64 files · +47 −0Browse files

Unified · Split

4 files
  1. libavutil/pixdesc.c +27 −0
  2. libavutil/pixfmt.h +5 −0
  3. tests/ref/fate/imgutils +4 −0
  4. tests/ref/fate/sws-pixdesc-query +11 −0
libavutil/pixdesc.c+27−0
@@ -2828,6 +2828,33 @@ static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { · 2827 unmodified lines
2828 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_FLOAT |2828 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_FLOAT |
2829 AV_PIX_FMT_FLAG_ALPHA,2829 AV_PIX_FMT_FLAG_ALPHA,
2830 },2830 },
2831 [AV_PIX_FMT_RGBA128BE] = {
2832 .name = "rgba128be",
2833 .nb_components = 4,
2834 .log2_chroma_w = 0,
2835 .log2_chroma_h = 0,
2836 .comp = {
2837 { 0, 16, 0, 0, 32 }, /* R */
2838 { 0, 16, 4, 0, 32 }, /* G */
2839 { 0, 16, 8, 0, 32 }, /* B */
2840 { 0, 16, 12, 0, 32 }, /* A */
2841 },
2842 .flags = AV_PIX_FMT_FLAG_BE | AV_PIX_FMT_FLAG_RGB |
2843 AV_PIX_FMT_FLAG_ALPHA,
2844 },
2845 [AV_PIX_FMT_RGBA128LE] = {
2846 .name = "rgba128le",
2847 .nb_components = 4,
2848 .log2_chroma_w = 0,
2849 .log2_chroma_h = 0,
2850 .comp = {
2851 { 0, 16, 0, 0, 32 }, /* R */
2852 { 0, 16, 4, 0, 32 }, /* G */
2853 { 0, 16, 8, 0, 32 }, /* B */
2854 { 0, 16, 12, 0, 32 }, /* A */
2855 },
2856 .flags = AV_PIX_FMT_FLAG_RGB | AV_PIX_FMT_FLAG_ALPHA,
2857 },
2831 [AV_PIX_FMT_P212BE] = {2858 [AV_PIX_FMT_P212BE] = {
2832 .name = "p212be",2859 .name = "p212be",
2833 .nb_components = 3,2860 .nb_components = 3,
libavutil/pixfmt.h+5−0
@@ -451,6 +451,9 @@ enum AVPixelFormat { · 450 unmodified lines
451 AV_PIX_FMT_RGBF16BE, ///< IEEE-754 half precision packed RGB 16:16:16, 48bpp, RGBRGB..., big-endian451 AV_PIX_FMT_RGBF16BE, ///< IEEE-754 half precision packed RGB 16:16:16, 48bpp, RGBRGB..., big-endian
452 AV_PIX_FMT_RGBF16LE, ///< IEEE-754 half precision packed RGB 16:16:16, 48bpp, RGBRGB..., little-endian452 AV_PIX_FMT_RGBF16LE, ///< IEEE-754 half precision packed RGB 16:16:16, 48bpp, RGBRGB..., little-endian
453 453
454 AV_PIX_FMT_RGBA128BE, ///< packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., big-endian
455 AV_PIX_FMT_RGBA128LE, ///< packed RGBA 32:32:32:32, 128bpp, RGBARGBA..., little-endian
456
454 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 versions457 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
455};458};
456 459
@@ -562,6 +565,8 @@ enum AVPixelFormat { · 105 unmodified lines
562#define AV_PIX_FMT_RGBF32 AV_PIX_FMT_NE(RGBF32BE, RGBF32LE)565#define AV_PIX_FMT_RGBF32 AV_PIX_FMT_NE(RGBF32BE, RGBF32LE)
563#define AV_PIX_FMT_RGBAF32 AV_PIX_FMT_NE(RGBAF32BE, RGBAF32LE)566#define AV_PIX_FMT_RGBAF32 AV_PIX_FMT_NE(RGBAF32BE, RGBAF32LE)
564 567
568#define AV_PIX_FMT_RGBA128 AV_PIX_FMT_NE(RGBA128BE, RGBA128LE)
569
565/**570/**
566 * Chromaticity coordinates of the source primaries.571 * Chromaticity coordinates of the source primaries.
567 * These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.1 and ITU-T H.273.572 * These values match the ones defined by ISO/IEC 23091-2_2019 subclause 8.1 and ITU-T H.273.
tests/ref/fate/imgutils+4−0
@@ -276,6 +276,8 @@ v30xbe planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 · 275 unmodified lines
276v30xle planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288276v30xle planes: 1, linesizes: 256 0 0 0, plane_sizes: 12288 0 0 0, plane_offsets: 0 0 0, total_size: 12288
277rgbf16be planes: 1, linesizes: 384 0 0 0, plane_sizes: 18432 0 0 0, plane_offsets: 0 0 0, total_size: 18432277rgbf16be planes: 1, linesizes: 384 0 0 0, plane_sizes: 18432 0 0 0, plane_offsets: 0 0 0, total_size: 18432
278rgbf16le planes: 1, linesizes: 384 0 0 0, plane_sizes: 18432 0 0 0, plane_offsets: 0 0 0, total_size: 18432278rgbf16le planes: 1, linesizes: 384 0 0 0, plane_sizes: 18432 0 0 0, plane_offsets: 0 0 0, total_size: 18432
279rgba128be planes: 1, linesizes: 1024 0 0 0, plane_sizes: 49152 0 0 0, plane_offsets: 0 0 0, total_size: 49152
280rgba128le planes: 1, linesizes: 1024 0 0 0, plane_sizes: 49152 0 0 0, plane_offsets: 0 0 0, total_size: 49152
279 281
280image_fill_black tests282image_fill_black tests
281yuv420p total_size: 4608, black_unknown_crc: 0xd00f6cc6, black_tv_crc: 0xd00f6cc6, black_pc_crc: 0x234969af283yuv420p total_size: 4608, black_unknown_crc: 0xd00f6cc6, black_tv_crc: 0xd00f6cc6, black_pc_crc: 0x234969af
@@ -499,3 +501,5 @@ v30xbe total_size: 12288, black_unknown_crc: 0x7108457c, black_tv_cr · 217 unmodified lines
499v30xle total_size: 12288, black_unknown_crc: 0xf5b3c795, black_tv_crc: 0xf5b3c795, black_pc_crc: 0x0b56173c501v30xle total_size: 12288, black_unknown_crc: 0xf5b3c795, black_tv_crc: 0xf5b3c795, black_pc_crc: 0x0b56173c
500rgbf16be total_size: 18432, black_unknown_crc: 0x00000000, black_tv_crc: 0x00000000, black_pc_crc: 0x00000000502rgbf16be total_size: 18432, black_unknown_crc: 0x00000000, black_tv_crc: 0x00000000, black_pc_crc: 0x00000000
501rgbf16le total_size: 18432, black_unknown_crc: 0x00000000, black_tv_crc: 0x00000000, black_pc_crc: 0x00000000503rgbf16le total_size: 18432, black_unknown_crc: 0x00000000, black_tv_crc: 0x00000000, black_pc_crc: 0x00000000
504rgba128be total_size: 49152, black_unknown_crc: 0x59ef499b, black_tv_crc: 0x59ef499b, black_pc_crc: 0x59ef499b
505rgba128le total_size: 49152, black_unknown_crc: 0x59ef499b, black_tv_crc: 0x59ef499b, black_pc_crc: 0x59ef499b
tests/ref/fate/sws-pixdesc-query+11−0
@@ -180,6 +180,7 @@ isBE: · 179 unmodified lines
180 rgb48be180 rgb48be
181 rgb555be181 rgb555be
182 rgb565be182 rgb565be
183 rgba128be
183 rgba64be184 rgba64be
184 rgbaf16be185 rgbaf16be
185 rgbaf32be186 rgbaf32be
@@ -541,6 +542,8 @@ isRGB: · 355 unmodified lines
541 rgb565be542 rgb565be
542 rgb565le543 rgb565le
543 rgb8544 rgb8
545 rgba128be
546 rgba128le
544 rgba64be547 rgba64be
545 rgba64le548 rgba64le
546 rgbaf16be549 rgbaf16be
@@ -701,6 +704,8 @@ AnyRGB: · 154 unmodified lines
701 rgb565be704 rgb565be
702 rgb565le705 rgb565le
703 rgb8706 rgb8
707 rgba128be
708 rgba128le
704 rgba64be709 rgba64be
705 rgba64le710 rgba64le
706 rgbaf16be711 rgbaf16be
@@ -738,6 +743,8 @@ ALPHA: · 31 unmodified lines
738 pal8743 pal8
739 rgb32744 rgb32
740 rgb32_1745 rgb32_1
746 rgba128be
747 rgba128le
741 rgba64be748 rgba64be
742 rgba64le749 rgba64le
743 rgbaf16be750 rgbaf16be
@@ -828,6 +835,8 @@ Packed: · 84 unmodified lines
828 rgb565be835 rgb565be
829 rgb565le836 rgb565le
830 rgb8837 rgb8
838 rgba128be
839 rgba128le
831 rgba64be840 rgba64be
832 rgba64le841 rgba64le
833 rgbaf16be842 rgbaf16be
@@ -1034,6 +1043,8 @@ PackedRGB: · 200 unmodified lines
1034 rgb565be1043 rgb565be
1035 rgb565le1044 rgb565le
1036 rgb81045 rgb8
1046 rgba128be
1047 rgba128le
1037 rgba64be1048 rgba64be
1038 rgba64le1049 rgba64le
1039 rgbaf16be1050 rgbaf16be

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