forge
Explore
Log in

Don't you dare go Hollow

edith

Clone
★ 0

0 watching0 forksRust18.3 MiB7f487c1Tahinli3 months ago659 commits

h265.rs49 lines, 1.6 KiBHistoryRawDownload
1// Copyright 2024 The ChromiumOS Authors
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use crate::codec::h265::parser::Level;
6use crate::codec::h265::parser::Profile;
7use crate::encoder::PredictionStructure;
8use crate::encoder::Tunings;
9use crate::Resolution;
10
11pub struct H265;
12
13/// What the SPS says the coded samples mean, as H.273 code points, and whether
14/// the luma codes cover the full range. Written into the VUI, which is the
15/// answer a decoder takes before it looks at any container tag.
16#[derive(Clone, Copy)]
17pub struct ColourDescription {
18 pub colour_primaries: u32,
19 pub transfer_characteristics: u32,
20 pub matrix_coeffs: u32,
21 pub full_range: bool,
22}
23
24#[derive(Clone)]
25pub struct EncoderConfig {
26 pub resolution: Resolution,
27 pub profile: Profile,
28 pub level: Level,
29 pub pred_structure: PredictionStructure,
30 /// Initial tunings values
31 pub initial_tunings: Tunings,
32 /// What the VUI declares about the samples. `None` writes no video signal
33 /// type at all, and a stream that says nothing is read as "unspecified".
34 pub colour: Option<ColourDescription>,
35}
36
37impl Default for EncoderConfig {
38 fn default() -> Self {
39 // Artificially encoder configuration with intent to be widely supported.
40 Self {
41 resolution: Resolution { width: 320, height: 240 },
42 profile: Profile::Main,
43 level: Level::L4,
44 pred_structure: PredictionStructure::LowDelay { limit: 2048 },
45 initial_tunings: Default::default(),
46 colour: None,
47 }
48 }
49}