X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fxfer.C;h=417a15dcda9ee5c7c0d797c3d1205ace35d55364;hb=9f917bc27389ebc36568a1f465b42208f7e8e46a;hp=c689b6b6a8b4cf3be0f7085d8b726626001cc5df;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/guicast/xfer.C b/cinelerra-5.1/guicast/xfer.C index c689b6b6..417a15dc 100644 --- a/cinelerra-5.1/guicast/xfer.C +++ b/cinelerra-5.1/guicast/xfer.C @@ -106,7 +106,8 @@ void BC_Xfer::init( switch( in_colormodel ) { case BC_UVY422: case BC_YUV422: in_w &= ~1; break; // 2x1 - case BC_YUV420P: in_w &= ~1; in_h &= ~1; break; // 2x2 + case BC_YUV420P: + case BC_YUV420PI: in_w &= ~1; in_h &= ~1; break; // 2x2 case BC_YUV422P: in_w &= ~1; break; // 2x1 case BC_YUV410P: in_w &= ~3; in_h &= ~3; break; // 4x4 case BC_YUV411P: in_w &= ~3; break; // 4x1 @@ -114,7 +115,8 @@ void BC_Xfer::init( switch( out_colormodel ) { case BC_UVY422: case BC_YUV422: out_w &= ~1; break; - case BC_YUV420P: out_w &= ~1; out_h &= ~1; break; + case BC_YUV420P: + case BC_YUV420PI: out_w &= ~1; out_h &= ~1; break; case BC_YUV422P: out_w &= ~1; break; case BC_YUV410P: out_w &= ~3; out_h &= ~3; break; case BC_YUV411P: out_w &= ~3; break; @@ -245,9 +247,9 @@ void BC_CModels::transfer( // specialized functions // in bccmdl.py: specialize("bc_rgba8888", "bc_transparency", "XFER_rgba8888_to_transparency") -void BC_Xfer::XFER_rgba8888_to_transparency() +void BC_Xfer::XFER_rgba8888_to_transparency(unsigned y0, unsigned y1) { - for( unsigned i=0; i max_slices ) slices = max_slices; + if( slices < 1 ) slices = 1; + Slicer *active[slices]; + unsigned y0 = 0, y1 = out_h; + int slices1 = slices-1; + if( slices1 > 0 ) { + slicers.lock("BC_Xfer::xfer_slices"); + for( int i=0; islice(this, y0, y1); + } + slicers.unlock(); + } + (this->*xfn)(y0, out_h); + if( slices1 > 0 ) { + for( int i=0; icomplete->lock("BC_Xfer::xfer_slices"); + slicers.lock("BC_Xfer::xfer_slices"); + for( int i=0; ixp = xp; + init = new Condition(0, "BC_Xfer::Slicer::init", 0); + complete = new Condition(0, "BC_Xfer::Slicer::complete", 0); + done = 0; + start(); +} +BC_Xfer::Slicer::~Slicer() +{ + done = 1; + init->unlock(); + join(); +} + +void BC_Xfer::Slicer::slice(BC_Xfer *xp, unsigned y0, unsigned y1) +{ + this->xp = xp; + this->y0 = y0; + this->y1 = y1; + init->unlock(); +} + +void BC_Xfer::Slicer::run() +{ + while( !done ) { + init->lock("Slicer::run"); + if( done ) break; + xfer_fn xfn = xp->xfn; + (xp->*xfn)(y0, y1); + complete->unlock(); + } +} + +void BC_CModels::bcxfer_stop_slicers() +{ + BC_Xfer::slicers.reset(); +} +