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

📄 mesh_memc.c

📁 spiht for linux this is used to decod and encode vedio i wich all enjoy
💻 C
📖 第 1 页 / 共 2 页
字号:
  RangeLower.x = 0;  RangeLower.y = 0;  RangeUpper.x = NumCols1;  RangeUpper.y = NumRows1;  if (QccRegularMeshGenerate(&ReferenceMesh,                             &RangeUpper,                             &RangeLower))    {      QccErrorAddMessage("%s: Error calling QccRegularMeshGenerate()",			 argv[0]);      QccErrorExit();    }  if (WindowSize <= 0)    {      QccErrorAddMessage("%s: Window size must be positive, non-zero",			 argv[0]);      QccErrorExit();    }  switch (MotionAccuracy)    {    case QCCVID_ME_FULLPIXEL:      CurrentFrame2.num_rows = CurrentFrame.Y.num_rows;      CurrentFrame2.num_cols = CurrentFrame.Y.num_cols;      ReferenceFrame2.num_rows = ReferenceFrame.Y.num_rows;      ReferenceFrame2.num_cols = ReferenceFrame.Y.num_cols;      break;    case QCCVID_ME_HALFPIXEL:      CurrentFrame2.num_rows = 2 * CurrentFrame.Y.num_rows;      CurrentFrame2.num_cols = 2 * CurrentFrame.Y.num_cols;      ReferenceFrame2.num_rows = 2 * ReferenceFrame.Y.num_rows;      ReferenceFrame2.num_cols = 2 * ReferenceFrame.Y.num_cols;      break;    case QCCVID_ME_QUARTERPIXEL:      CurrentFrame2.num_rows = 4 * CurrentFrame.Y.num_rows;      CurrentFrame2.num_cols = 4 * CurrentFrame.Y.num_cols;      ReferenceFrame2.num_rows = 4 * ReferenceFrame.Y.num_rows;      ReferenceFrame2.num_cols = 4 * ReferenceFrame.Y.num_cols;      break;    case QCCVID_ME_EIGHTHPIXEL:      CurrentFrame2.num_rows = 8 * CurrentFrame.Y.num_rows;      CurrentFrame2.num_cols = 8 * CurrentFrame.Y.num_cols;      ReferenceFrame2.num_rows = 8 * ReferenceFrame.Y.num_rows;      ReferenceFrame2.num_cols = 8 * ReferenceFrame.Y.num_cols;      break;    }  if (QccIMGImageComponentAlloc(&CurrentFrame2))    {      QccErrorAddMessage("%s: Error calling QccIMGImageComponentAlloc()",			 argv[0]);      QccErrorExit();    }  if (QccIMGImageComponentAlloc(&ReferenceFrame2))    {      QccErrorAddMessage("%s: Error calling QccIMGImageComponentAlloc()",			 argv[0]);      QccErrorExit();    }  if (QccVIDMotionEstimationCreateReferenceFrame(&CurrentFrame.Y,                                                 &CurrentFrame2,                                                 MotionAccuracy,                                                 ((FilterSpecified1) ?                                                  &Filter1 : NULL),                                                 ((FilterSpecified2) ?                                                  &Filter2 : NULL),                                                 ((FilterSpecified3) ?                                                  &Filter3 : NULL)))    {      QccErrorAddMessage("%s: Error calling QccVIDMotionEstimationCreateReferenceFrame()",			 argv[0]);      QccErrorExit();    }  if (QccVIDMotionEstimationCreateReferenceFrame(&ReferenceFrame.Y,                                                 &ReferenceFrame2,                                                 MotionAccuracy,                                                 ((FilterSpecified1) ?                                                  &Filter1 : NULL),                                                 ((FilterSpecified2) ?                                                  &Filter2 : NULL),                                                 ((FilterSpecified3) ?                                                  &Filter3 : NULL)))    {      QccErrorAddMessage("%s: Error calling QccVIDMotionEstimationCreateReferenceFrame()",			 argv[0]);      QccErrorExit();    }  if (QccVIDMeshMotionEstimationSearch(&CurrentFrame2,                                       &CurrentMesh,                                       &ReferenceFrame2,                                       &ReferenceMesh,                                       &HorizontalMotion,                                       &VerticalMotion,				       EstimationBlockSize,                                       WindowSize,                                       MotionAccuracy,                                       ConstrainedBoundary,                                       ExponentialKernel))    {      QccErrorAddMessage("%s: Error calling QccVIDMotionEstimationFullSearch()",			 argv[0]);      QccErrorExit();    }  if (QccVIDMotionVectorsWriteFile(&HorizontalMotion,                                   &VerticalMotion,                                   MVFilename,                                   0))    {      QccErrorAddMessage("%s: Error calling QccVIDMotionVectorWriteFile()",			 argv[0]);      QccErrorExit();    }  if (CompensatedFrameSpecified || ResidualFrameSpecified)    {      if (QccIMGImageSetSize(&CompensatedFrame,                             NumRows1,                             NumCols1))        {          QccErrorAddMessage("%s: Error calling QccIMGImageSetSize()",                             argv[0]);          QccErrorExit();        }      if (QccIMGImageAlloc(&CompensatedFrame))        {          QccErrorAddMessage("%s: Error calling QccIMGImageAlloc()",                             argv[0]);          QccErrorExit();        }            if (QccVIDMeshMotionEstimationCreateCompensatedFrame(&CompensatedFrame.Y,                                                           &CurrentMesh,                                                           &ReferenceFrame2,                                                           &ReferenceMesh,                                                           MotionAccuracy))        {          QccErrorAddMessage("%s: Error calling QccVIDMotionEstimationCreateCompensatedFrame()",                             argv[0]);          QccErrorExit();        }    }    if (CompensatedFrameSpecified)    {      if (QccIMGImageDetermineType(&CompensatedFrame))        {          QccErrorAddMessage("%s: Error calling QccIMGImageDetermineType()",                             argv[0]);          QccErrorExit();        }      if (QccIMGImageColor(&CompensatedFrame))        {          QccErrorAddMessage("%s: Motion-compensated frame must be grayscale",                             argv[0]);          QccErrorExit();        }      if (QccIMGImageWrite(&CompensatedFrame))        {          QccErrorAddMessage("%s: Error calling QccIMGImageWrite()",                             argv[0]);          QccErrorExit();        }    }    if (ResidualFrameSpecified)    {      if (QccIMGImageDetermineType(&ResidualFrame))        {          QccErrorAddMessage("%s: Error calling QccIMGImageDetermineType()",                             argv[0]);          QccErrorExit();        }      if (QccIMGImageColor(&ResidualFrame))        {          QccErrorAddMessage("%s: Motion-compensated frame must be grayscale",                             argv[0]);          QccErrorExit();        }      if (QccIMGImageSetSize(&ResidualFrame,                             NumRows1,                             NumCols1))        {          QccErrorAddMessage("%s: Error calling QccIMGImageSetSize()",                             argv[0]);          QccErrorExit();        }      if (QccIMGImageAlloc(&ResidualFrame))        {          QccErrorAddMessage("%s: Error calling QccIMGImageAlloc()",                             argv[0]);          QccErrorExit();        }      if (QccIMGImageComponentSubtract(&CurrentFrame.Y,                                       &CompensatedFrame.Y,                                       &ResidualFrame.Y))        {          QccErrorAddMessage("%s: Error calling QccIMGImageComponentSubtract()",                             argv[0]);          QccErrorExit();        }      if (QccIMGImageComponentAbsoluteValue(&ResidualFrame.Y))        {          QccErrorAddMessage("%s: Error calling QccIMGImageComponentAbsoluteValue()",                             argv[0]);          QccErrorExit();        }      if (QccIMGImageWrite(&ResidualFrame))        {          QccErrorAddMessage("%s: Error calling QccIMGImageWrite()",                             argv[0]);          QccErrorExit();        }    }  if (SubpixelReferenceFrameSpecified)    {      if (QccIMGImageDetermineType(&SubpixelReferenceFrame))        {          QccErrorAddMessage("%s: Error calling QccIMGImageDetermineType()",                             argv[0]);          QccErrorExit();        }      if (QccIMGImageColor(&SubpixelReferenceFrame))        {          QccErrorAddMessage("%s: Motion-compensated frame must be grayscale",                             argv[0]);          QccErrorExit();        }            if (QccIMGImageSetSize(&SubpixelReferenceFrame,                             ReferenceFrame2.num_rows,                             ReferenceFrame2.num_cols))        {          QccErrorAddMessage("%s: Error calling QccIMGImageSetSize()",                             argv[0]);          QccErrorExit();        }      SubpixelReferenceFrame.Y.image = ReferenceFrame2.image;            if (QccIMGImageWrite(&SubpixelReferenceFrame))        {          QccErrorAddMessage("%s: Error calling QccIMGImageWrite()",                             argv[0]);          QccErrorExit();        }    }    QccIMGImageFree(&CurrentFrame);  QccRegularMeshFree(&CurrentMesh);  QccIMGImageFree(&ReferenceFrame);  QccRegularMeshFree(&ReferenceMesh);  QccIMGImageComponentFree(&HorizontalMotion);  QccIMGImageComponentFree(&VerticalMotion);  QccIMGImageComponentFree(&CurrentFrame2);  QccIMGImageComponentFree(&ReferenceFrame2);  QccFilterFree(&Filter1);  QccFilterFree(&Filter2);  QccFilterFree(&Filter3);  QccIMGImageFree(&CompensatedFrame);  QccIMGImageFree(&ResidualFrame);  QccExit;}

⌨️ 快捷键说明

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