public H264Slice(EltH264Nalu nalu, H264Decoder decoder) : base(nalu) { switch (nalu.NaluType) { case NalUnitType.NAL_UNIT_CODED_SLICE: case NalUnitType.NAL_UNIT_AUX_CODED_SLICE: case NalUnitType.NAL_UNIT_CODED_SLICE_DATAPART_A: case NalUnitType.NAL_UNIT_CODED_SLICE_DATAPART_B: case NalUnitType.NAL_UNIT_CODED_SLICE_DATAPART_C: case NalUnitType.NAL_UNIT_CODED_SLICE_IDR: case NalUnitType.NAL_UNIT_CODED_SLICE_SCALABLE: break; default: throw new NotImplementedException(); } EltSyntax eltSyntax; eltSyntax = nalu.FindSyntax("pic_parameter_set_id"); Debug.Assert(eltSyntax != null); m_PicParamSetId = (UInt32)eltSyntax.Value; m_PicParamSet = decoder.FindPicParamSet(m_PicParamSetId); Debug.Assert(m_PicParamSet != null); m_SeqParamSet = m_PicParamSet.SeqParamSet; Debug.Assert(m_SeqParamSet != null); m_Macroblocs = new Dictionary<UInt32, Macroblock>(); ExplodeMacroblocs(nalu); }
public H264Slice(EltH264Nalu nalu, H264Decoder decoder) : base(nalu) { switch (nalu.NaluType) { case NalUnitType.NAL_UNIT_CODED_SLICE: case NalUnitType.NAL_UNIT_AUX_CODED_SLICE: case NalUnitType.NAL_UNIT_CODED_SLICE_DATAPART_A: case NalUnitType.NAL_UNIT_CODED_SLICE_DATAPART_B: case NalUnitType.NAL_UNIT_CODED_SLICE_DATAPART_C: case NalUnitType.NAL_UNIT_CODED_SLICE_IDR: case NalUnitType.NAL_UNIT_CODED_SLICE_SCALABLE: break; default: throw new NotImplementedException(); } EltSyntax eltSyntax; eltSyntax = nalu.FindSyntax("pic_parameter_set_id"); Debug.Assert(eltSyntax != null); m_PicParamSetId = (UInt32)eltSyntax.Value; m_PicParamSet = decoder.FindPicParamSet(m_PicParamSetId); Debug.Assert(m_PicParamSet != null); m_SeqParamSet = m_PicParamSet.SeqParamSet; Debug.Assert(m_SeqParamSet != null); m_Macroblocs = new Dictionary <UInt32, Macroblock>(); ExplodeMacroblocs(nalu); }
public H264PicParamSet(EltH264Nalu nalu, H264Decoder decoder) : base(nalu) { EltSyntax eltSyntax; Debug.Assert(nalu.NaluType == NalUnitType.NAL_UNIT_PPS); eltSyntax = nalu.FindSyntax("pic_parameter_set_id"); Debug.Assert(eltSyntax != null); m_Id = (UInt32)eltSyntax.Value; eltSyntax = nalu.FindSyntax("seq_parameter_set_id"); Debug.Assert(eltSyntax != null); m_SeqParamSetId = (UInt32)eltSyntax.Value; eltSyntax = nalu.FindSyntax("entropy_coding_mode_flag"); Debug.Assert(eltSyntax != null); m_IsCAVLCEncoded = (eltSyntax.Value == 0); m_SeqParamSet = decoder.FindSeqParamSet(nalu.LayerId, m_SeqParamSetId); Debug.Assert(m_SeqParamSet != null); }