예제 #1
0
/*!
 ***********************************************************************
 * \brief
 *    Initialise Q matrix values.
 ***********************************************************************
 */
void Init_QMatrix (void)
{
  char *content;


  allocate_QMatrix ();

  if(input->ScalingMatrixPresentFlag)
  {
    printf ("Parsing QMatrix file %s ", input->QmatrixFile);
    content = GetConfigFileContent(input->QmatrixFile, 0);
    if(content!='\0')
      ParseMatrix(content, strlen (content));
    else
      printf("\nError: %s\nProceeding with default values for all matrices.", errortext);

    PatchMatrix();
    printf("\n");

    memset(UseDefaultScalingMatrix4x4Flag, 0, 6 * sizeof(short));
    UseDefaultScalingMatrix8x8Flag[0]=UseDefaultScalingMatrix8x8Flag[1]=0;

    free(content);
  }
}
예제 #2
0
파일: q_matrix.c 프로젝트: Foredoomed/JM
/*!
 ***********************************************************************
 * \brief
 *    Initialise Q matrix values.
 ***********************************************************************
 */
void init_qmatrix (VideoParameters *p_Vid, InputParameters *p_Inp)
{
  QuantParameters *p_Quant = p_Vid->p_Quant;
  ScaleParameters *p_QScale = p_Vid->p_QScale;
  char *content;

  allocate_QMatrix (p_Quant, p_Inp);

  if(p_Inp->ScalingMatrixPresentFlag)
  {
    printf ("Parsing QMatrix file %s ", p_Inp->QmatrixFile);
    content = GetConfigFileContent(p_Inp->QmatrixFile, 0);
    if(content!='\0')
      ParseMatrix(p_Vid, content, (int) strlen (content));
    else
      printf("\nError: %s\nProceeding with default values for all matrices.", errortext);

    PatchMatrix(p_Vid, p_Inp);
    printf("\n");

    memset(p_QScale->UseDefaultScalingMatrix4x4Flag, 0, 6 * sizeof(short));
    memset(p_QScale->UseDefaultScalingMatrix8x8Flag, 0, 6 * sizeof(short));

    free(content);
  }
}