MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / stbi__jpeg_finish

Function stbi__jpeg_finish

lite/example/cpp_example/mge/cv/stb_image.h:3317–3336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3315}
3316
3317static void stbi__jpeg_finish(stbi__jpeg* z) {
3318 if (z->progressive) {
3319 // dequantize and idct the data
3320 int i, j, n;
3321 for (n = 0; n < z->s->img_n; ++n) {
3322 int w = (z->img_comp[n].x + 7) >> 3;
3323 int h = (z->img_comp[n].y + 7) >> 3;
3324 for (j = 0; j < h; ++j) {
3325 for (i = 0; i < w; ++i) {
3326 short* data = z->img_comp[n].coeff +
3327 64 * (i + j * z->img_comp[n].coeff_w);
3328 stbi__jpeg_dequantize(data, z->dequant[z->img_comp[n].tq]);
3329 z->idct_block_kernel(
3330 z->img_comp[n].data + z->img_comp[n].w2 * j * 8 + i * 8,
3331 z->img_comp[n].w2, data);
3332 }
3333 }
3334 }
3335 }
3336}
3337
3338static int stbi__process_marker(stbi__jpeg* z, int m) {
3339 int L;

Callers 1

stbi__decode_jpeg_imageFunction · 0.85

Calls 1

stbi__jpeg_dequantizeFunction · 0.85

Tested by

no test coverage detected