/*!
 ***********************************************************************
 * \brief
 *    Allocate Q matrix arrays
 ***********************************************************************
 */
void allocate_QOffsets ()
{
  int max_bitdepth = imax(params->output.bit_depth[0], params->output.bit_depth[1]);
  int max_qp = (3 + 6*(max_bitdepth));

  get_mem5Dint(&LevelOffset4x4Comp, 3, 2, max_qp + 1, 4, 4);
  get_mem5Dint(&LevelOffset8x8Comp, 3, 2, max_qp + 1, 8, 8);

  if (params->AdaptRoundingFixed)
  {
    get_mem3Dshort(&OffsetList4x4, 1, 25, 16);
    get_mem3Dshort(&OffsetList8x8, 1, 15, 64);    
  }
  else
  {
    get_mem3Dshort(&OffsetList4x4, max_qp + 1, 25, 16);
    get_mem3Dshort(&OffsetList8x8, max_qp + 1, 15, 64);    
  }

  get_mem2Dshort(&OffsetList4x4input, 25, 16);
  get_mem2Dshort(&OffsetList8x8input, 15, 64);
}
Example #2
0
/*!
 ***********************************************************************
 * \brief
 *    Allocate Q matrix arrays
 ***********************************************************************
 */
void allocate_QMatrix ()
{
  int bitdepth_qp_scale = 6*(input->BitDepthLuma - 8);
  int i;

  if ((qp_per_matrix = (int*)malloc((MAX_QP + 1 +  bitdepth_qp_scale)*sizeof(int))) == NULL)
    no_mem_exit("init_global_buffers: qp_per_matrix");
  if ((qp_rem_matrix = (int*)malloc((MAX_QP + 1 +  bitdepth_qp_scale)*sizeof(int))) == NULL)
    no_mem_exit("init_global_buffers: qp_per_matrix");

  for (i = 0; i < MAX_QP + bitdepth_qp_scale + 1; i++)
  {
    qp_per_matrix[i] = i / 6;
    qp_rem_matrix[i] = i % 6;
  }

  get_mem4Dint(&LevelScale4x4Luma,      2, 6, 4, 4);
  get_mem5Dint(&LevelScale4x4Chroma, 2, 2, 6, 4, 4);
  get_mem4Dint(&LevelScale8x8Luma,      2, 6, 8, 8);

  get_mem4Dint(&InvLevelScale4x4Luma,      2, 6, 4, 4);
  get_mem5Dint(&InvLevelScale4x4Chroma, 2, 2, 6, 4, 4);
  get_mem4Dint(&InvLevelScale8x8Luma,      2, 6, 8, 8);
}
Example #3
0
/*!
 ***********************************************************************
 * \brief
 *    Allocate Q matrix arrays
 ***********************************************************************
 */
void allocate_QOffsets ()
{
  int max_qp_per_luma = (3 + 6*(input->BitDepthLuma) - MIN_QP)/6 + 1;
  int max_qp_per_cr = (3 + 6*(input->BitDepthChroma) - MIN_QP)/6 + 1;
  int max_qp_per = imax(max_qp_per_luma,max_qp_per_cr);
  get_mem4Dint(&LevelOffset4x4Luma,      2, max_qp_per, 4, 4);
  get_mem5Dint(&LevelOffset4x4Chroma, 2, 2, max_qp_per, 4, 4);
  get_mem4Dint(&LevelOffset8x8Luma,      2, max_qp_per, 8, 8);

  get_mem2Dshort(&OffsetList4x4input, 15, 16);
  get_mem2Dshort(&OffsetList8x8input,  5, 64);
  get_mem2Dshort(&OffsetList4x4, 15, 16);
  get_mem2Dshort(&OffsetList8x8,  5, 64);

}