diff --git a/src/nal/slice/mod.rs b/src/nal/slice/mod.rs index 5ba6f0e..843ed4c 100644 --- a/src/nal/slice/mod.rs +++ b/src/nal/slice/mod.rs @@ -23,7 +23,7 @@ enum SliceExclusive { NonExclusive, } #[derive(Debug, PartialEq)] -struct SliceType { +pub struct SliceType { family: SliceFamily, exclusive: SliceExclusive, } @@ -113,7 +113,7 @@ impl From for SliceHeaderError { } #[derive(Debug)] -enum ColourPlane { +pub enum ColourPlane { /// Indicates the _chroma_ colour plane Y, /// Indicates the _blue-difference_ colour plane @@ -159,7 +159,7 @@ pub enum PicOrderCountLsb { } #[derive(Debug)] -enum NumRefIdxActive { +pub enum NumRefIdxActive { P { num_ref_idx_l0_active_minus1: u32, }, @@ -183,13 +183,13 @@ impl NumRefIdxActive { } #[derive(Debug)] -enum ModificationOfPicNums { +pub enum ModificationOfPicNums { Subtract(u32), Add(u32), LongTermRef(u32), } #[derive(Debug)] -enum RefPicListModifications { +pub enum RefPicListModifications { I, P { ref_pic_list_modification_l0: Vec, @@ -243,16 +243,16 @@ impl RefPicListModifications { } #[derive(Debug)] -struct PredWeight { - weight: i32, - offset: i32, +pub struct PredWeight { + pub weight: i32, + pub offset: i32, } #[derive(Debug)] -struct PredWeightTable { - luma_log2_weight_denom: u32, - chroma_log2_weight_denom: Option, - luma_weights: Vec>, - chroma_weights: Vec>, +pub struct PredWeightTable { + pub luma_log2_weight_denom: u32, + pub chroma_log2_weight_denom: Option, + pub luma_weights: Vec>, + pub chroma_weights: Vec>, } impl PredWeightTable { fn read( @@ -316,7 +316,7 @@ impl PredWeightTable { } #[derive(Debug)] -enum MemoryManagementControlOperation { +pub enum MemoryManagementControlOperation { /// `memory_management_control_operation` value of `1` ShortTermUnusedForRef { difference_of_pic_nums_minus1: u32 }, /// `memory_management_control_operation` value of `2` @@ -336,7 +336,7 @@ enum MemoryManagementControlOperation { /// Decoded reference picture marking #[derive(Debug)] -enum DecRefPicMarking { +pub enum DecRefPicMarking { Idr { no_output_of_prior_pics_flag: bool, long_term_reference_flag: bool, @@ -416,24 +416,24 @@ impl DecRefPicMarking { #[derive(Debug)] pub struct SliceHeader { - first_mb_in_slice: u32, - slice_type: SliceType, - colour_plane: Option, + pub first_mb_in_slice: u32, + pub slice_type: SliceType, + pub colour_plane: Option, pub frame_num: u16, pub field_pic: FieldPic, - idr_pic_id: Option, + pub idr_pic_id: Option, pub pic_order_cnt_lsb: Option, - redundant_pic_cnt: Option, - direct_spatial_mv_pred_flag: Option, - num_ref_idx_active: Option, - ref_pic_list_modification: Option, // may become an enum rather than Option in future (for ref_pic_list_mvc_modification) - pred_weight_table: Option, - dec_ref_pic_marking: Option, - cabac_init_idc: Option, - slice_qp_delta: i32, - sp_for_switch_flag: Option, - slice_qs: Option, - disable_deblocking_filter_idc: u8, + pub redundant_pic_cnt: Option, + pub direct_spatial_mv_pred_flag: Option, + pub num_ref_idx_active: Option, + pub ref_pic_list_modification: Option, // may become an enum rather than Option in future (for ref_pic_list_mvc_modification) + pub pred_weight_table: Option, + pub dec_ref_pic_marking: Option, + pub cabac_init_idc: Option, + pub slice_qp_delta: i32, + pub sp_for_switch_flag: Option, + pub slice_qs: Option, + pub disable_deblocking_filter_idc: u8, } impl SliceHeader { pub fn from_bits<'a, R: BitRead>(