]> git.sesse.net Git - fjl/blob - zigzag.h
More debug code moving.
[fjl] / zigzag.h
1 #ifndef _ZIGZAG_H
2 #define _ZIGZAG_H
3
4 #include "idct.h"
5
6 // Table for transforming from zig-zag order to natural order.
7 // We use the same trick as libjpeg here; there are 64 extra entries
8 // after the end of the table, since the run-length decoder could
9 // potentially cause entries indices >= 64 to be decoded.
10 static const unsigned unzigzag[DCTSIZE2 * 2] = {
11         // Regular entries.
12          0,  1,  8, 16,  9,  2,  3, 10,
13         17, 24, 32, 25, 18, 11,  4,  5,
14         12, 19, 26, 33, 40, 48, 41, 34,
15         27, 20, 13,  6,  7, 14, 21, 28,
16         35, 42, 49, 56, 57, 50, 43, 36,
17         29, 22, 15, 23, 30, 37, 44, 51,
18         58, 59, 52, 45, 38, 31, 39, 46,
19         53, 60, 61, 54, 47, 55, 62, 63,
20
21         // Extra padding entries.
22         // May get referenced by malformed data or during end-of-block processing.
23         63, 63, 63, 63, 63, 63, 63, 63,
24         63, 63, 63, 63, 63, 63, 63, 63,
25         63, 63, 63, 63, 63, 63, 63, 63,
26         63, 63, 63, 63, 63, 63, 63, 63,
27         63, 63, 63, 63, 63, 63, 63, 63,
28         63, 63, 63, 63, 63, 63, 63, 63,
29         63, 63, 63, 63, 63, 63, 63, 63,
30         63, 63, 63, 63, 63, 63, 63, 63,
31 };
32
33 #endif /* !defined(_ZIGZAG_H) */