History

avcodec/vvcdec: alf, support subpicture

Nuo Mi committed 2 years ago

Commit adeb51c1 parent bbf0ccb1 file · +9 −0Browse files

Unified · Split

libavcodec/vvc/vvc_filter.c+9−0
@@ -1199,6 +1199,7 @@ void ff_vvc_alf_copy_ctu_to_hv(VVCLocalContext* lc, const int x0, const int y0) · 1198 unmodified lines
1199void ff_vvc_alf_filter(VVCLocalContext *lc, const int x0, const int y0)1199void ff_vvc_alf_filter(VVCLocalContext *lc, const int x0, const int y0)
1200{1200{
1201 VVCFrameContext *fc = lc->fc;1201 VVCFrameContext *fc = lc->fc;
1202 const VVCSPS *sps = fc->ps.sps;
1202 const VVCPPS *pps = fc->ps.pps;1203 const VVCPPS *pps = fc->ps.pps;
1203 const int rx = x0 >> fc->ps.sps->ctb_log2_size_y;1204 const int rx = x0 >> fc->ps.sps->ctb_log2_size_y;
1204 const int ry = y0 >> fc->ps.sps->ctb_log2_size_y;1205 const int ry = y0 >> fc->ps.sps->ctb_log2_size_y;
@@ -1207,6 +1208,7 @@ void ff_vvc_alf_filter(VVCLocalContext *lc, const int x0, const int y0) · 2 unmodified lines
1207 const int padded_stride = EDGE_EMU_BUFFER_STRIDE << ps;1208 const int padded_stride = EDGE_EMU_BUFFER_STRIDE << ps;
1208 const int padded_offset = padded_stride * ALF_PADDING_SIZE + (ALF_PADDING_SIZE << ps);1209 const int padded_offset = padded_stride * ALF_PADDING_SIZE + (ALF_PADDING_SIZE << ps);
1209 const int c_end = fc->ps.sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : 1;1210 const int c_end = fc->ps.sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : 1;
1211 const int subpic_idx = lc->sc->sh.r->curr_subpic_idx;
1210 ALFParams *alf = &CTB(fc->tab.alf, rx, ry);1212 ALFParams *alf = &CTB(fc->tab.alf, rx, ry);
1211 int edges[MAX_EDGES] = { rx == 0, ry == 0, rx == pps->ctb_width - 1, ry == pps->ctb_height - 1 };1213 int edges[MAX_EDGES] = { rx == 0, ry == 0, rx == pps->ctb_width - 1, ry == pps->ctb_height - 1 };
1212 1214
@@ -1224,6 +1226,13 @@ void ff_vvc_alf_filter(VVCLocalContext *lc, const int x0, const int y0) · 11 unmodified lines
1224 edges[BOTTOM] = edges[BOTTOM] || CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx, ry + 1);1226 edges[BOTTOM] = edges[BOTTOM] || CTB(fc->tab.slice_idx, rx, ry) != CTB(fc->tab.slice_idx, rx, ry + 1);
1225 }1227 }
1226 1228
1229 if (!sps->r->sps_loop_filter_across_subpic_enabled_flag[subpic_idx]) {
1230 edges[LEFT] = edges[LEFT] || (lc->boundary_flags & BOUNDARY_LEFT_SUBPIC);
1231 edges[TOP] = edges[TOP] || (lc->boundary_flags & BOUNDARY_UPPER_SUBPIC);
1232 edges[RIGHT] = edges[RIGHT] || fc->ps.sps->r->sps_subpic_ctu_top_left_x[subpic_idx] + fc->ps.sps->r->sps_subpic_width_minus1[subpic_idx] == rx;
1233 edges[BOTTOM] = edges[BOTTOM] || fc->ps.sps->r->sps_subpic_ctu_top_left_y[subpic_idx] + fc->ps.sps->r->sps_subpic_height_minus1[subpic_idx] == ry;
1234 }
1235
1227 for (int c_idx = 0; c_idx < c_end; c_idx++) {1236 for (int c_idx = 0; c_idx < c_end; c_idx++) {
1228 const int hs = fc->ps.sps->hshift[c_idx];1237 const int hs = fc->ps.sps->hshift[c_idx];
1229 const int vs = fc->ps.sps->vshift[c_idx];1238 const int vs = fc->ps.sps->vshift[c_idx];

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