Mercurial > libavcodec.hg
comparison intrax8dsp.c @ 5907:fbd10e6dfbe1 libavcodec
cosmetics: Fix spacial --> spatial typo in function names.
author | diego |
---|---|
date | Sat, 10 Nov 2007 12:24:02 +0000 |
parents | 595a2f31430e |
children | e9d9d946f213 |
comparison
equal
deleted
inserted
replaced
5906:595a2f31430e | 5907:fbd10e6dfbe1 |
---|---|
59 1 - mb_x==0 - first block in the row, interpolate area #1,#2,#3; | 59 1 - mb_x==0 - first block in the row, interpolate area #1,#2,#3; |
60 2 - mb_y==0 - first row, interpolate area #3,#4,#5,#6; | 60 2 - mb_y==0 - first row, interpolate area #3,#4,#5,#6; |
61 note: 1|2 - mb_x==mb_y==0 - first block, use 0x80 value for all areas; | 61 note: 1|2 - mb_x==mb_y==0 - first block, use 0x80 value for all areas; |
62 4 - mb_x>= (mb_width-1) last block in the row, interpolate area #5; | 62 4 - mb_x>= (mb_width-1) last block in the row, interpolate area #5; |
63 */ | 63 */ |
64 static void x8_setup_spacial_compensation(uint8_t *src, uint8_t *dst, int linesize, | 64 static void x8_setup_spatial_compensation(uint8_t *src, uint8_t *dst, int linesize, |
65 int * range, int * psum, int edges){ | 65 int * range, int * psum, int edges){ |
66 uint8_t * ptr; | 66 uint8_t * ptr; |
67 int sum; | 67 int sum; |
68 int i; | 68 int i; |
69 int min_pix,max_pix; | 69 int min_pix,max_pix; |
145 161, 855, 206, 788, 266, 710, 340, 623, 411, 548, 455, 455, 548, 366, 576, 288, | 145 161, 855, 206, 788, 266, 710, 340, 623, 411, 548, 455, 455, 548, 366, 576, 288, |
146 122, 972, 159, 914, 211, 842, 276, 758, 341, 682, 389, 584, 483, 483, 520, 390, | 146 122, 972, 159, 914, 211, 842, 276, 758, 341, 682, 389, 584, 483, 483, 520, 390, |
147 110, 1172, 144, 1107, 193, 1028, 254, 932, 317, 846, 366, 731, 458, 611, 499, 499 | 147 110, 1172, 144, 1107, 193, 1028, 254, 932, 317, 846, 366, 731, 458, 611, 499, 499 |
148 }; | 148 }; |
149 | 149 |
150 static void spacial_compensation_0(uint8_t *src , uint8_t *dst, int linesize){ | 150 static void spatial_compensation_0(uint8_t *src , uint8_t *dst, int linesize){ |
151 int i,j; | 151 int i,j; |
152 int x,y; | 152 int x,y; |
153 unsigned int p;//power divided by 2 | 153 unsigned int p;//power divided by 2 |
154 int a; | 154 int a; |
155 uint16_t left_sum[2][8]; | 155 uint16_t left_sum[2][8]; |
200 )>>16; | 200 )>>16; |
201 } | 201 } |
202 dst+=linesize; | 202 dst+=linesize; |
203 } | 203 } |
204 } | 204 } |
205 static void spacial_compensation_1(uint8_t *src , uint8_t *dst, int linesize){ | 205 static void spatial_compensation_1(uint8_t *src , uint8_t *dst, int linesize){ |
206 int x,y; | 206 int x,y; |
207 | 207 |
208 for(y=0;y<8;y++){ | 208 for(y=0;y<8;y++){ |
209 for(x=0;x<8;x++){ | 209 for(x=0;x<8;x++){ |
210 dst[x]=src[area4 + FFMIN(2*y+x+2, 15) ]; | 210 dst[x]=src[area4 + FFMIN(2*y+x+2, 15) ]; |
211 } | 211 } |
212 dst+=linesize; | 212 dst+=linesize; |
213 } | 213 } |
214 } | 214 } |
215 static void spacial_compensation_2(uint8_t *src , uint8_t *dst, int linesize){ | 215 static void spatial_compensation_2(uint8_t *src , uint8_t *dst, int linesize){ |
216 int x,y; | 216 int x,y; |
217 | 217 |
218 for(y=0;y<8;y++){ | 218 for(y=0;y<8;y++){ |
219 for(x=0;x<8;x++){ | 219 for(x=0;x<8;x++){ |
220 dst[x]=src[area4 +1+y+x]; | 220 dst[x]=src[area4 +1+y+x]; |
221 } | 221 } |
222 dst+=linesize; | 222 dst+=linesize; |
223 } | 223 } |
224 } | 224 } |
225 static void spacial_compensation_3(uint8_t *src , uint8_t *dst, int linesize){ | 225 static void spatial_compensation_3(uint8_t *src , uint8_t *dst, int linesize){ |
226 int x,y; | 226 int x,y; |
227 | 227 |
228 for(y=0;y<8;y++){ | 228 for(y=0;y<8;y++){ |
229 for(x=0;x<8;x++){ | 229 for(x=0;x<8;x++){ |
230 dst[x]=src[area4 +((y+1)>>1)+x]; | 230 dst[x]=src[area4 +((y+1)>>1)+x]; |
231 } | 231 } |
232 dst+=linesize; | 232 dst+=linesize; |
233 } | 233 } |
234 } | 234 } |
235 static void spacial_compensation_4(uint8_t *src , uint8_t *dst, int linesize){ | 235 static void spatial_compensation_4(uint8_t *src , uint8_t *dst, int linesize){ |
236 int x,y; | 236 int x,y; |
237 | 237 |
238 for(y=0;y<8;y++){ | 238 for(y=0;y<8;y++){ |
239 for(x=0;x<8;x++){ | 239 for(x=0;x<8;x++){ |
240 dst[x]=( src[area4+x] + src[area6+x] + 1 )>>1; | 240 dst[x]=( src[area4+x] + src[area6+x] + 1 )>>1; |
241 } | 241 } |
242 dst+=linesize; | 242 dst+=linesize; |
243 } | 243 } |
244 } | 244 } |
245 static void spacial_compensation_5(uint8_t *src , uint8_t *dst, int linesize){ | 245 static void spatial_compensation_5(uint8_t *src , uint8_t *dst, int linesize){ |
246 int x,y; | 246 int x,y; |
247 | 247 |
248 for(y=0;y<8;y++){ | 248 for(y=0;y<8;y++){ |
249 for(x=0;x<8;x++){ | 249 for(x=0;x<8;x++){ |
250 if(2*x-y<0){ | 250 if(2*x-y<0){ |
254 } | 254 } |
255 } | 255 } |
256 dst+=linesize; | 256 dst+=linesize; |
257 } | 257 } |
258 } | 258 } |
259 static void spacial_compensation_6(uint8_t *src , uint8_t *dst, int linesize){ | 259 static void spatial_compensation_6(uint8_t *src , uint8_t *dst, int linesize){ |
260 int x,y; | 260 int x,y; |
261 | 261 |
262 for(y=0;y<8;y++){ | 262 for(y=0;y<8;y++){ |
263 for(x=0;x<8;x++){ | 263 for(x=0;x<8;x++){ |
264 dst[x]=src[area3+x-y]; | 264 dst[x]=src[area3+x-y]; |
265 } | 265 } |
266 dst+=linesize; | 266 dst+=linesize; |
267 } | 267 } |
268 } | 268 } |
269 static void spacial_compensation_7(uint8_t *src , uint8_t *dst, int linesize){ | 269 static void spatial_compensation_7(uint8_t *src , uint8_t *dst, int linesize){ |
270 int x,y; | 270 int x,y; |
271 | 271 |
272 for(y=0;y<8;y++){ | 272 for(y=0;y<8;y++){ |
273 for(x=0;x<8;x++){ | 273 for(x=0;x<8;x++){ |
274 if(x-2*y>0){ | 274 if(x-2*y>0){ |
278 } | 278 } |
279 } | 279 } |
280 dst+=linesize; | 280 dst+=linesize; |
281 } | 281 } |
282 } | 282 } |
283 static void spacial_compensation_8(uint8_t *src , uint8_t *dst, int linesize){ | 283 static void spatial_compensation_8(uint8_t *src , uint8_t *dst, int linesize){ |
284 int x,y; | 284 int x,y; |
285 | 285 |
286 for(y=0;y<8;y++){ | 286 for(y=0;y<8;y++){ |
287 for(x=0;x<8;x++){ | 287 for(x=0;x<8;x++){ |
288 dst[x]=( src[area1+7-y] + src[area2+7-y] + 1 )>>1; | 288 dst[x]=( src[area1+7-y] + src[area2+7-y] + 1 )>>1; |
289 } | 289 } |
290 dst+=linesize; | 290 dst+=linesize; |
291 } | 291 } |
292 } | 292 } |
293 static void spacial_compensation_9(uint8_t *src , uint8_t *dst, int linesize){ | 293 static void spatial_compensation_9(uint8_t *src , uint8_t *dst, int linesize){ |
294 int x,y; | 294 int x,y; |
295 | 295 |
296 for(y=0;y<8;y++){ | 296 for(y=0;y<8;y++){ |
297 for(x=0;x<8;x++){ | 297 for(x=0;x<8;x++){ |
298 dst[x]=src[area2+6-FFMIN(x+y,6)]; | 298 dst[x]=src[area2+6-FFMIN(x+y,6)]; |
299 } | 299 } |
300 dst+=linesize; | 300 dst+=linesize; |
301 } | 301 } |
302 } | 302 } |
303 static void spacial_compensation_10(uint8_t *src , uint8_t *dst, int linesize){ | 303 static void spatial_compensation_10(uint8_t *src , uint8_t *dst, int linesize){ |
304 int x,y; | 304 int x,y; |
305 | 305 |
306 for(y=0;y<8;y++){ | 306 for(y=0;y<8;y++){ |
307 for(x=0;x<8;x++){ | 307 for(x=0;x<8;x++){ |
308 dst[x]=(src[area2+7-y]*(8-x)+src[area4+x]*x+4)>>3; | 308 dst[x]=(src[area2+7-y]*(8-x)+src[area4+x]*x+4)>>3; |
309 } | 309 } |
310 dst+=linesize; | 310 dst+=linesize; |
311 } | 311 } |
312 } | 312 } |
313 static void spacial_compensation_11(uint8_t *src , uint8_t *dst, int linesize){ | 313 static void spatial_compensation_11(uint8_t *src , uint8_t *dst, int linesize){ |
314 int x,y; | 314 int x,y; |
315 | 315 |
316 for(y=0;y<8;y++){ | 316 for(y=0;y<8;y++){ |
317 for(x=0;x<8;x++){ | 317 for(x=0;x<8;x++){ |
318 dst[x]=(src[area2+7-y]*y+src[area4+x]*(8-y)+4)>>3; | 318 dst[x]=(src[area2+7-y]*y+src[area4+x]*(8-y)+4)>>3; |
414 } | 414 } |
415 | 415 |
416 void ff_intrax8dsp_init(DSPContext* dsp, AVCodecContext *avctx) { | 416 void ff_intrax8dsp_init(DSPContext* dsp, AVCodecContext *avctx) { |
417 dsp->x8_h_loop_filter=x8_h_loop_filter; | 417 dsp->x8_h_loop_filter=x8_h_loop_filter; |
418 dsp->x8_v_loop_filter=x8_v_loop_filter; | 418 dsp->x8_v_loop_filter=x8_v_loop_filter; |
419 dsp->x8_setup_spacial_compensation=x8_setup_spacial_compensation; | 419 dsp->x8_setup_spatial_compensation=x8_setup_spatial_compensation; |
420 dsp->x8_spacial_compensation[0]=spacial_compensation_0; | 420 dsp->x8_spatial_compensation[0]=spatial_compensation_0; |
421 dsp->x8_spacial_compensation[1]=spacial_compensation_1; | 421 dsp->x8_spatial_compensation[1]=spatial_compensation_1; |
422 dsp->x8_spacial_compensation[2]=spacial_compensation_2; | 422 dsp->x8_spatial_compensation[2]=spatial_compensation_2; |
423 dsp->x8_spacial_compensation[3]=spacial_compensation_3; | 423 dsp->x8_spatial_compensation[3]=spatial_compensation_3; |
424 dsp->x8_spacial_compensation[4]=spacial_compensation_4; | 424 dsp->x8_spatial_compensation[4]=spatial_compensation_4; |
425 dsp->x8_spacial_compensation[5]=spacial_compensation_5; | 425 dsp->x8_spatial_compensation[5]=spatial_compensation_5; |
426 dsp->x8_spacial_compensation[6]=spacial_compensation_6; | 426 dsp->x8_spatial_compensation[6]=spatial_compensation_6; |
427 dsp->x8_spacial_compensation[7]=spacial_compensation_7; | 427 dsp->x8_spatial_compensation[7]=spatial_compensation_7; |
428 dsp->x8_spacial_compensation[8]=spacial_compensation_8; | 428 dsp->x8_spatial_compensation[8]=spatial_compensation_8; |
429 dsp->x8_spacial_compensation[9]=spacial_compensation_9; | 429 dsp->x8_spatial_compensation[9]=spatial_compensation_9; |
430 dsp->x8_spacial_compensation[10]=spacial_compensation_10; | 430 dsp->x8_spatial_compensation[10]=spatial_compensation_10; |
431 dsp->x8_spacial_compensation[11]=spacial_compensation_11; | 431 dsp->x8_spatial_compensation[11]=spatial_compensation_11; |
432 } | 432 } |