예제 #1
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);

}
예제 #2
0
파일: q_offsets.c 프로젝트: Foredoomed/JM
/*!
 ***********************************************************************
 * \brief
 *    Allocate Q matrix arrays
 ***********************************************************************
 */
static void allocate_QOffsets (QuantParameters *p_Quant, InputParameters *p_Inp)
{
  int max_bitdepth = imax(p_Inp->output.bit_depth[0], p_Inp->output.bit_depth[1]);
  int max_qp = (3 + 6*(max_bitdepth));


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

  get_mem2Dshort(&p_Quant->OffsetList4x4input, 25, 16);
  get_mem2Dshort(&p_Quant->OffsetList8x8input, 15, 64);
}
예제 #3
0
/*!
 ************************************************************************
 * \brief
 *    Allocate 3D memory short array -> short array3D[frames][rows][columns]
 *
 * \par Output:
 *    memory size in bytes
 ************************************************************************
 */
int get_mem3Dshort(short ****array3D, int frames, int rows, int columns)
{
  int  j;

  if(((*array3D) = (short***)calloc(frames,sizeof(short**))) == NULL)
    no_mem_exit("get_mem3Dshort: array3D");

  for(j=0;j<frames;j++)
    get_mem2Dshort( (*array3D)+j, rows, columns ) ;

  return frames*rows*columns*sizeof(short);
}
/*!
 ***********************************************************************
 * \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);
}
예제 #5
0
/*!
 ************************************************************************
 * \brief
 *    Allocate 3D memory short array -> short array3D[frames][rows][columns]
 *
 * \par Output:
 *    memory size in bytes
 *-----------------------------------------------------------------------			
 *	 Function Argument List Changed [Removing Global Variables] 
 *	 Input parameters added are 
 *			- h264_decoder* dec_params
 *
 *		<*****@*****.**>
 ************************************************************************
 */
int get_mem3Dshort(short ****array3D, int frames, int rows, int columns)
{
  int  j;

  if(((*array3D) = (short***)h264_calloc(frames,sizeof(short**))) == NULL)
  {
    printf("get_mem3Dshort: array3D");
	exit(0);
  }
  for(j=0;j<frames;j++)
  {
	  get_mem2Dshort( (*array3D)+j, rows, columns) ;
  }
  return frames*rows*columns*sizeof(short);
}