History

avcodec/vvc/filter: skip deblocking filter for palette

Wu Jianhua committed 1 year ago

Commit 95473fa1 parent 26215b81 file · +18 −11Browse files

Unified · Split

libavcodec/vvc/filter.c+18−11
@@ -772,17 +772,15 @@ static int get_qp(const VVCFrameContext *fc, const uint8_t *src, const int x, co · 771 unmodified lines
772772
773773 static void vvc_deblock(const VVCLocalContext *lc, int x0, int y0, const int rs, const int vertical)
774774 {
775− VVCFrameContext *fc = lc->fc;
776− const VVCSPS *sps = fc->ps.sps;
777− const int c_end = sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : 1;
778− const int ctb_size = fc->ps.sps->ctb_size_y;
779− const DBParams *params = fc->tab.deblock + rs;
780− int x_end = FFMIN(x0 + ctb_size, fc->ps.pps->width);
781− int y_end = FFMIN(y0 + ctb_size, fc->ps.pps->height);
782−
783− //not use this yet, may needed by plt.
784− const uint8_t no_p[4] = { 0 };
785− const uint8_t no_q[4] = { 0 } ;
775+ VVCFrameContext *fc = lc->fc;
776+ const VVCSPS *sps = fc->ps.sps;
777+ const int c_end = sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : 1;
778+ const int ctb_size = fc->ps.sps->ctb_size_y;
779+ const DBParams *params = fc->tab.deblock + rs;
780+ int x_end = FFMIN(x0 + ctb_size, fc->ps.pps->width);
781+ int y_end = FFMIN(y0 + ctb_size, fc->ps.pps->height);
782+ const int log2_min_cb_size = fc->ps.sps->min_cb_log2_size_y;
783+ const int min_cb_width = fc->ps.pps->min_cb_width;
786784
787785 if (!vertical) {
788786 FFSWAP(int, x_end, y_end);
@@ -802,6 +800,8 @@ static void vvc_deblock(const VVCLocalContext *lc, int x0, int y0, const int rs, · 13 unmodified lines
802800 const uint8_t horizontal_ctu_edge = !vertical && !(x % ctb_size);
803801 int32_t bs[4], beta[4], tc[4] = { 0 }, all_zero_bs = 1;
804802 uint8_t max_len_p[4], max_len_q[4];
803+ uint8_t no_p[4] = { 0 };
804+ uint8_t no_q[4] = { 0 };
805805
806806 for (int i = 0; i < DEBLOCK_STEP >> (2 - vs); i++) {
807807 int tx = x;
@@ -818,6 +818,13 @@ static void vvc_deblock(const VVCLocalContext *lc, int x0, int y0, const int rs, · 10 unmodified lines
818818 tc[i] = TC_CALC(qp, bs[i]) ;
819819 max_filter_length(fc, tx, ty, c_idx, vertical, horizontal_ctu_edge, bs[i], &max_len_p[i], &max_len_q[i]);
820820 all_zero_bs = 0;
821+
822+ if (sps->r->sps_palette_enabled_flag) {
823+ const int cu_q = (ty >> log2_min_cb_size) * min_cb_width + (tx >> log2_min_cb_size);
824+ const int cu_p = (ty - !vertical >> log2_min_cb_size) * min_cb_width + (tx - vertical >> log2_min_cb_size);
825+ no_q[i] = fc->tab.cpm[!!c_idx][cu_q] == MODE_PLT;
826+ no_p[i] = cu_p >= 0 && fc->tab.cpm[!!c_idx][cu_p] == MODE_PLT;
827+ }
821828 }
822829 }
823830

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t