Lines Matching refs:mb

474     IVIMbInfo   *mb, *ref_mb;
477 mb = tile->mbs;
497 mb->xpos = x;
498 mb->ypos = y;
499 mb->buf_offs = mb_offset;
500 mb->b_mv_x =
501 mb->b_mv_y = 0;
504 av_log(avctx, AV_LOG_ERROR, "Insufficient input for mb info\n");
513 mb->type = 1; /* empty macroblocks are always INTER */
514 mb->cbp = 0; /* all blocks are empty */
516 mb->q_delta = 0;
518 mb->q_delta = get_vlc2(&ctx->gb, ctx->mb_vlc.tab->table,
520 mb->q_delta = IVI_TOSIGNED(mb->q_delta);
523 mb->mv_x = mb->mv_y = 0; /* no motion vector coded */
527 mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale);
528 mb->mv_y = ivi_scale_mv(ref_mb->mv_y, mv_scale);
530 mb->mv_x = ref_mb->mv_x;
531 mb->mv_y = ref_mb->mv_y;
536 /* copy mb_type from corresponding reference mb */
541 mb->type = ref_mb->type;
544 mb->type = 0; /* mb_type is always INTRA for intra-frames */
546 mb->type = get_bits(&ctx->gb, mb_type_bits);
549 mb->cbp = get_bits(&ctx->gb, blks_per_mb);
551 mb->q_delta = 0;
553 if (ref_mb) mb->q_delta = ref_mb->q_delta;
554 } else if (mb->cbp || (!band->plane && !band->band_num &&
556 mb->q_delta = get_vlc2(&ctx->gb, ctx->mb_vlc.tab->table,
558 mb->q_delta = IVI_TOSIGNED(mb->q_delta);
561 if (!mb->type) {
562 mb->mv_x = mb->mv_y = 0; /* there is no motion vector in intra-macroblocks */
568 mb->mv_x = ivi_scale_mv(ref_mb->mv_x, mv_scale);
569 mb->mv_y = ivi_scale_mv(ref_mb->mv_y, mv_scale);
571 mb->mv_x = ref_mb->mv_x;
572 mb->mv_y = ref_mb->mv_y;
582 mb->mv_x = mv_x;
583 mb->mv_y = mv_y;
584 if (mb->type == 3) {
593 mb->b_mv_x = -mv_x;
594 mb->b_mv_y = -mv_y;
597 if (mb->type == 2) {
598 mb->b_mv_x = -mb->mv_x;
599 mb->b_mv_y = -mb->mv_y;
600 mb->mv_x = 0;
601 mb->mv_y = 0;
607 if (mb->type)
608 if ( x + (mb->mv_x >>s) + (y+ (mb->mv_y >>s))*band->pitch < 0 ||
609 x + ((mb->mv_x+s)>>s) + band->mb_size - 1
610 + (y+band->mb_size - 1 +((mb->mv_y+s)>>s))*band->pitch > band->bufsize -1) {
611 av_log(avctx, AV_LOG_ERROR, "motion vector %d %d outside reference\n", x*s + mb->mv_x, y*s + mb->mv_y);
615 mb++;