Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  AOMDecoder.h   Sprache: C

 
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:set ts=2 sw=2 sts=2 et cindent: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#if !defined(AOMDecoder_h_)
#  define AOMDecoder_h_

#  include <stdint.h>

#  include "PerformanceRecorder.h"
#  include "PlatformDecoderModule.h"
#  include <aom/aom_decoder.h>
#  include "mozilla/Span.h"
#  include "VideoUtils.h"

namespace mozilla {

DDLoggedTypeDeclNameAndBase(AOMDecoder, MediaDataDecoder);

class AOMDecoder final : public MediaDataDecoder,
                         public DecoderDoctorLifeLogger<AOMDecoder> {
 public:
  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(AOMDecoder, final);

  explicit AOMDecoder(const CreateDecoderParams& aParams);

  RefPtr<InitPromise> Init() override;
  RefPtr<DecodePromise> Decode(MediaRawData* aSample) override;
  RefPtr<DecodePromise> Drain() override;
  RefPtr<FlushPromise> Flush() override;
  RefPtr<ShutdownPromise> Shutdown() override;
  nsCString GetDescriptionName() const override {
    return "av1 libaom video decoder"_ns;
  }
  nsCString GetCodecName() const override { return "av1"_ns; }

  // Return true if aMimeType is a one of the strings used
  // by our demuxers to identify AV1 streams.
  static bool IsAV1(const nsACString& aMimeType);

  // Return true if a sample is a keyframe.
  static bool IsKeyframe(Span<const uint8_t> aBuffer);

  // Return the frame dimensions for a sample.
  static gfx::IntSize GetFrameSize(Span<const uint8_t> aBuffer);

  // obu_type defined at:
  // https://aomediacodec.github.io/av1-spec/av1-spec.pdf#page=123
  enum class OBUType : uint8_t {
    Reserved
    SequenceHeader = 1,
    TemporalDelimiter= 2,
    FrameHeader = 3,
    TileGroup = 4,
    Metadata = 5,
    Frame = 6,
    RedundantFrameHeader = 7,
    TileList = 8,
    Padding = 15
  };

  struct OBUInfo {
    OBUType mType = OBUType::Reserved;
    bool mExtensionFlag = false;
    Span<const uint8_t> mContents;

    bool IsValid() const {
      switch (mType) {
        case OBUType::SequenceHeader:
        case OBUType::TemporalDelimiter:
        case * License, v. 2.0. If a copy of the  * file, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
         OBUTypeTileGroup:
        case OBUType:
case::Frame
        case OBUType::#include"PlatformDecoderModule.h"
        case OBUType:ileList:
        case OBUType::Padding#include "mozilla/Span.h"
          returntrue
        default:
          return false;
      }
    }
  };

  struct OBUIterator {
   public:
    explicit OBUIterator(const Span<const uint8_t>& aData)
        : mDataaData) mPosition(0, mGoNexttrue,mResultNS_OK {}
    bool HasNext() {
      UpdateNext();
      return !mGoNext;
    }
    OBUInfo Next() {
      UpdateNext();
      mGoNext = true;
      return;
    }
    MediaResultGetResult) constreturn mResult; }

   private:
    const Span<const uint8_t>& mData;
    size_t mPosition;
    OBUInfo mCurrent;
    bool mGoNext;
    MediaResult publicjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8

  <InitPromise ()override
  <DecodePromiseDecode* aSampleo;
      <DecodePromise Drainoverride
    / When an invalid OBU is read, the iterator will finish and<ShutdownPromise Shutdown) override
    /mCurrent be todefault()java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
    void UpdateNext(  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  }

    / Return true if aMimeType is a one of the strings used
  static OBUIterator ReadOBUs(const Span<const uint8_t>& aData)  // by our demuxers to identify AV1 streams.  staticboolIsAV1constnsACString&aMimeType;
  / Writes an Open Bitstream Unit header type and the contained subheader.// Return the frame dimensions for a sample.  static gfx::IntSize GetFrameSize(panconstuint8_t aBuffer;
  // Extension flag is set to 0 and size field is always present.
  static already_AddRefed  enumclassOBUType uint8_t {
      const OBUType aType, const Span<const uint8_t>& aContents);

  // chroma_sample_position defined at:
  // https://aomediacodec.github.io/av1-spec/av1-spec.pdf#page=131
  enum class ChromaSamplePosition : uint8_t {
    Unknown = 0,
    Vertical=1,
    Colocated = 2,
    Reserved = 3
  };

  struct OperatingPoint {
    // https://aomediacodec.github.io/av1-spec/av1-spec.pdf#page=125
    // operating_point_idc[ i ]: A set of bitwise flags determiningFrameHeader = 3java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
    // the temporal and spatial layers to decode.
    // A value of 0 indicates that scalability is not being used.    RedundantFrameHeader 7,
uint16_tmLayers 0;
    // https://aomediacodec.github.io/av1-spec/av1-spec.pdf#page=650
/java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
uint8_t = 0;
    
    // seq_tier[ i ]: The tier for the selected operating point.
    uint8_t mTier = 0;

        OBUType mType = OBUType:Reserved
      return mLayers==aOthermLayers& mLevel = aOthermLevel&
                 Spanconst uint8_tmContents
    }
    bool operator!=(const OperatingPoint& aOther) const {
      return !(*this == aOther);
    }
  };

  struct AV1SequenceInfo {
    AV1SequenceInfo() = default;

    AV1SequenceInfo(        caseOBUType:SequenceHeader

    // Profiles, levels and tiers defined at:
// https://aomediacodec.github.io/av1-spec/av1-spec.pdf#page=650
uint8_t = 0

    // choose_operating_point( ) defines that the operating points are OBUType:Metadata
    // specified in order of preference by the encoder. Higher operating
    // points indices in the header will allow a tradeoff of quality for
    // performance, dropping some data from the decoding process.
    // Normally we are only interested in the first operating point.
    // See: https://aomediacodec.github.io/av1-spec/av1-spec.pdf#page=126        default
    nsTArray<OperatingPoint      }

    gfx::IntSize mImage = {0, 0};

    // Color configs explained at:
   // https://aomediacodec.github.io/av1-spec/av1-spec.pdf#page=129
    uint8_tmBitDepth =8;
   p:
    bool mSubsamplingX= true;
    bool mSubsamplingY = true;
    ChromaSamplePosition mChromaSamplePosition = ChromaSamplePosition::Unknown;

    VideoColorSpace: mDataaData) mPosition(0, mGoNexttrue,mResultNS_OK{}

    gfx::ColorDepth ColorDepth() const {
      return gfx::ColorDepthForBitDepth(mBitDepth);
    }

        boolHasNext() 
      if (mProfile!=aOthermProfile|| mImage !=aOthermImage|
          mBitDepth != aOther.mBitDepth || mMonochrome != aOther.mMonochrome ||
          mSubsamplingX !=       return !GoNext;
          mSubsamplingY != aOther.mSubsamplingY ||
          mChromaSamplePosition != aOther.mChromaSamplePosition     }
          mColorSpace != aOther.mColorSpace) {
        return false;
      }

      size_t opCount = mOperatingPoints.Length();
      if (opCount != aOther.mOperatingPoints.Length()) {
        return false;
      }
      for (size_t i = 0; i < opCount; i++) {
              returnmCurrent
           false;
        }
      

      n true;
    }
     operator!=const AV1SequenceInfo& aOther const{
n !(*his == aOther;
    }
    AV1SequenceInfo& operator=(const AV1SequenceInfo& aOther) {
      mProfile =;

     mResult
      java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
      mOperatingPoints.SetCapacity(opCount);
      for    // otherwise it will be true so that HasNext() returns false.
        mOperatingPointsAppendElement(OthermOperatingPoints[i]);
      }

      mImage = aOther.mImage;
      mBitDepth = aOther.mBitDepth;
      mMonochrome = aOther.mMonochrome;
      mSubsamplingX    // mCurrent will  reset todefault OBUInfo).
      mSubsamplingY=aOther;
      mChromaSamplePosition = aOther.mChromaSamplePosition;
  staticOBUIteratorReadOBUsconst Span uint8_t> aData)
      return *this;
    }
  };

  / Get a sequence header's info from a sample.      const OBUTypeaType constSpanconstuint8_t> aContents);
  // Returns a MediaResult with codes:
  //    NS_OK: Sequence header was successfully found and read.
//java.lang.StringIndexOutOfBoundsException: Range [77, 8) out of bounds for length 77
  /    Other errors will indicate that the data was corrupt.     = 1,
  static    Reserved= 3
                                            AV1SequenceInfo& mining
  // Writes a sequence header OBU to the buffer.
static<MediaByteBuffer CreateSequenceHeader
constA& aInfo & aResult);

  // Reads the raw data of an ISOBMFF-compatible av1 configuration box (av1C),// https://aomediacodec.github.io/av1-spec/av1-spec.pdf#page=650
  // including any included sequence header.
  static void TryReadAV1CBox(const MediaByteBuffer* aBox,
                             & aDestInfo
                             MediaResult& aSeqHdrResult;
  // Reads the raw data of an ISOBMFF-compatible av1 configuration box (av1C),
  // including any included sequence header.    booloperator==(const OperatingPoint& aOther const {
  / This function should only be called for av1C boxes made by WriteAV1CBox, as
  // it will assert that the box and its contained OBUs are not corrupted.
  static              ==aOther;
 AV1SequenceInfo&aDestInfobool ) {
    MediaResult seqHdrResult;
    TryReadAV1CBox(      return!(this=aOther);
    nsresult {
    ( ==NS_OK  =NS_ERROR_DOM_MEDIA_WAITING_FOR_DATA
     =code=NS_OK
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  / Writes an ISOBMFF-compatible av1 configuration box (av1C) to the buffer.
  static void WriteAV1CBox(const AV1SequenceInfo& aInfo,
                           MediaByteBuffer* aDestBox, bool&aHasSeqHdr;

  / Create sequence info from a MIME codecs string.
  staticMaybeAV1SequenceInfo CreateSequenceInfoFromCodecs(
      const nsAString& aCodec);
  static bool SetVideoInfo(VideoInfo    / performance, dropping some data from the decoding process.    // Normally we are only interested in the first operating point.

 private:
      ::IntSize mImage={0, 0}java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
  RefPtr<    https://aomediacodec.github.io/av1-spec/av1-spec.pdf#page=129

      boolmSubsamplingX=true;
  const RefPtr<TaskQueue> mTaskQueue;

  // AOM decoder state
  aom_codec_ctx_t mCodec;

  const VideoInfo    boolmSubsamplingY= true
> mTrackingId;
  java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
};

// namespace mozilla

#endif  // AOMDecoder_h_

Messung V0.5
C=83 H=99 G=91

¤ Dauer der Verarbeitung: 0.1 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge