From: Good Guy Date: Mon, 17 Sep 2018 19:57:28 +0000 (-0600) Subject: remove / from shift drop filter, corrent alpha calculation in overlaysample X-Git-Url: http://git.cinelerra-gg.org/git/?p=goodguy%2Fhistory.git;a=commitdiff_plain;h=c0d624ab88c9973237c624b4ee055ad5dd83d4ed;hp=5cd4c287972f0b38b4c23fb478012df2293e8bbc remove / from shift drop filter, corrent alpha calculation in overlaysample --- diff --git a/cinelerra-5.1/cinelerra/binfolder.C b/cinelerra-5.1/cinelerra/binfolder.C index ffe5a12f..b5d4b9f8 100644 --- a/cinelerra-5.1/cinelerra/binfolder.C +++ b/cinelerra-5.1/cinelerra/binfolder.C @@ -354,7 +354,7 @@ int BinFolder::add_patterns(ArrayList *drag_idxbls, int use_basename if( use_basename && idxbl->is_asset ) { const char *cp = strrchr(tp, '/'); if( cp ) tp = cp + 1; - len += 2; // "*/" + fn + len += 1; // "*" + fn } len += strlen(tp) + 1; } @@ -370,7 +370,7 @@ int BinFolder::add_patterns(ArrayList *drag_idxbls, int use_basename if( use_basename && idxbl->is_asset ) { const char *cp = strrchr(tp, '/'); if( cp ) tp = cp + 1; - *bp++ = '*'; *bp++ = '/'; + *bp++ = '*'; } while( *tp ) *bp++ = *tp++; } diff --git a/cinelerra-5.1/cinelerra/overlaysample.C b/cinelerra-5.1/cinelerra/overlaysample.C index 49071595..a4b485d7 100644 --- a/cinelerra-5.1/cinelerra/overlaysample.C +++ b/cinelerra-5.1/cinelerra/overlaysample.C @@ -26,28 +26,22 @@ float racc=0.f, gacc=0.f, bacc=0.f, aacc=0.f; \ int ki = lookup_sk[j], x = lookup_sx0[j]; \ type *ip = input + x * components; \ - float wacc = 0, awacc = 0; \ - while(x++ < lookup_sx1[j]) { \ + while(x < lookup_sx1[j]) { \ float kv = k[abs(ki >> INDEX_FRACTION)]; \ /* handle fractional pixels on edges of input */ \ if(x == i1i) kv *= i1f; \ - if(x + 1 == i2i) kv *= i2f; \ - if( components == 4 ) { awacc += kv; kv *= ip[3]; } \ - wacc += kv; \ + if(++x == i2i) kv *= i2f; \ racc += kv * *ip++; \ gacc += kv * (*ip++ - ofs); \ bacc += kv * (*ip++ - ofs); \ - if( components == 4 ) { aacc += kv; ++ip; } \ + if( components == 4 ) { aacc += kv * *ip++; } \ ki += kd; \ } \ - if(wacc > 0.) wacc = 1. / wacc; \ + float wacc = lookup_wacc[j]; \ *tempp++ = racc * wacc; \ *tempp++ = gacc * wacc; \ *tempp++ = bacc * wacc; \ - if( components == 4 ) { \ - if(awacc > 0.) awacc = 1. / awacc; \ - *tempp++ = aacc * awacc; \ - } \ + if( components == 4 ) { *tempp++ = aacc * wacc; } \ } \ } \ \ @@ -147,7 +141,7 @@ void SampleUnit::process_package(LoadPackage *package) int *lookup_sx0 = engine->lookup_sx0; int *lookup_sx1 = engine->lookup_sx1; int *lookup_sk = engine->lookup_sk; - //float *lookup_wacc = engine->lookup_wacc; + float *lookup_wacc = engine->lookup_wacc; BLEND_SWITCH(XBLEND_SAMPLE); } @@ -243,12 +237,8 @@ void SampleEngine::init_packages() * the contribution of the first and last input pixel (if * fractional) are linearly weighted by the fraction */ - if(j == i1i) - wacc += k[abs(kv)] * i1f; - else if(j + 1 == i2i) - wacc += k[abs(kv)] * i2f; - else - wacc += k[abs(kv)]; + float fk = k[abs(kv)]; + wacc += j == i1i ? fk * i1f : j+1 == i2i ? fk * i2f : fk; /* this is where we clip the kernel convolution to the source plane */ if(j >= 0 && j < iw) {