本文整理汇总了C++中LLBitPack::bitPack方法的典型用法代码示例。如果您正苦于以下问题:C++ LLBitPack::bitPack方法的具体用法?C++ LLBitPack::bitPack怎么用?C++ LLBitPack::bitPack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLBitPack
的用法示例。
在下文中一共展示了LLBitPack::bitPack方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void code_patch_group_header(LLBitPack &bitpack, LLGroupHeader *gopp)
{
#ifdef LL_BIG_ENDIAN
U8 *stride = (U8 *)&gopp->stride;
bitpack.bitPack(&(stride[1]), 8);
bitpack.bitPack(&(stride[0]), 8);
#else
bitpack.bitPack((U8 *)&gopp->stride, 16);
#endif
bitpack.bitPack((U8 *)&gopp->patch_size, 8);
bitpack.bitPack((U8 *)&gopp->layer_type, 8);
gPatchSize = gopp->patch_size;
}
示例2: code_patch
void code_patch(LLBitPack &bitpack, S32 *patch, S32 postquant)
{
S32 i, j, patch_size = gPatchSize, wbits = gWordBits;
S32 temp;
BOOL b_eob;
if ( (postquant > patch_size*patch_size)
||(postquant < 0))
{
llerrs << "Bad postquant in code_patch!" << llendl;
}
if (postquant)
patch[patch_size*patch_size - postquant] = 0;
for (i = 0; i < patch_size*patch_size; i++)
{
b_eob = FALSE;
temp = patch[i];
if (!temp)
{
b_eob = TRUE;
for (j = i; j < patch_size*patch_size - postquant; j++)
{
if (patch[j])
{
b_eob = FALSE;
break;
}
}
if (b_eob)
{
bitpack.bitPack((U8 *)&ZERO_EOB, 2);
return;
}
else
{
bitpack.bitPack((U8 *)&ZERO_CODE, 1);
}
}
else
{
if (temp < 0)
{
temp *= -1;
if (temp > (1<<wbits))
{
temp = (1<<wbits);
// printf("patch quatization exceeding allowable bits!");
}
bitpack.bitPack((U8 *)&NEGATIVE_VALUE, 3);
bitpack.bitPack((U8 *)&temp, wbits);
}
else
{
if (temp > (1<<wbits))
{
temp = (1<<wbits);
// printf("patch quatization exceeding allowable bits!");
}
bitpack.bitPack((U8 *)&POSITIVE_VALUE, 3);
bitpack.bitPack((U8 *)&temp, wbits);
}
}
}
}