Changeset 19346 for trunk/ppStack/src/ppStackLoop.c
- Timestamp:
- Sep 3, 2008, 12:22:54 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/ppStack/src/ppStackLoop.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ppStack/src/ppStackLoop.c
r19337 r19346 477 477 pmReadout *outRO = NULL; // Output readout 478 478 pmFPAview *view = NULL; // View to readout 479 psArray *inspect = NULL; // Array of arrays of pixels to inspect 479 480 { 480 481 int row0, col0; // Offset for readout … … 518 519 519 520 bool status; // Status of read 520 for (int numChunk = 0; true; numChunk++) { 521 int numChunk; // Number of chunks 522 for (numChunk = 0; true; numChunk++) { 521 523 ppStackThread *thread = ppStackThreadRead(&status, stack, config, numChunk, overlap); 522 524 if (!status) { … … 567 569 } 568 570 571 // Harvest the jobs, gathering the inspection lists 572 inspect = psArrayAlloc(num); 573 for (int i = 0; i < num; i++) { 574 if (inputMask->data.U8[i]) { 575 continue; 576 } 577 inspect->data[i] = psArrayAllocEmpty(numChunk); 578 } 579 psThreadJob *job; // Completed job 580 while ((job = psThreadJobGetDone())) { 581 psArray *results = job->results; // Results of job 582 for (int i = 0; i < num; i++) { 583 if (inputMask->data.U8[i]) { 584 continue; 585 } 586 inspect->data[i] = psArrayAdd(inspect->data[i], 1, results->data[i]); 587 } 588 psFree(job); 589 } 590 569 591 memDump("initial"); 570 592 } … … 573 595 psArray *rejected = psArrayAlloc(num); 574 596 { 575 psArray *inspect = psArrayAlloc(num); // Pixels to inspect576 597 int numRejected = 0; // Number of inputs rejected completely 577 598 … … 581 602 numRejected++; 582 603 } 583 inspect->data[i] = psPixelsAllocEmpty(PIXELS_BUFFER);584 }585 586 // Harvest the jobs, combining the inspection lists587 psThreadJob *job; // Completed job588 while ((job = psThreadJobGetDone())) {589 psArray *results = job->results; // Results of job590 psAssert(results && results->n == num, "Results array.");591 for (int i = 0; i < num; i++) {592 if (inputMask->data.U8[i]) {593 continue;594 }595 inspect->data[i] = psPixelsConcatenate(inspect->data[i], results->data[i]);596 }597 psFree(job);598 604 } 599 605 … … 602 608 continue; 603 609 } 610 611 psThreadJob *job = psThreadJobAlloc("PPSTACK_INSPECT"); // Job to start 612 psArrayAdd(job->args, 1, inspect); 613 PS_ARRAY_ADD_SCALAR(job->args, i, PS_TYPE_S32); 614 if (!psThreadJobAddPending(job)) { 615 psFree(job); 616 psFree(subKernels); 617 psFree(subRegions); 618 psFree(stack); 619 psFree(inputMask); 620 psFree(view); 621 psFree(outRO); 622 psFree(inspect); 623 psFree(rejected); 624 return false; 625 } 626 psFree(job); 627 } 628 629 if (!psThreadPoolWait(false)) { 630 psError(PS_ERR_UNKNOWN, false, "Unable to concatenate inspection lists."); 631 psFree(subKernels); 632 psFree(subRegions); 633 psFree(stack); 634 psFree(inputMask); 635 psFree(view); 636 psFree(outRO); 637 psFree(inspect); 638 psFree(rejected); 639 return false; 640 } 641 642 if (psMetadataLookupS32(NULL, config->arguments, "-threads") > 0) { 643 pmStackRejectThreadsInit(); 644 } 645 646 // Reject bad pixels 647 for (int i = 0; i < num; i++) { 604 648 605 649 #ifdef TESTING
Note:
See TracChangeset
for help on using the changeset viewer.
