/** \file     CNNFilter.h
    \brief    convolutional neural network-based fiter class (header)
*/

#ifndef __CNNFILTER__
#define __CNNFILTER__

#include "CommonDef.h"
#include "Unit.h"
#include "Picture.h"
#include "Reshape.h"
//! \ingroup CommonLib
//! \{


class CNNFilter
{
public:
  CNNFilter();
  
  std::vector<PelStorage> m_tempBuf;
  std::string m_interLuma, m_interChroma, m_intraLuma, m_intraChroma;
#if SCALE_NN_RESIDUE
  std::vector<PelStorage> m_tempScaledBuf;
#endif
  template<typename T> void cnnFilterLumaBlock( Picture* pic, UnitArea inferArea, int extLeft, int extRight, int extTop, int extBottom, int paramIdx, bool inter);
  template<typename T> void cnnFilterChromaBlock( Picture* pic, UnitArea inferArea, int extLeft, int extRight, int extTop, int extBottom, int paramIdx, bool inter);
  void cnnFilter( Picture* pic);
#if SCALE_NN_RESIDUE
  void scaleResidualBlock(Picture *pic, UnitArea inferArea, int paramIdx, ComponentID compID);
#endif
  void create(const int picWidth, const int picHeight, const ChromaFormat format, const int cnnlfNumParams);
  void init(std::string interLuma, std::string interChroma, std::string intraLuma, std::string intraChroma);
  void destroy();
};

//! \}
#endif

