currCsArea参数具体意思

inline UnitArea clipArea(const UnitArea &area, const UnitArea &boundingBox)
{
  UnitArea ret(area.chromaFormat);

  for (uint32_t i = 0; i < area.blocks.size(); i++)
  {
    ret.blocks.push_back(clipArea(area.blocks[i], boundingBox.blocks[i]));
  }

  return ret;
}

boundingBox():分量的边界限制,如当前CTU

名称类型
area{x = 0, y = 0, width = 128, height = 128}const UnitArea &

而Y分量和CbCr分量的边界限制分别为

名称类型
boundingBox.blocks[i]{(Y) x = 0, y = 0, width = 832, height = 480}CompArea
名称类型
boundingBox.blocks[i]{(Cb) x = 0, y = 0, width = 416, height = 240}CompArea

 这里将当前CTU的YCbCr分量的区域信息和边界限制信息传输到ret中并返回,调用ret即可得到这些信息

UnitArea CS::getArea( const CodingStructure &cs, const UnitArea &area, const ChannelType chType )
{
  return isDualITree( cs ) || cs.treeType != TREE_D ? area.singleChan( chType ) : area;
}

如果当前bestCS结果为dual tree或不为joint tree,则返回singlechan()处理后的这块待处理的CTU,亮度Y和色度分量CbCr各自的位置,若为false,返回亮度色度分量共同的位置

const UnitArea UnitArea::singleChan(const ChannelType chType) const
{
  UnitArea ret(chromaFormat);

  for (const auto &blk : blocks)
  {
    if (toChannelType(blk.compID) == chType)
    {
      ret.blocks.push_back(blk);
    }
    else
    {
      ret.blocks.push_back(CompArea());
    }
  }

  return ret;
}

chType:是当前CTU的通道类型

auto &blk : blocks :遍历当前bsetCS结构下的所有块,并用blk赋值

if (toChannelType(blk.compID) == chType):如果满足当前块的通道类型和CTU的相同,则将blk的参数赋值给block。不是的话则将当前blk的位置和长宽,色度采样格式,颜色分量类型的compArea()赋给当前block。

此处block的值:应该是代表YCbCr三个分量,所以值为3

这个函数推测应该是singlechannal的缩写为双树或非joint-tree划分结构下,YCbCr三个分量的区域信息,即位置信息和长宽信息,可看做CTB

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值