• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2021 The WebM project authors. All Rights Reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license
5  *  that can be found in the LICENSE file in the root of the source
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #ifndef VPX_VPX_INTERNAL_VPX_RATECTRL_RTC_H_
12 #define VPX_VPX_INTERNAL_VPX_RATECTRL_RTC_H_
13 
14 #include "vpx/vpx_encoder.h"
15 
16 namespace libvpx {
17 struct VpxRateControlRtcConfig {
18  public:
VpxRateControlRtcConfigVpxRateControlRtcConfig19   VpxRateControlRtcConfig() {
20     width = 1280;
21     height = 720;
22     max_quantizer = 63;
23     min_quantizer = 2;
24     target_bandwidth = 1000;
25     buf_initial_sz = 600;
26     buf_optimal_sz = 600;
27     buf_sz = 1000;
28     undershoot_pct = overshoot_pct = 50;
29     max_intra_bitrate_pct = 50;
30     max_inter_bitrate_pct = 0;
31     framerate = 30.0;
32     ts_number_layers = 1;
33     rc_mode = VPX_CBR;
34     aq_mode = 0;
35     layer_target_bitrate[0] = static_cast<int>(target_bandwidth);
36     ts_rate_decimator[0] = 1;
37   }
38 
39   int width;
40   int height;
41   // 0-63
42   int max_quantizer;
43   int min_quantizer;
44   int64_t target_bandwidth;
45   int64_t buf_initial_sz;
46   int64_t buf_optimal_sz;
47   int64_t buf_sz;
48   int undershoot_pct;
49   int overshoot_pct;
50   int max_intra_bitrate_pct;
51   int max_inter_bitrate_pct;
52   double framerate;
53   // Number of temporal layers
54   int ts_number_layers;
55   int layer_target_bitrate[VPX_MAX_LAYERS];
56   int ts_rate_decimator[VPX_TS_MAX_LAYERS];
57   // vbr, cbr
58   enum vpx_rc_mode rc_mode;
59   int aq_mode;
60 };
61 }  // namespace libvpx
62 #endif  // VPX_VPX_INTERNAL_VPX_RATECTRL_RTC_H_
63