当前位置: 首页>>代码示例>>C++>>正文


C++ LLBitPack::bitPack方法代码示例

本文整理汇总了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; 
}
开发者ID:HizWylder,项目名称:GIS,代码行数:14,代码来源:patch_code.cpp

示例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);
			}
		}
	}
}
开发者ID:HizWylder,项目名称:GIS,代码行数:66,代码来源:patch_code.cpp


注:本文中的LLBitPack::bitPack方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。