/src/ffmpeg/libavcodec/h26x/h2656_deblock_template.c
Line | Count | Source |
1 | | |
2 | | /* |
3 | | * HEVC/VVC deblocking dsp template |
4 | | * |
5 | | * Copyright (C) 2024 Nuo Mi |
6 | | * Copyright (C) 2012 - 2013 Guillaume Martres |
7 | | * |
8 | | * This file is part of FFmpeg. |
9 | | * |
10 | | * FFmpeg is free software; you can redistribute it and/or |
11 | | * modify it under the terms of the GNU Lesser General Public |
12 | | * License as published by the Free Software Foundation; either |
13 | | * version 2.1 of the License, or (at your option) any later version. |
14 | | * |
15 | | * FFmpeg is distributed in the hope that it will be useful, |
16 | | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
18 | | * Lesser General Public License for more details. |
19 | | * |
20 | | * You should have received a copy of the GNU Lesser General Public |
21 | | * License along with FFmpeg; if not, write to the Free Software |
22 | | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
23 | | */ |
24 | | |
25 | | static void FUNC(loop_filter_luma_strong)(pixel *pix, const ptrdiff_t xstride, const ptrdiff_t ystride, |
26 | | const int32_t tc, const int32_t tc2, const int tc3, |
27 | | const uint8_t no_p, const uint8_t no_q) |
28 | 84.7M | { |
29 | 423M | for (int d = 0; d < 4; d++) { |
30 | 338M | const int p3 = P3; |
31 | 338M | const int p2 = P2; |
32 | 338M | const int p1 = P1; |
33 | 338M | const int p0 = P0; |
34 | 338M | const int q0 = Q0; |
35 | 338M | const int q1 = Q1; |
36 | 338M | const int q2 = Q2; |
37 | 338M | const int q3 = Q3; |
38 | 338M | if (!no_p) { |
39 | 286M | P0 = p0 + av_clip(((p2 + 2 * p1 + 2 * p0 + 2 * q0 + q1 + 4) >> 3) - p0, -tc3, tc3); |
40 | 286M | P1 = p1 + av_clip(((p2 + p1 + p0 + q0 + 2) >> 2) - p1, -tc2, tc2); |
41 | 286M | P2 = p2 + av_clip(((2 * p3 + 3 * p2 + p1 + p0 + q0 + 4) >> 3) - p2, -tc, tc); |
42 | 286M | } |
43 | 338M | if (!no_q) { |
44 | 286M | Q0 = q0 + av_clip(((p1 + 2 * p0 + 2 * q0 + 2 * q1 + q2 + 4) >> 3) - q0, -tc3, tc3); |
45 | 286M | Q1 = q1 + av_clip(((p0 + q0 + q1 + q2 + 2) >> 2) - q1, -tc2, tc2); |
46 | 286M | Q2 = q2 + av_clip(((2 * q3 + 3 * q2 + q1 + q0 + p0 + 4) >> 3) - q2, -tc, tc); |
47 | 286M | } |
48 | 338M | pix += ystride; |
49 | 338M | } |
50 | 84.7M | } dsp.c:loop_filter_luma_strong_9 Line | Count | Source | 28 | 14.4M | { | 29 | 72.1M | for (int d = 0; d < 4; d++) { | 30 | 57.6M | const int p3 = P3; | 31 | 57.6M | const int p2 = P2; | 32 | 57.6M | const int p1 = P1; | 33 | 57.6M | const int p0 = P0; | 34 | 57.6M | const int q0 = Q0; | 35 | 57.6M | const int q1 = Q1; | 36 | 57.6M | const int q2 = Q2; | 37 | 57.6M | const int q3 = Q3; | 38 | 57.6M | if (!no_p) { | 39 | 48.3M | P0 = p0 + av_clip(((p2 + 2 * p1 + 2 * p0 + 2 * q0 + q1 + 4) >> 3) - p0, -tc3, tc3); | 40 | 48.3M | P1 = p1 + av_clip(((p2 + p1 + p0 + q0 + 2) >> 2) - p1, -tc2, tc2); | 41 | 48.3M | P2 = p2 + av_clip(((2 * p3 + 3 * p2 + p1 + p0 + q0 + 4) >> 3) - p2, -tc, tc); | 42 | 48.3M | } | 43 | 57.6M | if (!no_q) { | 44 | 48.3M | Q0 = q0 + av_clip(((p1 + 2 * p0 + 2 * q0 + 2 * q1 + q2 + 4) >> 3) - q0, -tc3, tc3); | 45 | 48.3M | Q1 = q1 + av_clip(((p0 + q0 + q1 + q2 + 2) >> 2) - q1, -tc2, tc2); | 46 | 48.3M | Q2 = q2 + av_clip(((2 * q3 + 3 * q2 + q1 + q0 + p0 + 4) >> 3) - q2, -tc, tc); | 47 | 48.3M | } | 48 | 57.6M | pix += ystride; | 49 | 57.6M | } | 50 | 14.4M | } |
dsp.c:loop_filter_luma_strong_10 Line | Count | Source | 28 | 15.1M | { | 29 | 75.9M | for (int d = 0; d < 4; d++) { | 30 | 60.7M | const int p3 = P3; | 31 | 60.7M | const int p2 = P2; | 32 | 60.7M | const int p1 = P1; | 33 | 60.7M | const int p0 = P0; | 34 | 60.7M | const int q0 = Q0; | 35 | 60.7M | const int q1 = Q1; | 36 | 60.7M | const int q2 = Q2; | 37 | 60.7M | const int q3 = Q3; | 38 | 60.7M | if (!no_p) { | 39 | 52.3M | P0 = p0 + av_clip(((p2 + 2 * p1 + 2 * p0 + 2 * q0 + q1 + 4) >> 3) - p0, -tc3, tc3); | 40 | 52.3M | P1 = p1 + av_clip(((p2 + p1 + p0 + q0 + 2) >> 2) - p1, -tc2, tc2); | 41 | 52.3M | P2 = p2 + av_clip(((2 * p3 + 3 * p2 + p1 + p0 + q0 + 4) >> 3) - p2, -tc, tc); | 42 | 52.3M | } | 43 | 60.7M | if (!no_q) { | 44 | 52.3M | Q0 = q0 + av_clip(((p1 + 2 * p0 + 2 * q0 + 2 * q1 + q2 + 4) >> 3) - q0, -tc3, tc3); | 45 | 52.3M | Q1 = q1 + av_clip(((p0 + q0 + q1 + q2 + 2) >> 2) - q1, -tc2, tc2); | 46 | 52.3M | Q2 = q2 + av_clip(((2 * q3 + 3 * q2 + q1 + q0 + p0 + 4) >> 3) - q2, -tc, tc); | 47 | 52.3M | } | 48 | 60.7M | pix += ystride; | 49 | 60.7M | } | 50 | 15.1M | } |
dsp.c:loop_filter_luma_strong_12 Line | Count | Source | 28 | 7.14M | { | 29 | 35.7M | for (int d = 0; d < 4; d++) { | 30 | 28.5M | const int p3 = P3; | 31 | 28.5M | const int p2 = P2; | 32 | 28.5M | const int p1 = P1; | 33 | 28.5M | const int p0 = P0; | 34 | 28.5M | const int q0 = Q0; | 35 | 28.5M | const int q1 = Q1; | 36 | 28.5M | const int q2 = Q2; | 37 | 28.5M | const int q3 = Q3; | 38 | 28.5M | if (!no_p) { | 39 | 23.4M | P0 = p0 + av_clip(((p2 + 2 * p1 + 2 * p0 + 2 * q0 + q1 + 4) >> 3) - p0, -tc3, tc3); | 40 | 23.4M | P1 = p1 + av_clip(((p2 + p1 + p0 + q0 + 2) >> 2) - p1, -tc2, tc2); | 41 | 23.4M | P2 = p2 + av_clip(((2 * p3 + 3 * p2 + p1 + p0 + q0 + 4) >> 3) - p2, -tc, tc); | 42 | 23.4M | } | 43 | 28.5M | if (!no_q) { | 44 | 23.4M | Q0 = q0 + av_clip(((p1 + 2 * p0 + 2 * q0 + 2 * q1 + q2 + 4) >> 3) - q0, -tc3, tc3); | 45 | 23.4M | Q1 = q1 + av_clip(((p0 + q0 + q1 + q2 + 2) >> 2) - q1, -tc2, tc2); | 46 | 23.4M | Q2 = q2 + av_clip(((2 * q3 + 3 * q2 + q1 + q0 + p0 + 4) >> 3) - q2, -tc, tc); | 47 | 23.4M | } | 48 | 28.5M | pix += ystride; | 49 | 28.5M | } | 50 | 7.14M | } |
dsp.c:loop_filter_luma_strong_8 Line | Count | Source | 28 | 12.8M | { | 29 | 64.0M | for (int d = 0; d < 4; d++) { | 30 | 51.2M | const int p3 = P3; | 31 | 51.2M | const int p2 = P2; | 32 | 51.2M | const int p1 = P1; | 33 | 51.2M | const int p0 = P0; | 34 | 51.2M | const int q0 = Q0; | 35 | 51.2M | const int q1 = Q1; | 36 | 51.2M | const int q2 = Q2; | 37 | 51.2M | const int q3 = Q3; | 38 | 51.2M | if (!no_p) { | 39 | 43.4M | P0 = p0 + av_clip(((p2 + 2 * p1 + 2 * p0 + 2 * q0 + q1 + 4) >> 3) - p0, -tc3, tc3); | 40 | 43.4M | P1 = p1 + av_clip(((p2 + p1 + p0 + q0 + 2) >> 2) - p1, -tc2, tc2); | 41 | 43.4M | P2 = p2 + av_clip(((2 * p3 + 3 * p2 + p1 + p0 + q0 + 4) >> 3) - p2, -tc, tc); | 42 | 43.4M | } | 43 | 51.2M | if (!no_q) { | 44 | 43.4M | Q0 = q0 + av_clip(((p1 + 2 * p0 + 2 * q0 + 2 * q1 + q2 + 4) >> 3) - q0, -tc3, tc3); | 45 | 43.4M | Q1 = q1 + av_clip(((p0 + q0 + q1 + q2 + 2) >> 2) - q1, -tc2, tc2); | 46 | 43.4M | Q2 = q2 + av_clip(((2 * q3 + 3 * q2 + q1 + q0 + p0 + 4) >> 3) - q2, -tc, tc); | 47 | 43.4M | } | 48 | 51.2M | pix += ystride; | 49 | 51.2M | } | 50 | 12.8M | } |
dsp.c:loop_filter_luma_strong_12 Line | Count | Source | 28 | 7.14M | { | 29 | 35.7M | for (int d = 0; d < 4; d++) { | 30 | 28.5M | const int p3 = P3; | 31 | 28.5M | const int p2 = P2; | 32 | 28.5M | const int p1 = P1; | 33 | 28.5M | const int p0 = P0; | 34 | 28.5M | const int q0 = Q0; | 35 | 28.5M | const int q1 = Q1; | 36 | 28.5M | const int q2 = Q2; | 37 | 28.5M | const int q3 = Q3; | 38 | 28.5M | if (!no_p) { | 39 | 23.4M | P0 = p0 + av_clip(((p2 + 2 * p1 + 2 * p0 + 2 * q0 + q1 + 4) >> 3) - p0, -tc3, tc3); | 40 | 23.4M | P1 = p1 + av_clip(((p2 + p1 + p0 + q0 + 2) >> 2) - p1, -tc2, tc2); | 41 | 23.4M | P2 = p2 + av_clip(((2 * p3 + 3 * p2 + p1 + p0 + q0 + 4) >> 3) - p2, -tc, tc); | 42 | 23.4M | } | 43 | 28.5M | if (!no_q) { | 44 | 23.4M | Q0 = q0 + av_clip(((p1 + 2 * p0 + 2 * q0 + 2 * q1 + q2 + 4) >> 3) - q0, -tc3, tc3); | 45 | 23.4M | Q1 = q1 + av_clip(((p0 + q0 + q1 + q2 + 2) >> 2) - q1, -tc2, tc2); | 46 | 23.4M | Q2 = q2 + av_clip(((2 * q3 + 3 * q2 + q1 + q0 + p0 + 4) >> 3) - q2, -tc, tc); | 47 | 23.4M | } | 48 | 28.5M | pix += ystride; | 49 | 28.5M | } | 50 | 7.14M | } |
dsp.c:loop_filter_luma_strong_10 Line | Count | Source | 28 | 15.1M | { | 29 | 75.9M | for (int d = 0; d < 4; d++) { | 30 | 60.7M | const int p3 = P3; | 31 | 60.7M | const int p2 = P2; | 32 | 60.7M | const int p1 = P1; | 33 | 60.7M | const int p0 = P0; | 34 | 60.7M | const int q0 = Q0; | 35 | 60.7M | const int q1 = Q1; | 36 | 60.7M | const int q2 = Q2; | 37 | 60.7M | const int q3 = Q3; | 38 | 60.7M | if (!no_p) { | 39 | 52.3M | P0 = p0 + av_clip(((p2 + 2 * p1 + 2 * p0 + 2 * q0 + q1 + 4) >> 3) - p0, -tc3, tc3); | 40 | 52.3M | P1 = p1 + av_clip(((p2 + p1 + p0 + q0 + 2) >> 2) - p1, -tc2, tc2); | 41 | 52.3M | P2 = p2 + av_clip(((2 * p3 + 3 * p2 + p1 + p0 + q0 + 4) >> 3) - p2, -tc, tc); | 42 | 52.3M | } | 43 | 60.7M | if (!no_q) { | 44 | 52.3M | Q0 = q0 + av_clip(((p1 + 2 * p0 + 2 * q0 + 2 * q1 + q2 + 4) >> 3) - q0, -tc3, tc3); | 45 | 52.3M | Q1 = q1 + av_clip(((p0 + q0 + q1 + q2 + 2) >> 2) - q1, -tc2, tc2); | 46 | 52.3M | Q2 = q2 + av_clip(((2 * q3 + 3 * q2 + q1 + q0 + p0 + 4) >> 3) - q2, -tc, tc); | 47 | 52.3M | } | 48 | 60.7M | pix += ystride; | 49 | 60.7M | } | 50 | 15.1M | } |
dsp.c:loop_filter_luma_strong_8 Line | Count | Source | 28 | 12.8M | { | 29 | 64.0M | for (int d = 0; d < 4; d++) { | 30 | 51.2M | const int p3 = P3; | 31 | 51.2M | const int p2 = P2; | 32 | 51.2M | const int p1 = P1; | 33 | 51.2M | const int p0 = P0; | 34 | 51.2M | const int q0 = Q0; | 35 | 51.2M | const int q1 = Q1; | 36 | 51.2M | const int q2 = Q2; | 37 | 51.2M | const int q3 = Q3; | 38 | 51.2M | if (!no_p) { | 39 | 43.4M | P0 = p0 + av_clip(((p2 + 2 * p1 + 2 * p0 + 2 * q0 + q1 + 4) >> 3) - p0, -tc3, tc3); | 40 | 43.4M | P1 = p1 + av_clip(((p2 + p1 + p0 + q0 + 2) >> 2) - p1, -tc2, tc2); | 41 | 43.4M | P2 = p2 + av_clip(((2 * p3 + 3 * p2 + p1 + p0 + q0 + 4) >> 3) - p2, -tc, tc); | 42 | 43.4M | } | 43 | 51.2M | if (!no_q) { | 44 | 43.4M | Q0 = q0 + av_clip(((p1 + 2 * p0 + 2 * q0 + 2 * q1 + q2 + 4) >> 3) - q0, -tc3, tc3); | 45 | 43.4M | Q1 = q1 + av_clip(((p0 + q0 + q1 + q2 + 2) >> 2) - q1, -tc2, tc2); | 46 | 43.4M | Q2 = q2 + av_clip(((2 * q3 + 3 * q2 + q1 + q0 + p0 + 4) >> 3) - q2, -tc, tc); | 47 | 43.4M | } | 48 | 51.2M | pix += ystride; | 49 | 51.2M | } | 50 | 12.8M | } |
|
51 | | |
52 | | static void FUNC(loop_filter_luma_weak)(pixel *pix, const ptrdiff_t xstride, const ptrdiff_t ystride, |
53 | | const int32_t tc, const int32_t beta, const uint8_t no_p, const uint8_t no_q, const int nd_p, const int nd_q) |
54 | 177M | { |
55 | 177M | const int tc_2 = tc >> 1; |
56 | 887M | for (int d = 0; d < 4; d++) { |
57 | 709M | const int p2 = P2; |
58 | 709M | const int p1 = P1; |
59 | 709M | const int p0 = P0; |
60 | 709M | const int q0 = Q0; |
61 | 709M | const int q1 = Q1; |
62 | 709M | const int q2 = Q2; |
63 | 709M | int delta0 = (9 * (q0 - p0) - 3 * (q1 - p1) + 8) >> 4; |
64 | 709M | if (abs(delta0) < 10 * tc) { |
65 | 699M | delta0 = av_clip(delta0, -tc, tc); |
66 | 699M | if (!no_p) |
67 | 681M | P0 = av_clip_pixel(p0 + delta0); |
68 | 699M | if (!no_q) |
69 | 681M | Q0 = av_clip_pixel(q0 - delta0); |
70 | 699M | if (!no_p && nd_p > 1) { |
71 | 369M | const int deltap1 = av_clip((((p2 + p0 + 1) >> 1) - p1 + delta0) >> 1, -tc_2, tc_2); |
72 | 369M | P1 = av_clip_pixel(p1 + deltap1); |
73 | 369M | } |
74 | 699M | if (!no_q && nd_q > 1) { |
75 | 243M | const int deltaq1 = av_clip((((q2 + q0 + 1) >> 1) - q1 - delta0) >> 1, -tc_2, tc_2); |
76 | 243M | Q1 = av_clip_pixel(q1 + deltaq1); |
77 | 243M | } |
78 | 699M | } |
79 | 709M | pix += ystride; |
80 | 709M | } |
81 | 177M | } dsp.c:loop_filter_luma_weak_9 Line | Count | Source | 54 | 20.9M | { | 55 | 20.9M | const int tc_2 = tc >> 1; | 56 | 104M | for (int d = 0; d < 4; d++) { | 57 | 83.8M | const int p2 = P2; | 58 | 83.8M | const int p1 = P1; | 59 | 83.8M | const int p0 = P0; | 60 | 83.8M | const int q0 = Q0; | 61 | 83.8M | const int q1 = Q1; | 62 | 83.8M | const int q2 = Q2; | 63 | 83.8M | int delta0 = (9 * (q0 - p0) - 3 * (q1 - p1) + 8) >> 4; | 64 | 83.8M | if (abs(delta0) < 10 * tc) { | 65 | 82.9M | delta0 = av_clip(delta0, -tc, tc); | 66 | 82.9M | if (!no_p) | 67 | 80.4M | P0 = av_clip_pixel(p0 + delta0); | 68 | 82.9M | if (!no_q) | 69 | 80.4M | Q0 = av_clip_pixel(q0 - delta0); | 70 | 82.9M | if (!no_p && nd_p > 1) { | 71 | 41.1M | const int deltap1 = av_clip((((p2 + p0 + 1) >> 1) - p1 + delta0) >> 1, -tc_2, tc_2); | 72 | 41.1M | P1 = av_clip_pixel(p1 + deltap1); | 73 | 41.1M | } | 74 | 82.9M | if (!no_q && nd_q > 1) { | 75 | 29.0M | const int deltaq1 = av_clip((((q2 + q0 + 1) >> 1) - q1 - delta0) >> 1, -tc_2, tc_2); | 76 | 29.0M | Q1 = av_clip_pixel(q1 + deltaq1); | 77 | 29.0M | } | 78 | 82.9M | } | 79 | 83.8M | pix += ystride; | 80 | 83.8M | } | 81 | 20.9M | } |
dsp.c:loop_filter_luma_weak_10 Line | Count | Source | 54 | 31.9M | { | 55 | 31.9M | const int tc_2 = tc >> 1; | 56 | 159M | for (int d = 0; d < 4; d++) { | 57 | 127M | const int p2 = P2; | 58 | 127M | const int p1 = P1; | 59 | 127M | const int p0 = P0; | 60 | 127M | const int q0 = Q0; | 61 | 127M | const int q1 = Q1; | 62 | 127M | const int q2 = Q2; | 63 | 127M | int delta0 = (9 * (q0 - p0) - 3 * (q1 - p1) + 8) >> 4; | 64 | 127M | if (abs(delta0) < 10 * tc) { | 65 | 126M | delta0 = av_clip(delta0, -tc, tc); | 66 | 126M | if (!no_p) | 67 | 123M | P0 = av_clip_pixel(p0 + delta0); | 68 | 126M | if (!no_q) | 69 | 123M | Q0 = av_clip_pixel(q0 - delta0); | 70 | 126M | if (!no_p && nd_p > 1) { | 71 | 74.2M | const int deltap1 = av_clip((((p2 + p0 + 1) >> 1) - p1 + delta0) >> 1, -tc_2, tc_2); | 72 | 74.2M | P1 = av_clip_pixel(p1 + deltap1); | 73 | 74.2M | } | 74 | 126M | if (!no_q && nd_q > 1) { | 75 | 46.6M | const int deltaq1 = av_clip((((q2 + q0 + 1) >> 1) - q1 - delta0) >> 1, -tc_2, tc_2); | 76 | 46.6M | Q1 = av_clip_pixel(q1 + deltaq1); | 77 | 46.6M | } | 78 | 126M | } | 79 | 127M | pix += ystride; | 80 | 127M | } | 81 | 31.9M | } |
dsp.c:loop_filter_luma_weak_12 Line | Count | Source | 54 | 14.1M | { | 55 | 14.1M | const int tc_2 = tc >> 1; | 56 | 70.9M | for (int d = 0; d < 4; d++) { | 57 | 56.7M | const int p2 = P2; | 58 | 56.7M | const int p1 = P1; | 59 | 56.7M | const int p0 = P0; | 60 | 56.7M | const int q0 = Q0; | 61 | 56.7M | const int q1 = Q1; | 62 | 56.7M | const int q2 = Q2; | 63 | 56.7M | int delta0 = (9 * (q0 - p0) - 3 * (q1 - p1) + 8) >> 4; | 64 | 56.7M | if (abs(delta0) < 10 * tc) { | 65 | 54.9M | delta0 = av_clip(delta0, -tc, tc); | 66 | 54.9M | if (!no_p) | 67 | 54.4M | P0 = av_clip_pixel(p0 + delta0); | 68 | 54.9M | if (!no_q) | 69 | 54.4M | Q0 = av_clip_pixel(q0 - delta0); | 70 | 54.9M | if (!no_p && nd_p > 1) { | 71 | 32.4M | const int deltap1 = av_clip((((p2 + p0 + 1) >> 1) - p1 + delta0) >> 1, -tc_2, tc_2); | 72 | 32.4M | P1 = av_clip_pixel(p1 + deltap1); | 73 | 32.4M | } | 74 | 54.9M | if (!no_q && nd_q > 1) { | 75 | 18.3M | const int deltaq1 = av_clip((((q2 + q0 + 1) >> 1) - q1 - delta0) >> 1, -tc_2, tc_2); | 76 | 18.3M | Q1 = av_clip_pixel(q1 + deltaq1); | 77 | 18.3M | } | 78 | 54.9M | } | 79 | 56.7M | pix += ystride; | 80 | 56.7M | } | 81 | 14.1M | } |
dsp.c:loop_filter_luma_weak_8 Line | Count | Source | 54 | 32.0M | { | 55 | 32.0M | const int tc_2 = tc >> 1; | 56 | 160M | for (int d = 0; d < 4; d++) { | 57 | 128M | const int p2 = P2; | 58 | 128M | const int p1 = P1; | 59 | 128M | const int p0 = P0; | 60 | 128M | const int q0 = Q0; | 61 | 128M | const int q1 = Q1; | 62 | 128M | const int q2 = Q2; | 63 | 128M | int delta0 = (9 * (q0 - p0) - 3 * (q1 - p1) + 8) >> 4; | 64 | 128M | if (abs(delta0) < 10 * tc) { | 65 | 126M | delta0 = av_clip(delta0, -tc, tc); | 66 | 126M | if (!no_p) | 67 | 122M | P0 = av_clip_pixel(p0 + delta0); | 68 | 126M | if (!no_q) | 69 | 122M | Q0 = av_clip_pixel(q0 - delta0); | 70 | 126M | if (!no_p && nd_p > 1) { | 71 | 57.6M | const int deltap1 = av_clip((((p2 + p0 + 1) >> 1) - p1 + delta0) >> 1, -tc_2, tc_2); | 72 | 57.6M | P1 = av_clip_pixel(p1 + deltap1); | 73 | 57.6M | } | 74 | 126M | if (!no_q && nd_q > 1) { | 75 | 42.2M | const int deltaq1 = av_clip((((q2 + q0 + 1) >> 1) - q1 - delta0) >> 1, -tc_2, tc_2); | 76 | 42.2M | Q1 = av_clip_pixel(q1 + deltaq1); | 77 | 42.2M | } | 78 | 126M | } | 79 | 128M | pix += ystride; | 80 | 128M | } | 81 | 32.0M | } |
dsp.c:loop_filter_luma_weak_12 Line | Count | Source | 54 | 14.1M | { | 55 | 14.1M | const int tc_2 = tc >> 1; | 56 | 70.9M | for (int d = 0; d < 4; d++) { | 57 | 56.7M | const int p2 = P2; | 58 | 56.7M | const int p1 = P1; | 59 | 56.7M | const int p0 = P0; | 60 | 56.7M | const int q0 = Q0; | 61 | 56.7M | const int q1 = Q1; | 62 | 56.7M | const int q2 = Q2; | 63 | 56.7M | int delta0 = (9 * (q0 - p0) - 3 * (q1 - p1) + 8) >> 4; | 64 | 56.7M | if (abs(delta0) < 10 * tc) { | 65 | 54.9M | delta0 = av_clip(delta0, -tc, tc); | 66 | 54.9M | if (!no_p) | 67 | 54.4M | P0 = av_clip_pixel(p0 + delta0); | 68 | 54.9M | if (!no_q) | 69 | 54.4M | Q0 = av_clip_pixel(q0 - delta0); | 70 | 54.9M | if (!no_p && nd_p > 1) { | 71 | 32.4M | const int deltap1 = av_clip((((p2 + p0 + 1) >> 1) - p1 + delta0) >> 1, -tc_2, tc_2); | 72 | 32.4M | P1 = av_clip_pixel(p1 + deltap1); | 73 | 32.4M | } | 74 | 54.9M | if (!no_q && nd_q > 1) { | 75 | 18.3M | const int deltaq1 = av_clip((((q2 + q0 + 1) >> 1) - q1 - delta0) >> 1, -tc_2, tc_2); | 76 | 18.3M | Q1 = av_clip_pixel(q1 + deltaq1); | 77 | 18.3M | } | 78 | 54.9M | } | 79 | 56.7M | pix += ystride; | 80 | 56.7M | } | 81 | 14.1M | } |
dsp.c:loop_filter_luma_weak_10 Line | Count | Source | 54 | 31.9M | { | 55 | 31.9M | const int tc_2 = tc >> 1; | 56 | 159M | for (int d = 0; d < 4; d++) { | 57 | 127M | const int p2 = P2; | 58 | 127M | const int p1 = P1; | 59 | 127M | const int p0 = P0; | 60 | 127M | const int q0 = Q0; | 61 | 127M | const int q1 = Q1; | 62 | 127M | const int q2 = Q2; | 63 | 127M | int delta0 = (9 * (q0 - p0) - 3 * (q1 - p1) + 8) >> 4; | 64 | 127M | if (abs(delta0) < 10 * tc) { | 65 | 126M | delta0 = av_clip(delta0, -tc, tc); | 66 | 126M | if (!no_p) | 67 | 123M | P0 = av_clip_pixel(p0 + delta0); | 68 | 126M | if (!no_q) | 69 | 123M | Q0 = av_clip_pixel(q0 - delta0); | 70 | 126M | if (!no_p && nd_p > 1) { | 71 | 74.2M | const int deltap1 = av_clip((((p2 + p0 + 1) >> 1) - p1 + delta0) >> 1, -tc_2, tc_2); | 72 | 74.2M | P1 = av_clip_pixel(p1 + deltap1); | 73 | 74.2M | } | 74 | 126M | if (!no_q && nd_q > 1) { | 75 | 46.6M | const int deltaq1 = av_clip((((q2 + q0 + 1) >> 1) - q1 - delta0) >> 1, -tc_2, tc_2); | 76 | 46.6M | Q1 = av_clip_pixel(q1 + deltaq1); | 77 | 46.6M | } | 78 | 126M | } | 79 | 127M | pix += ystride; | 80 | 127M | } | 81 | 31.9M | } |
dsp.c:loop_filter_luma_weak_8 Line | Count | Source | 54 | 32.0M | { | 55 | 32.0M | const int tc_2 = tc >> 1; | 56 | 160M | for (int d = 0; d < 4; d++) { | 57 | 128M | const int p2 = P2; | 58 | 128M | const int p1 = P1; | 59 | 128M | const int p0 = P0; | 60 | 128M | const int q0 = Q0; | 61 | 128M | const int q1 = Q1; | 62 | 128M | const int q2 = Q2; | 63 | 128M | int delta0 = (9 * (q0 - p0) - 3 * (q1 - p1) + 8) >> 4; | 64 | 128M | if (abs(delta0) < 10 * tc) { | 65 | 126M | delta0 = av_clip(delta0, -tc, tc); | 66 | 126M | if (!no_p) | 67 | 122M | P0 = av_clip_pixel(p0 + delta0); | 68 | 126M | if (!no_q) | 69 | 122M | Q0 = av_clip_pixel(q0 - delta0); | 70 | 126M | if (!no_p && nd_p > 1) { | 71 | 57.6M | const int deltap1 = av_clip((((p2 + p0 + 1) >> 1) - p1 + delta0) >> 1, -tc_2, tc_2); | 72 | 57.6M | P1 = av_clip_pixel(p1 + deltap1); | 73 | 57.6M | } | 74 | 126M | if (!no_q && nd_q > 1) { | 75 | 42.2M | const int deltaq1 = av_clip((((q2 + q0 + 1) >> 1) - q1 - delta0) >> 1, -tc_2, tc_2); | 76 | 42.2M | Q1 = av_clip_pixel(q1 + deltaq1); | 77 | 42.2M | } | 78 | 126M | } | 79 | 128M | pix += ystride; | 80 | 128M | } | 81 | 32.0M | } |
|
82 | | |
83 | | static void FUNC(loop_filter_chroma_weak)(pixel *pix, const ptrdiff_t xstride, const ptrdiff_t ystride, |
84 | | const int size, const int32_t tc, const uint8_t no_p, const uint8_t no_q) |
85 | 355M | { |
86 | 1.75G | for (int d = 0; d < size; d++) { |
87 | 1.39G | int delta0; |
88 | 1.39G | const int p1 = P1; |
89 | 1.39G | const int p0 = P0; |
90 | 1.39G | const int q0 = Q0; |
91 | 1.39G | const int q1 = Q1; |
92 | 1.39G | delta0 = av_clip((((q0 - p0) * 4) + p1 - q1 + 4) >> 3, -tc, tc); |
93 | 1.39G | if (!no_p) |
94 | 1.34G | P0 = av_clip_pixel(p0 + delta0); |
95 | 1.39G | if (!no_q) |
96 | 1.34G | Q0 = av_clip_pixel(q0 - delta0); |
97 | 1.39G | pix += ystride; |
98 | 1.39G | } |
99 | 355M | } dsp.c:loop_filter_chroma_weak_9 Line | Count | Source | 85 | 47.2M | { | 86 | 236M | for (int d = 0; d < size; d++) { | 87 | 189M | int delta0; | 88 | 189M | const int p1 = P1; | 89 | 189M | const int p0 = P0; | 90 | 189M | const int q0 = Q0; | 91 | 189M | const int q1 = Q1; | 92 | 189M | delta0 = av_clip((((q0 - p0) * 4) + p1 - q1 + 4) >> 3, -tc, tc); | 93 | 189M | if (!no_p) | 94 | 182M | P0 = av_clip_pixel(p0 + delta0); | 95 | 189M | if (!no_q) | 96 | 182M | Q0 = av_clip_pixel(q0 - delta0); | 97 | 189M | pix += ystride; | 98 | 189M | } | 99 | 47.2M | } |
dsp.c:loop_filter_chroma_weak_10 Line | Count | Source | 85 | 59.3M | { | 86 | 286M | for (int d = 0; d < size; d++) { | 87 | 227M | int delta0; | 88 | 227M | const int p1 = P1; | 89 | 227M | const int p0 = P0; | 90 | 227M | const int q0 = Q0; | 91 | 227M | const int q1 = Q1; | 92 | 227M | delta0 = av_clip((((q0 - p0) * 4) + p1 - q1 + 4) >> 3, -tc, tc); | 93 | 227M | if (!no_p) | 94 | 219M | P0 = av_clip_pixel(p0 + delta0); | 95 | 227M | if (!no_q) | 96 | 219M | Q0 = av_clip_pixel(q0 - delta0); | 97 | 227M | pix += ystride; | 98 | 227M | } | 99 | 59.3M | } |
dsp.c:loop_filter_chroma_weak_12 Line | Count | Source | 85 | 52.3M | { | 86 | 261M | for (int d = 0; d < size; d++) { | 87 | 209M | int delta0; | 88 | 209M | const int p1 = P1; | 89 | 209M | const int p0 = P0; | 90 | 209M | const int q0 = Q0; | 91 | 209M | const int q1 = Q1; | 92 | 209M | delta0 = av_clip((((q0 - p0) * 4) + p1 - q1 + 4) >> 3, -tc, tc); | 93 | 209M | if (!no_p) | 94 | 203M | P0 = av_clip_pixel(p0 + delta0); | 95 | 209M | if (!no_q) | 96 | 203M | Q0 = av_clip_pixel(q0 - delta0); | 97 | 209M | pix += ystride; | 98 | 209M | } | 99 | 52.3M | } |
dsp.c:loop_filter_chroma_weak_8 Line | Count | Source | 85 | 42.1M | { | 86 | 210M | for (int d = 0; d < size; d++) { | 87 | 168M | int delta0; | 88 | 168M | const int p1 = P1; | 89 | 168M | const int p0 = P0; | 90 | 168M | const int q0 = Q0; | 91 | 168M | const int q1 = Q1; | 92 | 168M | delta0 = av_clip((((q0 - p0) * 4) + p1 - q1 + 4) >> 3, -tc, tc); | 93 | 168M | if (!no_p) | 94 | 159M | P0 = av_clip_pixel(p0 + delta0); | 95 | 168M | if (!no_q) | 96 | 159M | Q0 = av_clip_pixel(q0 - delta0); | 97 | 168M | pix += ystride; | 98 | 168M | } | 99 | 42.1M | } |
dsp.c:loop_filter_chroma_weak_12 Line | Count | Source | 85 | 52.3M | { | 86 | 261M | for (int d = 0; d < size; d++) { | 87 | 209M | int delta0; | 88 | 209M | const int p1 = P1; | 89 | 209M | const int p0 = P0; | 90 | 209M | const int q0 = Q0; | 91 | 209M | const int q1 = Q1; | 92 | 209M | delta0 = av_clip((((q0 - p0) * 4) + p1 - q1 + 4) >> 3, -tc, tc); | 93 | 209M | if (!no_p) | 94 | 203M | P0 = av_clip_pixel(p0 + delta0); | 95 | 209M | if (!no_q) | 96 | 203M | Q0 = av_clip_pixel(q0 - delta0); | 97 | 209M | pix += ystride; | 98 | 209M | } | 99 | 52.3M | } |
dsp.c:loop_filter_chroma_weak_10 Line | Count | Source | 85 | 59.3M | { | 86 | 286M | for (int d = 0; d < size; d++) { | 87 | 227M | int delta0; | 88 | 227M | const int p1 = P1; | 89 | 227M | const int p0 = P0; | 90 | 227M | const int q0 = Q0; | 91 | 227M | const int q1 = Q1; | 92 | 227M | delta0 = av_clip((((q0 - p0) * 4) + p1 - q1 + 4) >> 3, -tc, tc); | 93 | 227M | if (!no_p) | 94 | 219M | P0 = av_clip_pixel(p0 + delta0); | 95 | 227M | if (!no_q) | 96 | 219M | Q0 = av_clip_pixel(q0 - delta0); | 97 | 227M | pix += ystride; | 98 | 227M | } | 99 | 59.3M | } |
dsp.c:loop_filter_chroma_weak_8 Line | Count | Source | 85 | 42.1M | { | 86 | 210M | for (int d = 0; d < size; d++) { | 87 | 168M | int delta0; | 88 | 168M | const int p1 = P1; | 89 | 168M | const int p0 = P0; | 90 | 168M | const int q0 = Q0; | 91 | 168M | const int q1 = Q1; | 92 | 168M | delta0 = av_clip((((q0 - p0) * 4) + p1 - q1 + 4) >> 3, -tc, tc); | 93 | 168M | if (!no_p) | 94 | 159M | P0 = av_clip_pixel(p0 + delta0); | 95 | 168M | if (!no_q) | 96 | 159M | Q0 = av_clip_pixel(q0 - delta0); | 97 | 168M | pix += ystride; | 98 | 168M | } | 99 | 42.1M | } |
|