digiKam
pps.h
Go to the documentation of this file.
1 /*
2  * H.265 video codec.
3  * Copyright (c) 2013-2014 struktur AG, Dirk Farin <farin@struktur.de>
4  *
5  * This file is part of libde265.
6  *
7  * libde265 is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU Lesser General Public License as
9  * published by the Free Software Foundation, either version 3 of
10  * the License, or (at your option) any later version.
11  *
12  * libde265 is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with libde265. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef DE265_PPS_H
22 #define DE265_PPS_H
23 
24 #include "libde265/bitstream.h"
25 #include "libde265/sps.h" // for scaling list only
26 
27 #include <vector>
28 #include <memory>
29 
30 #define DE265_MAX_TILE_COLUMNS 10
31 #define DE265_MAX_TILE_ROWS 10
32 
33 class decoder_context;
34 class pic_parameter_set;
35 
36 
38 {
39  public:
41 
42  void reset();
43 
45  void dump(int fd) const;
46 
52  int8_t cb_qp_offset_list[6];
53  int8_t cr_qp_offset_list[6];
56 };
57 
58 
60 public:
63 
64  void reset() { set_defaults(); }
67  const seq_parameter_set* sps);
68 
69  bool is_tile_start_CTB(int ctbX,int ctbY) const;
70  void dump(int fd) const;
71 
72 
74 
75  bool pps_read; // whether this pps has been read from bitstream
76  std::shared_ptr<const seq_parameter_set> sps;
77 
78 
86 
90 
91  // --- QP ---
92 
94  int diff_cu_qp_delta_depth; // [ 0 ; log2_diff_max_min_luma_coding_block_size ]
95 
99 
100 
106 
107 
108  // --- tiles ---
109 
111  int num_tile_columns; // [1;PicWidthInCtbsY]
112  int num_tile_rows; // [1;PicHeightInCtbsY]
114 
115 
116  // --- ---
117 
121 
124 
127 
129  struct scaling_list_data scaling_list; // contains valid data if sps->scaling_list_enabled_flag set
130 
132  int log2_parallel_merge_level; // [2 ; log2(max CB size)]
139 
141 
142 
143  // --- derived values ---
144 
148 
153 
154  std::vector<int> CtbAddrRStoTS; // #CTBs
155  std::vector<int> CtbAddrTStoRS; // #CTBs
156  std::vector<int> TileId; // #CTBs // index in tile-scan order
157  std::vector<int> TileIdRS; // #CTBs // index in raster-scan order
158  std::vector<int> MinTbAddrZS; // #TBs [x + y*PicWidthInTbsY]
159 
161 };
162 
163 #endif
Definition: cabac.h:55
Definition: decctx.h:291
Definition: decctx.h:128
Definition: pps.h:59
char tiles_enabled_flag
Definition: pps.h:110
int pic_cb_qp_offset
Definition: pps.h:96
char uniform_spacing_flag
Definition: pps.h:113
pps_range_extension range_extension
Definition: pps.h:140
char weighted_bipred_flag
Definition: pps.h:102
int pic_init_qp
Definition: pps.h:87
int num_tile_rows
Definition: pps.h:112
char constrained_intra_pred_flag
Definition: pps.h:88
char num_ref_idx_l1_default_active
Definition: pps.h:85
std::vector< int > TileIdRS
Definition: pps.h:157
char weighted_pred_flag
Definition: pps.h:101
char pic_scaling_list_data_present_flag
Definition: pps.h:128
std::vector< int > CtbAddrRStoTS
Definition: pps.h:154
char transquant_bypass_enable_flag
Definition: pps.h:104
bool read(bitreader *, decoder_context *)
int tc_offset
Definition: pps.h:126
char pps_range_extension_flag
Definition: pps.h:136
bool is_tile_start_CTB(int ctbX, int ctbY) const
char transform_skip_enabled_flag
Definition: pps.h:89
int diff_cu_qp_delta_depth
Definition: pps.h:94
char lists_modification_present_flag
Definition: pps.h:131
char seq_parameter_set_id
Definition: pps.h:80
char pps_extension_6bits
Definition: pps.h:138
char dependent_slice_segments_enabled_flag
Definition: pps.h:81
void set_derived_values(const seq_parameter_set *sps)
char output_flag_present_flag
Definition: pps.h:103
void reset()
Definition: pps.h:64
char pps_slice_chroma_qp_offsets_present_flag
Definition: pps.h:98
char pps_multilayer_extension_flag
Definition: pps.h:137
char pic_disable_deblocking_filter_flag
Definition: pps.h:123
char sign_data_hiding_flag
Definition: pps.h:82
char num_ref_idx_l0_default_active
Definition: pps.h:84
std::vector< int > TileId
Definition: pps.h:156
char cu_qp_delta_enabled_flag
Definition: pps.h:93
std::vector< int > MinTbAddrZS
Definition: pps.h:158
char slice_segment_header_extension_present_flag
Definition: pps.h:134
char loop_filter_across_tiles_enabled_flag
Definition: pps.h:118
bool write(error_queue *, CABAC_encoder &, const seq_parameter_set *sps)
int Log2MinCuQpDeltaSize
Definition: pps.h:145
bool pps_read
Definition: pps.h:75
int pic_cr_qp_offset
Definition: pps.h:97
int colWidth[DE265_MAX_TILE_COLUMNS]
Definition: pps.h:149
void dump(int fd) const
char cabac_init_present_flag
Definition: pps.h:83
int Log2MaxTransformSkipSize
Definition: pps.h:147
char num_extra_slice_header_bits
Definition: pps.h:133
int rowBd[DE265_MAX_TILE_ROWS+1]
Definition: pps.h:152
char pps_loop_filter_across_slices_enabled_flag
Definition: pps.h:119
char pps_extension_flag
Definition: pps.h:135
char entropy_coding_sync_enabled_flag
Definition: pps.h:105
int num_tile_columns
Definition: pps.h:111
char pic_parameter_set_id
Definition: pps.h:79
char deblocking_filter_control_present_flag
Definition: pps.h:120
int colBd[DE265_MAX_TILE_COLUMNS+1]
Definition: pps.h:151
int Log2MinCuChromaQpOffsetSize
Definition: pps.h:146
std::shared_ptr< const seq_parameter_set > sps
Definition: pps.h:76
void set_defaults(enum PresetSet=Preset_Default)
std::vector< int > CtbAddrTStoRS
Definition: pps.h:155
int rowHeight[DE265_MAX_TILE_ROWS]
Definition: pps.h:150
char deblocking_filter_override_enabled_flag
Definition: pps.h:122
int beta_offset
Definition: pps.h:125
struct scaling_list_data scaling_list
Definition: pps.h:129
int log2_parallel_merge_level
Definition: pps.h:132
Definition: pps.h:38
pps_range_extension()
Definition: pps.h:40
bool chroma_qp_offset_list_enabled_flag
Definition: pps.h:49
uint8_t log2_sao_offset_scale_luma
Definition: pps.h:54
bool cross_component_prediction_enabled_flag
Definition: pps.h:48
uint8_t log2_max_transform_skip_block_size
Definition: pps.h:47
int8_t cr_qp_offset_list[6]
Definition: pps.h:53
uint8_t chroma_qp_offset_list_len
Definition: pps.h:51
uint8_t log2_sao_offset_scale_chroma
Definition: pps.h:55
void dump(int fd) const
bool read(bitreader *, decoder_context *, const pic_parameter_set *)
uint8_t diff_cu_chroma_qp_offset_depth
Definition: pps.h:50
int8_t cb_qp_offset_list[6]
Definition: pps.h:52
Definition: sps.h:86
#define DE265_MAX_TILE_COLUMNS
Definition: pps.h:30
#define DE265_MAX_TILE_ROWS
Definition: pps.h:31
PresetSet
Definition: sps.h:61
@ Preset_Default
Definition: sps.h:62
Definition: bitstream.h:39
Definition: sps.h:51