Revision 669ac79c

View differences:

libavcodec/dsputil.c
466 466
#else // 64 bit variant
467 467

  
468 468
#define PIXOP2(OPNAME, OP) \
469
static void OPNAME ## _pixels2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
470
    int i;\
471
    for(i=0; i<h; i++){\
472
        OP(*((uint16_t*)(block  )), LD16(pixels  ));\
473
        pixels+=line_size;\
474
        block +=line_size;\
475
    }\
476
}\
469 477
static void OPNAME ## _pixels4_c(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
470 478
    int i;\
471 479
    for(i=0; i<h; i++){\
......
526 534
    }\
527 535
}\
528 536
\
537
static inline void OPNAME ## _pixels2_l2(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
538
                                                int src_stride1, int src_stride2, int h){\
539
    int i;\
540
    for(i=0; i<h; i++){\
541
        uint32_t a,b;\
542
        a= LD16(&src1[i*src_stride1  ]);\
543
        b= LD16(&src2[i*src_stride2  ]);\
544
        OP(*((uint16_t*)&dst[i*dst_stride  ]), rnd_avg32(a, b));\
545
    }\
546
}\
547
\
529 548
static inline void OPNAME ## _pixels16_l2(uint8_t *dst, const uint8_t *src1, const uint8_t *src2, int dst_stride, \
530 549
                                                int src_stride1, int src_stride2, int h){\
531 550
    OPNAME ## _pixels8_l2(dst  , src1  , src2  , dst_stride, src_stride1, src_stride2, h);\
......
589 608
        OP(*((uint32_t*)&dst[i*dst_stride+4]), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
590 609
    }\
591 610
}\
611
\
612
static inline void OPNAME ## _pixels4_x2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
613
    OPNAME ## _pixels4_l2(block, pixels, pixels+1, line_size, line_size, line_size, h);\
614
}\
615
\
616
static inline void OPNAME ## _pixels4_y2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
617
    OPNAME ## _pixels4_l2(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\
618
}\
619
\
620
static inline void OPNAME ## _pixels2_x2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
621
    OPNAME ## _pixels2_l2(block, pixels, pixels+1, line_size, line_size, line_size, h);\
622
}\
623
\
624
static inline void OPNAME ## _pixels2_y2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h){\
625
    OPNAME ## _pixels2_l2(block, pixels, pixels+line_size, line_size, line_size, line_size, h);\
626
}\
627
\
592 628
static inline void OPNAME ## _no_rnd_pixels8_l4(uint8_t *dst, const uint8_t *src1, uint8_t *src2, uint8_t *src3, uint8_t *src4,\
593 629
                 int dst_stride, int src_stride1, int src_stride2,int src_stride3,int src_stride4, int h){\
594 630
    int i;\
......
635 671
    OPNAME ## _no_rnd_pixels8_l4(dst+8, src1+8, src2+8, src3+8, src4+8, dst_stride, src_stride1, src_stride2, src_stride3, src_stride4, h);\
636 672
}\
637 673
\
674
static inline void OPNAME ## _pixels2_xy2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
675
{\
676
        int i, a0, b0, a1, b1;\
677
        a0= pixels[0];\
678
        b0= pixels[1] + 2;\
679
        a0 += b0;\
680
        b0 += pixels[2];\
681
\
682
        pixels+=line_size;\
683
        for(i=0; i<h; i+=2){\
684
            a1= pixels[0];\
685
            b1= pixels[1];\
686
            a1 += b1;\
687
            b1 += pixels[2];\
688
\
689
            block[0]= (a1+a0)>>2; /* FIXME non put */\
690
            block[1]= (b1+b0)>>2;\
691
\
692
            pixels+=line_size;\
693
            block +=line_size;\
694
\
695
            a0= pixels[0];\
696
            b0= pixels[1] + 2;\
697
            a0 += b0;\
698
            b0 += pixels[2];\
699
\
700
            block[0]= (a1+a0)>>2;\
701
            block[1]= (b1+b0)>>2;\
702
            pixels+=line_size;\
703
            block +=line_size;\
704
        }\
705
}\
706
\
707
static inline void OPNAME ## _pixels4_xy2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
708
{\
709
        int i;\
710
        const uint32_t a= LD32(pixels  );\
711
        const uint32_t b= LD32(pixels+1);\
712
        uint32_t l0=  (a&0x03030303UL)\
713
                    + (b&0x03030303UL)\
714
                    + 0x02020202UL;\
715
        uint32_t h0= ((a&0xFCFCFCFCUL)>>2)\
716
                   + ((b&0xFCFCFCFCUL)>>2);\
717
        uint32_t l1,h1;\
718
\
719
        pixels+=line_size;\
720
        for(i=0; i<h; i+=2){\
721
            uint32_t a= LD32(pixels  );\
722
            uint32_t b= LD32(pixels+1);\
723
            l1=  (a&0x03030303UL)\
724
               + (b&0x03030303UL);\
725
            h1= ((a&0xFCFCFCFCUL)>>2)\
726
              + ((b&0xFCFCFCFCUL)>>2);\
727
            OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
728
            pixels+=line_size;\
729
            block +=line_size;\
730
            a= LD32(pixels  );\
731
            b= LD32(pixels+1);\
732
            l0=  (a&0x03030303UL)\
733
               + (b&0x03030303UL)\
734
               + 0x02020202UL;\
735
            h0= ((a&0xFCFCFCFCUL)>>2)\
736
              + ((b&0xFCFCFCFCUL)>>2);\
737
            OP(*((uint32_t*)block), h0+h1+(((l0+l1)>>2)&0x0F0F0F0FUL));\
738
            pixels+=line_size;\
739
            block +=line_size;\
740
        }\
741
}\
742
\
638 743
static inline void OPNAME ## _pixels8_xy2_c(uint8_t *block, const uint8_t *pixels, int line_size, int h)\
639 744
{\
640 745
    int j;\
......
819 924
        oy += dyy;
820 925
    }
821 926
}
927

  
928
static inline void put_tpel_pixels_mc00_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
929
    switch(width){
930
    case 2: put_pixels2_c (dst, src, stride, height); break;
931
    case 4: put_pixels4_c (dst, src, stride, height); break;
932
    case 8: put_pixels8_c (dst, src, stride, height); break;
933
    case 16:put_pixels16_c(dst, src, stride, height); break;
934
    }
935
}
936

  
937
static inline void put_tpel_pixels_mc10_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
938
    int i,j;
939
    for (i=0; i < height; i++) {
940
      for (j=0; j < width; j++) {
941
	dst[j] = (683*(2*src[j] + src[j+1] + 1)) >> 11;
942
      }
943
      src += stride;
944
      dst += stride;
945
    }
946
}
947

  
948
static inline void put_tpel_pixels_mc20_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
949
    int i,j;
950
    for (i=0; i < height; i++) {
951
      for (j=0; j < width; j++) {
952
	dst[j] = (683*(src[j] + 2*src[j+1] + 1)) >> 11;
953
      }
954
      src += stride;
955
      dst += stride;
956
    }
957
}
958
    
959
static inline void put_tpel_pixels_mc01_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
960
    int i,j;
961
    for (i=0; i < height; i++) {
962
      for (j=0; j < width; j++) {
963
	dst[j] = (683*(2*src[j] + src[j+stride] + 1)) >> 11;
964
      }
965
      src += stride;
966
      dst += stride;
967
    }
968
}
969
    
970
static inline void put_tpel_pixels_mc11_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
971
    int i,j;
972
    for (i=0; i < height; i++) {
973
      for (j=0; j < width; j++) {
974
	dst[j] = (2731*(4*src[j] + 3*src[j+1] + 3*src[j+stride] + 2*src[j+stride+1] + 6)) >> 15;
975
      }
976
      src += stride;
977
      dst += stride;
978
    }
979
}
980

  
981
static inline void put_tpel_pixels_mc12_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
982
    int i,j;
983
    for (i=0; i < height; i++) {
984
      for (j=0; j < width; j++) {
985
	dst[j] = (2731*(3*src[j] + 4*src[j+1] + 2*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15;
986
      }
987
      src += stride;
988
      dst += stride;
989
    }
990
}
991

  
992
static inline void put_tpel_pixels_mc02_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
993
    int i,j;
994
    for (i=0; i < height; i++) {
995
      for (j=0; j < width; j++) {
996
	dst[j] = (683*(src[j] + 2*src[j+stride] + 1)) >> 11;
997
      }
998
      src += stride;
999
      dst += stride;
1000
    }
1001
}
1002

  
1003
static inline void put_tpel_pixels_mc21_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
1004
    int i,j;
1005
    for (i=0; i < height; i++) {
1006
      for (j=0; j < width; j++) {
1007
	dst[j] = (2731*(3*src[j] + 2*src[j+1] + 4*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15;
1008
      }
1009
      src += stride;
1010
      dst += stride;
1011
    }
1012
}
1013

  
1014
static inline void put_tpel_pixels_mc22_c(uint8_t *dst, const uint8_t *src, int stride, int width, int height){
1015
    int i,j;
1016
    for (i=0; i < height; i++) {
1017
      for (j=0; j < width; j++) {
1018
	dst[j] = (2731*(2*src[j] + 3*src[j+1] + 3*src[j+stride] + 4*src[j+stride+1] + 6)) >> 15;
1019
      }
1020
      src += stride;
1021
      dst += stride;
1022
    }
1023
}
1024
#if 0
1025
#define TPEL_WIDTH(width)\
1026
static void put_tpel_pixels ## width ## _mc00_c(uint8_t *dst, const uint8_t *src, int stride, int height){\
1027
    void put_tpel_pixels_mc00_c(dst, src, stride, width, height);}\
1028
static void put_tpel_pixels ## width ## _mc10_c(uint8_t *dst, const uint8_t *src, int stride, int height){\
1029
    void put_tpel_pixels_mc10_c(dst, src, stride, width, height);}\
1030
static void put_tpel_pixels ## width ## _mc20_c(uint8_t *dst, const uint8_t *src, int stride, int height){\
1031
    void put_tpel_pixels_mc20_c(dst, src, stride, width, height);}\
1032
static void put_tpel_pixels ## width ## _mc01_c(uint8_t *dst, const uint8_t *src, int stride, int height){\
1033
    void put_tpel_pixels_mc01_c(dst, src, stride, width, height);}\
1034
static void put_tpel_pixels ## width ## _mc11_c(uint8_t *dst, const uint8_t *src, int stride, int height){\
1035
    void put_tpel_pixels_mc11_c(dst, src, stride, width, height);}\
1036
static void put_tpel_pixels ## width ## _mc21_c(uint8_t *dst, const uint8_t *src, int stride, int height){\
1037
    void put_tpel_pixels_mc21_c(dst, src, stride, width, height);}\
1038
static void put_tpel_pixels ## width ## _mc02_c(uint8_t *dst, const uint8_t *src, int stride, int height){\
1039
    void put_tpel_pixels_mc02_c(dst, src, stride, width, height);}\
1040
static void put_tpel_pixels ## width ## _mc12_c(uint8_t *dst, const uint8_t *src, int stride, int height){\
1041
    void put_tpel_pixels_mc12_c(dst, src, stride, width, height);}\
1042
static void put_tpel_pixels ## width ## _mc22_c(uint8_t *dst, const uint8_t *src, int stride, int height){\
1043
    void put_tpel_pixels_mc22_c(dst, src, stride, width, height);}
1044
#endif
1045

  
822 1046
#define H264_CHROMA_MC(OPNAME, OP)\
823 1047
static void OPNAME ## h264_chroma_mc2_c(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int x, int y){\
824 1048
    const int A=(8-x)*(8-y);\
......
2561 2785
    dspfunc(put_no_rnd, 0, 16);
2562 2786
    dspfunc(put, 1, 8);
2563 2787
    dspfunc(put_no_rnd, 1, 8);
2788
    dspfunc(put, 2, 4);
2789
    dspfunc(put, 3, 2);
2564 2790

  
2565 2791
    dspfunc(avg, 0, 16);
2566 2792
    dspfunc(avg_no_rnd, 0, 16);
......
2568 2794
    dspfunc(avg_no_rnd, 1, 8);
2569 2795
#undef dspfunc
2570 2796

  
2797
    c->put_tpel_pixels_tab[ 0] = put_tpel_pixels_mc00_c;
2798
    c->put_tpel_pixels_tab[ 1] = put_tpel_pixels_mc10_c;
2799
    c->put_tpel_pixels_tab[ 2] = put_tpel_pixels_mc20_c;
2800
    c->put_tpel_pixels_tab[ 4] = put_tpel_pixels_mc01_c;
2801
    c->put_tpel_pixels_tab[ 5] = put_tpel_pixels_mc11_c;
2802
    c->put_tpel_pixels_tab[ 6] = put_tpel_pixels_mc21_c;
2803
    c->put_tpel_pixels_tab[ 8] = put_tpel_pixels_mc02_c;
2804
    c->put_tpel_pixels_tab[ 9] = put_tpel_pixels_mc12_c;
2805
    c->put_tpel_pixels_tab[10] = put_tpel_pixels_mc22_c;
2806

  
2571 2807
#define dspfunc(PFX, IDX, NUM) \
2572 2808
    c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_c; \
2573 2809
    c->PFX ## _pixels_tab[IDX][ 1] = PFX ## NUM ## _mc10_c; \
......
2621 2857
    c->put_mspel_pixels_tab[5]= put_mspel8_mc12_c;
2622 2858
    c->put_mspel_pixels_tab[6]= put_mspel8_mc22_c;
2623 2859
    c->put_mspel_pixels_tab[7]= put_mspel8_mc32_c;
2624
    
2860
        
2625 2861
    c->hadamard8_diff[0]= hadamard8_diff16_c;
2626 2862
    c->hadamard8_diff[1]= hadamard8_diff_c;
2627 2863
    c->hadamard8_abs = hadamard8_abs_c;
libavcodec/dsputil.h
77 77
/* add and put pixel (decoding) */
78 78
// blocksizes for op_pixels_func are 8x4,8x8 16x8 16x16
79 79
typedef void (*op_pixels_func)(uint8_t *block/*align width (8 or 16)*/, const uint8_t *pixels/*align 1*/, int line_size, int h);
80
typedef void (*tpel_mc_func)(uint8_t *block/*align width (8 or 16)*/, const uint8_t *pixels/*align 1*/, int line_size, int w, int h);
80 81
typedef void (*qpel_mc_func)(uint8_t *dst/*align width (8 or 16)*/, uint8_t *src/*align 1*/, int stride);
81 82
typedef void (*h264_chroma_mc_func)(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int srcStride, int h, int x, int y);
82 83

  
......
146 147
    me_cmp_func me_sub_cmp[11];
147 148
    me_cmp_func mb_cmp[11];
148 149

  
149
    /* maybe create an array for 16/8 functions */
150
    /* maybe create an array for 16/8/4/2 functions */
150 151
    /**
151 152
     * Halfpel motion compensation with rounding (a+b+1)>>1.
152
     * this is an array[2][4] of motion compensation funcions for 2 
153
     * horizontal blocksizes (8,16) and the 4 halfpel positions<br>
153
     * this is an array[4][4] of motion compensation funcions for 4 
154
     * horizontal blocksizes (2,4,8,16) and the 4 halfpel positions<br>
154 155
     * *pixels_tab[ 0->16xH 1->8xH ][ xhalfpel + 2*yhalfpel ]
155 156
     * @param block destination where the result is stored
156 157
     * @param pixels source
157 158
     * @param line_size number of bytes in a horizontal line of block
158 159
     * @param h height
159 160
     */
160
    op_pixels_func put_pixels_tab[2][4];
161
    op_pixels_func put_pixels_tab[4][4];
161 162

  
162 163
    /**
163 164
     * Halfpel motion compensation with rounding (a+b+1)>>1.
......
194 195
     * @param h height
195 196
     */
196 197
    op_pixels_func avg_no_rnd_pixels_tab[2][4];
198
    
199
    /**
200
     * Thirdpel motion compensation with rounding (a+b+1)>>1.
201
     * this is an array[12] of motion compensation funcions for the 9 thirdpel positions<br>
202
     * *pixels_tab[ xthirdpel + 4*ythirdpel ]
203
     * @param block destination where the result is stored
204
     * @param pixels source
205
     * @param line_size number of bytes in a horizontal line of block
206
     * @param h height
207
     */
208
    tpel_mc_func put_tpel_pixels_tab[11]; //FIXME individual func ptr per width?
209
    
197 210
    qpel_mc_func put_qpel_pixels_tab[2][16];
198 211
    qpel_mc_func avg_qpel_pixels_tab[2][16];
199 212
    qpel_mc_func put_no_rnd_qpel_pixels_tab[2][16];
......
380 393

  
381 394
struct unaligned_64 { uint64_t l; } __attribute__((packed));
382 395
struct unaligned_32 { uint32_t l; } __attribute__((packed));
396
struct unaligned_16 { uint16_t l; } __attribute__((packed));
383 397

  
398
#define LD16(a) (((const struct unaligned_16 *) (a))->l)
384 399
#define LD32(a) (((const struct unaligned_32 *) (a))->l)
385 400
#define LD64(a) (((const struct unaligned_64 *) (a))->l)
386 401

  
......
388 403

  
389 404
#else /* __GNUC__ */
390 405

  
406
#define LD16(a) (*((uint16_t*)(a)))
391 407
#define LD32(a) (*((uint32_t*)(a)))
392 408
#define LD64(a) (*((uint64_t*)(a)))
393 409

  
libavcodec/svq3.c
262 262
  return 0;
263 263
}
264 264

  
265
static void sixpel_mc_put (MpegEncContext *s,
266
			   uint8_t *src, uint8_t *dst, int stride,
267
			   int dxy, int width, int height) {
268
  int i, j;
269

  
270
  switch (dxy) {
271
  case 6*0+0:
272
    for (i=0; i < height; i++) {
273
      memcpy (dst, src, width);
274
      src += stride;
275
      dst += stride;
276
    }
277
    break;
278
  case 6*0+2:
279
    for (i=0; i < height; i++) {
280
      for (j=0; j < width; j++) {
281
	dst[j] = (683*(2*src[j] + src[j+1] + 1)) >> 11;
282
      }
283
      src += stride;
284
      dst += stride;
285
    }
286
    break;
287
  case 6*0+3:
288
    for (i=0; i < height; i++) {
289
      for (j=0; j < width; j++) {
290
	dst[j] = (src[j] + src[j+1] + 1) >> 1;
291
      }
292
      src += stride;
293
      dst += stride;
294
    }
295
    break;
296
  case 6*0+4:
297
    for (i=0; i < height; i++) {
298
      for (j=0; j < width; j++) {
299
	dst[j] = (683*(src[j] + 2*src[j+1] + 1)) >> 11;
300
      }
301
      src += stride;
302
      dst += stride;
303
    }
304
    break;
305
  case 6*2+0:
306
    for (i=0; i < height; i++) {
307
      for (j=0; j < width; j++) {
308
	dst[j] = (683*(2*src[j] + src[j+stride] + 1)) >> 11;
309
      }
310
      src += stride;
311
      dst += stride;
312
    }
313
    break;
314
  case 6*2+2:
315
    for (i=0; i < height; i++) {
316
      for (j=0; j < width; j++) {
317
	dst[j] = (2731*(4*src[j] + 3*src[j+1] + 3*src[j+stride] + 2*src[j+stride+1] + 6)) >> 15;
318
      }
319
      src += stride;
320
      dst += stride;
321
    }
322
    break;
323
  case 6*2+4:
324
    for (i=0; i < height; i++) {
325
      for (j=0; j < width; j++) {
326
	dst[j] = (2731*(3*src[j] + 4*src[j+1] + 2*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15;
327
      }
328
      src += stride;
329
      dst += stride;
330
    }
331
    break;
332
  case 6*3+0:
333
    for (i=0; i < height; i++) {
334
      for (j=0; j < width; j++) {
335
	dst[j] = (src[j] + src[j+stride]+1) >> 1;
336
      }
337
      src += stride;
338
      dst += stride;
339
    }
340
    break;
341
  case 6*3+3:
342
    for (i=0; i < height; i++) {
343
      for (j=0; j < width; j++) {
344
	dst[j] = (src[j] + src[j+1] + src[j+stride] + src[j+stride+1] + 2) >> 2;
345
      }
346
      src += stride;
347
      dst += stride;
348
    }
349
    break;
350
  case 6*4+0:
351
    for (i=0; i < height; i++) {
352
      for (j=0; j < width; j++) {
353
	dst[j] = (683*(src[j] + 2*src[j+stride] + 1)) >> 11;
354
      }
355
      src += stride;
356
      dst += stride;
357
    }
358
    break;
359
  case 6*4+2:
360
    for (i=0; i < height; i++) {
361
      for (j=0; j < width; j++) {
362
	dst[j] = (2731*(3*src[j] + 2*src[j+1] + 4*src[j+stride] + 3*src[j+stride+1] + 6)) >> 15;
363
      }
364
      src += stride;
365
      dst += stride;
366
    }
367
    break;
368
  case 6*4+4:
369
    for (i=0; i < height; i++) {
370
      for (j=0; j < width; j++) {
371
	dst[j] = (2731*(2*src[j] + 3*src[j+1] + 3*src[j+stride] + 4*src[j+stride+1] + 6)) >> 15;
372
      }
373
      src += stride;
374
      dst += stride;
375
    }
376
    break;
377
  }
378
}
379

  
380 265
static inline void svq3_mc_dir_part (MpegEncContext *s, int x, int y,
381
				     int width, int height, int mx, int my, int dxy) {
266
				     int width, int height, int mx, int my, int dxy, int thirdpel) {
382 267
  uint8_t *src, *dest;
383 268
  int i, emu = 0;
269
  int blocksize= 2 - (width>>3); //16->0, 8->1, 4->2
384 270

  
385 271
  mx += x;
386 272
  my += y;
......
405 291
			 mx, my, s->width, s->height);
406 292
    src = s->edge_emu_buffer;
407 293
  }
408
  sixpel_mc_put (s, src, dest, s->linesize, dxy, width, height);
294
  if(thirdpel)
295
    s->dsp.put_tpel_pixels_tab[dxy](dest, src, s->linesize, width, height);
296
  else
297
    s->dsp.put_pixels_tab[blocksize][dxy](dest, src, s->linesize, height);
409 298

  
410 299
  if (!(s->flags & CODEC_FLAG_GRAY)) {
411 300
    mx	   = (mx + (mx < (int) x)) >> 1;
412 301
    my	   = (my + (my < (int) y)) >> 1;
413 302
    width  = (width  >> 1);
414 303
    height = (height >> 1);
304
    blocksize++;
415 305

  
416 306
    for (i=1; i < 3; i++) {
417 307
      dest = s->current_picture.data[i] + (x >> 1) + (y >> 1)*s->uvlinesize;
......
422 312
			     mx, my, (s->width >> 1), (s->height >> 1));
423 313
	src = s->edge_emu_buffer;
424 314
      }
425
      sixpel_mc_put (s, src, dest, s->uvlinesize, dxy, width, height);
315
      if(thirdpel)
316
        s->dsp.put_tpel_pixels_tab[dxy](dest, src, s->uvlinesize, width, height);
317
      else
318
        s->dsp.put_pixels_tab[blocksize][dxy](dest, src, s->uvlinesize, height);
426 319
    }
427 320
  }
428 321
}
......
441 334
  h->topright_samples_available	= 0xFFFF;
442 335

  
443 336
  if (mb_type == 0) {		/* SKIP */
444
    svq3_mc_dir_part (s, 16*s->mb_x, 16*s->mb_y, 16, 16, 0, 0, 0);
337
    svq3_mc_dir_part (s, 16*s->mb_x, 16*s->mb_y, 16, 16, 0, 0, 0, 0);
445 338

  
446 339
    cbp = 0;
447 340
    mb_type = MB_TYPE_SKIP;
......
521 414
          my = ((my + 1)>>1) + dy;
522 415
          fx= ((unsigned)(mx + 0x3000))/3 - 0x1000;
523 416
          fy= ((unsigned)(my + 0x3000))/3 - 0x1000;
524
          dxy= 2*(mx - 3*fx) + 2*6*(my - 3*fy);
417
          dxy= (mx - 3*fx) + 4*(my - 3*fy);
525 418

  
526
          svq3_mc_dir_part (s, x, y, part_width, part_height, fx, fy, dxy);
419
          svq3_mc_dir_part (s, x, y, part_width, part_height, fx, fy, dxy, 1);
527 420
          mx += mx;
528 421
          my += my;
529 422
	} else if (mode == HALFPEL_MODE) {
530 423
	  mx = ((unsigned)(mx + 1 + 0x3000))/3 + dx - 0x1000;
531 424
	  my = ((unsigned)(my + 1 + 0x3000))/3 + dy - 0x1000;
532
          dxy= 3*(mx&1) + 6*3*(my&1);
425
          dxy= (mx&1) + 2*(my&1);
533 426

  
534
          svq3_mc_dir_part (s, x, y, part_width, part_height, mx>>1, my>>1, dxy);
427
          svq3_mc_dir_part (s, x, y, part_width, part_height, mx>>1, my>>1, dxy, 0);
535 428
          mx *= 3;
536 429
          my *= 3;
537 430
	} else {
......
539 432
	  mx = ((unsigned)(mx + 3 + 0x6000))/6 + dx - 0x1000;
540 433
	  my = ((unsigned)(my + 3 + 0x6000))/6 + dy - 0x1000;
541 434

  
542
	  svq3_mc_dir_part (s, x, y, part_width, part_height, mx, my, 0);
435
	  svq3_mc_dir_part (s, x, y, part_width, part_height, mx, my, 0, 0);
543 436
          mx *= 6;
544 437
          my *= 6;
545 438
	}

Also available in: Unified diff