Lines Matching defs:code
38 - decode from memory or through FILE (define STBI_NO_STDIO to remove code)
239 // - Small source code footprint ("easy to maintain")
263 // code.)
271 // If for some reason you do not want to use any of SIMD code, or if
329 // your code footprint by #defining one or more of the following
990 // current code, even on 64-bit targets, is INT_MAX. this is not a
1585 // Common code used by all image loaders
1940 stbi__uint16 code[256];
2004 unsigned int code;
2015 code = 0;
2018 // compute delta to add to code to compute symbol id
2019 h->delta[j] = k - code;
2022 h->code[k++] = (stbi__uint16) (code++);
2023 if (code-1 >= (1u << j)) return stbi__err("bad code lengths","Corrupt JPEG");
2025 // compute largest code + 1 for this size, preshifted as needed later
2026 h->maxcode[j] = code << (16-j);
2027 code <<= 1;
2036 int c = h->code[i] << (FAST_BITS-s);
2061 // magnitude code followed by receive_extend code
2103 // if the code is <= FAST_BITS
2126 // error! code not found
2134 // convert the huffman code to the symbol id
2138 STBI_ASSERT((((j->code_buffer) >> (32 - h->size[c])) & stbi__bmask[h->size[c]]) == h->code[c]);
2215 if (t < 0 || t > 15) return stbi__err("bad huffman code","Corrupt JPEG");
2238 if (s > j->code_bits) return stbi__err("bad huffman code", "Combined length longer than code bits available");
2246 if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
2316 if (s > j->code_bits) return stbi__err("bad huffman code", "Combined length longer than code bits available");
2323 if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
2365 if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
2380 if (s != 1) return stbi__err("bad huffman code", "Corrupt JPEG");
3656 // to make sure the code produces the same results in both SIMD and scalar
4094 // (jpegs packs from left, zlib from right, so can't share code)
4125 int code, next_code[16], sizes[17];
4136 code = 0;
4138 next_code[i] = code;
4139 z->firstcode[i] = (stbi__uint16) code;
4141 code = (code + sizes[i]);
4143 if (code-1 >= (1 << i)) return stbi__err("bad codelengths","Corrupt PNG");
4144 z->maxcode[i] = code << (16-i); // preshift for inner loop
4145 code <<= 1;
4230 if (s >= 16) return -1; // invalid code!
4231 // code size is s, so:
4301 if (z < 0) return stbi__err("bad huffman code","Corrupt PNG"); // error in huffman codes
4314 if (z >= 286) return stbi__err("bad huffman code","Corrupt PNG"); // per DEFLATE, length codes 286 and 287 must not appear in compressed data
4319 if (z < 0 || z >= 30) return stbi__err("bad huffman code","Corrupt PNG"); // per DEFLATE, distance codes 30 and 31 must not appear in compressed data
4476 // use fixed code lengths
4775 // this could run two scanlines behind the above code, so it won't
5542 return NULL; // error code already set
6653 static void stbi__out_gif_code(stbi__gif *g, stbi__uint16 code)
6660 if (g->codes[code].prefix >= 0)
6661 stbi__out_gif_code(g, g->codes[code].prefix);
6669 c = &g->color_table[g->codes[code].suffix * 4];
6712 // support no starting clear code
6728 stbi__int32 code = bits & codemask;
6732 if (code == clear) { // clear code
6738 } else if (code == clear + 1) { // end of stream code
6743 } else if (code <= avail) {
6745 return stbi__errpuc("no clear code", "Corrupt GIF");
6756 p->suffix = (code == avail) ? p->first : g->codes[code].first;
6757 } else if (code == avail)
6758 return stbi__errpuc("illegal code in raster", "Corrupt GIF");
6760 stbi__out_gif_code(g, (stbi__uint16) code);
6767 oldcode = code;
6769 return stbi__errpuc("illegal code in raster", "Corrupt GIF");
6942 case 0x3B: // gif stream termination code
6946 return stbi__errpuc("unknown code", "Corrupt GIF");
7802 info() for BMP to shares code instead of sloppy parse
7804 code cleanup
7837 fix MSVC-only compiler problem in code changed in 1.42
7839 don't define _CRT_SECURE_NO_WARNINGS (affects user code)
7915 1.09 Fix format-conversion for PSD code (bad global variables!)
7916 1.08 Thatcher Ulrich's PSD code integrated by Nicolas Schulz
7978 software, either in source code form or as a compiled binary, for any purpose,