]> sjero.net Git - qpsnr/blob - src/stats.h
Initial Commit of QPSNR (version 0.2.1)
[qpsnr] / src / stats.h
1 /*
2 *       qpsnr (C) 2010 E. Oriani, ema <AT> fastwebnet <DOT> it
3 *
4 *       This file is part of qpsnr.
5 *
6 *       qpsnr is free software: you can redistribute it and/or modify
7 *       it under the terms of the GNU General Public License as published by
8 *       the Free Software Foundation, either version 3 of the License, or
9 *       (at your option) any later version.
10 *
11 *       qpsnr is distributed in the hope that it will be useful,
12 *       but WITHOUT ANY WARRANTY; without even the implied warranty of
13 *       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 *       GNU General Public License for more details.
15 *
16 *       You should have received a copy of the GNU General Public License
17 *       along with qpsnr.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef _STATS_H_
21 #define _STATS_H_
22
23 #include <vector>
24 #include <ostream>
25
26 namespace stats {
27         typedef std::vector<unsigned char>      VUCHAR;
28
29         class s_base {
30         protected:
31                 const int       _n_streams,
32                                 _i_width,
33                                 _i_height;
34                 std::ostream    &_ostr;
35         public:
36                 s_base(const int& n_streams, const int& i_width, const int& i_height, std::ostream& ostr) : 
37                 _n_streams(n_streams), _i_width(i_width), _i_height(i_height), _ostr(ostr) {
38                 }
39
40                 virtual void set_parameter(const char* p_name, const char *p_value) {
41                 }
42
43                 virtual void process(const int& ref_frame, VUCHAR& ref, const std::vector<bool>& v_ok, std::vector<VUCHAR>& streams) = 0;
44
45                 virtual ~s_base() {
46                 }
47         };
48
49         extern s_base* get_analyzer(const char* id, const int& n_streams, const int& i_width, const int& i_height, std::ostream& ostr);
50 }
51
52 #endif /*_STATS_H_*/
53