aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2022-06-30 15:04:24 +0200
committerPaul B Mahol <onemda@gmail.com>2022-06-30 15:07:55 +0200
commit3f72155fc664b6abccd194d71cbec44183ab64d9 (patch)
tree677b09a0c2551b24d8f266b1178688c64d6b8ed2
parent03b2ed9a50dc6cbf332a2d93e4c8811b88e6df7f (diff)
downloadffmpeg-3f72155fc664b6abccd194d71cbec44183ab64d9.tar.gz
avcodec/exrenc: add grayf32 format support
-rw-r--r--libavcodec/exrenc.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/exrenc.c b/libavcodec/exrenc.c
index 459afebb82..9138684bcb 100644
--- a/libavcodec/exrenc.c
+++ b/libavcodec/exrenc.c
@@ -54,8 +54,10 @@ enum ExrPixelType {
static const char abgr_chlist[4] = { 'A', 'B', 'G', 'R' };
static const char bgr_chlist[4] = { 'B', 'G', 'R', 'A' };
+static const char y_chlist[4] = { 'Y' };
static const uint8_t gbra_order[4] = { 3, 1, 0, 2 };
static const uint8_t gbr_order[4] = { 1, 0, 2, 0 };
+static const uint8_t y_order[4] = { 0 };
typedef struct EXRScanlineData {
uint8_t *compressed_data;
@@ -106,6 +108,11 @@ static int encode_init(AVCodecContext *avctx)
s->ch_names = abgr_chlist;
s->ch_order = gbra_order;
break;
+ case AV_PIX_FMT_GRAYF32:
+ s->planes = 1;
+ s->ch_names = y_chlist;
+ s->ch_order = y_order;
+ break;
default:
av_assert0(0);
}
@@ -546,6 +553,7 @@ const FFCodec ff_exr_encoder = {
FF_CODEC_ENCODE_CB(encode_frame),
.close = encode_close,
.p.pix_fmts = (const enum AVPixelFormat[]) {
+ AV_PIX_FMT_GRAYF32,
AV_PIX_FMT_GBRPF32,
AV_PIX_FMT_GBRAPF32,
AV_PIX_FMT_NONE },