FFmpeg
libavfilter
x86
vf_xpsnr_init.c
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2024 Christian R. Helmrich
3
* Copyright (c) 2024 Christian Lehmann
4
* Copyright (c) 2024 Christian Stoffers
5
*
6
* This file is part of FFmpeg.
7
*
8
* FFmpeg is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License as published by the Free Software Foundation; either
11
* version 2.1 of the License, or (at your option) any later version.
12
*
13
* FFmpeg is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
17
*
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with FFmpeg; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
*/
22
23
/**
24
* @file
25
* SIMD initialization for calculation of extended perceptually weighted PSNR (XPSNR).
26
*
27
* Authors: Christian Helmrich, Lehmann, and Stoffers, Fraunhofer HHI, Berlin, Germany
28
*/
29
30
#include "
libavutil/x86/cpu.h
"
31
#include "
libavfilter/xpsnr.h
"
32
33
uint64_t
ff_sse_line_16bit_sse2
(
const
uint8_t *buf,
const
uint8_t *
ref
,
const
int
w
);
34
35
void
ff_xpsnr_init_x86
(
PSNRDSPContext
*dsp,
const
int
bpp)
36
{
37
if
(bpp <= 15) {
/* XPSNR always operates with 16-bit internal precision */
38
const
int
cpu_flags
=
av_get_cpu_flags
();
39
40
if
(
EXTERNAL_SSE2
(
cpu_flags
))
41
dsp->
sse_line
=
ff_sse_line_16bit_sse2
;
42
}
43
}
ff_sse_line_16bit_sse2
uint64_t ff_sse_line_16bit_sse2(const uint8_t *buf, const uint8_t *ref, const int w)
cpu.h
w
uint8_t w
Definition:
llviddspenc.c:38
ff_xpsnr_init_x86
void ff_xpsnr_init_x86(PSNRDSPContext *dsp, const int bpp)
Definition:
vf_xpsnr_init.c:35
av_get_cpu_flags
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition:
cpu.c:107
cpu_flags
static atomic_int cpu_flags
Definition:
cpu.c:56
PSNRDSPContext
Definition:
psnr.h:27
EXTERNAL_SSE2
#define EXTERNAL_SSE2(flags)
Definition:
cpu.h:59
xpsnr.h
PSNRDSPContext::sse_line
uint64_t(* sse_line)(const uint8_t *buf, const uint8_t *ref, int w)
Definition:
psnr.h:28
ref
static int ref[MAX_W *MAX_W]
Definition:
jpeg2000dwt.c:112
Generated on Wed Sep 18 2024 19:22:45 for FFmpeg by
1.8.17