Add module to measure HEVC intra-prediction modes

This commit is contained in:
jfmcarreira committed 2018-07-23 21:43:57 +01:00
1 parent f770266250
commit 34e01b59f5
3 files changed
+127

No files matched your search

+1
View File
@@ -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 )
+76
View File
@@ -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<CalypFrame*> apcFrameList )
{
m_pcPredBlock = NULL;
m_pcPredBlock = new CalypFrame( m_uiBlockSize, m_uiBlockSize, CLP_GRAY, apcFrameList[0]->getBitsPel() );
return true;
}
CalypFrame* HEVCIntraPrediction::process( std::vector<CalypFrame*> 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;
}
+50
View File
@@ -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<CalypFrame*> apcFrameList );
CalypFrame* process( std::vector<CalypFrame*> apcFrameList );
void destroy();
};
#endif // __FRAMEBINARIZATION_H__