diff options
author | Paul B Mahol <onemda@gmail.com> | 2021-07-24 18:07:57 +0200 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2021-07-25 17:08:35 +0200 |
commit | a1f7d25ceff2fd52c56148fe1b4fa21e6ef2acd6 (patch) | |
tree | d09b7d8b521b6cb8e752bac9afb7af95f772fcaf /libavformat | |
parent | d08deb11d22bb7fe009fdbfa1fb1b08247c648a8 (diff) | |
download | ffmpeg-a1f7d25ceff2fd52c56148fe1b4fa21e6ef2acd6.tar.gz |
avformat/yuv4mpegenc: add support for yuva444p
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/yuv4mpegenc.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libavformat/yuv4mpegenc.c b/libavformat/yuv4mpegenc.c index aff066f1c5..efa05133d5 100644 --- a/libavformat/yuv4mpegenc.c +++ b/libavformat/yuv4mpegenc.c @@ -113,6 +113,9 @@ static int yuv4_write_header(AVFormatContext *s) case AV_PIX_FMT_YUV444P: colorspace = " C444 XYSCSS=444"; break; + case AV_PIX_FMT_YUVA444P: + colorspace = " C444alpha XYSCSS=444"; + break; case AV_PIX_FMT_YUV420P9: colorspace = " C420p9 XYSCSS=420P9"; break; @@ -197,6 +200,7 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt) case AV_PIX_FMT_YUV420P: case AV_PIX_FMT_YUV422P: case AV_PIX_FMT_YUV444P: + case AV_PIX_FMT_YUVA444P: // TODO: remove YUVJ pixel formats when they are completely removed from the codebase. case AV_PIX_FMT_YUVJ420P: case AV_PIX_FMT_YUVJ422P: @@ -254,6 +258,13 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt) avio_write(pb, ptr2, width); ptr2 += frame->linesize[2]; } + if (st->codecpar->format == AV_PIX_FMT_YUVA444P) { + ptr = frame->data[3]; + for (i = 0; i < height; i++) { /* A */ + avio_write(pb, ptr, width); + ptr += frame->linesize[3]; + } + } } return 0; @@ -302,6 +313,7 @@ static int yuv4_init(AVFormatContext *s) case AV_PIX_FMT_YUV420P16: case AV_PIX_FMT_YUV422P16: case AV_PIX_FMT_YUV444P16: + case AV_PIX_FMT_YUVA444P: if (s->strict_std_compliance >= FF_COMPLIANCE_NORMAL) { av_log(s, AV_LOG_ERROR, "'%s' is not an official yuv4mpegpipe pixel format. " "Use '-strict -1' to encode to this pixel format.\n", @@ -319,6 +331,7 @@ static int yuv4_init(AVFormatContext *s) "yuv444p12, yuv422p12, yuv420p12, " "yuv444p14, yuv422p14, yuv420p14, " "yuv444p16, yuv422p16, yuv420p16, " + "yuva444p, " "gray9, gray10, gray12 " "and gray16 pixel formats. " "Use -pix_fmt to select one.\n"); |