TUT HEVC Encoder
|
#include "filter.h"
#include <stdlib.h>
#include "cu.h"
#include "encoder.h"
#include "kvazaar.h"
#include "transform.h"
#include "videoframe.h"
Functions | |
static int | kvz_filter_deblock_luma_strong (kvz_pixel *line, int32_t tc) |
Perform in strong luma filtering in place. More... | |
static int | kvz_filter_deblock_luma_weak (const encoder_control_t *const encoder, kvz_pixel *line, int32_t tc, bool p_2nd, bool q_2nd) |
Perform in weak luma filtering in place. More... | |
static void | kvz_filter_deblock_chroma (const encoder_control_t *const encoder, kvz_pixel *src, int32_t offset, int32_t tc, int8_t part_P_nofilter, int8_t part_Q_nofilter) |
static bool | is_tu_boundary (const encoder_state_t *const state, int32_t x, int32_t y, edge_dir dir) |
Check whether an edge is a TU boundary. More... | |
static bool | is_pu_boundary (const encoder_state_t *const state, int32_t x, int32_t y, edge_dir dir) |
Check whether an edge is a PU boundary. More... | |
static bool | is_on_8x8_grid (int x, int y, edge_dir dir) |
Check whether an edge is aligned on a 8x8 grid. More... | |
static int8_t | get_qp_y_pred (const encoder_state_t *state, int x, int y, edge_dir dir) |
static void | gather_deblock_pixels (const kvz_pixel *src, int step, int stride, int reach, kvz_pixel *dst) |
Gather pixels needed for deblocking. More... | |
static void | scatter_deblock_pixels (const kvz_pixel *src, int step, int stride, int reach, kvz_pixel *dst) |
Scatter pixels. More... | |
static void | filter_deblock_edge_luma (encoder_state_t *const state, int32_t x, int32_t y, int32_t length, edge_dir dir, bool tu_boundary) |
Apply the deblocking filter to luma pixels on a single edge. More... | |
static void | filter_deblock_edge_chroma (encoder_state_t *const state, int32_t x, int32_t y, int32_t length, edge_dir dir, bool tu_boundary) |
Apply the deblocking filter to chroma pixels on a single edge. More... | |
static void | filter_deblock_unit (encoder_state_t *const state, int x, int y, int width, int height, edge_dir dir, bool tu_boundary) |
Filter edge of a single PU or TU. More... | |
static void | filter_deblock_lcu_inside (encoder_state_t *const state, int32_t x, int32_t y, edge_dir dir) |
Deblock PU and TU boundaries inside an LCU. More... | |
static void | filter_deblock_lcu_rightmost (encoder_state_t *const state, int32_t x_px, int32_t y_px) |
Filter rightmost 4 pixels of the horizontal egdes of an LCU. More... | |
void | kvz_filter_deblock_lcu (encoder_state_t *const state, int x_px, int y_px) |
Deblock a single LCU without using data from right or down. More... | |
Variables | |
const uint8_t | kvz_g_tc_table_8x8 [54] |
const uint8_t | kvz_g_beta_table_8x8 [52] |
const int8_t | kvz_g_luma_filter [4][8] |
const int8_t | kvz_g_chroma_filter [8][4] |
|
static |
The caller should check that the edge is a TU boundary or a PU boundary.
.-- filter this edge if dir == EDGE_HOR v +--------+ |o <-- pixel at (x, y) | | |<-- filter this edge if dir == EDGE_VER | | +--------+
state | encoder state |
x | x-coordinate in chroma pixels (see above) |
y | y-coordinate in chroma pixels (see above) |
length | length of the edge in chroma pixels |
dir | direction of the edge to filter |
tu_boundary | whether the edge is a TU boundary |
|
static |
The caller should check that the edge is a TU boundary or a PU boundary.
.-- filter this edge if dir == EDGE_HOR v +--------+ |o <-- pixel at (x, y) | | |<-- filter this edge if dir == EDGE_VER | | +--------+
state | encoder state |
x | x-coordinate in pixels (see above) |
y | y-coordinate in pixels (see above) |
length | length of the edge in pixels |
dir | direction of the edge to filter |
tu_boundary | whether the edge is a TU boundary |
|
static |
state | encoder state |
x_px | block x-position in pixels |
y_px | block y-position in pixels |
dir | direction of the edges to filter |
Recursively traverse the CU/TU quadtree. At the lowest level, apply the deblocking filter to the left edge (when dir == EDGE_VER) or the top edge (when dir == EDGE_HOR) as needed. Both luma and chroma are filtered.
|
static |
state | encoder state |
x_px | x-coordinate of the right edge of the LCU in pixels |
y_px | y-coordinate of the top edge of the LCU in pixels |
|
static |
state | encoder state |
x | block x-position in pixels |
y | block y-position in pixels |
width | block width in pixels |
height | block height in pixels |
dir | direction of the edges to filter |
tu_boundary | whether the edge is a TU boundary |
|
inlinestatic |
|
static |
|
static |
x | x-coordinate of the edge |
y | y-coordinate of the edge |
dir | direction of the edge |
|
static |
state | encoder state |
x | x-coordinate of the scu in pixels |
y | y-coordinate of the scu in pixels |
dir | direction of the edge to check |
|
static |
state | encoder state |
x | x-coordinate of the scu in pixels |
y | y-coordinate of the scu in pixels |
dir | direction of the edge to check |
|
inlinestatic |
void kvz_filter_deblock_lcu | ( | encoder_state_t *const | state, |
int | x_px, | ||
int | y_px | ||
) |
Filter the following vertical edges (horizontal filtering):
Filter the following horizontal edges (vertical filtering):
What is not filtered:
state | encoder state |
x_px | x-coordinate of the left edge of the LCU in pixels |
y_px | y-coordinate of the top edge of the LCU in pixels |
|
inlinestatic |
line | line of 8 pixels, with center at index 4 |
tc | tc treshold |
|
inlinestatic |
encoder | Encoder |
line | Line of 8 pixels, with center at index 4 |
tc | The tc treshold |
p_2nd | Whether to filter the 2nd line of P |
q_2nd | Whether to filter the 2nd line of Q |
|
inlinestatic |
const uint8_t kvz_g_beta_table_8x8[52] |
const int8_t kvz_g_chroma_filter[8][4] |
const int8_t kvz_g_luma_filter[4][8] |
const uint8_t kvz_g_tc_table_8x8[54] |