FFmpeg
hpeldsp_init_arm.c
Go to the documentation of this file.
1 /*
2  * ARM-optimized halfpel functions
3  * Copyright (c) 2001 Lionel Ulmer
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #include "libavutil/arm/cpu.h"
23 #include "libavutil/attributes.h"
24 #include "libavcodec/pixels.h"
25 #include "hpeldsp_arm.h"
26 
27 void ff_put_pixels8_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
28 void ff_put_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
29 void ff_put_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
30 void ff_put_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
31 
32 void ff_put_no_rnd_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
33 void ff_put_no_rnd_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
34 void ff_put_no_rnd_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
35 
36 void ff_put_pixels16_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
37 
38 CALL_2X_PIXELS(ff_put_pixels16_x2_arm, ff_put_pixels8_x2_arm, 8)
39 CALL_2X_PIXELS(ff_put_pixels16_y2_arm, ff_put_pixels8_y2_arm, 8)
40 CALL_2X_PIXELS(ff_put_pixels16_xy2_arm, ff_put_pixels8_xy2_arm, 8)
41 CALL_2X_PIXELS(ff_put_no_rnd_pixels16_x2_arm, ff_put_no_rnd_pixels8_x2_arm, 8)
42 CALL_2X_PIXELS(ff_put_no_rnd_pixels16_y2_arm, ff_put_no_rnd_pixels8_y2_arm, 8)
43 CALL_2X_PIXELS(ff_put_no_rnd_pixels16_xy2_arm, ff_put_no_rnd_pixels8_xy2_arm,8)
44 
46 {
48 
49  c->put_pixels_tab[0][0] = ff_put_pixels16_arm;
50  c->put_pixels_tab[0][1] = ff_put_pixels16_x2_arm;
51  c->put_pixels_tab[0][2] = ff_put_pixels16_y2_arm;
52  c->put_pixels_tab[0][3] = ff_put_pixels16_xy2_arm;
53  c->put_pixels_tab[1][0] = ff_put_pixels8_arm;
54  c->put_pixels_tab[1][1] = ff_put_pixels8_x2_arm;
55  c->put_pixels_tab[1][2] = ff_put_pixels8_y2_arm;
56  c->put_pixels_tab[1][3] = ff_put_pixels8_xy2_arm;
57 
58  c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_arm;
59  c->put_no_rnd_pixels_tab[0][1] = ff_put_no_rnd_pixels16_x2_arm;
60  c->put_no_rnd_pixels_tab[0][2] = ff_put_no_rnd_pixels16_y2_arm;
61  c->put_no_rnd_pixels_tab[0][3] = ff_put_no_rnd_pixels16_xy2_arm;
62  c->put_no_rnd_pixels_tab[1][0] = ff_put_pixels8_arm;
63  c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_arm;
64  c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_arm;
65  c->put_no_rnd_pixels_tab[1][3] = ff_put_no_rnd_pixels8_xy2_arm;
66 
67  if (have_armv6(cpu_flags))
69  if (have_neon(cpu_flags))
71 }
ff_hpeldsp_init_armv6
void ff_hpeldsp_init_armv6(HpelDSPContext *c, int flags)
Definition: hpeldsp_init_armv6.c:45
ff_put_no_rnd_pixels8_xy2_arm
void ff_put_no_rnd_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
ff_put_pixels8_arm
void ff_put_pixels8_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
pixels.h
av_get_cpu_flags
int av_get_cpu_flags(void)
Return the flags which specify extensions supported by the CPU.
Definition: cpu.c:101
cpu_flags
static atomic_int cpu_flags
Definition: cpu.c:52
av_cold
#define av_cold
Definition: attributes.h:90
ff_hpeldsp_init_neon
void ff_hpeldsp_init_neon(HpelDSPContext *c, int flags)
Definition: hpeldsp_init_neon.c:55
cpu.h
ff_put_no_rnd_pixels8_y2_arm
void ff_put_no_rnd_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
c
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
Definition: undefined.txt:32
HpelDSPContext
Half-pel DSP context.
Definition: hpeldsp.h:45
ff_put_pixels8_y2_arm
void ff_put_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
ff_put_no_rnd_pixels8_x2_arm
void ff_put_no_rnd_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
have_neon
#define have_neon(flags)
Definition: cpu.h:26
attributes.h
ff_put_pixels16_arm
void ff_put_pixels16_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
ff_put_pixels8_x2_arm
void ff_put_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)
CALL_2X_PIXELS
#define CALL_2X_PIXELS(a, b, n)
Definition: pixels.h:34
hpeldsp_arm.h
ff_hpeldsp_init_arm
av_cold void ff_hpeldsp_init_arm(HpelDSPContext *c, int flags)
Definition: hpeldsp_init_arm.c:45
have_armv6
#define have_armv6(flags)
Definition: cpu.h:26
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:561
block
The exact code depends on how similar the blocks are and how related they are to the block
Definition: filter_design.txt:207
h
h
Definition: vp9dsp_template.c:2038
ff_put_pixels8_xy2_arm
void ff_put_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h)