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:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-09-02 17:54:12 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-09-02 17:54:12 +0400
commit529c6d0eeb845da8706db6ab0bb27a1ae3907d9b (patch)
tree3317fc54b131d7132aff24490be4ddefbe49950f /source/blender/blenkernel/intern/sequencer.c
parent79759d8368d9b1767ffa61a8506f91027a3e41a0 (diff)
Fix #36124: VSE - Input Color option does not work for video files
Byte images and movies will now fully follow input color space. Before this non-sRGB input colorspace for byte images and movies behave really doggy (results in preview and final render were totally different). To prevent data loss, if byte image is set not stored in sequencer's space it'll be internally converted to float buffer. In theory some setups might be rendering a bit different now, but new behavior is totally expected and someone used non-sRGB input space for byte images/movies had Convert Float enabled anyway.
Diffstat (limited to 'source/blender/blenkernel/intern/sequencer.c')
-rw-r--r--source/blender/blenkernel/intern/sequencer.c50
1 files changed, 31 insertions, 19 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index a2ebdae572d..a88818dedcd 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -417,33 +417,41 @@ void BKE_sequencer_editing_free(Scene *scene)
static void sequencer_imbuf_assign_spaces(Scene *scene, ImBuf *ibuf)
{
- IMB_colormanagement_assign_float_colorspace(ibuf, scene->sequencer_colorspace_settings.name);
+ if (ibuf->rect_float) {
+ IMB_colormanagement_assign_float_colorspace(ibuf, scene->sequencer_colorspace_settings.name);
+ }
}
void BKE_sequencer_imbuf_to_sequencer_space(Scene *scene, ImBuf *ibuf, int make_float)
{
const char *from_colorspace = IMB_colormanagement_role_colorspace_name_get(COLOR_ROLE_SCENE_LINEAR);
const char *to_colorspace = scene->sequencer_colorspace_settings.name;
+ const char *float_colorspace = IMB_colormanagement_get_float_colorspace(ibuf);
if (!ibuf->rect_float) {
- if (make_float && ibuf->rect) {
- /* when converting byte buffer to float in sequencer we need to make float
- * buffer be in sequencer's working space, which is currently only doable
- * from linear space.
- *
- */
-
- /*
- * OCIO_TODO: would be nice to support direct single transform from byte to sequencer's
- */
-
- IMB_float_from_rect(ibuf);
+ if (ibuf->rect) {
+ const char *byte_colorspace = IMB_colormanagement_get_rect_colorspace(ibuf);
+ if (make_float || !STREQ(to_colorspace, byte_colorspace)) {
+ /* If byte space is not in sequencer's working space, we deliver float color space,
+ * this is to to prevent data loss.
+ */
+
+ /* when converting byte buffer to float in sequencer we need to make float
+ * buffer be in sequencer's working space, which is currently only doable
+ * from linear space.
+ */
+
+ /*
+ * OCIO_TODO: would be nice to support direct single transform from byte to sequencer's
+ */
+
+ IMB_float_from_rect(ibuf);
+ }
+ else {
+ return;
+ }
}
else {
- /* if there's only byte buffer in image it's already in compositor's working space,
- * nothing to do here
- */
-
return;
}
}
@@ -452,8 +460,10 @@ void BKE_sequencer_imbuf_to_sequencer_space(Scene *scene, ImBuf *ibuf, int make_
if (ibuf->rect)
imb_freerectImBuf(ibuf);
- IMB_colormanagement_transform_threaded(ibuf->rect_float, ibuf->x, ibuf->y, ibuf->channels,
- from_colorspace, to_colorspace, TRUE);
+ if (!STREQ(float_colorspace, to_colorspace)) {
+ IMB_colormanagement_transform_threaded(ibuf->rect_float, ibuf->x, ibuf->y, ibuf->channels,
+ from_colorspace, to_colorspace, TRUE);
+ }
}
}
@@ -2668,6 +2678,8 @@ static ImBuf *do_render_strip_uncached(SeqRenderData context, Sequence *seq, flo
seq->strip->proxy ? seq->strip->proxy->tc : IMB_TC_RECORD_RUN,
seq_rendersize_to_proxysize(context.preview_render_size));
+ BKE_sequencer_imbuf_to_sequencer_space(context.scene, ibuf, FALSE);
+
/* we don't need both (speed reasons)! */
if (ibuf && ibuf->rect_float && ibuf->rect)
imb_freerectImBuf(ibuf);