diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-10-03 07:25:05 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-10-03 07:25:05 +0400 |
commit | 3dd75fa6f17cfe39ab215c5f6712da3da5227d74 (patch) | |
tree | 41b11f216cac6c5eb70bc543242ba92b61c5fadc /source/blender | |
parent | 8b0e44c66e5d7b33fb7c7e2205abfa86238da525 (diff) |
patch [#27887] LOSSLESS RENDERING: HuffYUV and FFV1 both fail to render losslessly
from Troy Sobotka (sobotka)
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/writeffmpeg.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index 3cb32f9ad12..6010770e1ee 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -489,6 +489,12 @@ static AVStream* alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex c->qmax=51; } + // Keep lossless encodes in the RGB domain. + if (codec_id == CODEC_ID_HUFFYUV || codec_id == CODEC_ID_FFV1) { + /* HUFFYUV was PIX_FMT_YUV422P before */ + c->pix_fmt = PIX_FMT_RGB32; + } + if ((of->oformat->flags & AVFMT_GLOBALHEADER) // || !strcmp(of->oformat->name, "mp4") // || !strcmp(of->oformat->name, "mov") @@ -518,8 +524,8 @@ static AVStream* alloc_video_stream(RenderData *rd, int codec_id, AVFormatContex return NULL; } - video_buffersize = 2000000; - video_buffer = (uint8_t*)MEM_mallocN(video_buffersize, + video_buffersize = avpicture_get_size(c->pix_fmt, c->width, c->height); + video_buffer = (uint8_t*)MEM_mallocN(video_buffersize*sizeof(uint8_t), "FFMPEG video buffer"); current_frame = alloc_picture(c->pix_fmt, c->width, c->height); |