comparison vp6.c @ 8785:bee83b3f9a6b libavcodec

move vp6_filter_diag4() to a new vp6dsp.c file and use it throught dsputil
author aurel
date Mon, 09 Feb 2009 23:37:31 +0000
parents e9d9d946f213
children 0dce4fe6e6f3
comparison
equal deleted inserted replaced
8784:7c47da8e2cf8 8785:bee83b3f9a6b
529 uint8_t *tmp = s->edge_emu_buffer+16; 529 uint8_t *tmp = s->edge_emu_buffer+16;
530 s->dsp.put_h264_chroma_pixels_tab[0](tmp, src, stride, 9, h_weight, 0); 530 s->dsp.put_h264_chroma_pixels_tab[0](tmp, src, stride, 9, h_weight, 0);
531 s->dsp.put_h264_chroma_pixels_tab[0](dst, tmp, stride, 8, 0, v_weight); 531 s->dsp.put_h264_chroma_pixels_tab[0](dst, tmp, stride, 8, 0, v_weight);
532 } 532 }
533 533
534 static void vp6_filter_diag4(uint8_t *dst, uint8_t *src, int stride,
535 const int16_t *h_weights,const int16_t *v_weights)
536 {
537 int x, y;
538 int tmp[8*11];
539 int *t = tmp;
540
541 src -= stride;
542
543 for (y=0; y<11; y++) {
544 for (x=0; x<8; x++) {
545 t[x] = av_clip_uint8(( src[x-1] * h_weights[0]
546 + src[x ] * h_weights[1]
547 + src[x+1] * h_weights[2]
548 + src[x+2] * h_weights[3] + 64) >> 7);
549 }
550 src += stride;
551 t += 8;
552 }
553
554 t = tmp + 8;
555 for (y=0; y<8; y++) {
556 for (x=0; x<8; x++) {
557 dst[x] = av_clip_uint8(( t[x-8 ] * v_weights[0]
558 + t[x ] * v_weights[1]
559 + t[x+8 ] * v_weights[2]
560 + t[x+16] * v_weights[3] + 64) >> 7);
561 }
562 dst += stride;
563 t += 8;
564 }
565 }
566
567 static void vp6_filter(VP56Context *s, uint8_t *dst, uint8_t *src, 534 static void vp6_filter(VP56Context *s, uint8_t *dst, uint8_t *src,
568 int offset1, int offset2, int stride, 535 int offset1, int offset2, int stride,
569 VP56mv mv, int mask, int select, int luma) 536 VP56mv mv, int mask, int select, int luma)
570 { 537 {
571 int filter4 = 0; 538 int filter4 = 0;
599 vp6_block_copy_filter[select][x8]); 566 vp6_block_copy_filter[select][x8]);
600 } else if (!x8) { /* above or below combine */ 567 } else if (!x8) { /* above or below combine */
601 vp6_filter_hv4(dst, src+offset1, stride, stride, 568 vp6_filter_hv4(dst, src+offset1, stride, stride,
602 vp6_block_copy_filter[select][y8]); 569 vp6_block_copy_filter[select][y8]);
603 } else { 570 } else {
604 vp6_filter_diag4(dst, src+offset1 + ((mv.x^mv.y)>>31), stride, 571 s->dsp.vp6_filter_diag4(dst, src+offset1+((mv.x^mv.y)>>31), stride,
605 vp6_block_copy_filter[select][x8], 572 vp6_block_copy_filter[select][x8],
606 vp6_block_copy_filter[select][y8]); 573 vp6_block_copy_filter[select][y8]);
607 } 574 }
608 } else { 575 } else {
609 if (!x8 || !y8) { 576 if (!x8 || !y8) {