Skip to content

Commit c496d63

Browse files
author
Clement Champetier
committed
stat: split ProcessStat by adding VideoStat files
1 parent 94bf8fc commit c496d63

File tree

5 files changed

+51
-31
lines changed

5 files changed

+51
-31
lines changed

src/AvTranscoder/stat/ProcessStat.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
#include "ProcessStat.hpp"
22

33
#include <utility>
4-
#include <math.h>
54

65
namespace avtranscoder
76
{
87

9-
double VideoStat::psnr( const double d )
10-
{
11-
return -10.0 * log(d) / log(10.0);
12-
}
13-
148
void ProcessStat::addVideoStat( const size_t streamIndex, const VideoStat& videoStat )
159
{
1610
_videoStats.insert( std::make_pair( streamIndex, videoStat ) );

src/AvTranscoder/stat/ProcessStat.hpp

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,16 @@
11
#ifndef _AV_TRANSCODER_PROCESSSTAT_HPP
2-
#define _AV_TRANSCODER_PROCESSSTAT_HPP
2+
#define _AV_TRANSCODER_PROCESSSTAT_HPP
33

44
#include <AvTranscoder/common.hpp>
5+
#include <AvTranscoder/stat/VideoStat.hpp>
56

67
#include <map>
78

89
namespace avtranscoder
910
{
1011

1112
/**
12-
* @brief Statistic related to a video stream.
13-
*/
14-
class VideoStat
15-
{
16-
public:
17-
VideoStat( const double duration, const size_t nbFrames )
18-
: _duration( duration )
19-
, _nbFrames( nbFrames )
20-
, _quality( 0 )
21-
, _psnr( 0 )
22-
{}
23-
24-
public:
25-
static double psnr( const double d );
26-
27-
public:
28-
double _duration;
29-
size_t _nbFrames;
30-
size_t _quality; ///< Between 1 (good) and FF_LAMBDA_MAX (bad). 0 if unknown.
31-
double _psnr; ///< 0 if unknown.
32-
};
33-
34-
/**
35-
* @brief ProcessStat contains statistic results given after the process.
13+
* @brief ProcessStat contains statistics given after the process.
3614
* @see Transcoder::process methods
3715
*/
3816
class ProcessStat

src/AvTranscoder/stat/VideoStat.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include "ProcessStat.hpp"
2+
3+
#include <math.h>
4+
5+
namespace avtranscoder
6+
{
7+
8+
double VideoStat::psnr( const double d )
9+
{
10+
return -10.0 * log(d) / log(10.0);
11+
}
12+
13+
}

src/AvTranscoder/stat/VideoStat.hpp

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#ifndef _AV_TRANSCODER_VIDEOSTAT_HPP
2+
#define _AV_TRANSCODER_VIDEOSTAT_HPP
3+
4+
#include <AvTranscoder/common.hpp>
5+
6+
namespace avtranscoder
7+
{
8+
9+
/**
10+
* @brief Statistics related to a video stream.
11+
*/
12+
class VideoStat
13+
{
14+
public:
15+
VideoStat( const double duration, const size_t nbFrames )
16+
: _duration( duration )
17+
, _nbFrames( nbFrames )
18+
, _quality( 0 )
19+
, _psnr( 0 )
20+
{}
21+
22+
public:
23+
static double psnr( const double d );
24+
25+
public:
26+
double _duration;
27+
size_t _nbFrames;
28+
size_t _quality; ///< Between 1 (good) and FF_LAMBDA_MAX (bad). 0 if unknown.
29+
double _psnr; ///< 0 if unknown.
30+
};
31+
32+
}
33+
34+
#endif

src/AvTranscoder/transcoder/Transcoder.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include <AvTranscoder/file/util.hpp>
44
#include <AvTranscoder/progress/NoDisplayProgress.hpp>
5+
#include <AvTranscoder/stat/VideoStat.hpp>
56

67
#include <limits>
78
#include <algorithm>

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy