CU的递归扫描顺序[HEVC/H.265]
在HEVC中,每个CU是可以进行递归式切分的,每次切分为正方形的4个subCU,对于LCU=64x64,最小CU=8x8的情况来说,其最小partition为4x4,其Z形扫描顺序如下图所示:
为了简化计算,在HM参考软件中有两个数组对Z型扫描顺序和光栅扫描顺序之间做了映射,即:
RasterToZscan | |||||||||||||||
0 | 1 | 4 | 5 | 16 | 17 | 20 | 21 | 64 | 65 | 68 | 69 | 80 | 81 | 84 | 85 |
2 | 3 | 6 | 7 | 18 | 19 | 22 | 23 | 66 | 67 | 70 | 71 | 82 | 83 | 86 | 87 |
8 | 9 | 12 | 13 | 24 | 25 | 28 | 29 | 72 | 73 | 76 | 77 | 88 | 89 | 92 | 93 |
10 | 11 | 14 | 15 | 26 | 27 | 30 | 31 | 74 | 75 | 78 | 79 | 90 | 91 | 94 | 95 |
32 | 33 | 36 | 37 | 48 | 49 | 52 | 53 | 96 | 97 | 100 | 101 | 112 | 113 | 116 | 117 |
34 | 35 | 38 | 39 | 50 | 51 | 54 | 55 | 98 | 99 | 102 | 103 | 114 | 115 | 118 | 119 |
40 | 41 | 44 | 45 | 56 | 57 | 60 | 61 | 104 | 105 | 108 | 109 | 120 | 121 | 124 | 125 |
42 | 43 | 46 | 47 | 58 | 59 | 62 | 63 | 106 | 107 | 110 | 111 | 122 | 123 | 126 | 127 |
128 | 129 | 132 | 133 | 144 | 145 | 148 | 149 | 192 | 193 | 196 | 197 | 208 | 209 | 212 | 213 |
130 | 131 | 134 | 135 | 146 | 147 | 150 | 151 | 194 | 195 | 198 | 199 | 210 | 211 | 214 | 215 |
136 | 137 | 140 | 141 | 152 | 153 | 156 | 157 | 200 | 201 | 204 | 205 | 216 | 217 | 220 | 221 |
138 | 139 | 142 | 143 | 154 | 155 | 158 | 159 | 202 | 203 | 206 | 207 | 218 | 219 | 222 | 223 |
160 | 161 | 164 | 165 | 176 | 177 | 180 | 181 | 224 | 225 | 228 | 229 | 240 | 241 | 244 | 245 |
162 | 163 | 166 | 167 | 178 | 179 | 182 | 183 | 226 | 227 | 230 | 231 | 242 | 243 | 246 | 247 |
168 | 169 | 172 | 173 | 184 | 185 | 188 | 189 | 232 | 233 | 236 | 237 | 248 | 249 | 252 | 253 |
170 | 171 | 174 | 175 | 186 | 187 | 190 | 191 | 234 | 235 | 238 | 239 | 250 | 251 | 254 | 255 |
ZscanToRaster | |||||||||||||||
0 | 1 | 16 | 17 | 2 | 3 | 18 | 19 | 32 | 33 | 48 | 49 | 34 | 35 | 50 | 51 |
4 | 5 | 20 | 21 | 6 | 7 | 22 | 23 | 36 | 37 | 52 | 53 | 38 | 39 | 54 | 55 |
64 | 65 | 80 | 81 | 66 | 67 | 82 | 83 | 96 | 97 | 112 | 113 | 98 | 99 | 114 | 115 |
68 | 69 | 84 | 85 | 70 | 71 | 86 | 87 | 100 | 101 | 116 | 117 | 102 | 103 | 118 | 119 |
8 | 9 | 24 | 25 | 10 | 11 | 26 | 27 | 40 | 41 | 56 | 57 | 42 | 43 | 58 | 59 |
12 | 13 | 28 | 29 | 14 | 15 | 30 | 31 | 44 | 45 | 60 | 61 | 46 | 47 | 62 | 63 |
72 | 73 | 88 | 89 | 74 | 75 | 90 | 91 | 104 | 105 | 120 | 121 | 106 | 107 | 122 | 123 |
76 | 77 | 92 | 93 | 78 | 79 | 94 | 95 | 108 | 109 | 124 | 125 | 110 | 111 | 126 | 127 |
128 | 129 | 144 | 145 | 130 | 131 | 146 | 147 | 160 | 161 | 176 | 177 | 162 | 163 | 178 | 179 |
132 | 133 | 148 | 149 | 134 | 135 | 150 | 151 | 164 | 165 | 180 | 181 | 166 | 167 | 182 | 183 |
192 | 193 | 208 | 209 | 194 | 195 | 210 | 211 | 224 | 225 | 240 | 241 | 226 | 227 | 242 | 243 |
196 | 197 | 212 | 213 | 198 | 199 | 214 | 215 | 228 | 229 | 244 | 245 | 230 | 231 | 246 | 247 |
136 | 137 | 152 | 153 | 138 | 139 | 154 | 155 | 168 | 169 | 184 | 185 | 170 | 171 | 186 | 187 |
140 | 141 | 156 | 157 | 142 | 143 | 158 | 159 | 172 | 173 | 188 | 189 | 174 | 175 | 190 | 191 |
200 | 201 | 216 | 217 | 202 | 203 | 218 | 219 | 232 | 233 | 248 | 249 | 234 | 235 | 250 | 251 |
204 | 205 | 220 | 221 | 206 | 207 | 222 | 223 | 236 | 237 | 252 | 253 | 238 | 239 | 254 | 255 |