jcmaster.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * jcmaster.h
  3. *
  4. * This file was part of the Independent JPEG Group's software:
  5. * Copyright (C) 1991-1997, Thomas G. Lane.
  6. * mozjpeg Modifications:
  7. * Copyright (C) 2014, Mozilla Corporation.
  8. * For conditions of distribution and use, see the accompanying README file.
  9. *
  10. * This file contains the master control structures for the JPEG compressor.
  11. */
  12. /* Private state */
  13. typedef enum {
  14. main_pass, /* input data, also do first output step */
  15. huff_opt_pass, /* Huffman code optimization pass */
  16. output_pass, /* data output pass */
  17. trellis_pass /* trellis quantization pass */
  18. } c_pass_type;
  19. typedef struct {
  20. struct jpeg_comp_master pub; /* public fields */
  21. c_pass_type pass_type; /* the type of the current pass */
  22. int pass_number; /* # of passes completed */
  23. int total_passes; /* total # of passes needed */
  24. int scan_number; /* current index in scan_info[] */
  25. /* fields for scan optimisation */
  26. int pass_number_scan_opt_base; /* pass number where scan optimization begins */
  27. unsigned char * scan_buffer[64]; /* buffer for a given scan */
  28. unsigned long scan_size[64]; /* size for a given scan */
  29. int actual_Al[64]; /* actual value of Al used for a scan */
  30. unsigned long best_cost; /* bit count for best frequency split */
  31. int best_freq_split_idx_luma; /* index for best frequency split (luma) */
  32. int best_freq_split_idx_chroma; /* index for best frequency split (chroma) */
  33. int best_Al_luma; /* best value for Al found in scan search (luma) */
  34. int best_Al_chroma; /* best value for Al found in scan search (luma) */
  35. boolean interleave_chroma_dc; /* indicate whether to interleave chroma DC scans */
  36. struct jpeg_destination_mgr * saved_dest; /* saved value of cinfo->dest */
  37. /*
  38. * This is here so we can add libjpeg-turbo version/build information to the
  39. * global string table without introducing a new global symbol. Adding this
  40. * information to the global string table allows one to examine a binary
  41. * object and determine which version of libjpeg-turbo it was built from or
  42. * linked against.
  43. */
  44. const char *jpeg_version;
  45. } my_comp_master;
  46. typedef my_comp_master * my_master_ptr;