public static CopyrightExtension read(BitReader inb)
        {
            CopyrightExtension ce = new CopyrightExtension();

            ce.copyright_flag       = inb.read1Bit();
            ce.copyright_identifier = inb.readNBit(8);
            ce.original_or_copy     = inb.read1Bit();
            inb.skip(7);
            inb.read1Bit();
            ce.copyright_number_1 = inb.readNBit(20);
            inb.read1Bit();
            ce.copyright_number_2 = inb.readNBit(22);
            inb.read1Bit();
            ce.copyright_number_3 = inb.readNBit(22);
            return(ce);
        }
Exemple #2
0
        public static void readExtension(MemoryStream bb, PictureHeader ph, SequenceHeader sh)
        {
            ph.m_hasExtensions = true;
            BitReader inb     = new BitReader(bb);
            int       extType = inb.readNBit(4);

            switch (extType)
            {
            case Quant_Matrix_Extension:
                ph.quantMatrixExtension = QuantMatrixExtension.read(inb);
                break;

            case Copyright_Extension:
                ph.copyrightExtension = CopyrightExtension.read(inb);
                break;

            case Picture_Display_Extension:
                ph.pictureDisplayExtension = PictureDisplayExtension.read(inb, sh.sequenceExtension,
                                                                          ph.pictureCodingExtension);
                break;

            case Picture_Coding_Extension:
                ph.pictureCodingExtension = PictureCodingExtension.read(inb);
                break;

            case Picture_Spatial_Scalable_Extension:
                ph.pictureSpatialScalableExtension = PictureSpatialScalableExtension.read(inb);
                break;

            case Picture_Temporal_Scalable_Extension:
                ph.pictureTemporalScalableExtension = PictureTemporalScalableExtension.read(inb);
                break;

            default:
                throw new Exception("Unsupported extension: " + extType);
            }
        }