Lines Matching defs:block
59 * DiracBlock->ref flags, if set then the block does MC from the given ref
115 /* block length */
118 /* block separation (block n+1 starts after this many pixels in block n) */
1140 "invalid x/y block length (%d/%d) for x/y chroma shift (%d/%d)\n",
1153 av_log(s->avctx, AV_LOG_ERROR, "Unsupported large block size\n");
1342 static inline int pred_block_mode(DiracBlock *block, int stride, int x, int y, int refmask)
1349 return block[-1].ref & refmask;
1351 return block[-stride].ref & refmask;
1354 pred = (block[-1].ref & refmask) + (block[-stride].ref & refmask) + (block[-stride-1].ref & refmask);
1358 static inline void pred_block_dc(DiracBlock *block, int stride, int x, int y)
1362 memset(block->u.dc, 0, sizeof(block->u.dc));
1364 if (x && !(block[-1].ref & 3)) {
1366 block->u.dc[i] += block[-1].u.dc[i];
1370 if (y && !(block[-stride].ref & 3)) {
1372 block->u.dc[i] += block[-stride].u.dc[i];
1376 if (x && y && !(block[-1-stride].ref & 3)) {
1378 block->u.dc[i] += block[-1-stride].u.dc[i];
1384 block->u.dc[i] = (block->u.dc[i]+1)>>1;
1387 block->u.dc[i] = divide3(block->u.dc[i]);
1391 static inline void pred_mv(DiracBlock *block, int stride, int x, int y, int ref)
1398 if (x && (block[-1].ref & mask) == refmask)
1399 pred[n++] = block[-1].u.mv[ref];
1401 if (y && (block[-stride].ref & mask) == refmask)
1402 pred[n++] = block[-stride].u.mv[ref];
1404 if (x && y && (block[-stride-1].ref & mask) == refmask)
1405 pred[n++] = block[-stride-1].u.mv[ref];
1409 block->u.mv[ref][0] = 0;
1410 block->u.mv[ref][1] = 0;
1413 block->u.mv[ref][0] = pred[0][0];
1414 block->u.mv[ref][1] = pred[0][1];
1417 block->u.mv[ref][0] = (pred[0][0] + pred[1][0] + 1) >> 1;
1418 block->u.mv[ref][1] = (pred[0][1] + pred[1][1] + 1) >> 1;
1421 block->u.mv[ref][0] = mid_pred(pred[0][0], pred[1][0], pred[2][0]);
1422 block->u.mv[ref][1] = mid_pred(pred[0][1], pred[1][1], pred[2][1]);
1427 static void global_mv(DiracContext *s, DiracBlock *block, int x, int y, int ref)
1439 block->u.mv[ref][0] = (mx + (1<<(ez+ep))) >> (ez+ep);
1440 block->u.mv[ref][1] = (my + (1<<(ez+ep))) >> (ez+ep);
1443 static void decode_block_params(DiracContext *s, DiracArith arith[8], DiracBlock *block,
1448 block->ref = pred_block_mode(block, stride, x, y, DIRAC_REF_MASK_REF1);
1449 block->ref ^= dirac_get_arith_bit(arith, CTX_PMODE_REF1);
1452 block->ref |= pred_block_mode(block, stride, x, y, DIRAC_REF_MASK_REF2);
1453 block->ref ^= dirac_get_arith_bit(arith, CTX_PMODE_REF2) << 1;
1456 if (!block->ref) {
1457 pred_block_dc(block, stride, x, y);
1459 block->u.dc[i] += (unsigned)dirac_get_arith_int(arith+1+i, CTX_DC_F1, CTX_DC_DATA);
1464 block->ref |= pred_block_mode(block, stride, x, y, DIRAC_REF_MASK_GLOBAL);
1465 block->ref ^= dirac_get_arith_bit(arith, CTX_GLOBAL_BLOCK) << 2;
1469 if (block->ref & (i+1)) {
1470 if (block->ref & DIRAC_REF_MASK_GLOBAL) {
1471 global_mv(s, block, x, y, i);
1473 pred_mv(block, stride, x, y, i);
1474 block->u.mv[i][0] += (unsigned)dirac_get_arith_int(arith + 4 + 2 * i, CTX_MV_F1, CTX_MV_DATA);
1475 block->u.mv[i][1] += (unsigned)dirac_get_arith_int(arith + 5 + 2 * i, CTX_MV_F1, CTX_MV_DATA);
1481 * Copies the current block to the other blocks covered by the current superblock split mode
1483 static void propagate_block_data(DiracBlock *block, int stride, int size)
1486 DiracBlock *dst = block;
1489 dst[x] = *block;
1494 dst[x] = *block;
1548 DiracBlock *block = &s->blmotion[by*s->blwidth + bx];
1549 decode_block_params(s, arith, block, s->blwidth, bx, by);
1550 propagate_block_data(block, s->blwidth, step);
1640 * For block x,y, determine which of the hpel planes to do bilinear
1647 static int mc_subpel(DiracContext *s, DiracBlock *block, const uint8_t *src[5],
1652 int motion_x = block->u.mv[ref][0];
1653 int motion_y = block->u.mv[ref][1];
1758 static void block_mc(DiracContext *s, DiracBlock *block,
1766 switch (block->ref&3) {
1768 add_dc(mctmp, block->u.dc[plane], p->stride, obmc_weight, p->xblen, p->yblen);
1772 idx = mc_subpel(s, block, src, dstx, dsty, (block->ref&3)-1, plane);
1779 idx = mc_subpel(s, block, src, dstx, dsty, 0, plane);
1781 idx = mc_subpel(s, block, src, dstx, dsty, 1, plane);
1794 static void mc_row(DiracContext *s, DiracBlock *block, uint16_t *mctmp, int plane, int dsty)
1799 block_mc(s, block, mctmp, s->obmc_weight[0], plane, -p->xoffset, dsty);
1803 block_mc(s, block+x, mctmp, s->obmc_weight[1], plane, dstx, dsty);
1807 block_mc(s, block+x, mctmp, s->obmc_weight[2], plane, dstx, dsty);