| 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 |
| 13 |
| 14 | /* Private state */ |
| 15 |
| 16 | typedef enum { |
| 17 | main_pass, /* input data, also do first output step */ |
| 18 | huff_opt_pass, /* Huffman code optimization pass */ |
| 19 | output_pass, /* data output pass */ |
| 20 | trellis_pass /* trellis quantization pass */ |
| 21 | } c_pass_type; |
| 22 |
| 23 | typedef struct { |
| 24 | struct jpeg_comp_master pub; /* public fields */ |
| 25 |
| 26 | c_pass_type pass_type; /* the type of the current pass */ |
| 27 |
| 28 | int pass_number; /* # of passes completed */ |
| 29 | int total_passes; /* total # of passes needed */ |
| 30 |
| 31 | int scan_number; /* current index in scan_info[] */ |
| 32 |
| 33 | /* fields for scan optimisation */ |
| 34 | int pass_number_scan_opt_base; /* pass number where scan optimization begins */ |
| 35 | unsigned char * scan_buffer[64]; /* buffer for a given scan */ |
| 36 | unsigned long scan_size[64]; /* size for a given scan */ |
| 37 | int actual_Al[64]; /* actual value of Al used for a scan */ |
| 38 | unsigned long best_cost; /* bit count for best frequency split */ |
| 39 | int best_freq_split_idx_luma; /* index for best frequency split (luma) */ |
| 40 | int best_freq_split_idx_chroma; /* index for best frequency split (chroma) */ |
| 41 | int best_Al_luma; /* best value for Al found in scan search (luma) */ |
| 42 | int best_Al_chroma; /* best value for Al found in scan search (luma) */ |
| 43 | boolean interleave_chroma_dc; /* indicate whether to interleave chroma DC scans */ |
| 44 | struct jpeg_destination_mgr * saved_dest; /* saved value of cinfo->dest */ |
| 45 |
| 46 | /* |
| 47 | * This is here so we can add libjpeg-turbo version/build information to the |
| 48 | * global string table without introducing a new global symbol. Adding this |
| 49 | * information to the global string table allows one to examine a binary |
| 50 | * object and determine which version of libjpeg-turbo it was built from or |
| 51 | * linked against. |
| 52 | */ |
| 53 | const char *jpeg_version; |
| 54 | } my_comp_master; |
| 55 |
| 56 | typedef my_comp_master * my_master_ptr; |
| 57 |