MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / stbi__parse_zlib

Function stbi__parse_zlib

include/stb/stb_image.h:4481–4508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4479*/
4480
4481static int stbi__parse_zlib(stbi__zbuf *a, int parse_header)
4482{
4483 int final, type;
4484 if (parse_header)
4485 if (!stbi__parse_zlib_header(a)) return 0;
4486 a->num_bits = 0;
4487 a->code_buffer = 0;
4488 a->hit_zeof_once = 0;
4489 do {
4490 final = stbi__zreceive(a,1);
4491 type = stbi__zreceive(a,2);
4492 if (type == 0) {
4493 if (!stbi__parse_uncompressed_block(a)) return 0;
4494 } else if (type == 3) {
4495 return 0;
4496 } else {
4497 if (type == 1) {
4498 // use fixed code lengths
4499 if (!stbi__zbuild_huffman(&a->z_length , stbi__zdefault_length , STBI__ZNSYMS)) return 0;
4500 if (!stbi__zbuild_huffman(&a->z_distance, stbi__zdefault_distance, 32)) return 0;
4501 } else {
4502 if (!stbi__compute_huffman_codes(a)) return 0;
4503 }
4504 if (!stbi__parse_huffman_block(a)) return 0;
4505 }
4506 } while (!final);
4507 return 1;
4508}
4509
4510static int stbi__do_zlib(stbi__zbuf *a, char *obuf, int olen, int exp, int parse_header)
4511{

Callers 1

stbi__do_zlibFunction · 0.85

Calls 6

stbi__parse_zlib_headerFunction · 0.85
stbi__zreceiveFunction · 0.85
stbi__zbuild_huffmanFunction · 0.85

Tested by

no test coverage detected