Mercurial > libavcodec.hg
comparison i386/dsputil_mmx.c @ 324:9c6f056f0e41 libavcodec
fixed mpeg4 time stuff on encoding
mpeg4 b-frame enoding support
removed old, out-commented ratecontrol
reuse motion compensation code between encoding & decoding
prefix newly added global functions with ff_ to reduce namespace polution
b-frame ME (unfinished, but working)
added some comments to mpegvideo.h
do MC on encoding only once if possible
bugs? ;)
author | michaelni |
---|---|
date | Wed, 17 Apr 2002 04:32:12 +0000 |
parents | c1a8a1b4a24b |
children | 8635a7036395 |
comparison
equal
deleted
inserted
replaced
323:68cc7650c645 | 324:9c6f056f0e41 |
---|---|
41 | 41 |
42 int pix_abs8x8_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); | 42 int pix_abs8x8_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); |
43 int pix_abs8x8_x2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); | 43 int pix_abs8x8_x2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); |
44 int pix_abs8x8_y2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); | 44 int pix_abs8x8_y2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); |
45 int pix_abs8x8_xy2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); | 45 int pix_abs8x8_xy2_mmx2(UINT8 *blk1, UINT8 *blk2, int lx); |
46 | |
47 | 46 |
48 /* external functions, from idct_mmx.c */ | 47 /* external functions, from idct_mmx.c */ |
49 void ff_mmx_idct(DCTELEM *block); | 48 void ff_mmx_idct(DCTELEM *block); |
50 void ff_mmxext_idct(DCTELEM *block); | 49 void ff_mmxext_idct(DCTELEM *block); |
51 | 50 |
132 :"m"(*pix), "m"(*(pix+line_size)) | 131 :"m"(*pix), "m"(*(pix+line_size)) |
133 :"memory"); | 132 :"memory"); |
134 pix += line_size*2; | 133 pix += line_size*2; |
135 p += 16; | 134 p += 16; |
136 } | 135 } |
136 } | |
137 | |
138 static void diff_pixels_mmx(DCTELEM *block, const UINT8 *s1, const UINT8 *s2, int stride) | |
139 { | |
140 asm volatile( | |
141 ".balign 16 \n\t" | |
142 "movl $-128, %%eax \n\t" | |
143 "1: \n\t" | |
144 "movq (%0), %%mm0 \n\t" | |
145 "movq (%1), %%mm2 \n\t" | |
146 "movq %%mm0, %%mm1 \n\t" | |
147 "movq %%mm2, %%mm3 \n\t" | |
148 "punpcklbw %%mm7, %%mm0 \n\t" | |
149 "punpckhbw %%mm7, %%mm1 \n\t" | |
150 "punpcklbw %%mm7, %%mm2 \n\t" | |
151 "punpckhbw %%mm7, %%mm3 \n\t" | |
152 "psubw %%mm2, %%mm0 \n\t" | |
153 "psubw %%mm3, %%mm1 \n\t" | |
154 "movq %%mm0, (%2, %%eax)\n\t" | |
155 "movq %%mm1, 8(%2, %%eax)\n\t" | |
156 "addl %3, %0 \n\t" | |
157 "addl %3, %1 \n\t" | |
158 "addl $16, %%eax \n\t" | |
159 "jnz 1b \n\t" | |
160 : "+r" (s1), "+r" (s2) | |
161 : "r" (block+64), "r" (stride) | |
162 : "%eax" | |
163 ); | |
137 } | 164 } |
138 | 165 |
139 static void put_pixels_clamped_mmx(const DCTELEM *block, UINT8 *pixels, int line_size) | 166 static void put_pixels_clamped_mmx(const DCTELEM *block, UINT8 *pixels, int line_size) |
140 { | 167 { |
141 const DCTELEM *p; | 168 const DCTELEM *p; |
1062 printf("\n"); | 1089 printf("\n"); |
1063 #endif | 1090 #endif |
1064 | 1091 |
1065 if (mm_flags & MM_MMX) { | 1092 if (mm_flags & MM_MMX) { |
1066 get_pixels = get_pixels_mmx; | 1093 get_pixels = get_pixels_mmx; |
1094 diff_pixels = diff_pixels_mmx; | |
1067 put_pixels_clamped = put_pixels_clamped_mmx; | 1095 put_pixels_clamped = put_pixels_clamped_mmx; |
1068 add_pixels_clamped = add_pixels_clamped_mmx; | 1096 add_pixels_clamped = add_pixels_clamped_mmx; |
1069 clear_blocks= clear_blocks_mmx; | 1097 clear_blocks= clear_blocks_mmx; |
1070 | 1098 |
1071 pix_abs16x16 = pix_abs16x16_mmx; | 1099 pix_abs16x16 = pix_abs16x16_mmx; |