Fix T93856: VP9 lossless render missing alpha
Since 0ea0ccc4ff, `AV_PIX_FMT_YUV444P` pixel format was used for
lossless renders, which did override `AV_PIX_FMT_YUVA420P` format when
"RGBA" output is chosen. VP9 encoder doesn't seem to support
`AV_PIX_FMT_YUVA444P` pixel format, so use `AV_PIX_FMT_YUVA420P` for
lossless RGBA ouput instead.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D13947
This commit is contained in:
@@ -726,14 +726,12 @@ static AVStream *alloc_video_stream(FFMpegContext *context,
|
||||
}
|
||||
}
|
||||
|
||||
if (codec_id == AV_CODEC_ID_VP9) {
|
||||
if (rd->im_format.planes == R_IMF_PLANES_RGBA) {
|
||||
c->pix_fmt = AV_PIX_FMT_YUVA420P;
|
||||
}
|
||||
if (codec_id == AV_CODEC_ID_VP9 && rd->im_format.planes == R_IMF_PLANES_RGBA) {
|
||||
c->pix_fmt = AV_PIX_FMT_YUVA420P;
|
||||
}
|
||||
|
||||
/* Use 4:4:4 instead of 4:2:0 pixel format for lossless rendering. */
|
||||
if ((codec_id == AV_CODEC_ID_H264 || codec_id == AV_CODEC_ID_VP9) && context->ffmpeg_crf == 0) {
|
||||
else if ((codec_id == AV_CODEC_ID_H264 || codec_id == AV_CODEC_ID_VP9) &&
|
||||
context->ffmpeg_crf == 0) {
|
||||
/* Use 4:4:4 instead of 4:2:0 pixel format for lossless rendering. */
|
||||
c->pix_fmt = AV_PIX_FMT_YUV444P;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user