forked from avTranscoder/avTranscoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVideoStat.hpp
More file actions
43 lines (35 loc) · 990 Bytes
/
Copy pathVideoStat.hpp
File metadata and controls
43 lines (35 loc) · 990 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef _AV_TRANSCODER_VIDEOSTAT_HPP
#define _AV_TRANSCODER_VIDEOSTAT_HPP
#include <AvTranscoder/common.hpp>
namespace avtranscoder
{
/**
* @brief Statistics related to a video stream.
*/
class AvExport VideoStat
{
public:
VideoStat(const float duration, const size_t nbFrames)
: _duration(duration)
, _nbFrames(nbFrames)
, _quality(0)
, _psnr(0)
{
}
public:
float getDuration() const { return _duration; }
size_t getNbFrames() const { return _nbFrames; }
size_t getQuality() const { return _quality; }
double getPSNR() const { return _psnr; }
void setQuality(const size_t quality) { _quality = quality; }
void setPSNR(const double mse) { _psnr = VideoStat::toPSNR(mse); }
private:
static double toPSNR(const double mse);
private:
float _duration;
size_t _nbFrames;
size_t _quality; ///< Between 1 (good) and FF_LAMBDA_MAX (bad). 0 if unknown.
double _psnr; ///< 0 if unknown.
};
}
#endif