Revision 7fb7f636 libavcodec/dsputil.c

View differences:

libavcodec/dsputil.c
3937 3937
    return bits;
3938 3938
}
3939 3939

  
3940
static int vsad_intra16_c(/*MpegEncContext*/ void *c, uint8_t *s, uint8_t *dummy, int stride, int h){
3941
    int score=0;
3942
    int x,y;
3943

  
3944
    for(y=1; y<h; y++){
3945
        for(x=0; x<16; x+=4){
3946
            score+= FFABS(s[x  ] - s[x  +stride]) + FFABS(s[x+1] - s[x+1+stride])
3947
                   +FFABS(s[x+2] - s[x+2+stride]) + FFABS(s[x+3] - s[x+3+stride]);
3948
        }
3949
        s+= stride;
3950
    }
3951

  
3952
    return score;
3953
}
3940
#define VSAD_INTRA(size) \
3941
static int vsad_intra##size##_c(/*MpegEncContext*/ void *c, uint8_t *s, uint8_t *dummy, int stride, int h){ \
3942
    int score=0;                                                                                            \
3943
    int x,y;                                                                                                \
3944
                                                                                                            \
3945
    for(y=1; y<h; y++){                                                                                     \
3946
        for(x=0; x<size; x+=4){                                                                             \
3947
            score+= FFABS(s[x  ] - s[x  +stride]) + FFABS(s[x+1] - s[x+1+stride])                           \
3948
                   +FFABS(s[x+2] - s[x+2+stride]) + FFABS(s[x+3] - s[x+3+stride]);                          \
3949
        }                                                                                                   \
3950
        s+= stride;                                                                                         \
3951
    }                                                                                                       \
3952
                                                                                                            \
3953
    return score;                                                                                           \
3954
}
3955
VSAD_INTRA(8)
3956
VSAD_INTRA(16)
3954 3957

  
3955 3958
static int vsad16_c(/*MpegEncContext*/ void *c, uint8_t *s1, uint8_t *s2, int stride, int h){
3956 3959
    int score=0;
......
3968 3971
}
3969 3972

  
3970 3973
#define SQ(a) ((a)*(a))
3971
static int vsse_intra16_c(/*MpegEncContext*/ void *c, uint8_t *s, uint8_t *dummy, int stride, int h){
3972
    int score=0;
3973
    int x,y;
3974

  
3975
    for(y=1; y<h; y++){
3976
        for(x=0; x<16; x+=4){
3977
            score+= SQ(s[x  ] - s[x  +stride]) + SQ(s[x+1] - s[x+1+stride])
3978
                   +SQ(s[x+2] - s[x+2+stride]) + SQ(s[x+3] - s[x+3+stride]);
3979
        }
3980
        s+= stride;
3981
    }
3982

  
3983
    return score;
3984
}
3974
#define VSSE_INTRA(size) \
3975
static int vsse_intra##size##_c(/*MpegEncContext*/ void *c, uint8_t *s, uint8_t *dummy, int stride, int h){ \
3976
    int score=0;                                                                                            \
3977
    int x,y;                                                                                                \
3978
                                                                                                            \
3979
    for(y=1; y<h; y++){                                                                                     \
3980
        for(x=0; x<size; x+=4){                                                                               \
3981
            score+= SQ(s[x  ] - s[x  +stride]) + SQ(s[x+1] - s[x+1+stride])                                 \
3982
                   +SQ(s[x+2] - s[x+2+stride]) + SQ(s[x+3] - s[x+3+stride]);                                \
3983
        }                                                                                                   \
3984
        s+= stride;                                                                                         \
3985
    }                                                                                                       \
3986
                                                                                                            \
3987
    return score;                                                                                           \
3988
}
3989
VSSE_INTRA(8)
3990
VSSE_INTRA(16)
3985 3991

  
3986 3992
static int vsse16_c(/*MpegEncContext*/ void *c, uint8_t *s1, uint8_t *s2, int stride, int h){
3987 3993
    int score=0;
......
4540 4546

  
4541 4547
    SET_CMP_FUNC(hadamard8_diff)
4542 4548
    c->hadamard8_diff[4]= hadamard8_intra16_c;
4549
    c->hadamard8_diff[5]= hadamard8_intra8x8_c;
4543 4550
    SET_CMP_FUNC(dct_sad)
4544 4551
    SET_CMP_FUNC(dct_max)
4545 4552
#if CONFIG_GPL
......
4555 4562
    SET_CMP_FUNC(bit)
4556 4563
    c->vsad[0]= vsad16_c;
4557 4564
    c->vsad[4]= vsad_intra16_c;
4565
    c->vsad[5]= vsad_intra8_c;
4558 4566
    c->vsse[0]= vsse16_c;
4559 4567
    c->vsse[4]= vsse_intra16_c;
4568
    c->vsse[5]= vsse_intra8_c;
4560 4569
    c->nsse[0]= nsse16_c;
4561 4570
    c->nsse[1]= nsse8_c;
4562 4571
#if CONFIG_SNOW_ENCODER

Also available in: Unified diff