== Sequencer ==
Fixed: * crash with gamma tabs and blend modes * crash on rect -> rect_float blend mode input * alpha over and under have now input swapped
This commit is contained in:
@@ -786,9 +786,9 @@ static void do_cross_effect(Sequence * seq,int cfra,
|
|||||||
********************************************************************** */
|
********************************************************************** */
|
||||||
|
|
||||||
/* copied code from initrender.c */
|
/* copied code from initrender.c */
|
||||||
static unsigned short *gamtab = 0;
|
static unsigned short gamtab[65536];
|
||||||
static unsigned short *igamtab1 = 0;
|
static unsigned short igamtab1[256];
|
||||||
static int gamma_tabs_refcount = 0;
|
static int gamma_tabs_init = FALSE;
|
||||||
|
|
||||||
#define RE_GAMMA_TABLE_SIZE 400
|
#define RE_GAMMA_TABLE_SIZE 400
|
||||||
|
|
||||||
@@ -882,9 +882,6 @@ static void gamtabs(float gamma)
|
|||||||
float val, igamma= 1.0f/gamma;
|
float val, igamma= 1.0f/gamma;
|
||||||
int a;
|
int a;
|
||||||
|
|
||||||
gamtab= MEM_mallocN(65536*sizeof(short), "initGaus2");
|
|
||||||
igamtab1= MEM_mallocN(256*sizeof(short), "initGaus2");
|
|
||||||
|
|
||||||
/* gamtab: in short, out short */
|
/* gamtab: in short, out short */
|
||||||
for(a=0; a<65536; a++) {
|
for(a=0; a<65536; a++) {
|
||||||
val= a;
|
val= a;
|
||||||
@@ -907,36 +904,25 @@ static void gamtabs(float gamma)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void alloc_or_ref_gammatabs()
|
static void build_gammatabs()
|
||||||
{
|
{
|
||||||
if (gamma_tabs_refcount == 0) {
|
if (gamma_tabs_init == FALSE) {
|
||||||
gamtabs(2.0f);
|
gamtabs(2.0f);
|
||||||
makeGammaTables(2.0f);
|
makeGammaTables(2.0f);
|
||||||
|
gamma_tabs_init = TRUE;
|
||||||
}
|
}
|
||||||
gamma_tabs_refcount++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void init_gammacross(Sequence * seq)
|
static void init_gammacross(Sequence * seq)
|
||||||
{
|
{
|
||||||
alloc_or_ref_gammatabs();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void load_gammacross(Sequence * seq)
|
static void load_gammacross(Sequence * seq)
|
||||||
{
|
{
|
||||||
alloc_or_ref_gammatabs();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void free_gammacross(Sequence * seq)
|
static void free_gammacross(Sequence * seq)
|
||||||
{
|
{
|
||||||
if (--gamma_tabs_refcount == 0) {
|
|
||||||
MEM_freeN(gamtab);
|
|
||||||
MEM_freeN(igamtab1);
|
|
||||||
gamtab = 0;
|
|
||||||
igamtab1 = 0;
|
|
||||||
}
|
|
||||||
if (gamma_tabs_refcount < 0) {
|
|
||||||
fprintf(stderr, "seqeffects: free_gammacross double free!\n");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_gammacross_effect_byte(float facf0, float facf1,
|
static void do_gammacross_effect_byte(float facf0, float facf1,
|
||||||
@@ -1043,6 +1029,8 @@ static void do_gammacross_effect(Sequence * seq,int cfra,
|
|||||||
struct ImBuf *ibuf1, struct ImBuf *ibuf2,
|
struct ImBuf *ibuf1, struct ImBuf *ibuf2,
|
||||||
struct ImBuf *ibuf3, struct ImBuf *out)
|
struct ImBuf *ibuf3, struct ImBuf *out)
|
||||||
{
|
{
|
||||||
|
build_gammatabs();
|
||||||
|
|
||||||
if (out->rect_float) {
|
if (out->rect_float) {
|
||||||
do_gammacross_effect_float(
|
do_gammacross_effect_float(
|
||||||
facf0, facf1, x, y,
|
facf0, facf1, x, y,
|
||||||
|
|||||||
@@ -1498,7 +1498,7 @@ static TStripElem* do_build_seq_array_recursively(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
sh = get_sequence_blend(seq_arr[i]);
|
sh = get_sequence_blend(seq);
|
||||||
|
|
||||||
seq->facf0 = seq->facf1 = 1.0;
|
seq->facf0 = seq->facf1 = 1.0;
|
||||||
|
|
||||||
@@ -1549,7 +1549,7 @@ static TStripElem* do_build_seq_array_recursively(
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (se->ibuf_comp) {
|
if (se->ibuf_comp) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1568,6 +1568,7 @@ static TStripElem* do_build_seq_array_recursively(
|
|||||||
case 0: {
|
case 0: {
|
||||||
int x= se2->ibuf->x;
|
int x= se2->ibuf->x;
|
||||||
int y= se2->ibuf->y;
|
int y= se2->ibuf->y;
|
||||||
|
int swap_input = FALSE;
|
||||||
|
|
||||||
if (se1->ibuf_comp->rect_float ||
|
if (se1->ibuf_comp->rect_float ||
|
||||||
se2->ibuf->rect_float) {
|
se2->ibuf->rect_float) {
|
||||||
@@ -1592,16 +1593,32 @@ static TStripElem* do_build_seq_array_recursively(
|
|||||||
|
|
||||||
if (!se1->ibuf_comp->rect &&
|
if (!se1->ibuf_comp->rect &&
|
||||||
!se2->ibuf_comp->rect_float) {
|
!se2->ibuf_comp->rect_float) {
|
||||||
IMB_rect_from_float(se1->ibuf);
|
IMB_rect_from_float(se1->ibuf_comp);
|
||||||
}
|
}
|
||||||
if (!se2->ibuf->rect &&
|
if (!se2->ibuf->rect &&
|
||||||
!se2->ibuf_comp->rect_float) {
|
!se2->ibuf_comp->rect_float) {
|
||||||
IMB_rect_from_float(se2->ibuf);
|
IMB_rect_from_float(se2->ibuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
sh.execute(seq, cfra, seq->facf0, seq->facf1, x, y,
|
/* bad hack, to fix crazy input ordering of
|
||||||
se1->ibuf_comp, se2->ibuf, 0,
|
those two effects */
|
||||||
se2->ibuf_comp);
|
|
||||||
|
if (seq->blend_mode == SEQ_ALPHAOVER ||
|
||||||
|
seq->blend_mode == SEQ_ALPHAUNDER) {
|
||||||
|
swap_input = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (swap_input) {
|
||||||
|
sh.execute(seq, cfra,
|
||||||
|
seq->facf0, seq->facf1, x, y,
|
||||||
|
se2->ibuf, se1->ibuf_comp, 0,
|
||||||
|
se2->ibuf_comp);
|
||||||
|
} else {
|
||||||
|
sh.execute(seq, cfra,
|
||||||
|
seq->facf0, seq->facf1, x, y,
|
||||||
|
se1->ibuf_comp, se2->ibuf, 0,
|
||||||
|
se2->ibuf_comp);
|
||||||
|
}
|
||||||
|
|
||||||
IMB_cache_limiter_insert(se2->ibuf_comp);
|
IMB_cache_limiter_insert(se2->ibuf_comp);
|
||||||
IMB_cache_limiter_ref(se2->ibuf_comp);
|
IMB_cache_limiter_ref(se2->ibuf_comp);
|
||||||
|
|||||||
Reference in New Issue
Block a user