Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-10-03 07:25:05 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-10-03 07:25:05 +0400
commit3dd75fa6f17cfe39ab215c5f6712da3da5227d74 (patch)
tree41b11f216cac6c5eb70bc543242ba92b61c5fadc /source/blender/blenkernel
parent8b0e44c66e5d7b33fb7c7e2205abfa86238da525 (diff)
patch [#27887] LOSSLESS RENDERING: HuffYUV and FFV1 both fail to render losslessly
from Troy Sobotka (sobotka)
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/writeffmpeg.c10
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);