Mercurial > libavcodec.hg
comparison dsputil.c @ 2044:b6f2add2511e libavcodec
h261 decoder by (Maarten Daniels <maarten.daniels at student dot luc dot ac dot be>)
author | michael |
---|---|
date | Sun, 30 May 2004 20:37:15 +0000 |
parents | ef919e9ef73e |
children | 9447bbd8a7e9 |
comparison
equal
deleted
inserted
replaced
2043:703b80c99891 | 2044:b6f2add2511e |
---|---|
2358 src[y*stride-2] = p0 - d2; | 2358 src[y*stride-2] = p0 - d2; |
2359 src[y*stride+1] = p3 + d2; | 2359 src[y*stride+1] = p3 + d2; |
2360 } | 2360 } |
2361 } | 2361 } |
2362 | 2362 |
2363 static void h261_v_loop_filter_c(uint8_t *dest,uint8_t *src, int stride){ | |
2364 int i,j,xy,yz; | |
2365 int res; | |
2366 for(i=0; i<8; i++){ | |
2367 for(j=1; j<7; j++){ | |
2368 xy = j * stride + i; | |
2369 yz = j * 8 + i; | |
2370 res = (int)src[yz-1*8] + ((int)(src[yz+0*8]) * 2) + (int)src[yz+1*8]; | |
2371 res +=2; | |
2372 res >>=2; | |
2373 dest[xy] = (uint8_t)res; | |
2374 } | |
2375 } | |
2376 } | |
2377 | |
2378 static void h261_h_loop_filter_c(uint8_t *dest,uint8_t *src, int stride){ | |
2379 int i,j,xy,yz; | |
2380 int res; | |
2381 for(i=1; i<7; i++){ | |
2382 for(j=0; j<8; j++){ | |
2383 xy = j * stride + i; | |
2384 yz = j * 8 + i; | |
2385 res = (int)src[yz-1] + ((int)(src[yz]) *2) + (int)src[yz+1]; | |
2386 res+=2; | |
2387 res>>=2; | |
2388 dest[xy] = (uint8_t)res; | |
2389 } | |
2390 } | |
2391 } | |
2392 | |
2363 static inline int pix_abs16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) | 2393 static inline int pix_abs16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) |
2364 { | 2394 { |
2365 int s, i; | 2395 int s, i; |
2366 | 2396 |
2367 s = 0; | 2397 s = 0; |
3293 c->bswap_buf= bswap_buf; | 3323 c->bswap_buf= bswap_buf; |
3294 | 3324 |
3295 c->h263_h_loop_filter= h263_h_loop_filter_c; | 3325 c->h263_h_loop_filter= h263_h_loop_filter_c; |
3296 c->h263_v_loop_filter= h263_v_loop_filter_c; | 3326 c->h263_v_loop_filter= h263_v_loop_filter_c; |
3297 | 3327 |
3328 c->h261_h_loop_filter= h261_h_loop_filter_c; | |
3329 c->h261_v_loop_filter= h261_v_loop_filter_c; | |
3330 | |
3298 c->try_8x8basis= try_8x8basis_c; | 3331 c->try_8x8basis= try_8x8basis_c; |
3299 c->add_8x8basis= add_8x8basis_c; | 3332 c->add_8x8basis= add_8x8basis_c; |
3300 | 3333 |
3301 #ifdef HAVE_MMX | 3334 #ifdef HAVE_MMX |
3302 dsputil_init_mmx(c, avctx); | 3335 dsputil_init_mmx(c, avctx); |