/*!
 ***********************************************************************
 * \brief
 *    Initialise Q offset matrix values.
 ***********************************************************************
 */
void Init_QOffsetMatrix ()
{
  char *content;

  allocate_QOffsets ();

  if (params->OffsetMatrixPresentFlag)
  {
    printf ("Parsing Quantization Offset Matrix file %s ",
      params->QOffsetMatrixFile);
    content = GetConfigFileContent (params->QOffsetMatrixFile, 0);
    if (content != '\0')
      ParseQOffsetMatrix (content, strlen (content));
    else
    {
      printf
        ("\nError: %s\nProceeding with default values for all matrices.",
        errortext);
      params->OffsetMatrixPresentFlag = 0;
    }

    printf ("\n");

    free (content);
  }
  //! Now set up all offset params. This process could be reused if we wish to re-init offsets
  InitOffsetParam ();
}
예제 #2
0
파일: q_offsets.c 프로젝트: Foredoomed/JM
/*!
 ***********************************************************************
 * \brief
 *    Initialise Q offset matrix values.
 ***********************************************************************
 */
void init_qoffset (VideoParameters *p_Vid)
{
  char *content;
  InputParameters *p_Inp = p_Vid->p_Inp;

  allocate_QOffsets (p_Vid->p_Quant, p_Inp);

  if (p_Inp->OffsetMatrixPresentFlag)
  {
    printf ("Parsing Quantization Offset Matrix file %s ",
      p_Inp->QOffsetMatrixFile);
    content = GetConfigFileContent (p_Inp->QOffsetMatrixFile, 0);
    if (content != '\0')
      ParseQOffsetMatrix (p_Vid->p_Quant, content, (int) strlen (content));
    else
    {
      printf ("\nError: %s\nProceeding with default values for all matrices.", errortext);
      p_Inp->OffsetMatrixPresentFlag = 0;
    }

    printf ("\n");

    free (content);
  }
  //! Now set up all offset p_Inp. This process could be reused if we wish to re-init offsets
  InitOffsetParam (p_Vid->p_Quant, p_Inp);
}