public override int Write(IH264EntropyOutputStream stream) { stream.WriteUv(8, profileIdc); stream.WriteU1(constrainedSet0Flag); stream.WriteU1(constrainedSet1Flag); stream.WriteU1(constrainedSet2Flag); stream.WriteU1(constrainedSet3Flag); stream.WriteUv(4, 0); stream.WriteUv(8, levelIdc); stream.WriteUeV(seqParameterSetId); stream.WriteUeV(log2MaxFrameNumMinus4); stream.WriteUeV(picOrderCntType); if (picOrderCntType == 0) { stream.WriteUeV(log2MaxPicOrderCntLsbMinus4); } else if (picOrderCntType == 1) { // TODO Unreachable } stream.WriteUeV(numRefFrames); stream.WriteU1(gapsInFrameNumValueAllowedFlag); stream.WriteUeV(picWidthInMbsMinus1); stream.WriteUeV(picHeightInMapUnitsMinus1); stream.WriteU1(frameMbsOnlyFlag); if (!frameMbsOnlyFlag) { // TODO Unreachable } stream.WriteU1(direct_8X8InferenceFlag); stream.WriteU1(frameCroppingFlag); if (frameCroppingFlag) { // TODO Unreachable } stream.WriteU1(vuiParametersPresentFlag); if (vuiParametersPresentFlag) { // TODO Unreachable } stream.Close(); return (int)(stream.Length/8); }
public override int Write(IH264EntropyOutputStream stream) { stream.WriteUeV(picParameterSetId); stream.WriteUeV(seqParameterSetId); stream.WriteU1(entropyCodingModeFlag); stream.WriteU1(picOrderPresentFlag); stream.WriteUeV(numSliceGroupsMinus1); // FMO stuff if (numSliceGroupsMinus1 > 0) { // TODO Unreachable } // End of FMO stuff stream.WriteUeV(numRefIdxL0ActiveMinus1); stream.WriteUeV(numRefIdxL1ActiveMinus1); stream.WriteU1(weightedPredFlag); stream.WriteUv(2, weightedBipredIdc); stream.WriteSeV(picInitQpMinus26); stream.WriteSeV(picInitQsMinus26); stream.WriteSeV(chromaQpIndexOffset); stream.WriteU1(deblockingFilterControlPresentFlag); stream.WriteU1(constrainedIntraPredFlag); stream.WriteU1(redundantPicCntPresentFlag); // copies the last couple of bits into the byte Buffer stream.Close(); return (int)(stream.Length / 8); }
private static void TerminateSlice(IH264EntropyOutputStream outStream) { outStream.Close(); }