comparison libmpeg2/motion_comp_arm.c @ 27572:da2271c341ee

Update internal libmpeg2 copy to version 0.5.1.
author diego
date Sat, 13 Sep 2008 17:31:45 +0000
parents f0ddd02aec27
children 25337a2147e7
comparison
equal deleted inserted replaced
27571:fd18fa10de53 27572:da2271c341ee
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details. 16 * GNU General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software 19 * along with mpeg2dec; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */ 21 */
22 22
23 #include "config.h" 23 #include "config.h"
24 24
28 28
29 #include "mpeg2.h" 29 #include "mpeg2.h"
30 #include "attributes.h" 30 #include "attributes.h"
31 #include "mpeg2_internal.h" 31 #include "mpeg2_internal.h"
32 32
33 #define avg2(a,b) ((a+b+1)>>1) 33 #define avg2(a,b) ((a+b+1)>>1)
34 #define avg4(a,b,c,d) ((a+b+c+d+2)>>2) 34 #define avg4(a,b,c,d) ((a+b+c+d+2)>>2)
35 35
36 #define predict_o(i) (ref[i]) 36 #define predict_o(i) (ref[i])
37 #define predict_x(i) (avg2 (ref[i], ref[i+1])) 37 #define predict_x(i) (avg2 (ref[i], ref[i+1]))
38 #define predict_y(i) (avg2 (ref[i], (ref+stride)[i])) 38 #define predict_y(i) (avg2 (ref[i], (ref+stride)[i]))
39 #define predict_xy(i) (avg4 (ref[i], ref[i+1], \ 39 #define predict_xy(i) (avg4 (ref[i], ref[i+1], \
40 (ref+stride)[i], (ref+stride)[i+1])) 40 (ref+stride)[i], (ref+stride)[i+1]))
41 41
42 #define put(predictor,i) dest[i] = predictor (i) 42 #define put(predictor,i) dest[i] = predictor (i)
43 #define avg(predictor,i) dest[i] = avg2 (predictor (i), dest[i]) 43 #define avg(predictor,i) dest[i] = avg2 (predictor (i), dest[i])
65 op (predict_##xy, 13); \ 65 op (predict_##xy, 13); \
66 op (predict_##xy, 14); \ 66 op (predict_##xy, 14); \
67 op (predict_##xy, 15); \ 67 op (predict_##xy, 15); \
68 ref += stride; \ 68 ref += stride; \
69 dest += stride; \ 69 dest += stride; \
70 } while (--height); \ 70 } while (--height); \
71 } \ 71 } \
72 static void MC_##op##_##xy##_8_c (uint8_t * dest, const uint8_t * ref, \ 72 static void MC_##op##_##xy##_8_c (uint8_t * dest, const uint8_t * ref, \
73 const int stride, int height) \ 73 const int stride, int height) \
74 { \ 74 { \
75 do { \ 75 do { \
81 op (predict_##xy, 5); \ 81 op (predict_##xy, 5); \
82 op (predict_##xy, 6); \ 82 op (predict_##xy, 6); \
83 op (predict_##xy, 7); \ 83 op (predict_##xy, 7); \
84 ref += stride; \ 84 ref += stride; \
85 dest += stride; \ 85 dest += stride; \
86 } while (--height); \ 86 } while (--height); \
87 } \ 87 } \
88 /* definitions of the actual mc functions */ 88 /* definitions of the actual mc functions */
89 89
90 MC_FUNC (put,o)
91 MC_FUNC (avg,o) 90 MC_FUNC (avg,o)
92 MC_FUNC (put,x)
93 MC_FUNC (avg,x) 91 MC_FUNC (avg,x)
94 MC_FUNC (put,y) 92 MC_FUNC (put,y)
95 MC_FUNC (avg,y) 93 MC_FUNC (avg,y)
96 MC_FUNC (put,xy) 94 MC_FUNC (put,xy)
97 MC_FUNC (avg,xy) 95 MC_FUNC (avg,xy)
115 { 113 {
116 MC_put_xy_16_c(dest, ref, stride, height); 114 MC_put_xy_16_c(dest, ref, stride, height);
117 } 115 }
118 116
119 extern void MC_put_o_8_arm (uint8_t * dest, const uint8_t * ref, 117 extern void MC_put_o_8_arm (uint8_t * dest, const uint8_t * ref,
120 int stride, int height); 118 int stride, int height);
121 119
122 extern void MC_put_x_8_arm (uint8_t * dest, const uint8_t * ref, 120 extern void MC_put_x_8_arm (uint8_t * dest, const uint8_t * ref,
123 int stride, int height); 121 int stride, int height);
124 122
125 static void MC_put_y_8_arm (uint8_t * dest, const uint8_t * ref, 123 static void MC_put_y_8_arm (uint8_t * dest, const uint8_t * ref,