FFmpeg
vc1dsp_init_neon.c
Go to the documentation of this file.
1 /*
2  * This file is part of FFmpeg.
3  *
4  * FFmpeg is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * FFmpeg is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with FFmpeg; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 #include <stdint.h>
20 
21 #include "libavutil/attributes.h"
22 #include "libavcodec/vc1dsp.h"
23 #include "vc1dsp.h"
24 
25 void ff_vc1_inv_trans_8x8_neon(int16_t *block);
26 void ff_vc1_inv_trans_4x8_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block);
27 void ff_vc1_inv_trans_8x4_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block);
28 void ff_vc1_inv_trans_4x4_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block);
29 
30 void ff_vc1_inv_trans_8x8_dc_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block);
31 void ff_vc1_inv_trans_4x8_dc_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block);
32 void ff_vc1_inv_trans_8x4_dc_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block);
33 void ff_vc1_inv_trans_4x4_dc_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block);
34 
35 void ff_put_pixels8x8_neon(uint8_t *block, const uint8_t *pixels,
36  ptrdiff_t line_size, int rnd);
37 
38 #define DECL_PUT(X, Y) \
39 void ff_put_vc1_mspel_mc##X##Y##_neon(uint8_t *dst, const uint8_t *src, \
40  ptrdiff_t stride, int rnd); \
41 static void ff_put_vc1_mspel_mc##X##Y##_16_neon(uint8_t *dst, const uint8_t *src, \
42  ptrdiff_t stride, int rnd) \
43 { \
44  ff_put_vc1_mspel_mc##X##Y##_neon(dst+0, src+0, stride, rnd); \
45  ff_put_vc1_mspel_mc##X##Y##_neon(dst+8, src+8, stride, rnd); \
46  dst += 8*stride; src += 8*stride; \
47  ff_put_vc1_mspel_mc##X##Y##_neon(dst+0, src+0, stride, rnd); \
48  ff_put_vc1_mspel_mc##X##Y##_neon(dst+8, src+8, stride, rnd); \
49 }
50 
51 DECL_PUT(1, 0)
52 DECL_PUT(2, 0)
53 DECL_PUT(3, 0)
54 
55 DECL_PUT(0, 1)
56 DECL_PUT(0, 2)
57 DECL_PUT(0, 3)
58 
59 DECL_PUT(1, 1)
60 DECL_PUT(1, 2)
61 DECL_PUT(1, 3)
62 
63 DECL_PUT(2, 1)
64 DECL_PUT(2, 2)
65 DECL_PUT(2, 3)
66 
67 DECL_PUT(3, 1)
68 DECL_PUT(3, 2)
69 DECL_PUT(3, 3)
70 
71 void ff_put_vc1_chroma_mc8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
72  int h, int x, int y);
73 void ff_avg_vc1_chroma_mc8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
74  int h, int x, int y);
75 void ff_put_vc1_chroma_mc4_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
76  int h, int x, int y);
77 void ff_avg_vc1_chroma_mc4_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
78  int h, int x, int y);
79 
80 #define FN_ASSIGN(X, Y) \
81  dsp->put_vc1_mspel_pixels_tab[0][X+4*Y] = ff_put_vc1_mspel_mc##X##Y##_16_neon; \
82  dsp->put_vc1_mspel_pixels_tab[1][X+4*Y] = ff_put_vc1_mspel_mc##X##Y##_neon
83 
85 {
94 
96  FN_ASSIGN(1, 0);
97  FN_ASSIGN(2, 0);
98  FN_ASSIGN(3, 0);
99 
100  FN_ASSIGN(0, 1);
101  FN_ASSIGN(1, 1);
102  FN_ASSIGN(2, 1);
103  FN_ASSIGN(3, 1);
104 
105  FN_ASSIGN(0, 2);
106  FN_ASSIGN(1, 2);
107  FN_ASSIGN(2, 2);
108  FN_ASSIGN(3, 2);
109 
110  FN_ASSIGN(0, 3);
111  FN_ASSIGN(1, 3);
112  FN_ASSIGN(2, 3);
113  FN_ASSIGN(3, 3);
114 
119 }
ff_avg_vc1_chroma_mc8_neon
void ff_avg_vc1_chroma_mc8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int h, int x, int y)
stride
int stride
Definition: mace.c:144
vc1dsp.h
VC1DSPContext::vc1_inv_trans_4x4
void(* vc1_inv_trans_4x4)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition: vc1dsp.h:40
VC1DSPContext::avg_no_rnd_vc1_chroma_pixels_tab
h264_chroma_mc_func avg_no_rnd_vc1_chroma_pixels_tab[3]
Definition: vc1dsp.h:64
ff_vc1dsp_init_neon
av_cold void ff_vc1dsp_init_neon(VC1DSPContext *dsp)
Definition: vc1dsp_init_neon.c:84
VC1DSPContext::vc1_inv_trans_8x8_dc
void(* vc1_inv_trans_8x8_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition: vc1dsp.h:41
VC1DSPContext::put_no_rnd_vc1_chroma_pixels_tab
h264_chroma_mc_func put_no_rnd_vc1_chroma_pixels_tab[3]
Definition: vc1dsp.h:63
VC1DSPContext::vc1_inv_trans_4x4_dc
void(* vc1_inv_trans_4x4_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition: vc1dsp.h:44
vc1dsp.h
ff_vc1_inv_trans_8x8_neon
void ff_vc1_inv_trans_8x8_neon(int16_t *block)
rnd
#define rnd()
Definition: checkasm.h:111
VC1DSPContext::vc1_inv_trans_8x4_dc
void(* vc1_inv_trans_8x4_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition: vc1dsp.h:42
av_cold
#define av_cold
Definition: attributes.h:90
VC1DSPContext::vc1_inv_trans_8x4
void(* vc1_inv_trans_8x4)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition: vc1dsp.h:38
src
#define src
Definition: vp8dsp.c:255
ff_vc1_inv_trans_4x8_dc_neon
void ff_vc1_inv_trans_4x8_dc_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block)
ff_vc1_inv_trans_4x8_neon
void ff_vc1_inv_trans_4x8_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block)
VC1DSPContext::vc1_inv_trans_4x8_dc
void(* vc1_inv_trans_4x8_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition: vc1dsp.h:43
ff_avg_vc1_chroma_mc4_neon
void ff_avg_vc1_chroma_mc4_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int h, int x, int y)
ff_put_vc1_chroma_mc8_neon
void ff_put_vc1_chroma_mc8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int h, int x, int y)
ff_vc1_inv_trans_4x4_dc_neon
void ff_vc1_inv_trans_4x4_dc_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block)
attributes.h
VC1DSPContext::vc1_inv_trans_8x8
void(* vc1_inv_trans_8x8)(int16_t *b)
Definition: vc1dsp.h:37
ff_vc1_inv_trans_8x4_neon
void ff_vc1_inv_trans_8x4_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block)
VC1DSPContext
Definition: vc1dsp.h:35
VC1DSPContext::put_vc1_mspel_pixels_tab
vc1op_pixels_func put_vc1_mspel_pixels_tab[2][16]
Definition: vc1dsp.h:59
FN_ASSIGN
#define FN_ASSIGN(X, Y)
Definition: vc1dsp_init_neon.c:80
ff_vc1_inv_trans_8x8_dc_neon
void ff_vc1_inv_trans_8x8_dc_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block)
ff_vc1_inv_trans_4x4_neon
void ff_vc1_inv_trans_4x4_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block)
DECL_PUT
#define DECL_PUT(X, Y)
Definition: vc1dsp_init_neon.c:38
ff_put_vc1_chroma_mc4_neon
void ff_put_vc1_chroma_mc4_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride, int h, int x, int y)
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
VC1DSPContext::vc1_inv_trans_4x8
void(* vc1_inv_trans_4x8)(uint8_t *dest, ptrdiff_t stride, int16_t *block)
Definition: vc1dsp.h:39
ff_vc1_inv_trans_8x4_dc_neon
void ff_vc1_inv_trans_8x4_dc_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block)
ff_put_pixels8x8_neon
void ff_put_pixels8x8_neon(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int rnd)