void LdpcDecBG1AllZc(
	int CfgAddr,
	int Zc, int MaxIterNum,
	int ShiftBit, int MulFactor,
	int CodeRate,
	int in_ZnAddr,
	int in_BG1DecMatrixAddr,
	int io_Lmn0, int io_Lmn1, int io_Lmn2, int io_Lmn3,
	int in_BG1CheckMatrix0, int in_BG1CheckMatrix1,
	int out_DecOutAddr)
{
	volatile int *Para	= (volatile int *)CfgAddr;
	int LatchLen[4] = {2,5,6,8};			//4层/26Zc;9复合层/39Zc;12复合层/52Zc;16复合层/68Zc
	int EyeMatrixCols[4] = {0,13,26,42};	//用于Zn.Col(27:68)移位循环次数计算

	int _64DivZc = (Zc+63)>>6;			//LoadData

	if (128 >= Zc)
	{
		Para[12]= 0;
	}
	else if ((256 == Zc) || (192 >= Zc))
	{
		Para[12] = _64DivZc - 2;
	}
	else
	{
		Para[12] = 4;
	}

	//m[0]:kis
	Para[0] = (EyeMatrixCols[CodeRate]*Zc+63) >> 6;
	Para[1] = LatchLen[CodeRate];		//Latch加载次数;
	Para[2] = _64DivZc & 1;				//奇数倍判定
	Para[3] = _64DivZc;
	Para[5] = MaxIterNum;				//M[0][5]存储最大迭代次数,单ki5不作为最大迭代次数判定
	Para[6] = ShiftBit;					//bit[0-7]分别代表第1-8次迭代的移位值
	Para[10]= 13*_64DivZc;				//load zn
	Para[13]= (_64DivZc+1)>>1;			//每2*64行为1组
	Para[15]= CodeRate;

	//m[1]:info
	Para[1*16+0] = Zc;						//zc
	Para[1*16+1] = in_ZnAddr | (Zc<<21);	//循环模式输入初始化
	Para[1*16+2] = in_ZnAddr;				//基地址输入
	Para[1*16+3] = MulFactor;				//Zmn调整系数

	//m[2]:asi 初始化
	if (Zc <= 64)
	{
		Para[2*16+0] = 0x00200280;				//Zc<=64,占用1个mrega
	}
	else if (Zc <= 128)
	{
		Para[2*16+0] = 0x003e2080;				//Zc<=64,占用1个mreg
	}
	else if (Zc <=192)
	{
		Para[2*16+0] = 0x005e2080;				//Zc<=64,占用1个mreg
	}
	else if (Zc == 256)
	{
		Para[2*16+0] = 0x003f2080;				//Zc=256,占用4个mreg
	}
	else
	{
		Para[10] = 78;
		Para[1*16+1] = in_ZnAddr | (384<<21);	//循环模式输入初始化
		Para[2*16+0] = 0x005f2080;				//Zc>64 && Zc!=256,占用6个mreg
	}

	//m[3]:循环模式加载索引0,左半边zn.col(1, 2, 3, 5, 6, 7,12,13,15,18,20,24,26)
	//m[4]:循环模式加载索引1,右半边zn.col(4, 8, 9,10,11,14,16,17,19,21,22,23,25)
	//m[5]:用于计算zn.col(27:68)的参数索引
	//m[6]:shu,用于生成循环模式biu参数

	//m[7]:biux.zn.col(1-2)清零
	Para[7*16+0] = in_ZnAddr;
	Para[7*16+12]= 2*Zc;

	//m[8]:load latchcfg
	Para[8*16+0] = in_BG1DecMatrixAddr;

	//m[9]:biu.load(zn),循环模式默认参数
	//m[10]:biu.ki & ks(zn.col(27:68))
	Para[10*16+0] = (_64DivZc<<16) | _64DivZc;
	Para[10*16+6] = Zc;	//多层合并下加载Zn的地址跳转
	Para[10*16+7] = 2*Zc;
	Para[10*16+8] = 5*Zc;

	//m[11-14]:lmn[0-3]
	Para[11*16]= io_Lmn0;
	Para[12*16]= io_Lmn1;
	Para[13*16]= io_Lmn2;
	Para[14*16]= io_Lmn3;

	//m[15,16]:load CheckMatrix
	Para[15*16+0] = in_BG1CheckMatrix0;
	Para[15*16+1] = in_BG1CheckMatrix0;
	Para[16*16+0] = in_BG1CheckMatrix1;
	Para[16*16+1] = in_BG1CheckMatrix1;
	if (Zc > 64)
	{
		Para[15*16+4] = 0x4c;
		Para[15*16+5] = 2;
		Para[15*16+8] = 0x00020002;
		Para[15*16+9] = 0xffffffff;

		Para[16*16+4] = 0x4c;
		Para[16*16+5] = 2;
		Para[16*16+8] = 0x00020002;
		Para[16*16+9] = 0xffffffff;
	}
	else
	{
		Para[15*16+4] = 2;
		Para[15*16+8] = 0xffffffff;

		Para[16*16+4] = 2;
		Para[16*16+8] = 0xffffffff;
	}

	//m[17]:shu for encode
	//m[18]:shu for encode
	//m[19]:dis(latch) for encode
	//m[10]:dis(latch) for encode
	//m[21]:index for check
	//m[22]:index for check
	//m[23]:dec output
	Para[23*16+0] = out_DecOutAddr;
	Para[23*16+1] = out_DecOutAddr;
	if (64<Zc)
	{
		Para[23*16+4] = Zc>>3;
	}
	else
	{
		Para[23*16+4] = Zc;
	}

	//m[24]:shu for ExtractBit
	//m[25],set Zn.Col(27:68) RShift1
	Para[25*16+0] = in_ZnAddr + 26*Zc;
	Para[25*16+12]= EyeMatrixCols[CodeRate] * Zc;
	//m[26-27]:当Zc<=64时,先输出byte级译码结果,再读入、压缩、输出bit级的译码结果
	if (64 >= Zc)
	{
		Para[14] = (22*Zc+63)>>6;

		Para[26*16]		= out_DecOutAddr;
		Para[26*16+12]	=22*Zc;				//共22*Zc字节

		Para[27*16]		= out_DecOutAddr;
		Para[27*16+12]	= (Zc*22+7)>>3;		//共ceil(Zc*22/8)字节译码输出
	}
}
