[Bf-blender-cvs] [e7e8e0d] : Fixes for proxies color space

Sergey Sharybin noreply at git.blender.org
Wed Mar 12 18:15:22 CET 2014


Commit: e7e8e0dbd534eeb3a43d4b2e442b33b7a0af7676
Author: Sergey Sharybin
Date:   Thu Mar 6 17:27:16 2014 +0600
https://developer.blender.org/rBe7e8e0dbd534eeb3a43d4b2e442b33b7a0af7676

Fixes for proxies color space

Basically proxy colorspace didn't work well enough.

It is still a bit weird and mainly:

- Proxies for image sequences are built in the image color space.

- Proxies for movies are built in the movie color space.

This could be unified but would need some work in proxy build
to make it not just pipe frames from one FFmpeg context to
another but also apply OCIO on it.

===================================================================

M	source/blender/blenkernel/intern/movieclip.c
M	source/blender/editors/space_clip/clip_ops.c
M	source/blender/imbuf/intern/indexer.c

===================================================================

diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c
index 39c3b96..a41b478 100644
--- a/source/blender/blenkernel/intern/movieclip.c
+++ b/source/blender/blenkernel/intern/movieclip.c
@@ -214,8 +214,17 @@ static ImBuf *movieclip_load_sequence_file(MovieClip *clip, MovieClipUser *user,
 		int undistort = user->render_flag & MCLIP_PROXY_RENDER_UNDISTORT;
 		get_proxy_fname(clip, user->render_size, undistort, framenr, name);
 
-		/* proxies were built using default color space settings */
-		colorspace = NULL;
+		/* Well, this is a bit weird, but proxies for movie sources
+		 * are built in the same exact color space as the input,
+		 *
+		 * But image sequences are built in the display space.
+		 */
+		if (clip->source == MCLIP_SRC_MOVIE) {
+			colorspace = clip->colorspace_settings.name;
+		}
+		else {
+			colorspace = NULL;
+		}
 	}
 	else {
 		get_sequence_fname(clip, framenr, name);
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c
index 7a6c426..bb6c50d 100644
--- a/source/blender/editors/space_clip/clip_ops.c
+++ b/source/blender/editors/space_clip/clip_ops.c
@@ -1002,7 +1002,7 @@ static void do_movie_proxy(void *pjv, int *UNUSED(build_sizes), int UNUSED(build
 	}
 	else {
 		sfra = 1;
-		efra = IMB_anim_get_duration(clip->anim, IMB_TC_NONE);
+		efra = clip->len;
 	}
 
 	if (build_undistort_count) {
@@ -1118,7 +1118,8 @@ static void *do_proxy_thread(void *data_v)
 	while ((mem = proxy_thread_next_frame(data->queue, data->clip, &size, &cfra))) {
 		ImBuf *ibuf;
 
-		ibuf = IMB_ibImageFromMemory(mem, size, IB_rect | IB_multilayer | IB_alphamode_detect, NULL, "proxy frame");
+		ibuf = IMB_ibImageFromMemory(mem, size, IB_rect | IB_multilayer | IB_alphamode_detect,
+		                             data->clip->colorspace_settings.name, "proxy frame");
 
 		BKE_movieclip_build_proxy_frame_for_ibuf(data->clip, ibuf, NULL, cfra,
 		                                         data->build_sizes, data->build_count, false);
diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c
index 3eaf42b..2afcda8 100644
--- a/source/blender/imbuf/intern/indexer.c
+++ b/source/blender/imbuf/intern/indexer.c
@@ -1265,8 +1265,8 @@ struct anim *IMB_anim_open_proxy(
 
 	get_proxy_filename(anim, preview_size, fname, FALSE);
 
-	/* proxies are generated in default color space */
-	anim->proxy_anim[i] = IMB_open_anim(fname, 0, 0, NULL);
+	/* proxies are generated in the same color space as animation itself */
+	anim->proxy_anim[i] = IMB_open_anim(fname, 0, 0, anim->colorspace);
 	
 	anim->proxies_tried |= preview_size;




More information about the Bf-blender-cvs mailing list