1 /*!
2  **************************************************************************
3  *  \file enc_statistics.h
4  *
5  *  \brief
6  *     statistics reports for the encoding process.
7  *
8  *  \author
9  *      Main contributors (see contributors.h for copyright, address and affiliation details)
10  *      - Alexis Tourapis                 <alexismt@ieee.org>
11  *      - Karsten Suehring
12  *
13  **************************************************************************
14  */
15 
16 #ifndef _ENC_STATISTICS_H_
17 #define _ENC_STATISTICS_H_
18 #include "global.h"
19 
20 struct stat_parameters
21 {
22   float  bitrate;                     //!< average bit rate for the sequence except first frame
23   int64  bit_ctr;                     //!< counter for bit usage
24   int64  bit_ctr_n;                   //!< bit usage for the current frame
25   int64  bit_ctr_emulation_prevention; //!< stored bits needed to prevent start code emulation
26   int    bit_slice;                   //!< number of bits in current slice
27   int    stored_bit_slice;            //!< keep number of bits in current slice (to restore status in case of MB re-encoding)
28   int    b8_mode_0_use     [NUM_SLICE_TYPES][2];
29   int64  mode_use_transform[NUM_SLICE_TYPES][MAXMODE][2];
30   int64  intra_chroma_mode[4];
31 
32   // B pictures
33   int    NumberBFrames;
34 
35   int    frame_counter;
36   int64  quant                [NUM_SLICE_TYPES];
37   int64  num_macroblocks      [NUM_SLICE_TYPES];
38   int    frame_ctr            [NUM_SLICE_TYPES];
39   int64  bit_counter          [NUM_SLICE_TYPES];
40   float  bitrate_st           [NUM_SLICE_TYPES];
41   int64  mode_use             [NUM_SLICE_TYPES][MAXMODE]; //!< Macroblock mode usage for Intra frames
42   int64  bit_use_mode         [NUM_SLICE_TYPES][MAXMODE]; //!< statistics of bit usage
43   int64  bit_use_mb_type      [NUM_SLICE_TYPES];
44   int64  bit_use_header       [NUM_SLICE_TYPES];
45   int64  tmp_bit_use_cbp      [NUM_SLICE_TYPES];
46   int64  bit_use_coeffC       [NUM_SLICE_TYPES];
47   int64  bit_use_coeff     [3][NUM_SLICE_TYPES];
48   int64  bit_use_delta_quant  [NUM_SLICE_TYPES];
49   int64  bit_use_stuffing_bits[NUM_SLICE_TYPES];
50 
51   int    bit_ctr_parametersets;
52   int    bit_ctr_parametersets_n;
53   int64  bit_ctr_filler_data;
54   int64  bit_ctr_filler_data_n;
55 
56 #if (MVC_EXTENSION_ENABLE)
57   float  bitrate_v[2];                       //!< average bit rate for the sequence except first frame
58   int64  bit_ctr_v[2];                     //!< counter for bit usage
59   int64  bit_ctr_n_v[2];                   //!< bit usage for the current frame
60   int64  bit_ctr_emulationprevention_v[2]; //!< stored bits needed to prevent start code emulation
61   int64  bit_counter_v[2][NUM_SLICE_TYPES];
62   int    bit_ctr_parametersets_v[2];
63   int    bit_ctr_parametersets_n_v[2];
64   int64  bit_ctr_filler_data_v[2];
65   int64  bit_ctr_filler_data_n_v[2];
66 #endif
67 };
68 typedef struct stat_parameters StatParameters;
69 
70 #endif
71