Convert the CompressionConfig instance to a dictionary. If attribute_codec_registry is not None, it will be converted to a dictionary using its to_dict method.
(self)
| 167 | }) |
| 168 | |
| 169 | def to_dict(self) -> Dict[str, Any]: |
| 170 | """ |
| 171 | Convert the CompressionConfig instance to a dictionary. |
| 172 | If attribute_codec_registry is not None, it will be converted to a dictionary using its to_dict method. |
| 173 | """ |
| 174 | # Get only attributes defined in VideoCompressionConfig |
| 175 | video_compression_attrs = [ |
| 176 | "video_codec_type", "use_sort", "sort_type", "verbose", "qp", |
| 177 | "use_all_intra", "debug", "transform_attributes", |
| 178 | "chroma_subsampling", "use_chroma_qp_offset", "attribute_configs", |
| 179 | ] |
| 180 | |
| 181 | result = {attr: getattr(self, attr) for attr in video_compression_attrs} |
| 182 | |
| 183 | return result |
| 184 | |
| 185 | |
| 186 | @dataclass |
nothing calls this directly
no outgoing calls
no test coverage detected