ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/CV/CV.xs
(Generate patch)

Comparing CV/CV.xs (file contents):
Revision 1.63 by root, Sun Nov 28 23:26:51 2021 UTC vs.
Revision 1.66 by root, Tue Mar 21 00:06:49 2023 UTC

302///////////////////////////////////////////////////////////////////////////// 302/////////////////////////////////////////////////////////////////////////////
303 303
304MODULE = Gtk2::CV PACKAGE = Gtk2::CV 304MODULE = Gtk2::CV PACKAGE = Gtk2::CV
305 305
306PROTOTYPES: ENABLE 306PROTOTYPES: ENABLE
307
308void
309_exit (int code)
307 310
308# calculate the common prefix length of two strings 311# calculate the common prefix length of two strings
309# missing function in perl. really :) 312# missing function in perl. really :)
310int 313int
311common_prefix_length (a, b) 314common_prefix_length (a, b)
589 JxlBasicInfo info; 592 JxlBasicInfo info;
590 const uint8_t *next_in = (uint8_t *)SvPVbyte_nolen (image_data); 593 const uint8_t *next_in = (uint8_t *)SvPVbyte_nolen (image_data);
591 size_t avail_in = SvCUR (image_data); 594 size_t avail_in = SvCUR (image_data);
592 const char *error = 0; 595 const char *error = 0;
593 JxlDecoderStatus status; 596 JxlDecoderStatus status;
597 static void *runner_cache;
594 void *runner = 0; 598 void *runner = 0;
595 struct bmff_box box;
596 599
597 RETVAL = 0; 600 RETVAL = 0;
601
602 if (runner_cache)
603 runner = runner_cache;
604 else
605 runner = JxlThreadParallelRunnerCreate (0, JxlThreadParallelRunnerDefaultNumWorkerThreads ());
606
607 runner_cache = 0;
598 608
599 perlinterp_release (); 609 perlinterp_release ();
600 610
601 dec = JxlDecoderCreate (0); 611 dec = JxlDecoderCreate (0);
602 612
603 error = "JxlDecoderCreate failed"; 613 error = "JxlDecoderCreate failed";
604 if (!dec) 614 if (!dec)
605 goto done; 615 goto done;
606
607 runner = JxlThreadParallelRunnerCreate (0, JxlThreadParallelRunnerDefaultNumWorkerThreads ());
608 616
609 status = JxlDecoderSetParallelRunner (dec, JxlThreadParallelRunner, runner); 617 status = JxlDecoderSetParallelRunner (dec, JxlThreadParallelRunner, runner);
610 error = "JxlDecoderSetParallelRunner failed"; 618 error = "JxlDecoderSetParallelRunner failed";
611 if (status != JXL_DEC_SUCCESS) 619 if (status != JXL_DEC_SUCCESS)
612 goto done; 620 goto done;
688 696
689 done: 697 done:
690 if (dec) 698 if (dec)
691 JxlDecoderDestroy (dec); 699 JxlDecoderDestroy (dec);
692 700
701 perlinterp_acquire ();
702
693 if (runner) 703 if (runner_cache)
694 JxlThreadParallelRunnerDestroy (runner); 704 JxlThreadParallelRunnerDestroy (runner);
695 705
696 perlinterp_acquire (); 706 runner_cache = runner;
697 707
698 if (error) 708 if (error)
699 { 709 {
700 if (RETVAL) 710 if (RETVAL)
701 g_object_unref (RETVAL); 711 g_object_unref (RETVAL);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines