Clean some comments

This commit is contained in:
jfmcarreira committed 2016-05-04 01:50:12 +01:00
1 parent 399065965b
commit 501e24fc5d
24 files changed
+168 -153

No files matched your search

+1 -2
View File
@@ -13,9 +13,8 @@ set(PlaYUVer_Lib_SRCS
PlaYUVerStream.cpp
StreamHandlerRaw.cpp
StreamHandlerPortableMap.cpp
# Command Parser
# Options Parser
PlaYUVerOptions.cpp
# PlaYUVerCmdParser.cpp
)
IF( USE_FFMPEG )
+1
View File
@@ -27,6 +27,7 @@
#define __PLAYUVERDEFS_H__
#include <string>
#include <vector>
#include <algorithm>
+5 -9
View File
@@ -19,23 +19,19 @@
/**
* \file PlaYUVerFrame.cpp
* \ingroup PlaYUVerLib
* \brief Video Frame handling
*/
#include "config.h"
#include <cstdio>
#include <cmath>
#include "LibMemory.h"
#include "PlaYUVerFrame.h"
#include "PlaYUVerFramePixelFormats.h"
#ifdef USE_FFMPEG
#include "StreamHandlerLibav.h"
#endif
#include <cmath>
#ifdef USE_OPENCV
#include "StreamHandlerOpenCV.h"
#include <opencv2/core.hpp>
#endif
#include "LibMemory.h"
#include "PlaYUVerFramePixelFormats.h"
/*! \brief Supported formats
*
+10 -15
View File
@@ -19,21 +19,15 @@
/**
* \file PlaYUVerFrame.h
* \ingroup PlaYUVerLib
* \brief Video Frame handling
*/
#ifndef __PLAYUVERFRAME_H__
#define __PLAYUVERFRAME_H__
#include <iostream>
#include <cstdio>
#include <cassert>
#include <vector>
#include "PlaYUVerDefs.h"
#include "PlaYUVerPixel.h"
namespace cv
{
class Mat;
@@ -51,7 +45,6 @@ struct PlaYUVerFramePrivate;
* \brief Frame handling class
*/
class PlaYUVerFrame
//: public PlaYUVerFrameStats
{
public:
@@ -133,8 +126,6 @@ public:
~PlaYUVerFrame();
Void clear();
Bool haveSameFmt( PlaYUVerFrame* other, UInt match = MATCH_ALL ) const;
/**
@@ -144,11 +135,13 @@ public:
Int getPelFormat() const;
/**
* Get pixel format information
* @return pixel format name
*/
String getPelFmtName();
/**
* Get color space information
* @return get color space index
* @
*/
@@ -198,6 +191,11 @@ public:
*/
static UInt64 getBytesPerFrame( UInt uiWidth, UInt uiHeight, Int iPixelFormat, UInt bitsPixel );
/**
* Reset frame pixels to zero
*/
Void clear();
Pel*** getPelBufferYUV() const;
Pel*** getPelBufferYUV();
UChar* getRGBBuffer() const;
@@ -236,16 +234,13 @@ public:
Bool fromMat( cv::Mat& cvMat );
/**
* @defgroup PlaYUVerLib_QualityMetrics Quality Metrics Interface
* \ingroup PlaYUVerLib_Frame
* @defgroup PlaYUVerLib_Frame_QualityMetrics Quality Metrics Interface
* @{
* \ingroup PlaYUVerLib
* Quality metrics interface
*
* @}
*/
//! @ingroup PlaYUVerLib_QualityMetrics
//! @{
enum QualityMetrics
{
NO_METRIC = -1,
@@ -269,7 +264,7 @@ public:
Double getPSNR( PlaYUVerFrame* Org, Int component );
Double getSSIM( PlaYUVerFrame* Org, Int component );
//! @}
/** @} */
private:
PlaYUVerFramePrivate* d;
+6 -4
View File
@@ -19,22 +19,24 @@
/**
* \file PlaYUVerFramePixelFormats.cpp
* \ingroup PlaYUVerLib
* \brief Handling the pixel formats definition
*/
#include "config.h"
#include <cstdio>
#include "LibMemory.h"
#include "PlaYUVerFramePixelFormats.h"
// #include <cstdio>
#ifdef USE_SSE
#include <emmintrin.h>
#include <smmintrin.h>
#include <limits.h>
#endif
#include "LibMemory.h"
#ifdef USE_FFMPEG
#include "StreamHandlerLibav.h"
#endif
#include "PlaYUVerFramePixelFormats.h"
/*
+1 -3
View File
@@ -19,7 +19,6 @@
/**
* \file PlaYUVerFramePixelFormats.h
* \ingroup PlaYUVerLib
* \brief Handling the pixel formats definition
*/
@@ -27,9 +26,8 @@
#define __PLAYUVERFRAMEPIXELFORMATS_H__
#include "PlaYUVerDefs.h"
#include "PlaYUVerFrame.h"
#include "PlaYUVerPixel.h"
#include "PlaYUVerFrame.h"
#define CHROMA_RESAMPLING( X ) ( ( ( X + 1 ) >> 1 ) << 1 )
+5 -6
View File
@@ -19,7 +19,6 @@
/**
* \file PlaYUVerLib.h
* \ingroup PlaYUVerLib
* \brief Inlcude all modules of PlaYUVer Lib
*/
@@ -40,16 +39,16 @@
* This guaratees that the top-level applications does not need to worry
* about dealig with different stream formats as well as different pixel formats
*
* @defgroup PlaYUVerLib_Stream PlaYUVer Stream
* @{
* Describe PlaYUVerStream
* @}
*
* @defgroup PlaYUVerLib_Frame PlaYUVer Frame
* @{
* Describe PlaYUVerFrame
* @}
*
* @defgroup PlaYUVerLib_Stream PlaYUVer Stream
* @{
* Describe PlaYUVerStream
* @}
*
* @}
*
*/
+41 -6
View File
@@ -19,12 +19,22 @@
/**
* \file PlaYUVerModuleIf.h
* \ingroup PlaYUVerLib_Modules
* \brief PlaYUVer modules interface
*/
#ifndef __PLAYUVERMODULESIF_H__
#define __PLAYUVERMODULESIF_H__
/**
* \ingroup PlaYUVerLib
* @defgroup PlaYUVerLib_Modules PlaYUVer Modules
* @{
* PlaYUVerLib supports the creation of independent
* frame processing modules
* @}
*/
#include "PlaYUVerDefs.h"
#include "PlaYUVerFrame.h"
#include "PlaYUVerOptions.h"
@@ -46,31 +56,48 @@ for( UInt i = 0; i < apcFrameList.size(); i++ ) \
if( !apcFrameList[i] ) \
return false;
enum // Module API
/** Module_API_Version Enum
* \ingroup PlaYUVerLib_Modules
* Version of the modules API required
* @see m_iModuleAPI
*/
enum Module_API_Version
{
MODULE_API_1,
MODULE_API_2,
};
enum // Module type
/** Module_Type Enum
* \ingroup PlaYUVerLib_Modules
* Type of module
* @see m_iModuleType
*/
enum Module_Type
{
FRAME_PROCESSING_MODULE,
FRAME_MEASUREMENT_MODULE,
};
#define APPLY_WHILE_PLAYING true
#define MAX_NUMBER_FRAMES 3
/** Module_NumberOfFrames Enum
* \ingroup PlaYUVerLib_Modules
* Number of frames requires by a module
* @see m_uiNumberOfFrames
*/
enum Module_NumberOfFrames
{
MODULE_REQUIRES_ONE_FRAME = 1,
MODULE_REQUIRES_TWO_FRAMES,
MODULE_REQUIRES_THREE_FRAMES,
MODULE_REQUIRES_FOUR_FRAMES,
MODULE_REQUIRES_FIVE_FRAMES,
MODULE_REQUIRES_SIX_FRAMES,
MODULE_REQUIRES_MAX_FRAMES = 255,
};
/** Module_Features Enum
* \ingroup PlaYUVerLib_Modules
* Features/Requirements of a module
* @see m_uiModuleRequirements
*/
enum Module_Features
{
MODULE_REQUIRES_NOTHING = 0,
@@ -89,6 +116,11 @@ enum Module_Key_Supported
};
/**
* \class PlaYUVerModuleIf
* \ingroup PlaYUVerLib PlaYUVerLib_Modules
* \brief Abstract class for modules
*/
class PlaYUVerModuleIf
{
public:
@@ -98,7 +130,10 @@ public:
const Char* m_pchModuleCategory;
const Char* m_pchModuleName;
const Char* m_pchModuleTooltip;
//! Number of frames
enum Module_NumberOfFrames m_uiNumberOfFrames;
//! Features/Requirements
UInt m_uiModuleRequirements;
PlaYUVerOptions m_cModuleOptions;
+1 -1
View File
@@ -33,7 +33,7 @@
/**
* \file PlaYUVerOptions.cpp
* \brief Input args handler
* \brief Options handler
*/
#include "config.h"
+1 -1
View File
@@ -33,7 +33,7 @@
/**
* \file PlaYUVerOptions.h
* \brief Input args handler
* \brief Options handler
*/
#ifndef __PROGRAMOPTIONS_H__
-1
View File
@@ -19,7 +19,6 @@
/**
* \file PlaYUVerPixel.cpp
* \ingroup PlaYUVerLib
* \brief Pixel handling
*/
-1
View File
@@ -19,7 +19,6 @@
/**
* \file PlaYUVerPixel.h
* \ingroup PlaYUVerLib
* \brief Pixel handling
*/
+8 -9
View File
@@ -19,19 +19,18 @@
/**
* \file PlaYUVerStream.cpp
* \ingroup PlaYUVerLib
* \brief Input stream handling
*/
#include "config.h"
#include <cstdio>
#include <vector>
#include "LibMemory.h"
#include "PlaYUVerStream.h"
#include <cstdio>
#include "LibMemory.h"
#include "PlaYUVerStreamHandlerIf.h"
#include "StreamHandlerRaw.h"
#include "StreamHandlerPortableMap.h"
#ifdef USE_FFMPEG
#include "StreamHandlerLibav.h"
#endif
@@ -43,8 +42,8 @@
std::vector<PlaYUVerSupportedFormat> PlaYUVerStream::supportedReadFormats()
{
INI_REGIST_PLAYUVER_SUPPORTED_FMT;
REGIST_PLAYUVER_SUPPORTED_FMT( &PlaYUVerRawHandler::Create, "Raw Video", "yuv" );
REGIST_PLAYUVER_SUPPORTED_FMT( &PlaYUVerRawHandler::Create, "Raw Video", "gray" );
REGIST_PLAYUVER_SUPPORTED_FMT( &StreamHandlerRaw::Create, "Raw Video", "yuv" );
REGIST_PLAYUVER_SUPPORTED_FMT( &StreamHandlerRaw::Create, "Raw Video", "gray" );
REGIST_PLAYUVER_SUPPORTED_FMT( &StreamHandlerPortableMap::Create, "Portable BitMap ", "pbm" );
REGIST_PLAYUVER_SUPPORTED_FMT( &StreamHandlerPortableMap::Create, "Portable GrayMap ", "pgm" );
REGIST_PLAYUVER_SUPPORTED_FMT( &StreamHandlerPortableMap::Create, "Portable PixMap ", "ppm" );
@@ -60,7 +59,7 @@ std::vector<PlaYUVerSupportedFormat> PlaYUVerStream::supportedReadFormats()
std::vector<PlaYUVerSupportedFormat> PlaYUVerStream::supportedWriteFormats()
{
INI_REGIST_PLAYUVER_SUPPORTED_FMT;
REGIST_PLAYUVER_SUPPORTED_FMT( &PlaYUVerRawHandler::Create, "Raw Video", "yuv" );
REGIST_PLAYUVER_SUPPORTED_FMT( &StreamHandlerRaw::Create, "Raw Video", "yuv" );
REGIST_PLAYUVER_SUPPORTED_FMT( &StreamHandlerPortableMap::Create, "Portable BitMap ", "pbm" );
REGIST_PLAYUVER_SUPPORTED_FMT( &StreamHandlerPortableMap::Create, "Portable GrayMap ", "pgm" );
#ifdef USE_FFMPEG
@@ -124,7 +123,7 @@ CreateStreamHandlerFn PlaYUVerStream::findStreamHandler( String strFilename, boo
return supportedFmts[i].formatFct;
}
}
return &PlaYUVerRawHandler::Create;
return &StreamHandlerRaw::Create;
}
PlaYUVerStream::PlaYUVerStream()
+1 -6
View File
@@ -19,7 +19,6 @@
/**
* \file PlaYUVerStream.h
* \ingroup PlaYUVerLib
* \brief Input stream handling
*/
@@ -27,13 +26,8 @@
#define __PLAYUVERSTREAM_H__
#include "PlaYUVerDefs.h"
#include <iostream>
#include <fstream>
#include <cstdio>
#include "PlaYUVerFrame.h"
class LibOpenCVHandler;
class PlaYUVerStreamHandlerIf;
typedef struct
@@ -76,6 +70,7 @@ typedef struct
/**
* \class PlaYUVerStream
* \ingroup PlaYUVerLib PlaYUVerLib_Stream
* \brief Stream handling class
*/
class PlaYUVerStream
{
+1 -1
View File
@@ -37,7 +37,7 @@
/**
* \class PlaYUVerStreamHandlerIf
* \ingroup PlaYUVerLib PlaYUVerLib_Stream
* \ingroup PlaYUVerLib_Stream
* \brief Abstract class for stream handling
*/
class PlaYUVerStreamHandlerIf
-1
View File
@@ -19,7 +19,6 @@
/**
* \file StreamHandlerLibav.cpp
* \ingroup PlaYUVerLib
* \brief Interface with libav libs
*/
+8 -3
View File
@@ -19,7 +19,6 @@
/**
* \file StreamHandlerLibav.h
* \ingroup PlaYUVerLib
* \brief Interface with libav libs
*/
@@ -43,7 +42,6 @@ extern "C"
#include <libavutil/avutil.h>
#include <libavutil/imgutils.h>
#include <libavutil/samplefmt.h>
//#include <libavutil/timestamp.h>
#include <libavformat/avformat.h>
}
@@ -52,6 +50,14 @@ extern "C"
#include "PlaYUVerStreamHandlerIf.h"
struct AVFormatContext;
struct AVCodecContext;
struct AVStream;
struct AVStream;
struct AVPacket;
class StreamHandlerLibav: public PlaYUVerStreamHandlerIf
{
REGISTER_STREAM_HANDLER( StreamHandlerLibav )
@@ -85,7 +91,6 @@ public:
UInt64 m_uiFrameBufferSize;
private:
AVFormatContext* m_cFmtCtx;
AVCodecContext* m_cCodecCtx;
AVStream* m_cStream;
-1
View File
@@ -19,7 +19,6 @@
/**
* \file StreamHandlerOpenCV.cpp
* \ingroup PlaYUVerLib
* \brief Interface with opencv lib
*/
-1
View File
@@ -19,7 +19,6 @@
/**
* \file StreamHandlerOpenCV.h
* \ingroup PlaYUVerLib
* \brief Interface with opencv lib
*/
+1 -2
View File
@@ -19,8 +19,7 @@
/**
* \file StreamHandlerPortableMap.cpp
* \ingroup PlaYUVerLib
* \brief Interface with opencv lib
* \brief Handling portable pixmap formats
*/
#include <cstdio>
+1 -2
View File
@@ -19,8 +19,7 @@
/**
* \file StreamHandlerPortableMap.h
* \ingroup PlaYUVerLib
* \brief Interface with opencv lib
* \brief Handling portable pixmap formats
*/
#ifndef __STREAMHANDLERPORTABLEMAP_H__
+7 -8
View File
@@ -19,7 +19,6 @@
/**
* \file StreamHandlerRaw.cpp
* \ingroup PlaYUVerLib
* \brief Interface for raw (yuv) streams
*/
@@ -30,7 +29,7 @@
#include "LibMemory.h"
Bool PlaYUVerRawHandler::openHandler( String strFilename, Bool bInput )
Bool StreamHandlerRaw::openHandler( String strFilename, Bool bInput )
{
m_bIsInput = bInput;
m_pFile = NULL;
@@ -44,19 +43,19 @@ Bool PlaYUVerRawHandler::openHandler( String strFilename, Bool bInput )
return true;
}
Void PlaYUVerRawHandler::closeHandler()
Void StreamHandlerRaw::closeHandler()
{
if( m_pFile )
fclose( m_pFile );
}
Bool PlaYUVerRawHandler::configureBuffer( PlaYUVerFrame* pcFrame )
Bool StreamHandlerRaw::configureBuffer( PlaYUVerFrame* pcFrame )
{
return getMem1D<Byte>( &m_pStreamBuffer, pcFrame->getBytesPerFrame() );
}
UInt64 PlaYUVerRawHandler::calculateFrameNumber()
UInt64 StreamHandlerRaw::calculateFrameNumber()
{
if( !m_pFile || m_uiNBytesPerFrame == 0 )
return 0;
@@ -66,7 +65,7 @@ UInt64 PlaYUVerRawHandler::calculateFrameNumber()
return ( fileSize / m_uiNBytesPerFrame );
}
Bool PlaYUVerRawHandler::seek( UInt64 iFrameNum )
Bool StreamHandlerRaw::seek( UInt64 iFrameNum )
{
if( m_bIsInput && m_pFile )
{
@@ -76,7 +75,7 @@ Bool PlaYUVerRawHandler::seek( UInt64 iFrameNum )
return false;
}
Bool PlaYUVerRawHandler::read( PlaYUVerFrame* pcFrame )
Bool StreamHandlerRaw::read( PlaYUVerFrame* pcFrame )
{
UInt64 processed_bytes = fread( m_pStreamBuffer, sizeof( Byte ), m_uiNBytesPerFrame, m_pFile );
if( processed_bytes != m_uiNBytesPerFrame )
@@ -85,7 +84,7 @@ Bool PlaYUVerRawHandler::read( PlaYUVerFrame* pcFrame )
return true;
}
Bool PlaYUVerRawHandler::write( PlaYUVerFrame* pcFrame )
Bool StreamHandlerRaw::write( PlaYUVerFrame* pcFrame )
{
pcFrame->frameToBuffer( m_pStreamBuffer );
UInt64 processed_bytes = fwrite( m_pStreamBuffer, sizeof( Byte ), m_uiNBytesPerFrame, m_pFile );
+5 -6
View File
@@ -30,20 +30,19 @@
/**
* \class PlaYUVerRawHandler
* \ingroup PlaYUVerLib PlaYUVerLib_Stream
* \class StreamHandlerRaw
* \brief Class to handle raw video format
*/
class PlaYUVerRawHandler: public PlaYUVerStreamHandlerIf
class StreamHandlerRaw: public PlaYUVerStreamHandlerIf
{
REGISTER_STREAM_HANDLER( PlaYUVerRawHandler )
REGISTER_STREAM_HANDLER( StreamHandlerRaw )
private:
FILE* m_pFile; /**< The input file pointer >*/
public:
PlaYUVerRawHandler() {}
~PlaYUVerRawHandler() {}
StreamHandlerRaw() {}
~StreamHandlerRaw() {}
Bool openHandler( String strFilename, Bool bInput );
Void closeHandler();