⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 convertpar.cpp

📁 完整的RTP RTSP代码库
💻 CPP
📖 第 1 页 / 共 5 页
字号:
	// load non-default  gray alpha inter Q-Matrix, 0 -- FALSE, 1 -- TRUE	nextValidLine (pfPara, pnLine);	for (iObj = 0; iObj < nVO; iObj++)	{		if (fscanf (pfPara, "%d", &rgbLoadInterMatrixAlpha [BASE_LAYER] [iObj]) != 1)	{			fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);			fatal_error("Conversion aborted");		}		my_assert (rgbLoadInterMatrixAlpha [BASE_LAYER] [iObj] ==0 || 				rgbLoadInterMatrixAlpha [BASE_LAYER] [iObj] == 1);		/*************/		fprintf(pfOut, "Alpha.QuantMatrix.Inter.Enable [%d] = %d\n", iObj, rgbLoadInterMatrixAlpha [BASE_LAYER] [iObj]);		/*************/		if (rgbLoadInterMatrixAlpha [BASE_LAYER] [iObj]) {			/*************/			fprintf(pfOut, "Alpha.QuantMatrix.Inter [%d] = {", iObj);			/*************/			for (UInt i = 0; i < BLOCK_SQUARE_SIZE; i++) {				if(i>0)					/*************/					fprintf(pfOut, ", ");					/*************/				if (fscanf (pfPara, "%d", &rgppiInterQuantizerMatrixAlpha [BASE_LAYER] [iObj] [i]) != 1)	{					fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);					fatal_error("Conversion aborted");				}				/*************/				fprintf(pfOut, "%d", rgppiInterQuantizerMatrixAlpha [BASE_LAYER] [iObj] [i]);				/*************/			}			/*************/			fprintf(pfOut, "}\n");			/*************/		}	}	if (bAnyScalability)	{		for (iObj = 0; iObj < nVO; iObj++)	{			if (fscanf (pfPara, "%d", &rgbLoadInterMatrixAlpha [ENHN_LAYER] [iObj]) != 1)	{				fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);				fatal_error("Conversion aborted");			}			my_assert (rgbLoadInterMatrixAlpha [ENHN_LAYER] [iObj] ==0 || 					rgbLoadInterMatrixAlpha [ENHN_LAYER] [iObj] == 1);			/*************/			fprintf(pfOut, "Alpha.QuantMatrix.Inter.Enable [%d] = %d\n", iObj + nVO, rgbLoadInterMatrixAlpha [ENHN_LAYER] [iObj]);			/*************/			if (rgbLoadInterMatrixAlpha [ENHN_LAYER] [iObj]) {				/*************/				fprintf(pfOut, "Alpha.QuantMatrix.Inter [%d] = {", iObj + nVO);				/*************/				for (UInt i = 0; i < BLOCK_SQUARE_SIZE; i++) {					if(i>0)						/*************/						fprintf(pfOut, ", ");						/*************/					if (fscanf (pfPara, "%d", &rgppiInterQuantizerMatrixAlpha [ENHN_LAYER] [iObj] [i]) != 1)	{						fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);						fatal_error("Conversion aborted");					}					/*************/					fprintf(pfOut, "%d", rgppiInterQuantizerMatrixAlpha [ENHN_LAYER] [iObj] [i]);					/*************/				}				/*************/				fprintf(pfOut, "}\n");				/*************/			}		}	}	// I-VO quantization stepsize for Alpha	nextValidLine (pfPara, pnLine);	for (iObj = 0; iObj < nVO; iObj++)	{		if (fscanf (pfPara, "%d", &(rgiIStepAlpha [BASE_LAYER] [iObj])) != 1)	{			fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);			fatal_error("Conversion aborted");		}		my_assert (rgiIStepAlpha [BASE_LAYER] [iObj] > 0 && rgiIStepAlpha [BASE_LAYER] [iObj] < 32);		/*************/		fprintf(pfOut, "Alpha.QuantStep.IVOP [%d] = %d\n", iObj, rgiIStepAlpha [BASE_LAYER] [iObj]);		/*************/	}	if (bAnyScalability)	{		for (iObj = 0; iObj < nVO; iObj++)	{			if (fscanf (pfPara, "%d", &(rgiIStepAlpha [ENHN_LAYER] [iObj])) != 1)	{				fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);				fatal_error("Conversion aborted");			}			my_assert (rgiIStepAlpha [ENHN_LAYER] [iObj] > 0 && rgiIStepAlpha [ENHN_LAYER] [iObj] < 32);			/*************/			fprintf(pfOut, "Alpha.QuantStep.IVOP [%d] = %d\n", iObj + nVO, rgiIStepAlpha [ENHN_LAYER] [iObj]);			/*************/		}	}	// P-VO quantization stepsize for Alpha	nextValidLine (pfPara, pnLine);	for (iObj = 0; iObj < nVO; iObj++)	{		if (fscanf (pfPara, "%d", &(rgiPStepAlpha [BASE_LAYER] [iObj])) != 1)	{			fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);			fatal_error("Conversion aborted");		}		my_assert (rgiPStepAlpha [BASE_LAYER] [iObj] > 0 && rgiPStepAlpha [BASE_LAYER] [iObj] < 64);		/*************/		fprintf(pfOut, "Alpha.QuantStep.PVOP [%d] = %d\n", iObj, rgiPStepAlpha [BASE_LAYER] [iObj]);		/*************/	}	if (bAnyScalability)	{		for (iObj = 0; iObj < nVO; iObj++)	{			if (fscanf (pfPara, "%d", &(rgiPStepAlpha [ENHN_LAYER] [iObj])) != 1)	{				fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);				fatal_error("Conversion aborted");			}			my_assert (rgiPStepAlpha [ENHN_LAYER] [iObj] > 0 && rgiPStepAlpha [ENHN_LAYER] [iObj] < 64);			/*************/			fprintf(pfOut, "Alpha.QuantStep.PVOP [%d] = %d\n", iObj + nVO, rgiPStepAlpha [ENHN_LAYER] [iObj]);			/*************/		}	}	// B-VO quantization stepsize for Alpha	nextValidLine (pfPara, pnLine);	for (iObj = 0; iObj < nVO; iObj++)	{		if (fscanf (pfPara, "%d", &(rgiBStepAlpha [BASE_LAYER] [iObj])) != 1)	{			fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);			fatal_error("Conversion aborted");		}		my_assert (rgiBStepAlpha [BASE_LAYER] [iObj] > 0 && rgiBStepAlpha [BASE_LAYER] [iObj] < 64);		/*************/		fprintf(pfOut, "Alpha.QuantStep.BVOP [%d] = %d\n", iObj, rgiBStepAlpha [BASE_LAYER] [iObj]);		/*************/	}	if (bAnyScalability)	{		for (iObj = 0; iObj < nVO; iObj++)	{			if (fscanf (pfPara, "%d", &(rgiBStepAlpha [ENHN_LAYER] [iObj])) != 1)	{				fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);				fatal_error("Conversion aborted");			}			my_assert (rgiBStepAlpha [ENHN_LAYER] [iObj] > 0 && rgiBStepAlpha [ENHN_LAYER] [iObj] < 64);			/*************/			fprintf(pfOut, "Alpha.QuantStep.BVOP [%d] = %d\n", iObj + nVO, rgiBStepAlpha [ENHN_LAYER] [iObj]);			/*************/		}	}	// disable_gray_quant_update	nextValidLine (pfPara, pnLine);	for (iObj = 0; iObj < nVO; iObj++)	{		if (fscanf (pfPara, "%d", &(rgbNoGrayQuantUpdate [BASE_LAYER] [iObj])) != 1)	{			fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);			fatal_error("Conversion aborted");		}		/*************/		fprintf(pfOut, "Alpha.QuantDecouple.Enable [%d] = %d\n", iObj, rgbNoGrayQuantUpdate [BASE_LAYER] [iObj]);		/*************/	}	if (bAnyScalability)	{		for (iObj = 0; iObj < nVO; iObj++)	{			if (fscanf (pfPara, "%d", &(rgbNoGrayQuantUpdate [ENHN_LAYER] [iObj])) != 1)	{				fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);				fatal_error("Conversion aborted");			}			/*************/			fprintf(pfOut, "Alpha.QuantDecouple.Enable [%d] = %d\n", iObj + nVO, rgbNoGrayQuantUpdate [ENHN_LAYER] [iObj]);			/*************/		}	}	// number of P-VOP's between 2 I-VOP's; if there are B-VOPs, the no. of encode frames will multiply	nextValidLine (pfPara, pnLine);	for (iObj = 0; iObj < nVO; iObj++)	{		if (fscanf (pfPara, "%d", &rgiNumPbetweenIVOP [iObj]) != 1)	{			fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);			fatal_error("Conversion aborted");		}		/*************/		fprintf(pfOut, "Motion.PBetweenICount [%d] = %d\n", iObj, rgiNumPbetweenIVOP [iObj]);		/*************/	}	// number of B-VOP's between 2 P-VOP's	nextValidLine (pfPara, pnLine);	for (iObj = 0; iObj < nVO; iObj++)	{		if (fscanf (pfPara, "%d", &rgiNumBbetweenPVOP [iObj]) != 1)	{			fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);			fatal_error("Conversion aborted");		}		my_assert (rgiNumBbetweenPVOP [iObj] >= 0);		/*************/		fprintf(pfOut, "Motion.BBetweenPCount [%d] = %d\n", iObj, rgiNumBbetweenPVOP [iObj]);		/*************/	}	if(iVersion==815)	{		// rgbAllowSkippedPMBs		nextValidLine (pfPara, pnLine);		for (iObj = 0; iObj < nVO; iObj++)	{			if (fscanf (pfPara, "%d", &rgbAllowSkippedPMBs [iObj]) != 1)	{				fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);				fatal_error("Conversion aborted");			}			my_assert (rgbAllowSkippedPMBs [iObj] == 0 || rgbAllowSkippedPMBs[iObj]==1);		}	}	else		for (iObj = 0; iObj < nVO; iObj++)			rgbAllowSkippedPMBs [iObj] = 1;	for (iObj = 0; iObj < nVO; iObj++)		/*************/		fprintf(pfOut, "Motion.SkippedMB.Enable [%d] = %d\n", iObj, rgbAllowSkippedPMBs [iObj]);		/*************/	//added to encode GOV header by SONY 980212	//number of VOP between GOV header	//CAUTION:GOV period is not used in spatial scalable coding	nextValidLine (pfPara, pnLine);	for (iObj = 0; iObj < nVO; iObj++)	{		if (fscanf (pfPara, "%d", &rgiGOVperiod [iObj]) != 1)	{			fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);			fatal_error("Conversion aborted");		}		my_assert (rgiGOVperiod [iObj] >= 0);		/*************/		fprintf(pfOut, "GOV.Enable [%d] = %d\n", iObj, rgiGOVperiod [iObj] > 0);		fprintf(pfOut, "GOV.Period [%d] = %d\n", iObj, rgiGOVperiod [iObj]);		/*************/	}	//980212	// deblocking filter disable	nextValidLine (pfPara, pnLine);	for (iObj = 0; iObj < nVO; iObj++)	{		if (fscanf (pfPara, "%d", &rgbDeblockFilterDisable [iObj]) != 1)	{			fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);			fatal_error("Conversion aborted");		}		/*************/		fprintf(pfOut, "Motion.DeblockingFilter.Enable [%d] = %d\n", iObj, !rgbDeblockFilterDisable [iObj]);		/*************/	}	// Temporal sampling rate	nextValidLine (pfPara, pnLine);	for (iObj = 0; iObj < nVO; iObj++)	{		if (fscanf (pfPara, "%d", &rgiTSRate [iObj]) != 1)	{			fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);			fatal_error("Conversion aborted");		}		my_assert (rgiTSRate [iObj] >= 1);		/*************/		fprintf(pfOut, "Source.SamplingRate [%d] = %d\n", iObj, rgiTSRate [iObj]);		/*************/	}	if ( bAnyScalability ){ // This part is added by Norio Ito		for (iObj = 0; iObj < nVO; iObj++)	{			if (fscanf (pfPara, "%d", &rgiEnhcTSRate [iObj]) != 1)	{				fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);				fatal_error("Conversion aborted");			}			my_assert (rgiEnhcTSRate [iObj] >= 1);			/*************/			fprintf(pfOut, "Source.SamplingRate [%d] = %d\n", iObj + nVO, rgiEnhcTSRate [iObj]);			/*************/		}	}	// maximum displacement	nextValidLine (pfPara, pnLine);	for (iObj = 0; iObj < nVO; iObj++) {		if (fscanf (pfPara, "%d", &rguiSearchRange [BASE_LAYER] [iObj]) != 1)	{			fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);			fatal_error("Conversion aborted");		}		my_assert (rguiSearchRange [BASE_LAYER] [iObj] >= 1);		/*************/		fprintf(pfOut, "Motion.SearchRange [%d] = %d\n", iObj, rguiSearchRange [BASE_LAYER] [iObj]);		/*************/	}	if (bAnyScalability)	{		for (iObj = 0; iObj < nVO; iObj++) {			if (fscanf (pfPara, "%d", &rguiSearchRange [ENHN_LAYER] [iObj]) != 1)	{				fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);				fatal_error("Conversion aborted");			}			my_assert (rguiSearchRange [ENHN_LAYER] [iObj] >= 1);			/*************/			fprintf(pfOut, "Motion.SearchRange [%d] = %d\n", iObj + nVO, rguiSearchRange [ENHN_LAYER] [iObj]);			/*************/		}	}	// use original or reconstructed previous VO for ME	nextValidLine (pfPara, pnLine);	for (iObj = 0; iObj < nVO; iObj++)	{		if (fscanf (pfPara, "%d", &rgbOriginalME [BASE_LAYER] [iObj]) != 1)	{			fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);			fatal_error("Conversion aborted");		}		my_assert (rgbOriginalME [BASE_LAYER] [iObj] == 0 || rgbOriginalME [BASE_LAYER] [iObj] == 1);		/*************/		fprintf(pfOut, "Motion.UseSourceForME.Enable [%d] = %d\n", iObj, rgbOriginalME [BASE_LAYER] [iObj]);		/*************/	}	if (bAnyScalability)	{		for (iObj = 0; iObj < nVO; iObj++)	{			if (fscanf (pfPara, "%d", &rgbOriginalME [ENHN_LAYER] [iObj]) != 1)	{				fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);				fatal_error("Conversion aborted");			}			my_assert (rgbOriginalME [ENHN_LAYER] [iObj] == 0 || rgbOriginalME [ENHN_LAYER] [iObj] == 1);			/*************/			fprintf(pfOut, "Motion.UseSourceForME.Enable [%d] = %d\n", iObj + nVO, rgbOriginalME [ENHN_LAYER] [iObj]);			/*************/		}	}	// disable advance prediction (obmc only)?	nextValidLine (pfPara, pnLine);	for (iObj = 0; iObj < nVO; iObj++)	{		if (fscanf (pfPara, "%d", &rgbAdvPredDisable [BASE_LAYER] [iObj]) != 1)	{			fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);			fatal_error("Conversion aborted");		}		my_assert (rgbAdvPredDisable [BASE_LAYER] [iObj] == 0 || rgbAdvPredDisable [BASE_LAYER] [iObj] == 1);		/*************/		fprintf(pfOut, "Motion.AdvancedPrediction.Enable [%d] = %d\n", iObj, !rgbAdvPredDisable [BASE_LAYER] [iObj]);		/*************/	}	if (bAnyScalability)	{		for (iObj = 0; iObj < nVO; iObj++)	{			if (fscanf (pfPara, "%d", &rgbAdvPredDisable [ENHN_LAYER] [iObj]) != 1)	{				fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);				fatal_error("Conversion aborted");			}			my_assert (rgbAdvPredDisable [ENHN_LAYER] [iObj] == 0 || rgbAdvPredDisable [ENHN_LAYER] [iObj] == 1);			/*************/			fprintf(pfOut, "Motion.AdvancedPrediction.Enable [%d] = %d\n", iObj + nVO, !rgbAdvPredDisable [ENHN_LAYER] [iObj]);			/*************/		}	}	if(iVersion>815)	{		// Quarter Sample		nextValidLine (pfPara, pnLine);				for (iObj = 0; iObj < nVO; iObj++)	{			if (fscanf (pfPara, "%d", &rgbQuarterSample [BASE_LAYER] [iObj]) != 1)	{				fprintf(stderr, "wrong parameter file format on line %d\n", *pnLine);				exit (1);			}			my_assert (rgbQuarterSample [BASE_LAYER] [iObj] == 0 || 					rgbQuarterSample [BASE_LAYER] [iObj] == 1);		}		if (bAnyScalability)	{						for (iObj = 0; iObj < nVO; iObj++)	{				if (fscanf (pfPara, "%d", &rgbQuarterSample [ENHN_LAYER] [iObj]) != 1)	{					fprintf(stderr, "wrong parameter file format on line %d\n", *

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -