You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
avcodec/vvc/filter: skip deblocking filter for palette
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
This commit is contained in:
@@ -772,17 +772,15 @@ static int get_qp(const VVCFrameContext *fc, const uint8_t *src, const int x, co
|
|||||||
|
|
||||||
static void vvc_deblock(const VVCLocalContext *lc, int x0, int y0, const int rs, const int vertical)
|
static void vvc_deblock(const VVCLocalContext *lc, int x0, int y0, const int rs, const int vertical)
|
||||||
{
|
{
|
||||||
VVCFrameContext *fc = lc->fc;
|
VVCFrameContext *fc = lc->fc;
|
||||||
const VVCSPS *sps = fc->ps.sps;
|
const VVCSPS *sps = fc->ps.sps;
|
||||||
const int c_end = sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : 1;
|
const int c_end = sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : 1;
|
||||||
const int ctb_size = fc->ps.sps->ctb_size_y;
|
const int ctb_size = fc->ps.sps->ctb_size_y;
|
||||||
const DBParams *params = fc->tab.deblock + rs;
|
const DBParams *params = fc->tab.deblock + rs;
|
||||||
int x_end = FFMIN(x0 + ctb_size, fc->ps.pps->width);
|
int x_end = FFMIN(x0 + ctb_size, fc->ps.pps->width);
|
||||||
int y_end = FFMIN(y0 + ctb_size, fc->ps.pps->height);
|
int y_end = FFMIN(y0 + ctb_size, fc->ps.pps->height);
|
||||||
|
const int log2_min_cb_size = fc->ps.sps->min_cb_log2_size_y;
|
||||||
//not use this yet, may needed by plt.
|
const int min_cb_width = fc->ps.pps->min_cb_width;
|
||||||
const uint8_t no_p[4] = { 0 };
|
|
||||||
const uint8_t no_q[4] = { 0 } ;
|
|
||||||
|
|
||||||
if (!vertical) {
|
if (!vertical) {
|
||||||
FFSWAP(int, x_end, y_end);
|
FFSWAP(int, x_end, y_end);
|
||||||
@@ -802,6 +800,8 @@ static void vvc_deblock(const VVCLocalContext *lc, int x0, int y0, const int rs,
|
|||||||
const uint8_t horizontal_ctu_edge = !vertical && !(x % ctb_size);
|
const uint8_t horizontal_ctu_edge = !vertical && !(x % ctb_size);
|
||||||
int32_t bs[4], beta[4], tc[4] = { 0 }, all_zero_bs = 1;
|
int32_t bs[4], beta[4], tc[4] = { 0 }, all_zero_bs = 1;
|
||||||
uint8_t max_len_p[4], max_len_q[4];
|
uint8_t max_len_p[4], max_len_q[4];
|
||||||
|
uint8_t no_p[4] = { 0 };
|
||||||
|
uint8_t no_q[4] = { 0 };
|
||||||
|
|
||||||
for (int i = 0; i < DEBLOCK_STEP >> (2 - vs); i++) {
|
for (int i = 0; i < DEBLOCK_STEP >> (2 - vs); i++) {
|
||||||
int tx = x;
|
int tx = x;
|
||||||
@@ -818,6 +818,13 @@ static void vvc_deblock(const VVCLocalContext *lc, int x0, int y0, const int rs,
|
|||||||
tc[i] = TC_CALC(qp, bs[i]) ;
|
tc[i] = TC_CALC(qp, bs[i]) ;
|
||||||
max_filter_length(fc, tx, ty, c_idx, vertical, horizontal_ctu_edge, bs[i], &max_len_p[i], &max_len_q[i]);
|
max_filter_length(fc, tx, ty, c_idx, vertical, horizontal_ctu_edge, bs[i], &max_len_p[i], &max_len_q[i]);
|
||||||
all_zero_bs = 0;
|
all_zero_bs = 0;
|
||||||
|
|
||||||
|
if (sps->r->sps_palette_enabled_flag) {
|
||||||
|
const int cu_q = (ty >> log2_min_cb_size) * min_cb_width + (tx >> log2_min_cb_size);
|
||||||
|
const int cu_p = (ty - !vertical >> log2_min_cb_size) * min_cb_width + (tx - vertical >> log2_min_cb_size);
|
||||||
|
no_q[i] = fc->tab.cpm[!!c_idx][cu_q] == MODE_PLT;
|
||||||
|
no_p[i] = cu_p >= 0 && fc->tab.cpm[!!c_idx][cu_p] == MODE_PLT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user