History

avcodec/exrenc: add grayf32 format support

Paul B Mahol committed 4 years ago

Commit 3f721551 parent 03b2ed91 file · +8 −0Browse files

Unified · Split

libavcodec/exrenc.c+8−0
@@ -54,8 +54,10 @@ enum ExrPixelType { · 53 unmodified lines
5454
5555 static const char abgr_chlist[4] = { 'A', 'B', 'G', 'R' };
5656 static const char bgr_chlist[4] = { 'B', 'G', 'R', 'A' };
57+static const char y_chlist[4] = { 'Y' };
5758 static const uint8_t gbra_order[4] = { 3, 1, 0, 2 };
5859 static const uint8_t gbr_order[4] = { 1, 0, 2, 0 };
60+static const uint8_t y_order[4] = { 0 };
5961
6062 typedef struct EXRScanlineData {
6163 uint8_t *compressed_data;
@@ -106,6 +108,11 @@ static int encode_init(AVCodecContext *avctx) · 44 unmodified lines
106108 s->ch_names = abgr_chlist;
107109 s->ch_order = gbra_order;
108110 break;
111+ case AV_PIX_FMT_GRAYF32:
112+ s->planes = 1;
113+ s->ch_names = y_chlist;
114+ s->ch_order = y_order;
115+ break;
109116 default:
110117 av_assert0(0);
111118 }
@@ -546,6 +553,7 @@ const FFCodec ff_exr_encoder = { · 434 unmodified lines
546553 FF_CODEC_ENCODE_CB(encode_frame),
547554 .close = encode_close,
548555 .p.pix_fmts = (const enum AVPixelFormat[]) {
556+ AV_PIX_FMT_GRAYF32,
549557 AV_PIX_FMT_GBRPF32,
550558 AV_PIX_FMT_GBRAPF32,
551559 AV_PIX_FMT_NONE },

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