diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 457810a..b427985 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -29,6 +29,7 @@ ADD_MODULE( EightBitsSampling "EightBitsSampling" ) ADD_MODULE( FrameCrop "FrameCrop" ) ADD_MODULE( LumaAverage "LumaAverage" ) ADD_MODULE( WeightedPSNR "WeightedPSNR" ) +ADD_MODULE( HEVCIntraPrediction "HEVCIntraPrediction" ) ADD_MODULE_USE_OPENCV( MeasureOpticalFlowDualTVL1 "MeasureOpticalFlowDualTVL1" VERSION 2.4.13.0 MODULES video ) ADD_MODULE_USE_OPENCV( DisparityStereoBM "DisparityStereoBM" VERSION 2.4.13.0 MODULES calib3d ) diff --git a/modules/HEVCIntraPrediction.cpp b/modules/HEVCIntraPrediction.cpp new file mode 100644 index 0000000..0120803 --- /dev/null +++ b/modules/HEVCIntraPrediction.cpp @@ -0,0 +1,76 @@ +/* This file is a part of Calyp project + * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) + * Luis Lucas (luisfrlucas@gmail.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + * \file HEVCIntraPrediction.cpp + * \brief Binarize frame module + */ + +#include "HEVCIntraPrediction.h" + +HEVCIntraPrediction::HEVCIntraPrediction() +{ + /* Module Definition */ + m_iModuleAPI = CLP_MODULE_API_2; + m_iModuleType = CLP_FRAME_PROCESSING_MODULE; + m_pchModuleCategory = "HEVC"; + m_pchModuleLongName = "Intra Prediction"; + m_pchModuleName = "HEVCIntraPrediction"; + m_pchModuleTooltip = "Apply intra-frame prediction"; + m_uiNumberOfFrames = 1; + m_uiModuleRequirements = CLP_MODULE_REQUIRES_OPTIONS; + + m_cModuleOptions.addOptions() /**/ +// ( "mode", m_uiMode, "Intra mode [0-34]" ) +// ( "block_size", m_uiBlockSize, "Block size" ) + ( "x_pel", m_uiXpel, "X coordinate [0]" ) + ( "y_pel", m_uiXpel, "Y coordinate [0]" ) + ; + + m_pcPredBlock = NULL; + m_uiMode = 31; + m_uiBlockSize = 4; + m_uiXpel = 0; + m_uiYpel = 0; +} + +bool HEVCIntraPrediction::create( std::vector apcFrameList ) +{ + m_pcPredBlock = NULL; + m_pcPredBlock = new CalypFrame( m_uiBlockSize, m_uiBlockSize, CLP_GRAY, apcFrameList[0]->getBitsPel() ); + return true; +} + +CalypFrame* HEVCIntraPrediction::process( std::vector apcFrameList ) +{ + // Vertical modes + if( m_uiMode >= 18 && m_uiMode <=34 ) + { + + + } + return m_pcPredBlock; +} + +void HEVCIntraPrediction::destroy() +{ + if( m_pcPredBlock ) + delete m_pcPredBlock; + m_pcPredBlock = NULL; +} diff --git a/modules/HEVCIntraPrediction.h b/modules/HEVCIntraPrediction.h new file mode 100644 index 0000000..8920f10 --- /dev/null +++ b/modules/HEVCIntraPrediction.h @@ -0,0 +1,50 @@ +/* This file is a part of Calyp project + * Copyright (C) 2014-2018 by Joao Carreira (jfmcarreira@gmail.com) + * Luis Lucas (luisfrlucas@gmail.com) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + * \file HEVCIntraPrediction.h + * \brief Binarize frame module + */ + +#ifndef __HEVCIntraPrediction_H__ +#define __FRAMEBINARIZATION_H__ + +// CalypLib +#include "lib/CalypModuleIf.h" + +class HEVCIntraPrediction : public CalypModuleIf +{ + REGISTER_CLASS_FACTORY( HEVCIntraPrediction ) + +private: + CalypFrame* m_pcPredBlock; + unsigned int m_uiMode; + unsigned int m_uiBlockSize; + unsigned int m_uiXpel; + unsigned int m_uiYpel; + +public: + HEVCIntraPrediction(); + virtual ~HEVCIntraPrediction() {} + bool create( std::vector apcFrameList ); + CalypFrame* process( std::vector apcFrameList ); + void destroy(); +}; + +#endif // __FRAMEBINARIZATION_H__