|
TUT HEVC Encoder
|
#include "transform.h"#include "image.h"#include "kvazaar.h"#include "rdo.h"#include "strategies/strategies-dct.h"#include "strategies/strategies-quant.h"#include "strategies/strategies-picture.h"#include "tables.h"Typedefs | |
| typedef enum rdpcm_dir | rdpcm_dir |
| RDPCM direction. More... | |
Enumerations | |
| enum | rdpcm_dir { RDPCM_VER = 0 , RDPCM_HOR = 1 } |
| RDPCM direction. More... | |
Functions | |
| static bool | bypass_transquant (const int width, const int in_stride, const int out_stride, const kvz_pixel *const ref_in, const kvz_pixel *const pred_in, kvz_pixel *rec_out, coeff_t *coeff_out) |
| Bypass transform and quantization. More... | |
| static void | rdpcm (const int width, const rdpcm_dir dir, coeff_t *coeff) |
| Apply DPCM to residual. More... | |
| int32_t | kvz_get_scaled_qp (int8_t type, int8_t qp, int8_t qp_offset) |
| Get scaled QP used in quantization. More... | |
| void | kvz_transformskip (const encoder_control_t *const encoder, int16_t *block, int16_t *coeff, int8_t block_size) |
| NxN inverse transform (2D) More... | |
| void | kvz_itransformskip (const encoder_control_t *const encoder, int16_t *block, int16_t *coeff, int8_t block_size) |
| inverse transform skip More... | |
| void | kvz_transform2d (const encoder_control_t *const encoder, int16_t *block, int16_t *coeff, int8_t block_size, color_t color, cu_type_t type) |
| forward transform (2D) More... | |
| void | kvz_itransform2d (const encoder_control_t *const encoder, int16_t *block, int16_t *coeff, int8_t block_size, color_t color, cu_type_t type) |
| int | kvz_quantize_residual_trskip (encoder_state_t *const state, const cu_info_t *const cur_cu, const int width, const color_t color, const coeff_scan_order_t scan_order, int8_t *trskip_out, const int in_stride, const int out_stride, const kvz_pixel *const ref_in, const kvz_pixel *const pred_in, kvz_pixel *rec_out, coeff_t *coeff_out) |
| Like kvz_quantize_residual except that this uses trskip if that is better. More... | |
| static void | quantize_tr_residual (encoder_state_t *const state, const color_t color, const int32_t x, const int32_t y, const uint8_t depth, cu_info_t *cur_pu, lcu_t *lcu, bool early_skip) |
| Calculate the residual coefficients for a single TU. More... | |
| void | kvz_quantize_lcu_residual (encoder_state_t *const state, const bool luma, const bool chroma, const int32_t x, const int32_t y, const uint8_t depth, cu_info_t *cur_pu, lcu_t *lcu, bool early_skip) |
| This function calculates the residual coefficients for a region of the LCU (defined by x, y and depth) and updates the reconstruction with the kvantized residual. More... | |
Variables | |
| const uint8_t | kvz_g_chroma_scale [58] |
| enum rdpcm_dir |
|
static |
Copies the reference pixels directly to reconstruction and the residual directly to coefficients. Used when cu_transquant_bypass_flag is set. Parameters pred_in and rec_out may be aliased.
| width | Transform width. |
| in_stride | Stride for ref_in and pred_in |
| out_stride | Stride for rec_out. |
| ref_in | Reference pixels. |
| pred_in | Predicted pixels. |
| rec_out | Returns the reconstructed pixels. |
| coeff_out | Returns the coefficients used for reconstruction of rec_out. |
| int32_t kvz_get_scaled_qp | ( | int8_t | type, |
| int8_t | qp, | ||
| int8_t | qp_offset | ||
| ) |
| void kvz_itransform2d | ( | const encoder_control_t *const | encoder, |
| int16_t * | block, | ||
| int16_t * | coeff, | ||
| int8_t | block_size, | ||
| color_t | color, | ||
| cu_type_t | type | ||
| ) |
| void kvz_itransformskip | ( | const encoder_control_t *const | encoder, |
| int16_t * | block, | ||
| int16_t * | coeff, | ||
| int8_t | block_size | ||
| ) |
| coeff | input data (transform coefficients) |
| block | output data (residual) |
| block_size | width of transform |
| void kvz_quantize_lcu_residual | ( | encoder_state_t *const | state, |
| const bool | luma, | ||
| const bool | chroma, | ||
| const int32_t | x, | ||
| const int32_t | y, | ||
| const uint8_t | depth, | ||
| cu_info_t * | cur_pu, | ||
| lcu_t * | lcu, | ||
| bool | early_skip | ||
| ) |
Processes the TU tree recursively.
Inputs are:
Outputs are:
| int kvz_quantize_residual_trskip | ( | encoder_state_t *const | state, |
| const cu_info_t *const | cur_cu, | ||
| const int | width, | ||
| const color_t | color, | ||
| const coeff_scan_order_t | scan_order, | ||
| int8_t * | trskip_out, | ||
| const int | in_stride, | ||
| const int | out_stride, | ||
| const kvz_pixel *const | ref_in, | ||
| const kvz_pixel *const | pred_in, | ||
| kvz_pixel * | rec_out, | ||
| coeff_t * | coeff_out | ||
| ) |
Using this function saves one step of quantization and inverse quantization compared to doing the decision separately from the actual operation.
| width | Transform width. |
| color | Color. |
| scan_order | Coefficient scan order. |
| trskip_out | Whether transform skip is used. |
| stride | Stride for ref_in, pred_in and rec_out. |
| ref_in | Reference pixels. |
| pred_in | Predicted pixels. |
| rec_out | Reconstructed pixels. |
| coeff_out | Coefficients used for reconstruction of rec_out. |
| void kvz_transform2d | ( | const encoder_control_t *const | encoder, |
| int16_t * | block, | ||
| int16_t * | coeff, | ||
| int8_t | block_size, | ||
| color_t | color, | ||
| cu_type_t | type | ||
| ) |
| block | input residual |
| coeff | transform coefficients |
| block_size | width of transform |
| void kvz_transformskip | ( | const encoder_control_t *const | encoder, |
| int16_t * | block, | ||
| int16_t * | coeff, | ||
| int8_t | block_size | ||
| ) |
| coeff | input data (transform coefficients) |
| block | output data (residual) |
| block_size | input data (width of transform) |
|
static |
| early_skip | if this is used for early skip, bypass IT and IQ |
| width | width of the block |
| dir | RDPCM direction |
| coeff | coefficients (residual) to filter |
| const uint8_t kvz_g_chroma_scale[58] |