Revision d4c5d2ad

View differences:

libavcodec/avcodec.h
17 17

  
18 18
#define FFMPEG_VERSION_INT     0x000408
19 19
#define FFMPEG_VERSION         "0.4.8"
20
#define LIBAVCODEC_BUILD       4715
20
#define LIBAVCODEC_BUILD       4716
21 21

  
22 22
#define LIBAVCODEC_VERSION_INT FFMPEG_VERSION_INT
23 23
#define LIBAVCODEC_VERSION     FFMPEG_VERSION
......
1591 1591
     int mb_threshold;
1592 1592

  
1593 1593
    /**
1594
     * 
1594
     * precision of the intra dc coefficient - 8.
1595 1595
     * - encoding: set by user
1596 1596
     * - decoding: unused
1597 1597
     */
1598 1598
     int intra_dc_precision;
1599

  
1600
    /**
1601
     * noise vs. sse weight for the nsse comparsion function.
1602
     * - encoding: set by user
1603
     * - decoding: unused
1604
     */
1605
     int nsse_weight;
1599 1606
} AVCodecContext;
1600 1607

  
1601 1608

  
libavcodec/dsputil.c
2587 2587
    return s;
2588 2588
}
2589 2589

  
2590
static int nsse16_c(/*MpegEncContext*/ void *c, uint8_t *s1, uint8_t *s2, int stride, int h){
2590
static int nsse16_c(MpegEncContext *c, uint8_t *s1, uint8_t *s2, int stride, int h){
2591 2591
    int score1=0;
2592 2592
    int score2=0;
2593 2593
    int x,y;
2594
    
2594

  
2595 2595
    for(y=0; y<h; y++){
2596 2596
        for(x=0; x<16; x++){
2597 2597
            score1+= (s1[x  ] - s2[x ])*(s1[x  ] - s2[x ]);
......
2607 2607
        s1+= stride;
2608 2608
        s2+= stride;
2609 2609
    }
2610
    
2611
    return score1 + ABS(score2)*8;
2610

  
2611
    if(c) return score1 + ABS(score2)*c->avctx->nsse_weight;
2612
    else  return score1 + ABS(score2)*8;
2612 2613
}
2613 2614

  
2614
static int nsse8_c(/*MpegEncContext*/ void *c, uint8_t *s1, uint8_t *s2, int stride, int h){
2615
static int nsse8_c(MpegEncContext *c, uint8_t *s1, uint8_t *s2, int stride, int h){
2615 2616
    int score1=0;
2616 2617
    int score2=0;
2617 2618
    int x,y;
......
2632 2633
        s2+= stride;
2633 2634
    }
2634 2635
    
2635
    return score1 + ABS(score2)*8;
2636
    if(c) return score1 + ABS(score2)*c->avctx->nsse_weight;
2637
    else  return score1 + ABS(score2)*8;
2636 2638
}
2637 2639

  
2638 2640
static int try_8x8basis_c(int16_t rem[64], int16_t weight[64], int16_t basis[64], int scale){
libavcodec/motion_est.c
223 223
    switch(type&0xFF){
224 224
    default:
225 225
    case FF_CMP_SAD:
226
    case FF_CMP_NSSE:
227 226
        return s->lambda>>FF_LAMBDA_SHIFT;
228 227
    case FF_CMP_DCT:
229 228
        return (3*s->lambda)>>(FF_LAMBDA_SHIFT+1);
......
232 231
    case FF_CMP_RD:
233 232
    case FF_CMP_PSNR:
234 233
    case FF_CMP_SSE:
234
    case FF_CMP_NSSE:
235 235
        return s->lambda2>>FF_LAMBDA_SHIFT;
236 236
    case FF_CMP_BIT:
237 237
        return 1;
libavcodec/mpegvideo.c
3917 3917

  
3918 3918
    if(w==16 && h==16)
3919 3919
      if(s->avctx->mb_cmp == FF_CMP_NSSE){
3920
        return  s->dsp.nsse[0](NULL, s->new_picture.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], s->linesize, 16)
3921
               +s->dsp.nsse[1](NULL, s->new_picture.data[1] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[1], s->uvlinesize, 8)
3922
               +s->dsp.nsse[1](NULL, s->new_picture.data[2] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[2], s->uvlinesize, 8);
3920
        return  s->dsp.nsse[0](s, s->new_picture.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], s->linesize, 16)
3921
               +s->dsp.nsse[1](s, s->new_picture.data[1] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[1], s->uvlinesize, 8)
3922
               +s->dsp.nsse[1](s, s->new_picture.data[2] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[2], s->uvlinesize, 8);
3923 3923
      }else{
3924 3924
        return  s->dsp.sse[0](NULL, s->new_picture.data[0] + s->mb_x*16 + s->mb_y*s->linesize*16, s->dest[0], s->linesize, 16)
3925 3925
               +s->dsp.sse[1](NULL, s->new_picture.data[1] + s->mb_x*8  + s->mb_y*s->uvlinesize*8,s->dest[1], s->uvlinesize, 8)

Also available in: Unified diff