tprintf("pred_motion (%2d %2d %2d) (%2d %2d %2d) (%2d %2d %2d) -> (%2d %2d %2d) at %2d %2d %d list %d\n", top_ref, B[0], B[1],                    diagonal_ref, C[0], C[1], left_ref, A[0], A[1], ref, *mx, *my, s->mb_x, s->mb_y, n, list);
tprintf("pred_motion (%2d %2d %2d) (%2d %2d %2d) (%2d %2d %2d) -> (%2d %2d %2d) at %2d %2d %d list %d\n", top_ref, B[0], B[1],                    diagonal_ref, C[0], C[1], left_ref, A[0], A[1], ref, *mx, *my, h->s.mb_x, h->s.mb_y, n, list);
static inline void pred_motion(H264Context * const h, int n, int part_width, int list, int ref, int * const mx, int * const my){    MpegEncContext * const s = &h->s;    const int index8= scan8[n];    const int top_ref=      h->ref_cache[list][ index8 - 8 ];    const int left_ref=     h->ref_cache[list][ index8 - 1 ];    const int16_t * const A= h->mv_cache[list][ index8 - 1 ];    const int16_t * const B= h->mv_cache[list][ index8 - 8 ];    const int16_t * C;    int diagonal_ref, match_count;    assert(part_width==1 || part_width==2 || part_width==4);/* mv_cache  B . . A T T T T   U . . L . . , .  U . . L . . . .  U . . L . . , .  . . . L . . . .*/    diagonal_ref= fetch_diagonal_mv(h, &C, index8, list, part_width);    match_count= (diagonal_ref==ref) + (top_ref==ref) + (left_ref==ref);        if(match_count > 1){ //most common        *mx= mid_pred(A[0], B[0], C[0]);        *my= mid_pred(A[1], B[1], C[1]);    }else if(match_count==1){        if(left_ref==ref){            *mx= A[0];            *my= A[1];                }else if(top_ref==ref){            *mx= B[0];            *my= B[1];                }else{            *mx= C[0];            *my= C[1];                }    }else{        if(top_ref == PART_NOT_AVAILABLE && diagonal_ref == PART_NOT_AVAILABLE && left_ref != PART_NOT_AVAILABLE){            *mx= A[0];            *my= A[1];                }else{            *mx= mid_pred(A[0], B[0], C[0]);            *my= mid_pred(A[1], B[1], C[1]);        }    }            tprintf("pred_motion (%2d %2d %2d) (%2d %2d %2d) (%2d %2d %2d) -> (%2d %2d %2d) at %2d %2d %d list %d\n", top_ref, B[0], B[1],                    diagonal_ref, C[0], C[1], left_ref, A[0], A[1], ref, *mx, *my, s->mb_x, s->mb_y, n, list);}