28 uint8_t *lvl, uint8_t (*
mask)[4],
29 uint8_t *
dst, ptrdiff_t ls)
31 int y, x, bytesperpixel =
s->bytesperpixel;
34 for (y = 0; y < 8; y += 2 << ss_v,
dst += 16 * ls, lvl += 16 << ss_v) {
35 uint8_t *ptr =
dst, *l = lvl, *hmask1 =
mask[y], *hmask2 =
mask[y + 1 + ss_v];
36 unsigned hm1 = hmask1[0] | hmask1[1] | hmask1[2], hm13 = hmask1[3];
37 unsigned hm2 = hmask2[1] | hmask2[2], hm23 = hmask2[3];
38 unsigned hm = hm1 | hm2 | hm13 | hm23;
40 for (x = 1; hm & ~(x - 1); x <<= 1, ptr += 8 * bytesperpixel >> ss_h) {
43 int L = *l,
H =
L >> 4;
44 int E =
s->filter_lut.mblim_lut[
L], I =
s->filter_lut.lim_lut[
L];
49 s->dsp.loop_filter_16[0](ptr, ls,
E, I,
H);
51 s->dsp.loop_filter_8[2][0](ptr, ls,
E, I,
H);
56 E |=
s->filter_lut.mblim_lut[
L] << 8;
57 I |=
s->filter_lut.lim_lut[
L] << 8;
58 s->dsp.loop_filter_mix2[!!(hmask1[1] & x)]
60 [0](ptr, ls,
E, I,
H);
62 s->dsp.loop_filter_8[!!(hmask1[1] & x)]
63 [0](ptr, ls,
E, I,
H);
66 int L = l[8 << ss_v],
H =
L >> 4;
67 int E =
s->filter_lut.mblim_lut[
L], I =
s->filter_lut.lim_lut[
L];
69 s->dsp.loop_filter_8[!!(hmask2[1] & x)]
70 [0](ptr + 8 * ls, ls,
E, I,
H);
78 int L = *l,
H =
L >> 4;
79 int E =
s->filter_lut.mblim_lut[
L], I =
s->filter_lut.lim_lut[
L];
84 E |=
s->filter_lut.mblim_lut[
L] << 8;
85 I |=
s->filter_lut.lim_lut[
L] << 8;
86 s->dsp.loop_filter_mix2[0][0][0](ptr + 4 * bytesperpixel, ls,
E, I,
H);
88 s->dsp.loop_filter_8[0][0](ptr + 4 * bytesperpixel, ls,
E, I,
H);
90 }
else if (hm23 & x) {
91 int L = l[8 << ss_v],
H =
L >> 4;
92 int E =
s->filter_lut.mblim_lut[
L], I =
s->filter_lut.lim_lut[
L];
94 s->dsp.loop_filter_8[0][0](ptr + 8 * ls + 4 * bytesperpixel, ls,
E, I,
H);
103 uint8_t *lvl, uint8_t (*
mask)[4],
104 uint8_t *
dst, ptrdiff_t ls)
106 int y, x, bytesperpixel =
s->bytesperpixel;
111 for (y = 0; y < 8; y++, dst += 8 * ls >> ss_v) {
112 uint8_t *ptr =
dst, *l = lvl, *vmask =
mask[y];
113 unsigned vm = vmask[0] | vmask[1] | vmask[2], vm3 = vmask[3];
115 for (x = 1; vm & ~(x - 1); x <<= (2 << ss_h), ptr += 16 * bytesperpixel, l += 2 << ss_h) {
118 int L = *l,
H =
L >> 4;
119 int E =
s->filter_lut.mblim_lut[
L], I =
s->filter_lut.lim_lut[
L];
122 if (vmask[0] & (x << (1 + ss_h))) {
124 s->dsp.loop_filter_16[1](ptr, ls,
E, I,
H);
126 s->dsp.loop_filter_8[2][1](ptr, ls,
E, I,
H);
128 }
else if (vm & (x << (1 + ss_h))) {
131 E |=
s->filter_lut.mblim_lut[
L] << 8;
132 I |=
s->filter_lut.lim_lut[
L] << 8;
133 s->dsp.loop_filter_mix2[!!(vmask[1] & x)]
134 [!!(vmask[1] & (x << (1 + ss_h)))]
135 [1](ptr, ls,
E, I,
H);
137 s->dsp.loop_filter_8[!!(vmask[1] & x)]
138 [1](ptr, ls,
E, I,
H);
140 }
else if (vm & (x << (1 + ss_h))) {
141 int L = l[1 + ss_h],
H =
L >> 4;
142 int E =
s->filter_lut.mblim_lut[
L], I =
s->filter_lut.lim_lut[
L];
144 s->dsp.loop_filter_8[!!(vmask[1] & (x << (1 + ss_h)))]
145 [1](ptr + 8 * bytesperpixel, ls,
E, I,
H);
150 int L = *l,
H =
L >> 4;
151 int E =
s->filter_lut.mblim_lut[
L], I =
s->filter_lut.lim_lut[
L];
153 if (vm3 & (x << (1 + ss_h))) {
156 E |=
s->filter_lut.mblim_lut[
L] << 8;
157 I |=
s->filter_lut.lim_lut[
L] << 8;
158 s->dsp.loop_filter_mix2[0][0][1](ptr + ls * 4, ls,
E, I,
H);
160 s->dsp.loop_filter_8[0][1](ptr + ls * 4, ls,
E, I,
H);
162 }
else if (vm3 & (x << (1 + ss_h))) {
163 int L = l[1 + ss_h],
H =
L >> 4;
164 int E =
s->filter_lut.mblim_lut[
L], I =
s->filter_lut.lim_lut[
L];
166 s->dsp.loop_filter_8[0][1](ptr + ls * 4 + 8 * bytesperpixel, ls,
E, I,
H);
180 int row,
int col, ptrdiff_t yoff, ptrdiff_t uvoff)
184 uint8_t *
dst =
f->data[0] + yoff;
185 ptrdiff_t ls_y =
f->linesize[0], ls_uv =
f->linesize[1];
186 uint8_t (*uv_masks)[8][4] = lflvl->
mask[
s->ss_h |
s->ss_v];
198 for (p = 0; p < 2; p++) {
199 dst =
f->data[1 + p] + uvoff;