Note: The HM code version is hm-16.2+scm-3.0rc1/.
three ways to scan
HEVC has three scanning methods: Diagonal scan, horizontal scan, vertical scan in the upper right corner. Corresponds as shown.
Figure 1 HEVC three ways to scan
Depending on the mode, use one of the three ways: horizontal, vertical, diagonal. For blocks that exceed 4x4, the blocks are first divided into several 4x4 CG (coefficient Group), and CG and each CG interior are scanned using the selected scan sequence.
selection of scanning methods
So how does HEVC choose the scanning method? The adaptive coefficient scan is taken. The code corresponds to the Tcomdatacu::getcoefscanidx () function.
Figure 2 Adaptive coefficient scanning
Note: For all block sizes, the transform coefficients of the inter-frame prediction mode, and the conversion coefficients of the forecast within the 16x16 or 32x32 frame, you cannot use a 4x4 diagonal scan to the top right of the transform coefficients sub-block. (Legacy issues)
HEVC Scan Mode