Revision fb44e070

View differences:

libavcodec/roqvideoenc.c
125 125
// FIXME Could use DSPContext.sse, but it is not so speed critical (used
126 126
// just for motion estimation).
127 127
static int block_sse(uint8_t **buf1, uint8_t **buf2, int x1, int y1, int x2,
128
                     int y2, int *stride, int size)
128
                     int y2, int *stride1, int *stride2, int size)
129 129
{
130 130
    int i, k;
131 131
    int sse=0;
......
133 133
    for (k=0; k<3; k++) {
134 134
        int bias = (k ? CHROMA_BIAS : 4);
135 135
        for (i=0; i<size; i++)
136
            sse += bias*eval_sse(buf1[k] + (y1+i)*stride[k] + x1,
137
                                 buf2[k] + (y2+i)*stride[k] + x2, size);
136
            sse += bias*eval_sse(buf1[k] + (y1+i)*stride1[k] + x1,
137
                                 buf2[k] + (y2+i)*stride2[k] + x2, size);
138 138
    }
139 139

  
140 140
    return sse;
......
159 159
        return INT_MAX;
160 160

  
161 161
    return block_sse(enc->frame_to_enc->data, enc->last_frame->data, x, y,
162
                     mx, my, enc->frame_to_enc->linesize, size);
162
                     mx, my,
163
                     enc->frame_to_enc->linesize, enc->last_frame->linesize,
164
                     size);
163 165
}
164 166

  
165 167
/**
......
417 419
                                                  enc->current_frame->data, x,
418 420
                                                  y, x, y,
419 421
                                                  enc->frame_to_enc->linesize,
422
                                                  enc->current_frame->linesize,
420 423
                                                  4);
421 424
    else
422 425
        subcel->eval_dist[RoQ_ID_MOT] = INT_MAX;
......
479 482
                                               enc->current_frame->data,
480 483
                                               cel->sourceX, cel->sourceY,
481 484
                                               cel->sourceX, cel->sourceY,
482
                                               enc->frame_to_enc->linesize, 8);
485
                                               enc->frame_to_enc->linesize,
486
                                               enc->current_frame->linesize,8);
483 487
    else
484 488
        cel->eval_dist[RoQ_ID_MOT] = INT_MAX;
485 489

  
......
740 744
    av_log(enc->avctx, AV_LOG_ERROR, "Expected distortion: %i Actual: %i\n",
741 745
           dist,
742 746
           block_sse(fdata, cdata, 0, 0, 0, 0,
743
                     enc->frame_to_enc->linesize, enc->width));  //WARNING: Square dimensions implied...
747
                     enc->frame_to_enc->linesize,
748
                     enc->current_frame->linesize,
749
                     enc->width));  //WARNING: Square dimensions implied...
744 750
#endif
745 751
}
746 752

  
......
993 999
    uint8_t *buf_start = buf;
994 1000

  
995 1001
    enc->out_buf = buf;
996
    enc->y_stride = frame->linesize[0];
997
    enc->c_stride = frame->linesize[1];
998 1002
    enc->avctx = avctx;
999 1003

  
1000 1004
    enc->frame_to_enc = frame;

Also available in: Unified diff