Revision bb4fcfa3 libavcodec/error_resilience.c

View differences:

libavcodec/error_resilience.c
220 220
 * @param h     height in 8 pixel blocks
221 221
 */
222 222
static void h_block_filter(MpegEncContext *s, uint8_t *dst, int w, int h, int stride, int is_luma){
223
    int b_x, b_y;
223
    int b_x, b_y, mvx_stride, mvy_stride;
224 224
    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
225
    set_mv_strides(s, &mvx_stride, &mvy_stride);
226
    mvx_stride >>= is_luma;
227
    mvy_stride *= mvx_stride;
225 228

  
226 229
    for(b_y=0; b_y<h; b_y++){
227 230
        for(b_x=0; b_x<w-1; b_x++){
......
233 236
            int left_damage =  left_status&(DC_ERROR|AC_ERROR|MV_ERROR);
234 237
            int right_damage= right_status&(DC_ERROR|AC_ERROR|MV_ERROR);
235 238
            int offset= b_x*8 + b_y*stride*8;
236
            int16_t *left_mv=  s->current_picture.motion_val[0][s->b8_stride*(b_y<<(1-is_luma)) + ( b_x   <<(1-is_luma))];
237
            int16_t *right_mv= s->current_picture.motion_val[0][s->b8_stride*(b_y<<(1-is_luma)) + ((b_x+1)<<(1-is_luma))];
239
            int16_t *left_mv=  s->current_picture.motion_val[0][mvy_stride*b_y + mvx_stride* b_x   ];
240
            int16_t *right_mv= s->current_picture.motion_val[0][mvy_stride*b_y + mvx_stride*(b_x+1)];
238 241

  
239 242
            if(!(left_damage||right_damage)) continue; // both undamaged
240 243

  
......
280 283
 * @param h     height in 8 pixel blocks
281 284
 */
282 285
static void v_block_filter(MpegEncContext *s, uint8_t *dst, int w, int h, int stride, int is_luma){
283
    int b_x, b_y;
286
    int b_x, b_y, mvx_stride, mvy_stride;
284 287
    uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
288
    set_mv_strides(s, &mvx_stride, &mvy_stride);
289
    mvx_stride >>= is_luma;
290
    mvy_stride *= mvx_stride;
285 291

  
286 292
    for(b_y=0; b_y<h-1; b_y++){
287 293
        for(b_x=0; b_x<w; b_x++){
......
293 299
            int top_damage =      top_status&(DC_ERROR|AC_ERROR|MV_ERROR);
294 300
            int bottom_damage= bottom_status&(DC_ERROR|AC_ERROR|MV_ERROR);
295 301
            int offset= b_x*8 + b_y*stride*8;
296
            int16_t *top_mv=    s->current_picture.motion_val[0][s->b8_stride*( b_y   <<(1-is_luma)) + (b_x<<(1-is_luma))];
297
            int16_t *bottom_mv= s->current_picture.motion_val[0][s->b8_stride*((b_y+1)<<(1-is_luma)) + (b_x<<(1-is_luma))];
302
            int16_t *top_mv=    s->current_picture.motion_val[0][mvy_stride* b_y    + mvx_stride*b_x];
303
            int16_t *bottom_mv= s->current_picture.motion_val[0][mvy_stride*(b_y+1) + mvx_stride*b_x];
298 304

  
299 305
            if(!(top_damage||bottom_damage)) continue; // both undamaged
300 306

  

Also available in: Unified diff