annotate cavsdsp.c @ 4391:20944c70a3c0 libavcodec

fix segfault with darkkben.free.fr/corrupted_h264.mp4
author michael
date Tue, 23 Jan 2007 19:32:26 +0000
parents 23da44e8fd05
children a96d905dcbaa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
1 /*
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
2 * Chinese AVS video (AVS1-P2, JiZhun profile) decoder.
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
3 *
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
4 * DSP functions
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
5 *
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
6 * Copyright (c) 2006 Stefan Gehrer <stefan.gehrer@gmx.de>
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
7 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3524
diff changeset
8 * This file is part of FFmpeg.
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3524
diff changeset
9 *
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3524
diff changeset
10 * FFmpeg is free software; you can redistribute it and/or
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
11 * modify it under the terms of the GNU Lesser General Public
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
12 * License as published by the Free Software Foundation; either
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3524
diff changeset
13 * version 2.1 of the License, or (at your option) any later version.
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
14 *
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3524
diff changeset
15 * FFmpeg is distributed in the hope that it will be useful,
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
18 * Lesser General Public License for more details.
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
19 *
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
20 * You should have received a copy of the GNU Lesser General Public
3947
c8c591fe26f8 Change license headers to say 'FFmpeg' instead of 'this program/this library'
diego
parents: 3524
diff changeset
21 * License along with FFmpeg; if not, write to the Free Software
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
22 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
23 */
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
24
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
25 #include <stdio.h>
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
26 #include "dsputil.h"
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
27
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
28 /*****************************************************************************
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
29 *
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
30 * in-loop deblocking filter
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
31 *
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
32 ****************************************************************************/
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
33
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
34 #define P2 p0_p[-3*stride]
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
35 #define P1 p0_p[-2*stride]
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
36 #define P0 p0_p[-1*stride]
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
37 #define Q0 p0_p[ 0*stride]
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
38 #define Q1 p0_p[ 1*stride]
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
39 #define Q2 p0_p[ 2*stride]
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
40
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
41 static inline void loop_filter_l2(uint8_t *p0_p,int stride,int alpha, int beta) {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
42 int p0 = P0;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
43 int q0 = Q0;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
44
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
45 if(abs(p0-q0)<alpha && abs(P1-p0)<beta && abs(Q1-q0)<beta) {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
46 int s = p0 + q0 + 2;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
47 alpha = (alpha>>2) + 2;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
48 if(abs(P2-p0) < beta && abs(p0-q0) < alpha) {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
49 P0 = (P1 + p0 + s) >> 2;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
50 P1 = (2*P1 + s) >> 2;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
51 } else
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
52 P0 = (2*P1 + s) >> 2;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
53 if(abs(Q2-q0) < beta && abs(q0-p0) < alpha) {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
54 Q0 = (Q1 + q0 + s) >> 2;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
55 Q1 = (2*Q1 + s) >> 2;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
56 } else
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
57 Q0 = (2*Q1 + s) >> 2;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
58 }
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
59 }
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
60
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
61 static inline void loop_filter_l1(uint8_t *p0_p, int stride, int alpha, int beta, int tc) {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
62 int p0 = P0;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
63 int q0 = Q0;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
64
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
65 if(abs(p0-q0)<alpha && abs(P1-p0)<beta && abs(Q1-q0)<beta) {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
66 int delta = clip(((q0-p0)*3+P1-Q1+4)>>3,-tc, tc);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
67 P0 = clip_uint8(p0+delta);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
68 Q0 = clip_uint8(q0-delta);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
69 if(abs(P2-p0)<beta) {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
70 delta = clip(((P0-P1)*3+P2-Q0+4)>>3, -tc, tc);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
71 P1 = clip_uint8(P1+delta);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
72 }
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
73 if(abs(Q2-q0)<beta) {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
74 delta = clip(((Q1-Q0)*3+P0-Q2+4)>>3, -tc, tc);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
75 Q1 = clip_uint8(Q1-delta);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
76 }
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
77 }
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
78 }
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
79
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
80 static inline void loop_filter_c2(uint8_t *p0_p,int stride,int alpha, int beta) {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
81 int p0 = P0;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
82 int q0 = Q0;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
83
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
84 if(abs(p0-q0)<alpha && abs(P1-p0)<beta && abs(Q1-q0)<beta) {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
85 int s = p0 + q0 + 2;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
86 alpha = (alpha>>2) + 2;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
87 if(abs(P2-p0) < beta && abs(p0-q0) < alpha) {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
88 P0 = (P1 + p0 + s) >> 2;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
89 } else
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
90 P0 = (2*P1 + s) >> 2;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
91 if(abs(Q2-q0) < beta && abs(q0-p0) < alpha) {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
92 Q0 = (Q1 + q0 + s) >> 2;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
93 } else
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
94 Q0 = (2*Q1 + s) >> 2;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
95 }
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
96 }
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
97
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
98 static inline void loop_filter_c1(uint8_t *p0_p,int stride,int alpha, int beta,
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
99 int tc) {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
100 if(abs(P0-Q0)<alpha && abs(P1-P0)<beta && abs(Q1-Q0)<beta) {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
101 int delta = clip(((Q0-P0)*3+P1-Q1+4)>>3, -tc, tc);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
102 P0 = clip_uint8(P0+delta);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
103 Q0 = clip_uint8(Q0-delta);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
104 }
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
105 }
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
106
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
107 #undef P0
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
108 #undef P1
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
109 #undef P2
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
110 #undef Q0
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
111 #undef Q1
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
112 #undef Q2
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
113
3395
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
114 static void cavs_filter_lv_c(uint8_t *d, int stride, int alpha, int beta, int tc,
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
115 int bs1, int bs2) {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
116 int i;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
117 if(bs1==2)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
118 for(i=0;i<16;i++)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
119 loop_filter_l2(d + i*stride,1,alpha,beta);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
120 else {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
121 if(bs1)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
122 for(i=0;i<8;i++)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
123 loop_filter_l1(d + i*stride,1,alpha,beta,tc);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
124 if (bs2)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
125 for(i=8;i<16;i++)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
126 loop_filter_l1(d + i*stride,1,alpha,beta,tc);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
127 }
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
128 }
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
129
3395
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
130 static void cavs_filter_lh_c(uint8_t *d, int stride, int alpha, int beta, int tc,
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
131 int bs1, int bs2) {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
132 int i;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
133 if(bs1==2)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
134 for(i=0;i<16;i++)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
135 loop_filter_l2(d + i,stride,alpha,beta);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
136 else {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
137 if(bs1)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
138 for(i=0;i<8;i++)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
139 loop_filter_l1(d + i,stride,alpha,beta,tc);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
140 if (bs2)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
141 for(i=8;i<16;i++)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
142 loop_filter_l1(d + i,stride,alpha,beta,tc);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
143 }
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
144 }
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
145
3395
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
146 static void cavs_filter_cv_c(uint8_t *d, int stride, int alpha, int beta, int tc,
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
147 int bs1, int bs2) {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
148 int i;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
149 if(bs1==2)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
150 for(i=0;i<8;i++)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
151 loop_filter_c2(d + i*stride,1,alpha,beta);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
152 else {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
153 if(bs1)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
154 for(i=0;i<4;i++)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
155 loop_filter_c1(d + i*stride,1,alpha,beta,tc);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
156 if (bs2)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
157 for(i=4;i<8;i++)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
158 loop_filter_c1(d + i*stride,1,alpha,beta,tc);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
159 }
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
160 }
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
161
3395
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
162 static void cavs_filter_ch_c(uint8_t *d, int stride, int alpha, int beta, int tc,
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
163 int bs1, int bs2) {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
164 int i;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
165 if(bs1==2)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
166 for(i=0;i<8;i++)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
167 loop_filter_c2(d + i,stride,alpha,beta);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
168 else {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
169 if(bs1)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
170 for(i=0;i<4;i++)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
171 loop_filter_c1(d + i,stride,alpha,beta,tc);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
172 if (bs2)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
173 for(i=4;i<8;i++)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
174 loop_filter_c1(d + i,stride,alpha,beta,tc);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
175 }
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
176 }
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
177
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
178 /*****************************************************************************
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
179 *
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
180 * inverse transform
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
181 *
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
182 ****************************************************************************/
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
183
3395
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
184 static void cavs_idct8_add_c(uint8_t *dst, DCTELEM *block, int stride) {
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
185 int i;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
186 DCTELEM (*src)[8] = (DCTELEM(*)[8])block;
4176
23da44e8fd05 rename cropTbl -> ff_cropTbl
mru
parents: 3947
diff changeset
187 uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
188
3412
26dc0057a8f8 add rounding bias earlier in the idct, avoids many adds
michael
parents: 3395
diff changeset
189 src[0][0] += 8;
26dc0057a8f8 add rounding bias earlier in the idct, avoids many adds
michael
parents: 3395
diff changeset
190
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
191 for( i = 0; i < 8; i++ ) {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
192 const int a0 = 3*src[i][1] - (src[i][7]<<1);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
193 const int a1 = 3*src[i][3] + (src[i][5]<<1);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
194 const int a2 = (src[i][3]<<1) - 3*src[i][5];
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
195 const int a3 = (src[i][1]<<1) + 3*src[i][7];
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
196
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
197 const int b4 = ((a0 + a1 + a3)<<1) + a1;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
198 const int b5 = ((a0 - a1 + a2)<<1) + a0;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
199 const int b6 = ((a3 - a2 - a1)<<1) + a3;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
200 const int b7 = ((a0 - a2 - a3)<<1) - a2;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
201
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
202 const int a7 = (src[i][2]<<2) - 10*src[i][6];
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
203 const int a6 = (src[i][6]<<2) + 10*src[i][2];
3412
26dc0057a8f8 add rounding bias earlier in the idct, avoids many adds
michael
parents: 3395
diff changeset
204 const int a5 = ((src[i][0] - src[i][4]) << 3) + 4;
26dc0057a8f8 add rounding bias earlier in the idct, avoids many adds
michael
parents: 3395
diff changeset
205 const int a4 = ((src[i][0] + src[i][4]) << 3) + 4;
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
206
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
207 const int b0 = a4 + a6;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
208 const int b1 = a5 + a7;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
209 const int b2 = a5 - a7;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
210 const int b3 = a4 - a6;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
211
3412
26dc0057a8f8 add rounding bias earlier in the idct, avoids many adds
michael
parents: 3395
diff changeset
212 src[i][0] = (b0 + b4) >> 3;
26dc0057a8f8 add rounding bias earlier in the idct, avoids many adds
michael
parents: 3395
diff changeset
213 src[i][1] = (b1 + b5) >> 3;
26dc0057a8f8 add rounding bias earlier in the idct, avoids many adds
michael
parents: 3395
diff changeset
214 src[i][2] = (b2 + b6) >> 3;
26dc0057a8f8 add rounding bias earlier in the idct, avoids many adds
michael
parents: 3395
diff changeset
215 src[i][3] = (b3 + b7) >> 3;
26dc0057a8f8 add rounding bias earlier in the idct, avoids many adds
michael
parents: 3395
diff changeset
216 src[i][4] = (b3 - b7) >> 3;
26dc0057a8f8 add rounding bias earlier in the idct, avoids many adds
michael
parents: 3395
diff changeset
217 src[i][5] = (b2 - b6) >> 3;
26dc0057a8f8 add rounding bias earlier in the idct, avoids many adds
michael
parents: 3395
diff changeset
218 src[i][6] = (b1 - b5) >> 3;
26dc0057a8f8 add rounding bias earlier in the idct, avoids many adds
michael
parents: 3395
diff changeset
219 src[i][7] = (b0 - b4) >> 3;
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
220 }
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
221 for( i = 0; i < 8; i++ ) {
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
222 const int a0 = 3*src[1][i] - (src[7][i]<<1);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
223 const int a1 = 3*src[3][i] + (src[5][i]<<1);
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
224 const int a2 = (src[3][i]<<1) - 3*src[5][i];
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
225 const int a3 = (src[1][i]<<1) + 3*src[7][i];
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
226
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
227 const int b4 = ((a0 + a1 + a3)<<1) + a1;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
228 const int b5 = ((a0 - a1 + a2)<<1) + a0;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
229 const int b6 = ((a3 - a2 - a1)<<1) + a3;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
230 const int b7 = ((a0 - a2 - a3)<<1) - a2;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
231
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
232 const int a7 = (src[2][i]<<2) - 10*src[6][i];
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
233 const int a6 = (src[6][i]<<2) + 10*src[2][i];
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
234 const int a5 = (src[0][i] - src[4][i]) << 3;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
235 const int a4 = (src[0][i] + src[4][i]) << 3;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
236
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
237 const int b0 = a4 + a6;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
238 const int b1 = a5 + a7;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
239 const int b2 = a5 - a7;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
240 const int b3 = a4 - a6;
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
241
3412
26dc0057a8f8 add rounding bias earlier in the idct, avoids many adds
michael
parents: 3395
diff changeset
242 dst[i + 0*stride] = cm[ dst[i + 0*stride] + ((b0 + b4) >> 7)];
26dc0057a8f8 add rounding bias earlier in the idct, avoids many adds
michael
parents: 3395
diff changeset
243 dst[i + 1*stride] = cm[ dst[i + 1*stride] + ((b1 + b5) >> 7)];
26dc0057a8f8 add rounding bias earlier in the idct, avoids many adds
michael
parents: 3395
diff changeset
244 dst[i + 2*stride] = cm[ dst[i + 2*stride] + ((b2 + b6) >> 7)];
26dc0057a8f8 add rounding bias earlier in the idct, avoids many adds
michael
parents: 3395
diff changeset
245 dst[i + 3*stride] = cm[ dst[i + 3*stride] + ((b3 + b7) >> 7)];
26dc0057a8f8 add rounding bias earlier in the idct, avoids many adds
michael
parents: 3395
diff changeset
246 dst[i + 4*stride] = cm[ dst[i + 4*stride] + ((b3 - b7) >> 7)];
26dc0057a8f8 add rounding bias earlier in the idct, avoids many adds
michael
parents: 3395
diff changeset
247 dst[i + 5*stride] = cm[ dst[i + 5*stride] + ((b2 - b6) >> 7)];
26dc0057a8f8 add rounding bias earlier in the idct, avoids many adds
michael
parents: 3395
diff changeset
248 dst[i + 6*stride] = cm[ dst[i + 6*stride] + ((b1 - b5) >> 7)];
26dc0057a8f8 add rounding bias earlier in the idct, avoids many adds
michael
parents: 3395
diff changeset
249 dst[i + 7*stride] = cm[ dst[i + 7*stride] + ((b0 - b4) >> 7)];
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
250 }
3524
419409926166 some MMX optimizations for the CAVS decoder
stefang
parents: 3412
diff changeset
251 memset(block,0,64*sizeof(DCTELEM));
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
252 }
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
253
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
254 /*****************************************************************************
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
255 *
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
256 * motion compensation
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
257 *
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
258 ****************************************************************************/
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
259
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
260 #define CAVS_SUBPIX(OPNAME, OP, NAME, A, B, C, D, E, F) \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
261 static void OPNAME ## cavs_filt8_h_ ## NAME(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
262 const int h=8;\
4176
23da44e8fd05 rename cropTbl -> ff_cropTbl
mru
parents: 3947
diff changeset
263 uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
264 int i;\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
265 for(i=0; i<h; i++)\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
266 {\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
267 OP(dst[0], A*src[-2] + B*src[-1] + C*src[0] + D*src[1] + E*src[2] + F*src[3]);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
268 OP(dst[1], A*src[-1] + B*src[ 0] + C*src[1] + D*src[2] + E*src[3] + F*src[4]);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
269 OP(dst[2], A*src[ 0] + B*src[ 1] + C*src[2] + D*src[3] + E*src[4] + F*src[5]);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
270 OP(dst[3], A*src[ 1] + B*src[ 2] + C*src[3] + D*src[4] + E*src[5] + F*src[6]);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
271 OP(dst[4], A*src[ 2] + B*src[ 3] + C*src[4] + D*src[5] + E*src[6] + F*src[7]);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
272 OP(dst[5], A*src[ 3] + B*src[ 4] + C*src[5] + D*src[6] + E*src[7] + F*src[8]);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
273 OP(dst[6], A*src[ 4] + B*src[ 5] + C*src[6] + D*src[7] + E*src[8] + F*src[9]);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
274 OP(dst[7], A*src[ 5] + B*src[ 6] + C*src[7] + D*src[8] + E*src[9] + F*src[10]);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
275 dst+=dstStride;\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
276 src+=srcStride;\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
277 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
278 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
279 \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
280 static void OPNAME ## cavs_filt8_v_ ## NAME(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
281 const int w=8;\
4176
23da44e8fd05 rename cropTbl -> ff_cropTbl
mru
parents: 3947
diff changeset
282 uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
283 int i;\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
284 for(i=0; i<w; i++)\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
285 {\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
286 const int srcB= src[-2*srcStride];\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
287 const int srcA= src[-1*srcStride];\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
288 const int src0= src[0 *srcStride];\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
289 const int src1= src[1 *srcStride];\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
290 const int src2= src[2 *srcStride];\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
291 const int src3= src[3 *srcStride];\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
292 const int src4= src[4 *srcStride];\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
293 const int src5= src[5 *srcStride];\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
294 const int src6= src[6 *srcStride];\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
295 const int src7= src[7 *srcStride];\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
296 const int src8= src[8 *srcStride];\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
297 const int src9= src[9 *srcStride];\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
298 const int src10= src[10 *srcStride];\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
299 OP(dst[0*dstStride], A*srcB + B*srcA + C*src0 + D*src1 + E*src2 + F*src3);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
300 OP(dst[1*dstStride], A*srcA + B*src0 + C*src1 + D*src2 + E*src3 + F*src4);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
301 OP(dst[2*dstStride], A*src0 + B*src1 + C*src2 + D*src3 + E*src4 + F*src5);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
302 OP(dst[3*dstStride], A*src1 + B*src2 + C*src3 + D*src4 + E*src5 + F*src6);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
303 OP(dst[4*dstStride], A*src2 + B*src3 + C*src4 + D*src5 + E*src6 + F*src7);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
304 OP(dst[5*dstStride], A*src3 + B*src4 + C*src5 + D*src6 + E*src7 + F*src8);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
305 OP(dst[6*dstStride], A*src4 + B*src5 + C*src6 + D*src7 + E*src8 + F*src9);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
306 OP(dst[7*dstStride], A*src5 + B*src6 + C*src7 + D*src8 + E*src9 + F*src10);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
307 dst++;\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
308 src++;\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
309 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
310 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
311 \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
312 static void OPNAME ## cavs_filt16_v_ ## NAME(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
313 OPNAME ## cavs_filt8_v_ ## NAME(dst , src , dstStride, srcStride);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
314 OPNAME ## cavs_filt8_v_ ## NAME(dst+8, src+8, dstStride, srcStride);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
315 src += 8*srcStride;\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
316 dst += 8*dstStride;\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
317 OPNAME ## cavs_filt8_v_ ## NAME(dst , src , dstStride, srcStride);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
318 OPNAME ## cavs_filt8_v_ ## NAME(dst+8, src+8, dstStride, srcStride);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
319 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
320 \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
321 static void OPNAME ## cavs_filt16_h_ ## NAME(uint8_t *dst, uint8_t *src, int dstStride, int srcStride){\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
322 OPNAME ## cavs_filt8_h_ ## NAME(dst , src , dstStride, srcStride);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
323 OPNAME ## cavs_filt8_h_ ## NAME(dst+8, src+8, dstStride, srcStride);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
324 src += 8*srcStride;\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
325 dst += 8*dstStride;\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
326 OPNAME ## cavs_filt8_h_ ## NAME(dst , src , dstStride, srcStride);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
327 OPNAME ## cavs_filt8_h_ ## NAME(dst+8, src+8, dstStride, srcStride);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
328 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
329
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
330 #define CAVS_SUBPIX_HV(OPNAME, OP, NAME, AH, BH, CH, DH, EH, FH, AV, BV, CV, DV, EV, FV, FULL) \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
331 static void OPNAME ## cavs_filt8_hv_ ## NAME(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride){\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
332 int16_t temp[8*(8+5)];\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
333 int16_t *tmp = temp;\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
334 const int h=8;\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
335 const int w=8;\
4176
23da44e8fd05 rename cropTbl -> ff_cropTbl
mru
parents: 3947
diff changeset
336 uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;\
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
337 int i;\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
338 src1 -= 2*srcStride;\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
339 for(i=0; i<h+5; i++)\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
340 {\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
341 tmp[0]= AH*src1[-2] + BH*src1[-1] + CH*src1[0] + DH*src1[1] + EH*src1[2] + FH*src1[3];\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
342 tmp[1]= AH*src1[-1] + BH*src1[ 0] + CH*src1[1] + DH*src1[2] + EH*src1[3] + FH*src1[4];\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
343 tmp[2]= AH*src1[ 0] + BH*src1[ 1] + CH*src1[2] + DH*src1[3] + EH*src1[4] + FH*src1[5];\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
344 tmp[3]= AH*src1[ 1] + BH*src1[ 2] + CH*src1[3] + DH*src1[4] + EH*src1[5] + FH*src1[6];\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
345 tmp[4]= AH*src1[ 2] + BH*src1[ 3] + CH*src1[4] + DH*src1[5] + EH*src1[6] + FH*src1[7];\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
346 tmp[5]= AH*src1[ 3] + BH*src1[ 4] + CH*src1[5] + DH*src1[6] + EH*src1[7] + FH*src1[8];\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
347 tmp[6]= AH*src1[ 4] + BH*src1[ 5] + CH*src1[6] + DH*src1[7] + EH*src1[8] + FH*src1[9];\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
348 tmp[7]= AH*src1[ 5] + BH*src1[ 6] + CH*src1[7] + DH*src1[8] + EH*src1[9] + FH*src1[10];\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
349 tmp+=8;\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
350 src1+=srcStride;\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
351 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
352 if(FULL) {\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
353 tmp = temp+8*2; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
354 for(i=0; i<w; i++) \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
355 { \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
356 const int tmpB= tmp[-2*8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
357 const int tmpA= tmp[-1*8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
358 const int tmp0= tmp[0 *8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
359 const int tmp1= tmp[1 *8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
360 const int tmp2= tmp[2 *8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
361 const int tmp3= tmp[3 *8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
362 const int tmp4= tmp[4 *8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
363 const int tmp5= tmp[5 *8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
364 const int tmp6= tmp[6 *8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
365 const int tmp7= tmp[7 *8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
366 const int tmp8= tmp[8 *8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
367 const int tmp9= tmp[9 *8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
368 const int tmp10=tmp[10*8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
369 OP(dst[0*dstStride], AV*tmpB + BV*tmpA + CV*tmp0 + DV*tmp1 + EV*tmp2 + FV*tmp3 + 64*src2[0*srcStride]); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
370 OP(dst[1*dstStride], AV*tmpA + BV*tmp0 + CV*tmp1 + DV*tmp2 + EV*tmp3 + FV*tmp4 + 64*src2[1*srcStride]); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
371 OP(dst[2*dstStride], AV*tmp0 + BV*tmp1 + CV*tmp2 + DV*tmp3 + EV*tmp4 + FV*tmp5 + 64*src2[2*srcStride]); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
372 OP(dst[3*dstStride], AV*tmp1 + BV*tmp2 + CV*tmp3 + DV*tmp4 + EV*tmp5 + FV*tmp6 + 64*src2[3*srcStride]); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
373 OP(dst[4*dstStride], AV*tmp2 + BV*tmp3 + CV*tmp4 + DV*tmp5 + EV*tmp6 + FV*tmp7 + 64*src2[4*srcStride]); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
374 OP(dst[5*dstStride], AV*tmp3 + BV*tmp4 + CV*tmp5 + DV*tmp6 + EV*tmp7 + FV*tmp8 + 64*src2[5*srcStride]); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
375 OP(dst[6*dstStride], AV*tmp4 + BV*tmp5 + CV*tmp6 + DV*tmp7 + EV*tmp8 + FV*tmp9 + 64*src2[6*srcStride]); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
376 OP(dst[7*dstStride], AV*tmp5 + BV*tmp6 + CV*tmp7 + DV*tmp8 + EV*tmp9 + FV*tmp10 + 64*src2[7*srcStride]); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
377 dst++; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
378 tmp++; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
379 src2++; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
380 } \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
381 } else {\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
382 tmp = temp+8*2; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
383 for(i=0; i<w; i++) \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
384 { \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
385 const int tmpB= tmp[-2*8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
386 const int tmpA= tmp[-1*8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
387 const int tmp0= tmp[0 *8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
388 const int tmp1= tmp[1 *8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
389 const int tmp2= tmp[2 *8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
390 const int tmp3= tmp[3 *8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
391 const int tmp4= tmp[4 *8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
392 const int tmp5= tmp[5 *8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
393 const int tmp6= tmp[6 *8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
394 const int tmp7= tmp[7 *8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
395 const int tmp8= tmp[8 *8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
396 const int tmp9= tmp[9 *8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
397 const int tmp10=tmp[10*8]; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
398 OP(dst[0*dstStride], AV*tmpB + BV*tmpA + CV*tmp0 + DV*tmp1 + EV*tmp2 + FV*tmp3); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
399 OP(dst[1*dstStride], AV*tmpA + BV*tmp0 + CV*tmp1 + DV*tmp2 + EV*tmp3 + FV*tmp4); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
400 OP(dst[2*dstStride], AV*tmp0 + BV*tmp1 + CV*tmp2 + DV*tmp3 + EV*tmp4 + FV*tmp5); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
401 OP(dst[3*dstStride], AV*tmp1 + BV*tmp2 + CV*tmp3 + DV*tmp4 + EV*tmp5 + FV*tmp6); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
402 OP(dst[4*dstStride], AV*tmp2 + BV*tmp3 + CV*tmp4 + DV*tmp5 + EV*tmp6 + FV*tmp7); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
403 OP(dst[5*dstStride], AV*tmp3 + BV*tmp4 + CV*tmp5 + DV*tmp6 + EV*tmp7 + FV*tmp8); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
404 OP(dst[6*dstStride], AV*tmp4 + BV*tmp5 + CV*tmp6 + DV*tmp7 + EV*tmp8 + FV*tmp9); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
405 OP(dst[7*dstStride], AV*tmp5 + BV*tmp6 + CV*tmp7 + DV*tmp8 + EV*tmp9 + FV*tmp10); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
406 dst++; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
407 tmp++; \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
408 } \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
409 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
410 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
411 \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
412 static void OPNAME ## cavs_filt16_hv_ ## NAME(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int srcStride){ \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
413 OPNAME ## cavs_filt8_hv_ ## NAME(dst , src1, src2 , dstStride, srcStride); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
414 OPNAME ## cavs_filt8_hv_ ## NAME(dst+8, src1+8, src2+8, dstStride, srcStride); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
415 src1 += 8*srcStride;\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
416 src2 += 8*srcStride;\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
417 dst += 8*dstStride;\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
418 OPNAME ## cavs_filt8_hv_ ## NAME(dst , src1, src2 , dstStride, srcStride); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
419 OPNAME ## cavs_filt8_hv_ ## NAME(dst+8, src1+8, src2+8, dstStride, srcStride); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
420 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
421
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
422 #define CAVS_MC(OPNAME, SIZE) \
3395
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
423 static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc10_c(uint8_t *dst, uint8_t *src, int stride){\
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
424 OPNAME ## cavs_filt ## SIZE ## _h_qpel_l(dst, src, stride, stride);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
425 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
426 \
3395
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
427 static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc20_c(uint8_t *dst, uint8_t *src, int stride){\
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
428 OPNAME ## cavs_filt ## SIZE ## _h_hpel(dst, src, stride, stride);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
429 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
430 \
3395
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
431 static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc30_c(uint8_t *dst, uint8_t *src, int stride){\
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
432 OPNAME ## cavs_filt ## SIZE ## _h_qpel_r(dst, src, stride, stride);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
433 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
434 \
3395
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
435 static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc01_c(uint8_t *dst, uint8_t *src, int stride){\
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
436 OPNAME ## cavs_filt ## SIZE ## _v_qpel_l(dst, src, stride, stride);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
437 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
438 \
3395
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
439 static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc02_c(uint8_t *dst, uint8_t *src, int stride){\
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
440 OPNAME ## cavs_filt ## SIZE ## _v_hpel(dst, src, stride, stride);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
441 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
442 \
3395
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
443 static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc03_c(uint8_t *dst, uint8_t *src, int stride){\
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
444 OPNAME ## cavs_filt ## SIZE ## _v_qpel_r(dst, src, stride, stride);\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
445 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
446 \
3395
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
447 static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc22_c(uint8_t *dst, uint8_t *src, int stride){\
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
448 OPNAME ## cavs_filt ## SIZE ## _hv_jj(dst, src, NULL, stride, stride); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
449 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
450 \
3395
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
451 static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc11_c(uint8_t *dst, uint8_t *src, int stride){\
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
452 OPNAME ## cavs_filt ## SIZE ## _hv_egpr(dst, src, src, stride, stride); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
453 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
454 \
3395
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
455 static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc13_c(uint8_t *dst, uint8_t *src, int stride){\
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
456 OPNAME ## cavs_filt ## SIZE ## _hv_egpr(dst, src, src+stride, stride, stride); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
457 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
458 \
3395
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
459 static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc31_c(uint8_t *dst, uint8_t *src, int stride){\
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
460 OPNAME ## cavs_filt ## SIZE ## _hv_egpr(dst, src, src+1, stride, stride); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
461 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
462 \
3395
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
463 static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc33_c(uint8_t *dst, uint8_t *src, int stride){\
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
464 OPNAME ## cavs_filt ## SIZE ## _hv_egpr(dst, src, src+stride+1,stride, stride); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
465 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
466 \
3395
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
467 static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc21_c(uint8_t *dst, uint8_t *src, int stride){\
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
468 OPNAME ## cavs_filt ## SIZE ## _hv_ff(dst, src, src+stride+1,stride, stride); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
469 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
470 \
3395
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
471 static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc12_c(uint8_t *dst, uint8_t *src, int stride){\
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
472 OPNAME ## cavs_filt ## SIZE ## _hv_ii(dst, src, src+stride+1,stride, stride); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
473 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
474 \
3395
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
475 static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc32_c(uint8_t *dst, uint8_t *src, int stride){\
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
476 OPNAME ## cavs_filt ## SIZE ## _hv_kk(dst, src, src+stride+1,stride, stride); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
477 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
478 \
3395
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
479 static void ff_ ## OPNAME ## cavs_qpel ## SIZE ## _mc23_c(uint8_t *dst, uint8_t *src, int stride){\
3380
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
480 OPNAME ## cavs_filt ## SIZE ## _hv_qq(dst, src, src+stride+1,stride, stride); \
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
481 }\
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
482
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
483 #define op_put1(a, b) a = cm[((b)+4)>>3]
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
484 #define op_put2(a, b) a = cm[((b)+64)>>7]
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
485 #define op_put3(a, b) a = cm[((b)+32)>>6]
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
486 #define op_put4(a, b) a = cm[((b)+512)>>10]
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
487 #define op_avg1(a, b) a = ((a)+cm[((b)+4)>>3] +1)>>1
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
488 #define op_avg2(a, b) a = ((a)+cm[((b)+64)>>7] +1)>>1
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
489 #define op_avg3(a, b) a = ((a)+cm[((b)+32)>>6] +1)>>1
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
490 #define op_avg4(a, b) a = ((a)+cm[((b)+512)>>10]+1)>>1
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
491 CAVS_SUBPIX(put_ , op_put1, hpel, 0, -1, 5, 5, -1, 0)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
492 CAVS_SUBPIX(put_ , op_put2, qpel_l, -1, -2, 96, 42, -7, 0)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
493 CAVS_SUBPIX(put_ , op_put2, qpel_r, 0, -7, 42, 96, -2, -1)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
494 CAVS_SUBPIX_HV(put_, op_put3, jj, 0, -1, 5, 5, -1, 0, 0, -1, 5, 5, -1, 0, 0)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
495 CAVS_SUBPIX_HV(put_, op_put4, ff, 0, -1, 5, 5, -1, 0, -1, -2, 96, 42, -7, 0, 0)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
496 CAVS_SUBPIX_HV(put_, op_put4, ii, -1, -2, 96, 42, -7, 0, 0, -1, 5, 5, -1, 0, 0)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
497 CAVS_SUBPIX_HV(put_, op_put4, kk, 0, -7, 42, 96, -2, -1, 0, -1, 5, 5, -1, 0, 0)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
498 CAVS_SUBPIX_HV(put_, op_put4, qq, 0, -1, 5, 5, -1, 0, 0, -7, 42, 96, -2,-1, 0)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
499 CAVS_SUBPIX_HV(put_, op_put2, egpr, 0, -1, 5, 5, -1, 0, 0, -1, 5, 5, -1, 0, 1)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
500 CAVS_SUBPIX(avg_ , op_avg1, hpel, 0, -1, 5, 5, -1, 0)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
501 CAVS_SUBPIX(avg_ , op_avg2, qpel_l, -1, -2, 96, 42, -7, 0)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
502 CAVS_SUBPIX(avg_ , op_avg2, qpel_r, 0, -7, 42, 96, -2, -1)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
503 CAVS_SUBPIX_HV(avg_, op_avg3, jj, 0, -1, 5, 5, -1, 0, 0, -1, 5, 5, -1, 0, 0)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
504 CAVS_SUBPIX_HV(avg_, op_avg4, ff, 0, -1, 5, 5, -1, 0, -1, -2, 96, 42, -7, 0, 0)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
505 CAVS_SUBPIX_HV(avg_, op_avg4, ii, -1, -2, 96, 42, -7, 0, 0, -1, 5, 5, -1, 0, 0)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
506 CAVS_SUBPIX_HV(avg_, op_avg4, kk, 0, -7, 42, 96, -2, -1, 0, -1, 5, 5, -1, 0, 0)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
507 CAVS_SUBPIX_HV(avg_, op_avg4, qq, 0, -1, 5, 5, -1, 0, 0, -7, 42, 96, -2,-1, 0)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
508 CAVS_SUBPIX_HV(avg_, op_avg2, egpr, 0, -1, 5, 5, -1, 0, 0, -1, 5, 5, -1, 0, 1)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
509 CAVS_MC(put_, 8)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
510 CAVS_MC(put_, 16)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
511 CAVS_MC(avg_, 8)
1f47e26323bc new files for the CAVS decoder by (Stefan Gehrer <stefan gehrer gmx de)
michael
parents:
diff changeset
512 CAVS_MC(avg_, 16)
3395
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
513
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
514 void ff_put_cavs_qpel8_mc00_c(uint8_t *dst, uint8_t *src, int stride);
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
515 void ff_avg_cavs_qpel8_mc00_c(uint8_t *dst, uint8_t *src, int stride);
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
516 void ff_put_cavs_qpel16_mc00_c(uint8_t *dst, uint8_t *src, int stride);
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
517 void ff_avg_cavs_qpel16_mc00_c(uint8_t *dst, uint8_t *src, int stride);
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
518
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
519 void ff_cavsdsp_init(DSPContext* c, AVCodecContext *avctx) {
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
520 #define dspfunc(PFX, IDX, NUM) \
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
521 c->PFX ## _pixels_tab[IDX][ 0] = ff_ ## PFX ## NUM ## _mc00_c; \
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
522 c->PFX ## _pixels_tab[IDX][ 1] = ff_ ## PFX ## NUM ## _mc10_c; \
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
523 c->PFX ## _pixels_tab[IDX][ 2] = ff_ ## PFX ## NUM ## _mc20_c; \
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
524 c->PFX ## _pixels_tab[IDX][ 3] = ff_ ## PFX ## NUM ## _mc30_c; \
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
525 c->PFX ## _pixels_tab[IDX][ 4] = ff_ ## PFX ## NUM ## _mc01_c; \
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
526 c->PFX ## _pixels_tab[IDX][ 5] = ff_ ## PFX ## NUM ## _mc11_c; \
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
527 c->PFX ## _pixels_tab[IDX][ 6] = ff_ ## PFX ## NUM ## _mc21_c; \
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
528 c->PFX ## _pixels_tab[IDX][ 7] = ff_ ## PFX ## NUM ## _mc31_c; \
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
529 c->PFX ## _pixels_tab[IDX][ 8] = ff_ ## PFX ## NUM ## _mc02_c; \
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
530 c->PFX ## _pixels_tab[IDX][ 9] = ff_ ## PFX ## NUM ## _mc12_c; \
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
531 c->PFX ## _pixels_tab[IDX][10] = ff_ ## PFX ## NUM ## _mc22_c; \
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
532 c->PFX ## _pixels_tab[IDX][11] = ff_ ## PFX ## NUM ## _mc32_c; \
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
533 c->PFX ## _pixels_tab[IDX][12] = ff_ ## PFX ## NUM ## _mc03_c; \
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
534 c->PFX ## _pixels_tab[IDX][13] = ff_ ## PFX ## NUM ## _mc13_c; \
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
535 c->PFX ## _pixels_tab[IDX][14] = ff_ ## PFX ## NUM ## _mc23_c; \
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
536 c->PFX ## _pixels_tab[IDX][15] = ff_ ## PFX ## NUM ## _mc33_c
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
537 dspfunc(put_cavs_qpel, 0, 16);
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
538 dspfunc(put_cavs_qpel, 1, 8);
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
539 dspfunc(avg_cavs_qpel, 0, 16);
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
540 dspfunc(avg_cavs_qpel, 1, 8);
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
541 c->cavs_filter_lv = cavs_filter_lv_c;
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
542 c->cavs_filter_lh = cavs_filter_lh_c;
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
543 c->cavs_filter_cv = cavs_filter_cv_c;
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
544 c->cavs_filter_ch = cavs_filter_ch_c;
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
545 c->cavs_idct8_add = cavs_idct8_add_c;
adccbf4a1040 CAVS decoder by (Stefan Gehrer stefan.gehrer gmx.de)
michael
parents: 3380
diff changeset
546 }