|
TUT HEVC Encoder
|
Coding Unit data structure and related functions. More...
Go to the source code of this file.
Data Structures | |
| struct | vector2d_t |
| struct | cu_info_t |
| Struct for CU info. More... | |
| struct | cu_array_t |
| struct | lcu_ref_px_t |
| Top and left intra reference pixels for LCU. More... | |
| struct | lcu_t |
Typedefs | |
| typedef struct cu_array_t | cu_array_t |
Enumerations | |
| enum | cu_type_t { CU_NOTSET = 0 , CU_INTRA = 1 , CU_INTER = 2 , CU_PCM = 3 } |
| enum | part_mode_t { SIZE_2Nx2N = 0 , SIZE_2NxN = 1 , SIZE_Nx2N = 2 , SIZE_NxN = 3 , SIZE_2NxnU = 4 , SIZE_2NxnD = 5 , SIZE_nLx2N = 6 , SIZE_nRx2N = 7 } |
Variables | |
| const uint8_t | kvz_part_mode_num_parts [] |
| Number of PUs in a CU. | |
| const uint8_t | kvz_part_mode_offsets [][4][2] |
| PU offsets. | |
| const uint8_t | kvz_part_mode_sizes [][4][2] |
| PU sizes. | |
| lcu_coeff_t | |
| static const uint16_t | cbf_masks [5] = { 0x1f, 0x0f, 0x07, 0x03, 0x1 } |
| #define CHECKPOINT_CU | ( | prefix_str, | |
| cu | |||
| ) |
| #define CHECKPOINT_LCU | ( | prefix_str, | |
| lcu | |||
| ) |
| #define CU_GET_MV_CAND | ( | cu_info_ptr, | |
| reflist | |||
| ) | (((reflist) == 0) ? (cu_info_ptr)->inter.mv_cand0 : (cu_info_ptr)->inter.mv_cand1) |
| #define CU_SET_MV_CAND | ( | cu_info_ptr, | |
| reflist, | |||
| value | |||
| ) |
| #define LCU_CU_OFFSET (LCU_T_CU_WIDTH + 1) |
| #define LCU_CU_WIDTH 16 |
| #define LCU_GET_CU_AT_PX | ( | lcu, | |
| x_px, | |||
| y_px | |||
| ) | (&(lcu)->cu[LCU_CU_OFFSET + ((x_px) >> 2) + ((y_px) >> 2) * LCU_T_CU_WIDTH]) |
| lcu | pointer to the containing LCU |
| x_px | x-coordinate relative to the upper left corner of the LCU |
| y_px | y-coordinate relative to the upper left corner of the LCU |
| #define LCU_GET_TOP_RIGHT_CU | ( | lcu | ) | (&(lcu)->cu[LCU_T_CU_WIDTH * LCU_T_CU_WIDTH]) |
| #define LCU_T_CU_WIDTH (LCU_CU_WIDTH + 1) |
| #define NUM_CBF_DEPTHS 5 |
| #define PU_GET_H | ( | part_mode, | |
| cu_width, | |||
| i | |||
| ) | (kvz_part_mode_sizes[(part_mode)][(i)][1] * (cu_width) / 4) |
| part_mode | partition mode of the containing CU |
| cu_width | width of the containing CU |
| i | number of the PU |
| #define PU_GET_W | ( | part_mode, | |
| cu_width, | |||
| i | |||
| ) | (kvz_part_mode_sizes[(part_mode)][(i)][0] * (cu_width) / 4) |
| part_mode | partition mode of the containing CU |
| cu_width | width of the containing CU |
| i | number of the PU |
| #define PU_GET_X | ( | part_mode, | |
| cu_width, | |||
| cu_x, | |||
| i | |||
| ) | ((cu_x) + kvz_part_mode_offsets[(part_mode)][(i)][0] * (cu_width) / 4) |
| part_mode | partition mode of the containing CU |
| cu_width | width of the containing CU |
| cu_x | x coordinate of the containing CU |
| i | number of the PU |
| #define PU_GET_Y | ( | part_mode, | |
| cu_width, | |||
| cu_y, | |||
| i | |||
| ) | ((cu_y) + kvz_part_mode_offsets[(part_mode)][(i)][1] * (cu_width) / 4) |
| part_mode | partition mode of the containing CU |
| cu_width | width of the containing CU |
| cu_y | y coordinate of the containing CU |
| i | number of the PU |
| #define SCU_WIDTH (LCU_WIDTH / LCU_CU_WIDTH) |
The 7 lower-order bits correspond to the distance from the left or top edge of the containing 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
+------+------+------+------+---------------------------+ | 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 | | | | | | | | | | | | | | | | +-------------+-------------+-------------+-------------+
|
inlinestatic |
|
inlinestatic |
| width | Size of the block to be copied in pixels. |
| src | Pointer to the source array. |
| dest | Pointer to the destination array. |
| cu_array_t * kvz_cu_array_alloc | ( | const int | width, |
| const int | height | ||
| ) |
| width | width of the array in luma pixels |
| height | height of the array in luma pixels |
| cu_info_t * kvz_cu_array_at | ( | cu_array_t * | cua, |
| unsigned | x_px, | ||
| unsigned | y_px | ||
| ) |
All values are in luma pixels.
| dst | destination array |
| dst_x | x-coordinate of the left edge of the copied area in dst |
| dst_y | y-coordinate of the top edge of the copied area in dst |
| src | source lcu |
| cu_array_t * kvz_cu_array_copy_ref | ( | cu_array_t * | cua | ) |
Increment reference count and return the cu array.
| void kvz_cu_array_free | ( | cu_array_t ** | cua_ptr | ) |
| cu_array_t * kvz_cu_subarray | ( | cu_array_t * | base, |
| const unsigned | x_offset, | ||
| const unsigned | y_offset, | ||
| const unsigned | width, | ||
| const unsigned | height | ||
| ) |
Only works for widths and coordinates divisible by four. Width must be a power of two in range [4..64].
| width | size of the containing block |
| x | x-coordinate |
| y | y-coordinate |
Indexed by [part mode][PU number][axis].
Units are 1/4 of the width of the CU.
Indexed by [part mode][PU number][axis].
Units are 1/4 of the width of the CU.
| lcu_coeff_t |