Beispiel #1
0
/*
 * This method takes in a graphics and image objects to be used into
 * drawing the plane sprite onto the screen
 *
 * @param graphics is used for drawing the plane sprite
 * @param image is the sprite sheet where the plane sprite is retrieve from
 */
void Plane::draw(Graphics* graphics, Image* image)
{
    image->draw(getOffsetX(), getOffsetY(), SOURCE_SPRITE_OFFSET_X[color_][frameCounter_], SOURCE_SPRITE_OFFSET_Y[color_][frameCounter_], getSourceWidth(), getSourceHeight(), graphics);
    puffCloud_.draw(graphics, image);
}
Beispiel #2
0
Void TEncTop::create ()
{
  // initialize global variables
  initROM();

  // create processing unit classes
  m_cGOPEncoder.        create( );
  m_cSliceEncoder.      create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, m_maxTotalCUDepth );
  m_cCuEncoder.         create( m_maxTotalCUDepth, m_maxCUWidth, m_maxCUHeight, m_chromaFormatIDC );
  if (m_bUseSAO)
  {
    m_cEncSAO.create( getSourceWidth(), getSourceHeight(), m_chromaFormatIDC, m_maxCUWidth, m_maxCUHeight, m_maxTotalCUDepth, m_saoOffsetBitShift[CHANNEL_TYPE_LUMA], m_saoOffsetBitShift[CHANNEL_TYPE_CHROMA] );
#if SAO_ENCODE_ALLOW_USE_PREDEBLOCK
    m_cEncSAO.createEncData(getSaoCtuBoundary());
#else
    m_cEncSAO.createEncData();
#endif
  }
#if ADAPTIVE_QP_SELECTION
  if (m_bUseAdaptQpSelect)
  {
    m_cTrQuant.initSliceQpDelta();
  }
#endif

  m_cLoopFilter.create( m_maxTotalCUDepth );

  if ( m_RCEnableRateControl )
  {
    m_cRateCtrl.init( m_framesToBeEncoded, m_RCTargetBitrate, m_iFrameRate, m_iGOPSize, m_iSourceWidth, m_iSourceHeight,
        m_maxCUWidth, m_maxCUHeight, m_RCKeepHierarchicalBit, m_RCUseLCUSeparateModel, m_GOPList );
  }

  m_pppcRDSbacCoder = new TEncSbac** [m_maxTotalCUDepth+1];
#if FAST_BIT_EST
  m_pppcBinCoderCABAC = new TEncBinCABACCounter** [m_maxTotalCUDepth+1];
#else
  m_pppcBinCoderCABAC = new TEncBinCABAC** [m_maxTotalCUDepth+1];
#endif

  for ( Int iDepth = 0; iDepth < m_maxTotalCUDepth+1; iDepth++ )
  {
    m_pppcRDSbacCoder[iDepth] = new TEncSbac* [CI_NUM];
#if FAST_BIT_EST
    m_pppcBinCoderCABAC[iDepth] = new TEncBinCABACCounter* [CI_NUM];
#else
    m_pppcBinCoderCABAC[iDepth] = new TEncBinCABAC* [CI_NUM];
#endif

    for (Int iCIIdx = 0; iCIIdx < CI_NUM; iCIIdx ++ )
    {
      m_pppcRDSbacCoder[iDepth][iCIIdx] = new TEncSbac;
#if FAST_BIT_EST
      m_pppcBinCoderCABAC [iDepth][iCIIdx] = new TEncBinCABACCounter;
#else
      m_pppcBinCoderCABAC [iDepth][iCIIdx] = new TEncBinCABAC;
#endif
      m_pppcRDSbacCoder   [iDepth][iCIIdx]->init( m_pppcBinCoderCABAC [iDepth][iCIIdx] );
    }
  }
}
Beispiel #3
0
void Background::draw(Graphics* graphics, Image* image)
{
    image->draw(getOffsetX(), getOffsetY(), SOURCE_SPRITE_OFFSET_X, SOURCE_SPRITE_OFFSET_Y, getSourceWidth(), getSourceHeight(), graphics);
}
Beispiel #4
0
void Ground::draw(Graphics* graphics, Image* image)
{

    image->draw(getOffsetX(), getOffsetY(), SOURCE_SPRITE_OFFSET_X[type_], SOURCE_SPRITE_OFFSET_Y[type_], getSourceWidth(), getSourceHeight(), graphics);
    image->draw((getOffsetX() + GROUND_WIDTH), getOffsetY(), SOURCE_SPRITE_OFFSET_X[type_], SOURCE_SPRITE_OFFSET_Y[type_], getSourceWidth(), getSourceHeight(), graphics);
}