OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
ricehdf.h
Go to the documentation of this file.
1 /* BEGIN THIRD_PARTY_COPYRIGHT */
2 /*==============================================================
3 The SZIP Science Data Lossless Compression Program is Copyright (C) 2001
4 Science & Technology Corporation @ UNM. All rights released.
5 Copyright (C) 2003 Lowell H. Miles and Jack A. Venbrux. Licensed to ICs, LLC,
6 for distribution by the University of Illinois' National Center for
7 Supercomputing Applications as a part of the HDF data storage and retrieval
8 file format and software library products package. All rights reserved.
9 Do not modify or use for other purposes.
10 
11 SZIP implements an extended Rice adaptive lossless compression algorithm for
12 sample data. The primary algorithm was developed by R. F. Rice at Jet
13 Propulsion Laboratory.
14 
15 SZIP embodies certain inventions patented by the National Aeronautics &
16 Space Administration. United States Patent Nos. 5,448,642, 5,687,255,
17 and 5,822,457 have been licensed to ICs, LLC, for distribution with the
18 HDF data storage and retrieval file format and software library products.
19 All rights reserved.
20 
21 Revocable, royalty-free, nonexclusive sublicense to use SZIP decompression
22 software routines and underlying patents is hereby granted by ICs, LLC, to
23 all users of and in conjunction with HDF data storage and retrieval file
24 format and software library products.
25 
26 Revocable, royalty-free, nonexclusive sublicense to use SZIP compression
27 software routines and underlying patents for non-commercial, scientific use
28 only is hereby granted by ICs, LLC, to users of and in conjunction with HDF
29 data storage and retrieval file format and software library products.
30 
31 For commercial use license to SZIP compression software routines and
32 underlying patents please contact ICs, LLC, at:
33  ICs, LLC
34  2600-A E. Seltice Way #234,
35  Post Falls, ID 83854
36 
37  Phone: (208) 755-8990
38  Fax: (208) 773-5747.
39 
40 *************Begin NPOESS Specific Permission *******************
41 NPOESS Permissions: Email correspondence, dated February 6, 2007, from
42 Dr. Joseph J. Feeley, Chief Executive Officer, of ICs, LLC
43 2040 Warren Wagon Road, PO Box 2236, McCall ID 83638, USA, grants:
44 1. Raytheon Company is granted Royalty free permission to use this code
45 file (as modified) for the compression and decompression of all NPOESS data
46 packets.
47 2. Same permission is granted to the NPOESS Integrated Program Office,
48 all NPOESS contractors, and all U.S. Government agencies using NPOESS data.
49  **
50 3. NPOESS data users may use SZIP decompression software routines and
51 underlying patents only in conjunction with decompressing NPOESS data in
52 accordance with and as limited by the above Third Party License.
53 
54 4. All other rights reserved. Do not modify or use for other purposes.
55 Further information available at http://www.hdfgroup.org/doc.resource/SZIP/
56 or by contacting ICs, LLC, at support@ICs4chips.com
57 *************End NPOESS Specific Permission *******************
58 
59 ==============================================================================*/
60 /* END THIRD_PARTY_COPYRIGHT */
61 
62 /* BEGIN GOVERNMENT RIGHTS */
63 /**************************************************************************
64 * This code was partially developed under NASA, and other
65 * U.S. Government contracts.
66 *
67 * Patent/copyrights are retained as described in THIRD_PARTY_COPYRIGHT above.
68 *
69 * Please also see "LIMITATIONS" below.
70 *
71 ****************************************************************************/
72 /* END GOVERNMENT RIGHTS */
73 
74 /* BEGIN ITAR */
75 /* END ITAR CONTROL */
76 
77 /* BEGIN CATEGORY */
78 /**************************************************************************
79 * CATEGORY: 1 (see SEN for definitions)
80 *
81 * ricehdf.h
82 *
83 * Refer to Software Standards and Practices Manual (SSPM) for
84 * coding standards.
85 *
86 * NOTE: This code is exempt from NPOESS SSPM because it is Third Party,
87 * copyrighted code. (Please see THIRD_PARTY_COPYRIGHT above)
88 *
89 **************************************************************************/
90 /* END CATEGORY */
91 
92 /**************************************************************************
93 *
94 * NAME: ricehdf.h
95 *
96 * REVISION/EVENT HISTORY:
97 * DATE PR# AUTHOR Build DESCRIPTION
98 * --------- --- ------ ----- -----------
99 * 29AUG2006 Miles 1.5 received source from L. Miles
100 * at ICs Corp. Source is same as
101 * U. of Illinois HDF Library.
102 * 25SEP2006 Arbeiter 1.5 inserted modifications
103 * developed by Jennings, SBRS
104 * 27SEP2006 Arbeiter 1.5 added NPOESS headings
105 * 16FEB2007 Arbeiter 1.5 added NPOESS specific
106 * permissions to 3rd Party
107 * copyright Notices.
108 * 16APR2007 Arbeiter 1.5 Updated header comments
109 * 21DEC2007 Arbeiter 1.5 Updated header comments
110 * and LIMITATIONS notes
111 * 31JAN2008 Arbeiter 1.5x1 Limitations updated
112 * 21NOV2008 Arbeiter 1.5x1 comment updates
113 * --------- --- ------ ----- -----------
114 *
115 * REFERENCES: None.
116 *
117 *
118 * LIMITATIONS:
119 * 1. This code is not generalized Rice Compress/Uncompress. It will only
120 * work with the VIIRS sensor data.
121 *
122 * 2. Use of this software for data from satellites other than NPP or NPOESS
123 * is prohibited.
124 *
125 * 3. This code has only been tested with the numbers of pixels in the VIIRS
126 * aggregation or compression zones, or the number of calibration pixels:
127 * 16, 48, 64, 96, 368, 488, 592, 640, 736, 760, 784, 1184, 1280, and 1776.
128 * Results with other numbers of pixels may be unreliable.
129 *
130 * 4. Raytheon has only tested this code with settings for 15 bits per pixel,
131 * 8 pixels per block, and option mask for NN, MSB, RAW, and CHIP. Results with
132 * other settings may be unreliable. (These are the settings used by
133 * the VIIRS sensor for all compressions.)
134 *
135 * NOTES (MISCELLANEOUS) SECTION:
136 * Raytheon Company, Bellevue, Nebraska
137 * 2007 Raytheon Company. All Rights Reserved.
138 * 2008 Raytheon Company. All Rights Reserved.
139 *
140 * Comment marking "MJJ" is code written by Michael J. Jennings,
141 * of Raytheon SBRS, Goleta, California, 04/28/2004.
142 *
143 * Comment marking "RGA" is code written by Randolph G. Arbeiter,
144 * of Raytheon IIS, Omaha, Nebraska, September 2006.
145 *
146 *******************************************************************************/
147 
148 /* ##begin code inserted for VIIRS - RGA 14SEP2006 */
149 #ifndef _RICEHDF_H_
150 #define _RICEHDF_H_
151 
152 #ifdef __cplusplus
153 extern "C" /* prevents name dithering by C++ compiler RGA */
154 {
155 #endif
156 /* ##end code inserted for VIIRS - RGA 14SEP2006 */
157 
158 /********************************************************/
159 /* defines and declarations to interface to the szip */
160 /* functions in file rice.c. */
161 /* USE EXTREME CARE WHEN MODIFYING THIS FILE */
162 /********************************************************/
163 extern int szip_allow_encoding;
164 
165 #define SZ_ALLOW_K13_OPTION_MASK 1
166 #define SZ_CHIP_OPTION_MASK 2
167 #define SZ_EC_OPTION_MASK 4
168 #define SZ_LSB_OPTION_MASK 8
169 #define SZ_MSB_OPTION_MASK 16
170 #define SZ_NN_OPTION_MASK 32
171 #define SZ_RAW_OPTION_MASK 128
172 
173 #define SZ_STREAM_ERROR (-1)
174 #define SZ_MEM_ERROR (-2)
175 #define SZ_INIT_ERROR (-3)
176 #define SZ_PARAM_ERROR (-4)
177 #define SZ_NO_ENCODER_ERROR (-5)
178 
179 #define SZ_MAX_BLOCKS_PER_SCANLINE 256
180 #define SZ_MAX_PIXELS_PER_BLOCK 32
181 #define SZ_MAX_PIXELS_PER_SCANLINE (SZ_MAX_BLOCKS_PER_SCANLINE)*(SZ_MAX_PIXELS_PER_BLOCK)
182 
184  int options_mask,
185  int bits_per_pixel,
186  int pixels_per_block,
187  int pixels_per_scanline,
188  const void *in,
189  long pixels,
190  char *out);
191 
193  int new_options_mask,
194  int new_bits_per_pixel,
195  int new_pixels_per_block,
196  int new_pixels_per_scanline,
197  const char *in,
198  long in_bytes,
199  void *out,
200  long out_pixels);
201 
203  int bits_per_pixel,
204  int pixels_per_block,
205  int pixels_per_scanline,
206  long image_pixels,
207  char **msg);
208 
209 /* ##begin code inserted for VIIRS - RGA 14SEP2006 */
210 #ifdef __cplusplus
211 }
212 #endif
213 
214 #endif
215 /* ##end code inserted for VIIRS - RGA 14SEP2006 */
int szip_allow_encoding
no change in intended resolving MODur00064 Corrected handling of bad ephemeris attitude resolving resolving GSFcd00179 Corrected handling of fill values for[Sensor|Solar][Zenith|Azimuth] resolving MODxl01751 Changed to validate LUT version against a value retrieved from the resolving MODxl02056 Changed to calculate Solar Diffuser angles without adjustment for estimated post launch changes in the MODIS orientation relative to incidentally resolving defects MODxl01766 Also resolves MODxl01947 Changed to ignore fill values in SCI_ABNORM and SCI_STATE rather than treating them as resolving MODxl01780 Changed to use spacecraft ancillary data to recognise when the mirror encoder data is being set by side A or side B and to change calculations accordingly This removes the need for seperate LUTs for Side A and Side B data it makes the new LUTs incompatible with older versions of the and vice versa Also resolves MODxl01685 A more robust GRing algorithm is being which will create a non default GRing anytime there s even a single geolocated pixel in a granule Removed obsolete messages from seed as required for compatibility with version of the SDP toolkit Corrected test output file names to end in out
Definition: HISTORY.txt:422
long szip_compress_memory(int options_mask, int bits_per_pixel, int pixels_per_block, int pixels_per_scanline, const void *in, long pixels, char *out)
int pixels_per_block[8]
Definition: rice.h:242
long szip_uncompress_memory(int new_options_mask, int new_bits_per_pixel, int new_pixels_per_block, int new_pixels_per_scanline, const char *in, long in_bytes, void *out, long out_pixels)
int bits_per_pixel[8]
Definition: rice.h:241
string msg
Definition: mapgen.py:227
int szip_check_params(int bits_per_pixel, int pixels_per_block, int pixels_per_scanline, long image_pixels, char **msg)