Repo for the search and displace ingest module that takes odf, docx and pdf and transforms it into .md to be used with search and displace operations
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.7 KiB

3 years ago
  1. unit imjcinit;
  2. { Original: jcinit.c ; Copyright (C) 1991-1997, Thomas G. Lane. }
  3. { This file contains initialization logic for the JPEG compressor.
  4. This routine is in charge of selecting the modules to be executed and
  5. making an initialization call to each one.
  6. Logically, this code belongs in jcmaster.c. It's split out because
  7. linking this routine implies linking the entire compression library.
  8. For a transcoding-only application, we want to be able to use jcmaster.c
  9. without linking in the whole library. }
  10. interface
  11. {$I imjconfig.inc}
  12. uses
  13. imjinclude,
  14. imjdeferr,
  15. imjerror,
  16. imjpeglib,
  17. {$ifdef C_PROGRESSIVE_SUPPORTED}
  18. imjcphuff,
  19. {$endif}
  20. imjchuff, imjcmaster, imjccolor, imjcsample, imjcprepct,
  21. imjcdctmgr, imjccoefct, imjcmainct, imjcmarker;
  22. { Master selection of compression modules.
  23. This is done once at the start of processing an image. We determine
  24. which modules will be used and give them appropriate initialization calls. }
  25. {GLOBAL}
  26. procedure jinit_compress_master (cinfo : j_compress_ptr);
  27. implementation
  28. { Master selection of compression modules.
  29. This is done once at the start of processing an image. We determine
  30. which modules will be used and give them appropriate initialization calls. }
  31. {GLOBAL}
  32. procedure jinit_compress_master (cinfo : j_compress_ptr);
  33. begin
  34. { Initialize master control (includes parameter checking/processing) }
  35. jinit_c_master_control(cinfo, FALSE { full compression });
  36. { Preprocessing }
  37. if (not cinfo^.raw_data_in) then
  38. begin
  39. jinit_color_converter(cinfo);
  40. jinit_downsampler(cinfo);
  41. jinit_c_prep_controller(cinfo, FALSE { never need full buffer here });
  42. end;
  43. { Forward DCT }
  44. jinit_forward_dct(cinfo);
  45. { Entropy encoding: either Huffman or arithmetic coding. }
  46. if (cinfo^.arith_code) then
  47. begin
  48. ERREXIT(j_common_ptr(cinfo), JERR_ARITH_NOTIMPL);
  49. end
  50. else
  51. begin
  52. if (cinfo^.progressive_mode) then
  53. begin
  54. {$ifdef C_PROGRESSIVE_SUPPORTED}
  55. jinit_phuff_encoder(cinfo);
  56. {$else}
  57. ERREXIT(j_common_ptr(cinfo), JERR_NOT_COMPILED);
  58. {$endif}
  59. end
  60. else
  61. jinit_huff_encoder(cinfo);
  62. end;
  63. { Need a full-image coefficient buffer in any multi-pass mode. }
  64. jinit_c_coef_controller(cinfo,
  65. (cinfo^.num_scans > 1) or (cinfo^.optimize_coding));
  66. jinit_c_main_controller(cinfo, FALSE { never need full buffer here });
  67. jinit_marker_writer(cinfo);
  68. { We can now tell the memory manager to allocate virtual arrays. }
  69. cinfo^.mem^.realize_virt_arrays (j_common_ptr(cinfo));
  70. { Write the datastream header (SOI) immediately.
  71. Frame and scan headers are postponed till later.
  72. This lets application insert special markers after the SOI. }
  73. cinfo^.marker^.write_file_header (cinfo);
  74. end;
  75. end.