FFmpeg coverage


Directory: ../../../ffmpeg/
File: src/libavcodec/vp6dsp.c
Date: 2026-01-14 03:33:33
Exec Total Coverage
Lines: 25 25 100.0%
Functions: 2 2 100.0%
Branches: 8 8 100.0%

Line Branch Exec Source
1 /*
2 * Copyright (C) 2006 Aurelien Jacobs <aurel@gnuage.org>
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 /**
22 * @file
23 * VP6 DSP-oriented functions
24 */
25
26 #include "libavutil/common.h"
27 #include "vp56dsp.h"
28
29
30 27349 static void vp6_filter_diag4_c(uint8_t *dst, const uint8_t *src, ptrdiff_t stride,
31 const int16_t *h_weights, const int16_t *v_weights)
32 {
33 int x, y;
34 int tmp[8*11];
35 27349 int *t = tmp;
36
37 27349 src -= stride;
38
39
2/2
✓ Branch 0 taken 300839 times.
✓ Branch 1 taken 27349 times.
328188 for (y=0; y<11; y++) {
40
2/2
✓ Branch 0 taken 2406712 times.
✓ Branch 1 taken 300839 times.
2707551 for (x=0; x<8; x++) {
41 2406712 t[x] = av_clip_uint8(( src[x-1] * h_weights[0]
42 2406712 + src[x ] * h_weights[1]
43 2406712 + src[x+1] * h_weights[2]
44 2406712 + src[x+2] * h_weights[3] + 64) >> 7);
45 }
46 300839 src += stride;
47 300839 t += 8;
48 }
49
50 27349 t = tmp + 8;
51
2/2
✓ Branch 0 taken 218792 times.
✓ Branch 1 taken 27349 times.
246141 for (y=0; y<8; y++) {
52
2/2
✓ Branch 0 taken 1750336 times.
✓ Branch 1 taken 218792 times.
1969128 for (x=0; x<8; x++) {
53 1750336 dst[x] = av_clip_uint8(( t[x-8 ] * v_weights[0]
54 1750336 + t[x ] * v_weights[1]
55 1750336 + t[x+8 ] * v_weights[2]
56 1750336 + t[x+16] * v_weights[3] + 64) >> 7);
57 }
58 218792 dst += stride;
59 218792 t += 8;
60 }
61 27349 }
62
63 35 av_cold void ff_vp6dsp_init(VP6DSPContext *s)
64 {
65 35 s->vp6_filter_diag4 = vp6_filter_diag4_c;
66
67 #if ARCH_X86 && HAVE_X86ASM
68 35 ff_vp6dsp_init_x86(s);
69 #endif
70 35 }
71