Revision 59006372

View differences:

libavcodec/dsputil.c
3694 3694
    return score;
3695 3695
}
3696 3696

  
3697
static int ssd_int8_vs_int16_c(int8_t *pix1, int16_t *pix2, int size){
3698
    int score=0;
3699
    int i;
3700
    for(i=0; i<size; i++)
3701
        score += (pix1[i]-pix2[i])*(pix1[i]-pix2[i]);
3702
    return score;
3703
}
3704

  
3697 3705
WARPER8_16_SQ(hadamard8_diff8x8_c, hadamard8_diff16_c)
3698 3706
WARPER8_16_SQ(hadamard8_intra8x8_c, hadamard8_intra16_c)
3699 3707
WARPER8_16_SQ(dct_sad8x8_c, dct_sad16_c)
......
4076 4084
    c->w97[1]= w97_8_c;
4077 4085
#endif
4078 4086

  
4087
    c->ssd_int8_vs_int16 = ssd_int8_vs_int16_c;
4088

  
4079 4089
    c->add_bytes= add_bytes_c;
4080 4090
    c->diff_bytes= diff_bytes_c;
4081 4091
    c->sub_hfyu_median_prediction= sub_hfyu_median_prediction_c;
libavcodec/dsputil.h
200 200
    me_cmp_func ildct_cmp[5]; //only width 16 used
201 201
    me_cmp_func frame_skip_cmp[5]; //only width 8 used
202 202

  
203
    int (*ssd_int8_vs_int16)(int8_t *pix1, int16_t *pix2, int size);
204

  
203 205
    /**
204 206
     * Halfpel motion compensation with rounding (a+b+1)>>1.
205 207
     * this is an array[4][4] of motion compensation funcions for 4
libavcodec/i386/dsputil_mmx.c
1730 1730

  
1731 1731
WARPER8_16_SQ(hadamard8_diff_mmx, hadamard8_diff16_mmx)
1732 1732
WARPER8_16_SQ(hadamard8_diff_mmx2, hadamard8_diff16_mmx2)
1733

  
1734
static int ssd_int8_vs_int16_mmx(int8_t *pix1, int16_t *pix2, int size){
1735
    int sum;
1736
    long i=size;
1737
    asm volatile(
1738
        "pxor %%mm4, %%mm4 \n"
1739
        "1: \n"
1740
        "sub $8, %0 \n"
1741
        "movq (%2,%0), %%mm2 \n"
1742
        "movq (%3,%0,2), %%mm0 \n"
1743
        "movq 8(%3,%0,2), %%mm1 \n"
1744
        "punpckhbw %%mm2, %%mm3 \n"
1745
        "punpcklbw %%mm2, %%mm2 \n"
1746
        "psraw $8, %%mm3 \n"
1747
        "psraw $8, %%mm2 \n"
1748
        "psubw %%mm3, %%mm1 \n"
1749
        "psubw %%mm2, %%mm0 \n"
1750
        "pmaddwd %%mm1, %%mm1 \n"
1751
        "pmaddwd %%mm0, %%mm0 \n"
1752
        "paddd %%mm1, %%mm4 \n"
1753
        "paddd %%mm0, %%mm4 \n"
1754
        "jg 1b \n"
1755
        "movq %%mm4, %%mm3 \n"
1756
        "psrlq $32, %%mm3 \n"
1757
        "paddd %%mm3, %%mm4 \n"
1758
        "movd %%mm4, %1 \n"
1759
        :"+r"(i), "=r"(sum)
1760
        :"r"(pix1), "r"(pix2)
1761
    );
1762
    return sum;
1763
}
1764

  
1733 1765
#endif //CONFIG_ENCODERS
1734 1766

  
1735 1767
#define put_no_rnd_pixels8_mmx(a,b,c,d) put_pixels8_mmx(a,b,c,d)
......
3215 3247
        }
3216 3248
        c->add_8x8basis= add_8x8basis_mmx;
3217 3249

  
3250
        c->ssd_int8_vs_int16 = ssd_int8_vs_int16_mmx;
3251

  
3218 3252
#endif //CONFIG_ENCODERS
3219 3253

  
3220 3254
        c->h263_v_loop_filter= h263_v_loop_filter_mmx;
libavcodec/svq1.c
992 992

  
993 993
            for(i=0; i<16; i++){
994 994
                int sum= codebook_sum[stage*16 + i];
995
                int sqr=0;
996
                int diff, mean, score;
995
                int sqr, diff, mean, score;
997 996

  
998 997
                vector = codebook + stage*size*16 + i*size;
999

  
1000
                for(j=0; j<size; j++){
1001
                    int v= vector[j];
1002
                    sqr += (v - block[stage][j])*(v - block[stage][j]);
1003
                }
998
                sqr = s->dsp.ssd_int8_vs_int16(vector, block[stage], size);
1004 999
                diff= block_sum[stage] - sum;
1005 1000
                mean= (diff + (size>>1)) >> (level+3);
1006 1001
                assert(mean >-300 && mean<300);

Also available in: Unified diff