[Bf-blender-cvs] [3fc293c] master: Fix T39141: Video Sequencer Proxies don't take into account Strip Input Offset (or strip modifiers)

Sergey Sharybin noreply at git.blender.org
Thu Mar 20 10:46:51 CET 2014


Commit: 3fc293cd5718a70044438efea3514d6fb50e8a2c
Author: Sergey Sharybin
Date:   Thu Mar 20 15:08:23 2014 +0600
https://developer.blender.org/rB3fc293cd5718a70044438efea3514d6fb50e8a2c

Fix T39141: Video Sequencer Proxies don't take into account Strip Input Offset (or strip modifiers)

Basically issue was caused by the fact that strip for proxy has been
post-processed but proxy files were considered pre-processed. This lead
to situation of postprocessing being applied twice.

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

M	source/blender/blenkernel/BKE_sequencer.h
M	source/blender/blenkernel/intern/sequencer.c

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

diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h
index 0cbb921..ea47f0b 100644
--- a/source/blender/blenkernel/BKE_sequencer.h
+++ b/source/blender/blenkernel/BKE_sequencer.h
@@ -99,6 +99,7 @@ typedef struct SeqRenderData {
 	int motion_blur_samples;
 	float motion_blur_shutter;
 	bool skip_cache;
+	bool is_proxy_render;
 } SeqRenderData;
 
 SeqRenderData BKE_sequencer_new_render_data(struct EvaluationContext *eval_ctx, struct Main *bmain,
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 17c523e..84f0775 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -1467,8 +1467,8 @@ static void seq_proxy_build_frame(const SeqRenderData *context, Sequence *seq, i
 
 	ibuf = seq_render_strip(context, seq, cfra);
 
-	rectx = (proxy_render_size * context->scene->r.xsch) / 100;
-	recty = (proxy_render_size * context->scene->r.ysch) / 100;
+	rectx = (proxy_render_size * ibuf->x) / 100;
+	recty = (proxy_render_size * ibuf->y) / 100;
 
 	if (ibuf->x != rectx || ibuf->y != recty) {
 		IMB_scalefastImBuf(ibuf, (short)rectx, (short)recty);
@@ -1562,6 +1562,7 @@ void BKE_sequencer_proxy_rebuild(SeqIndexBuildContext *context, short *stop, sho
 	                                    (scene->r.size * (float) scene->r.xsch) / 100.0f + 0.5f,
 	                                    (scene->r.size * (float) scene->r.ysch) / 100.0f + 0.5f, 100);
 	render_context.skip_cache = true;
+	render_context.is_proxy_render = true;
 
 	for (cfra = seq->startdisp + seq->startstill;  cfra < seq->enddisp - seq->endstill; cfra++) {
 		if (context->size_flags & IMB_PROXY_25) {
@@ -1919,10 +1920,14 @@ void BKE_sequencer_color_balance_apply(StripColorBalance *cb, ImBuf *ibuf, float
  *  - Premultiply
  */
 
-int BKE_sequencer_input_have_to_preprocess(const SeqRenderData *UNUSED(context), Sequence *seq, float UNUSED(cfra))
+int BKE_sequencer_input_have_to_preprocess(const SeqRenderData *context, Sequence *seq, float UNUSED(cfra))
 {
 	float mul;
 
+	if (context->is_proxy_render) {
+		return FALSE;
+	}
+
 	if (seq->flag & (SEQ_FILTERY | SEQ_USE_CROP | SEQ_USE_TRANSFORM | SEQ_FLIPX | SEQ_FLIPY | SEQ_MAKE_FLOAT)) {
 		return TRUE;
 	}
@@ -2806,8 +2811,12 @@ static ImBuf *seq_render_strip(const SeqRenderData *context, Sequence *seq, floa
 				if (ibuf == NULL)
 					ibuf = do_render_strip_uncached(context, seq, cfra);
 
-				if (ibuf)
+				if (ibuf) {
+					if (ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_MOVIECLIP)) {
+						is_proxy_image = (context->preview_render_size != 100);
+					}
 					BKE_sequencer_preprocessed_cache_put(context, seq, cfra, SEQ_STRIPELEM_IBUF, ibuf);
+				}
 			}
 		}
 
@@ -2826,8 +2835,11 @@ static ImBuf *seq_render_strip(const SeqRenderData *context, Sequence *seq, floa
 		sequencer_imbuf_assign_spaces(context->scene, ibuf);
 	}
 
-	if (ibuf->x != context->rectx || ibuf->y != context->recty)
+	if (context->is_proxy_render == false &&
+	    (ibuf->x != context->rectx || ibuf->y != context->recty))
+	{
 		use_preprocess = TRUE;
+	}
 
 	if (use_preprocess)
 		ibuf = input_preprocess(context, seq, cfra, ibuf, is_proxy_image, is_preprocessed);




More information about the Bf-blender-cvs mailing list