Add a comment explaining the coefficient order
@@ -224,6 +224,53 @@ typedef struct {
kvz_pixel v[LCU_REF_PX_WIDTH / 2 + 1];
} lcu_ref_px_t;
+/**
+ * \brief Coefficients of an LCU
+ *
+ * Coefficients inside a single TU are stored in row-major order. TUs
+ * themselves are stored in a zig-zag order, so that the coefficients of
+ * a TU are contiguous in memory.
+ *
+ * Example storage order for a 32x32 pixel TU tree
+ *
+ \verbatim
+
+ +------+------+------+------+---------------------------+
+ | 0 | 16 | 64 | 80 | |
+ | - | - | - | - | |
+ | 15 | 31 | 79 | 95 | |
+ +------+------+------+------+ |
+ | 32 | 48 | 96 | 112 | |
+ | - | - | - | - | |
+ | 47 | 63 | 111 | 127 | |
+ +------+------+------+------+ 256 - 511 |
+ | 128 | 144 | 192 | 208 | |
+ | - | - | - | - | |
+ | 143 | 159 | 207 | 223 | |
+ +------+------+------+------+ |
+ | 160 | 176 | 224 | 240 | |
+ | - | - | - | - | |
+ | 175 | 191 | 239 | 255 | |
+ +------+------+------+------+-------------+------+------+
+ | 512 | 528 | | | 832 | 848 |
+ | - | - | | | - | - |
+ | 527 | 543 | | | 847 | 863 |
+ +------+------+ 576 - 639 | 768 - 831 +------+------+
+ | 544 | 560 | | | 864 | 880 |
+ | - | - | | | - | - |
+ | 559 | 575 | | | 879 | 895 |
+ +------+------+-------------+-------------+------+------+
+ | | | | |
+ | | | | |
+ | | | | |
+ | 640 - 703 | 704 - 767 | 896 - 959 | 960 - 1023 |
+ | | | | |
+ | | | | |
+ | | | | |
+ +-------------+-------------+-------------+-------------+
+
+ \endverbatim
+ */
typedef struct {
coeff_t y[LCU_LUMA_SIZE];
coeff_t u[LCU_CHROMA_SIZE];
