diff --git a/.prettierignore b/.prettierignore index e1bdfd2ee437..ae03dc691ebd 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1368,6 +1368,7 @@ media/libpng/ media/libsoundtouch/ media/libspeex_resampler/ media/libtheora/ +media/libtremor/ media/libvorbis/ media/libvpx/ media/libwebp/ diff --git a/CLOBBER b/CLOBBER index cbef5801de7b..361877374292 100644 --- a/CLOBBER +++ b/CLOBBER @@ -22,4 +22,5 @@ # changes to stick? As of bug 928195, this shouldn't be necessary! Please # don't change CLOBBER for WebIDL changes any more. -Modified system_headers to use in bug 1823953. + +Merge day clobber 2023-07-31 \ No newline at end of file diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index 511f77a85ab9..04b247c165ee 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -151,7 +151,6 @@ @BINPATH@/@DLL_PREFIX@mozsqlite3@DLL_SUFFIX@ #endif @BINPATH@/@DLL_PREFIX@lgpllibs@DLL_SUFFIX@ -@BINPATH@/@DLL_PREFIX@gkcodecs@DLL_SUFFIX@ #ifdef MOZ_FFVPX @BINPATH@/@DLL_PREFIX@mozavutil@DLL_SUFFIX@ @BINPATH@/@DLL_PREFIX@mozavcodec@DLL_SUFFIX@ @@ -457,7 +456,6 @@ i686/xul.dll i686/nss3.dll i686/mozglue.dll i686/lgpllibs.dll -i686/gkcodecs.dll i686/msvcp140.dll i686/vcruntime140.dll i686/vcruntime140_1.dll diff --git a/config/external/gkcodecs/gkcodecs.symbols b/config/external/gkcodecs/gkcodecs.symbols deleted file mode 100644 index 324183313443..000000000000 --- a/config/external/gkcodecs/gkcodecs.symbols +++ /dev/null @@ -1,63 +0,0 @@ -ogg_calloc_func -ogg_free_func -ogg_malloc_func -ogg_realloc_func -ogg_set_mem_functions -ogg_stream_clear -ogg_stream_eos -ogg_stream_flush -ogg_stream_init -ogg_stream_packetin -ogg_stream_pageout -opus_decode -opus_decoder_create -opus_decoder_ctl -opus_decoder_destroy -opus_encode -opus_encode_float -opus_encoder_create -opus_encoder_ctl -opus_encoder_destroy -opus_get_version_string -opus_multistream_decode -opus_multistream_decode_float -opus_multistream_decoder_create -opus_multistream_decoder_ctl -opus_multistream_decoder_destroy -opus_multistream_encode -opus_multistream_encoder_create -opus_multistream_encoder_ctl -opus_multistream_encoder_destroy -opus_packet_get_nb_channels -opus_packet_get_nb_frames -opus_packet_get_samples_per_frame -opus_packet_parse -opus_strerror -vorbis_block_clear -vorbis_block_init -vorbis_comment_clear -vorbis_comment_init -vorbis_dsp_clear -vorbis_info_clear -vorbis_info_init -vorbis_packet_blocksize -vorbis_synthesis -vorbis_synthesis_blockin -vorbis_synthesis_headerin -vorbis_synthesis_init -vorbis_synthesis_pcmout -vorbis_synthesis_read -vorbis_synthesis_restart -th_info_init -th_setup_free -th_decode_free -th_comment_clear -th_decode_headerin -th_packet_isheader -th_granule_frame -th_decode_packetin -th_decode_ycbcr_out -th_comment_init -th_packet_iskeyframe -th_info_clear -th_decode_alloc diff --git a/config/external/gkcodecs/moz.build b/config/external/gkcodecs/moz.build deleted file mode 100644 index 58e189d51c29..000000000000 --- a/config/external/gkcodecs/moz.build +++ /dev/null @@ -1,16 +0,0 @@ -# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- -# vim: set filetype=python: -# 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/. - -# The gkcodecs library contains code from third-party libraries implementing -# encoding an decoding for particular audio codecs. -# -# They are compiled in a separate shared library to be able to be available -# both from libxul (when decoding using the codec integration layer Gecko -# provides) and from ffmpeg (when decoding trough ffmpeg). - -GeckoSharedLibrary("gkcodecs", linkage=None) -SHARED_LIBRARY_NAME = "gkcodecs" -SYMBOLS_FILE = "gkcodecs.symbols" diff --git a/config/external/moz.build b/config/external/moz.build index e1e089325f06..a0877c9d717e 100644 --- a/config/external/moz.build +++ b/config/external/moz.build @@ -7,7 +7,6 @@ external_dirs = [] DIRS += [ - "gkcodecs", "lgpllibs", "rlbox", "sqlite", @@ -39,6 +38,9 @@ external_dirs += ["modules/xz-embedded"] if CONFIG["MOZ_VORBIS"]: external_dirs += ["media/libvorbis"] +if CONFIG["MOZ_TREMOR"]: + external_dirs += ["media/libtremor"] + if not CONFIG["MOZ_SYSTEM_LIBVPX"]: external_dirs += ["media/libvpx"] diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild index dc7f580453a7..d9489c8f15e4 100644 --- a/config/system-headers.mozbuild +++ b/config/system-headers.mozbuild @@ -1012,11 +1012,6 @@ system_headers = [ 'wx/xrc/xmlres.h', 'xlocale.h', 'zmouse.h', - 'vorbis/codec.h', - 'opus/opus.h', - 'opus/opus_multistream.h', - 'ogg/ogg.h', - 'theora/theoradec.h' ] if CONFIG['MOZ_X11']: diff --git a/dom/media/AudioConfig.h b/dom/media/AudioConfig.h index c9abf69ee9c6..d0433b108393 100644 --- a/dom/media/AudioConfig.h +++ b/dom/media/AudioConfig.h @@ -210,7 +210,13 @@ class AudioConfig { FORMAT_S24, FORMAT_S32, FORMAT_FLT, +# if defined(MOZ_SAMPLE_TYPE_FLOAT32) FORMAT_DEFAULT = FORMAT_FLT +# elif defined(MOZ_SAMPLE_TYPE_S16) + FORMAT_DEFAULT = FORMAT_S16 +# else +# error "Not supported audio type" +# endif }; AudioConfig(const ChannelLayout& aChannelLayout, uint32_t aRate, diff --git a/dom/media/AudioSampleFormat.h b/dom/media/AudioSampleFormat.h index 33e4e85a058a..f53021262bdb 100644 --- a/dom/media/AudioSampleFormat.h +++ b/dom/media/AudioSampleFormat.h @@ -25,8 +25,12 @@ enum AudioSampleFormat { AUDIO_FORMAT_S16, // Signed 32-bit float samples AUDIO_FORMAT_FLOAT32, - // The format used for output by AudioStream. +// The format used for output by AudioStream. +#ifdef MOZ_SAMPLE_TYPE_S16 + AUDIO_OUTPUT_FORMAT = AUDIO_FORMAT_S16 +#else AUDIO_OUTPUT_FORMAT = AUDIO_FORMAT_FLOAT32 +#endif }; enum { MAX_AUDIO_SAMPLE_SIZE = sizeof(float) }; @@ -37,15 +41,15 @@ class AudioSampleTraits; template <> class AudioSampleTraits { public: - using Type = float; + typedef float Type; }; template <> class AudioSampleTraits { public: - using Type = int16_t; + typedef int16_t Type; }; -using AudioDataValue = AudioSampleTraits::Type; +typedef AudioSampleTraits::Type AudioDataValue; template class AudioSampleTypeToFormat; @@ -70,11 +74,9 @@ class AudioSampleTypeToFormat { * http://blog.bjornroche.com/2009/12/linearity-and-dynamic-range-in-int.html */ inline float AudioSampleToFloat(float aValue) { return aValue; } -inline float AudioSampleToFloat(int16_t aValue) { - return static_cast(aValue) / 32768.0f; -} +inline float AudioSampleToFloat(int16_t aValue) { return aValue / 32768.0f; } inline float AudioSampleToFloat(int32_t aValue) { - return static_cast(aValue) / (float)(1U << 31); + return aValue / (float)(1U << 31); } template @@ -96,8 +98,7 @@ T UInt8bitToAudioSample(uint8_t aValue); template <> inline float UInt8bitToAudioSample(uint8_t aValue) { - return static_cast(aValue) * (static_cast(2) / UINT8_MAX) - - static_cast(1); + return aValue * (static_cast(2) / UINT8_MAX) - static_cast(1); } template <> inline int16_t UInt8bitToAudioSample(uint8_t aValue) { @@ -109,7 +110,7 @@ T IntegerToAudioSample(int16_t aValue); template <> inline float IntegerToAudioSample(int16_t aValue) { - return static_cast(aValue) / 32768.0f; + return aValue / 32768.0f; } template <> inline int16_t IntegerToAudioSample(int16_t aValue) { @@ -121,7 +122,7 @@ T Int24bitToAudioSample(int32_t aValue); template <> inline float Int24bitToAudioSample(int32_t aValue) { - return static_cast(aValue) / static_cast(1 << 23); + return aValue / static_cast(1 << 23); } template <> inline int16_t Int24bitToAudioSample(int32_t aValue) { diff --git a/dom/media/GraphDriver.cpp b/dom/media/GraphDriver.cpp index 702f4dc98649..30e298eb1d6e 100644 --- a/dom/media/GraphDriver.cpp +++ b/dom/media/GraphDriver.cpp @@ -7,7 +7,6 @@ #include "GraphDriver.h" #include "AudioNodeEngine.h" -#include "cubeb/cubeb.h" #include "mozilla/dom/AudioContext.h" #include "mozilla/dom/AudioDeviceInfo.h" #include "mozilla/dom/BaseAudioContextBinding.h" @@ -592,7 +591,14 @@ void AudioCallbackDriver::Init() { "This is blocking and should never run on the main thread."); output.rate = mSampleRate; + +#ifdef MOZ_SAMPLE_TYPE_S16 + MOZ_ASSERT(AUDIO_OUTPUT_FORMAT == AUDIO_FORMAT_S16); + output.format = CUBEB_SAMPLE_S16NE; +#else + MOZ_ASSERT(AUDIO_OUTPUT_FORMAT == AUDIO_FORMAT_FLOAT32); output.format = CUBEB_SAMPLE_FLOAT32NE; +#endif if (!mOutputChannelCount) { LOG(LogLevel::Warning, ("Output number of channels is 0.")); diff --git a/dom/media/MediaData.h b/dom/media/MediaData.h index c6addcd7333a..0ecfaa790429 100644 --- a/dom/media/MediaData.h +++ b/dom/media/MediaData.h @@ -59,11 +59,10 @@ class TrackInfoSharedPtr; // becomes: // AlignedFloatBuffer buffer(samples); // if (!buffer) { return NS_ERROR_OUT_OF_MEMORY; } -class InflatableShortBuffer; + template class AlignedBuffer { public: - friend InflatableShortBuffer; AlignedBuffer() : mData(nullptr), mLength(0), mBuffer(nullptr), mCapacity(0) {} @@ -84,7 +83,7 @@ class AlignedBuffer { AlignedBuffer(const AlignedBuffer& aOther) : AlignedBuffer(aOther.Data(), aOther.Length()) {} - AlignedBuffer(AlignedBuffer&& aOther) noexcept + AlignedBuffer(AlignedBuffer&& aOther) : mData(aOther.mData), mLength(aOther.mLength), mBuffer(std::move(aOther.mBuffer)), @@ -94,7 +93,7 @@ class AlignedBuffer { aOther.mCapacity = 0; } - AlignedBuffer& operator=(AlignedBuffer&& aOther) noexcept { + AlignedBuffer& operator=(AlignedBuffer&& aOther) { this->~AlignedBuffer(); new (this) AlignedBuffer(std::move(aOther)); return *this; @@ -247,41 +246,10 @@ class AlignedBuffer { size_t mCapacity{}; // in bytes }; -using AlignedByteBuffer = AlignedBuffer; -using AlignedFloatBuffer = AlignedBuffer; -using AlignedShortBuffer = AlignedBuffer; -using AlignedAudioBuffer = AlignedBuffer; - -// A buffer in which int16_t audio can be written to, and then converted to -// float32 audio without reallocating. -// This class is useful when an API hands out int16_t audio but the samples -// need to be immediately converted to f32. -class InflatableShortBuffer { - public: - explicit InflatableShortBuffer(size_t aElementCount) - : mBuffer(aElementCount * 2) {} - AlignedFloatBuffer Inflate() { - // Convert the data from int16_t to f32 in place, in the same buffer. - // The reason this works is because the buffer has in fact twice the - // capacity, and the loop goes backward. - float* output = reinterpret_cast(mBuffer.mData); - for (size_t i = Length() - 1; i--;) { - output[i] = AudioSampleToFloat(mBuffer.mData[i]); - } - AlignedFloatBuffer rv; - rv.mBuffer = std::move(mBuffer.mBuffer); - rv.mCapacity = mBuffer.mCapacity; - rv.mLength = Length(); - rv.mData = output; - return rv; - } - size_t Length() const { return mBuffer.mLength / 2; } - int16_t* get() const { return mBuffer.get(); } - explicit operator bool() const { return mBuffer.mData != nullptr; } - - protected: - AlignedShortBuffer mBuffer; -}; +typedef AlignedBuffer AlignedByteBuffer; +typedef AlignedBuffer AlignedFloatBuffer; +typedef AlignedBuffer AlignedShortBuffer; +typedef AlignedBuffer AlignedAudioBuffer; // Container that holds media samples. class MediaData { @@ -448,16 +416,16 @@ class VideoInfo; // Holds a decoded video frame, in YCbCr format. These are queued in the reader. class VideoData : public MediaData { public: - using IntRect = gfx::IntRect; - using IntSize = gfx::IntSize; - using ColorDepth = gfx::ColorDepth; - using ColorRange = gfx::ColorRange; - using YUVColorSpace = gfx::YUVColorSpace; - using ColorSpace2 = gfx::ColorSpace2; - using ChromaSubsampling = gfx::ChromaSubsampling; - using ImageContainer = layers::ImageContainer; - using Image = layers::Image; - using PlanarYCbCrImage = layers::PlanarYCbCrImage; + typedef gfx::IntRect IntRect; + typedef gfx::IntSize IntSize; + typedef gfx::ColorDepth ColorDepth; + typedef gfx::ColorRange ColorRange; + typedef gfx::YUVColorSpace YUVColorSpace; + typedef gfx::ColorSpace2 ColorSpace2; + typedef gfx::ChromaSubsampling ChromaSubsampling; + typedef layers::ImageContainer ImageContainer; + typedef layers::Image Image; + typedef layers::PlanarYCbCrImage PlanarYCbCrImage; static const Type sType = Type::VIDEO_DATA; static const char* sTypeName; @@ -475,7 +443,7 @@ class VideoData : public MediaData { uint32_t mSkip; }; - Plane mPlanes[3]{}; + Plane mPlanes[3]; YUVColorSpace mYUVColorSpace = YUVColorSpace::Identity; ColorSpace2 mColorPrimaries = ColorSpace2::UNKNOWN; ColorDepth mColorDepth = ColorDepth::COLOR_8; @@ -689,6 +657,10 @@ class MediaRawData final : public MediaData { // Indicates that this is the last packet of the stream. bool mEOS = false; + // Indicate to the audio decoder that mDiscardPadding frames should be + // trimmed. + uint32_t mDiscardPadding = 0; + RefPtr mTrackInfo; // May contain the original start time and duration of the frames. diff --git a/dom/media/MediaFormatReader.cpp b/dom/media/MediaFormatReader.cpp index 103e327ab8d9..5f7fc4635135 100644 --- a/dom/media/MediaFormatReader.cpp +++ b/dom/media/MediaFormatReader.cpp @@ -56,7 +56,7 @@ mozilla::LazyLogModule gMediaDemuxerLog("MediaDemuxer"); namespace mozilla { -using MediaDataDecoderID = void*; +typedef void* MediaDataDecoderID; /** * This class tracks shutdown promises to ensure all decoders are shut down @@ -73,7 +73,7 @@ class MediaFormatReader::ShutdownPromisePool { RefPtr Shutdown(); // Track a shutdown promise. - void Track(const RefPtr& aPromise); + void Track(RefPtr aPromise); // Shut down a decoder and track its shutdown promise. void ShutdownDecoder(already_AddRefed aDecoder) { @@ -96,7 +96,7 @@ RefPtr MediaFormatReader::ShutdownPromisePool::Shutdown() { } void MediaFormatReader::ShutdownPromisePool::Track( - const RefPtr& aPromise) { + RefPtr aPromise) { MOZ_DIAGNOSTIC_ASSERT(!mShutdown); MOZ_DIAGNOSTIC_ASSERT(!mPromises.Contains(aPromise)); mPromises.Insert(aPromise); @@ -1069,7 +1069,7 @@ bool MediaFormatReader::ResolveSetCDMPromiseIfDone(TrackType aTrack) { if (mSetCDMForTracks.isEmpty()) { LOGV("%s : Done ", __func__); - mSetCDMPromise.Resolve(/* aResolveValue = */ true, __func__); + mSetCDMPromise.Resolve(/* aIgnored = */ true, __func__); if (HasAudio()) { ScheduleUpdate(TrackInfo::kAudioTrack); } @@ -1135,8 +1135,7 @@ RefPtr MediaFormatReader::SetCDMProxy(CDMProxy* aProxy) { // 3) A null cdm proxy is set // the promise can be resolved directly. mSetCDMForTracks.clear(); - return SetCDMPromise::CreateAndResolve(/* aResolveValue = */ true, - __func__); + return SetCDMPromise::CreateAndResolve(/* aIgnored = */ true, __func__); } RefPtr p = mSetCDMPromise.Ensure(__func__); @@ -1560,16 +1559,16 @@ void MediaFormatReader::DoDemuxVideo() { p->Then( OwnerThread(), __func__, [self, perfRecorder(std::move(perfRecorder))]( - const RefPtr& aSamples) mutable { + RefPtr aSamples) mutable { perfRecorder.Record(); - self->OnVideoDemuxCompleted(aSamples); + self->OnVideoDemuxCompleted(std::move(aSamples)); }, [self](const MediaResult& aError) { self->OnVideoDemuxFailed(aError); }) ->Track(mVideo.mDemuxRequest); } void MediaFormatReader::OnVideoDemuxCompleted( - const RefPtr& aSamples) { + RefPtr aSamples) { AUTO_PROFILER_LABEL("MediaFormatReader::OnVideoDemuxCompleted", MEDIA_PLAYBACK); LOGV("%zu video samples demuxed (sid:%d)", aSamples->GetSamples().Length(), @@ -1655,16 +1654,16 @@ void MediaFormatReader::DoDemuxAudio() { p->Then( OwnerThread(), __func__, [self, perfRecorder(std::move(perfRecorder))]( - const RefPtr& aSamples) mutable { + RefPtr aSamples) mutable { perfRecorder.Record(); - self->OnAudioDemuxCompleted(aSamples); + self->OnAudioDemuxCompleted(std::move(aSamples)); }, [self](const MediaResult& aError) { self->OnAudioDemuxFailed(aError); }) ->Track(mAudio.mDemuxRequest); } void MediaFormatReader::OnAudioDemuxCompleted( - const RefPtr& aSamples) { + RefPtr aSamples) { LOGV("%zu audio samples demuxed (sid:%d)", aSamples->GetSamples().Length(), aSamples->GetSamples()[0]->mTrackInfo ? aSamples->GetSamples()[0]->mTrackInfo->GetID() @@ -1685,7 +1684,7 @@ void MediaFormatReader::NotifyNewOutput( DDLOG(DDLogCategory::Log, aTrack == TrackInfo::kAudioTrack ? "decoded_audio" : "decoded_video", "no output samples"); - } else { + } else for (auto&& sample : aResults) { if (DecoderDoctorLogger::IsDDLoggingEnabled()) { switch (sample->mType) { @@ -1760,7 +1759,6 @@ void MediaFormatReader::NotifyNewOutput( decoder.mNumOfConsecutiveUtilityCrashes = 0; } } - } LOG("Done processing new %s samples", TrackTypeToStr(aTrack)); if (!aResults.IsEmpty()) { @@ -2685,7 +2683,7 @@ RefPtr MediaFormatReader::WaitForData( return p; } -nsresult MediaFormatReader::ResetDecode(const TrackSet& aTracks) { +nsresult MediaFormatReader::ResetDecode(TrackSet aTracks) { AUTO_PROFILER_LABEL("MediaFormatReader::ResetDecode", MEDIA_PLAYBACK); MOZ_ASSERT(OnTaskQueue()); LOGV(""); @@ -3306,34 +3304,29 @@ void MediaFormatReader::GetDebugInfo(dom::MediaFormatReaderDebugInfo& aInfo) { aInfo.mAudioState.mWaitingPromise = !mAudio.mWaitingPromise.IsEmpty(); aInfo.mAudioState.mHasDemuxRequest = mAudio.mDemuxRequest.Exists(); aInfo.mAudioState.mDemuxQueueSize = - AssertedCast(mAudio.mQueuedSamples.Length()); + uint32_t(mAudio.mQueuedSamples.Length()); aInfo.mAudioState.mHasDecoder = mAudio.mDecodeRequest.Exists(); aInfo.mAudioState.mTimeTreshold = mAudio.mTimeThreshold ? mAudio.mTimeThreshold.ref().Time().ToSeconds() : -1.0; aInfo.mAudioState.mTimeTresholdHasSeeked = mAudio.mTimeThreshold ? mAudio.mTimeThreshold.ref().mHasSeeked : false; - aInfo.mAudioState.mNumSamplesInput = - AssertedCast(mAudio.mNumSamplesInput); - aInfo.mAudioState.mNumSamplesOutput = - AssertedCast(mAudio.mNumSamplesOutput); - aInfo.mAudioState.mQueueSize = - AssertedCast(size_t(mAudio.mSizeOfQueue)); - aInfo.mAudioState.mPending = AssertedCast(mAudio.mOutput.Length()); + aInfo.mAudioState.mNumSamplesInput = mAudio.mNumSamplesInput; + aInfo.mAudioState.mNumSamplesOutput = mAudio.mNumSamplesOutput; + aInfo.mAudioState.mQueueSize = size_t(mAudio.mSizeOfQueue); + aInfo.mAudioState.mPending = mAudio.mOutput.Length(); aInfo.mAudioState.mWaitingForData = mAudio.mWaitingForData; aInfo.mAudioState.mDemuxEOS = mAudio.mDemuxEOS; aInfo.mAudioState.mDrainState = int32_t(mAudio.mDrainState); aInfo.mAudioState.mWaitingForKey = mAudio.mWaitingForKey; - aInfo.mAudioState.mLastStreamSourceID = - AssertedCast(mAudio.mLastStreamSourceID); + aInfo.mAudioState.mLastStreamSourceID = mAudio.mLastStreamSourceID; } CopyUTF8toUTF16(audioDecoderName, aInfo.mAudioDecoderName); CopyUTF8toUTF16(audioType, aInfo.mAudioType); - aInfo.mAudioChannels = AssertedCast(audioInfo.mChannels); + aInfo.mAudioChannels = audioInfo.mChannels; aInfo.mAudioRate = audioInfo.mRate; - aInfo.mAudioFramesDecoded = - AssertedCast(mAudio.mNumSamplesOutputTotal); + aInfo.mAudioFramesDecoded = mAudio.mNumSamplesOutputTotal; VideoInfo videoInfo; if (HasVideo()) { @@ -3346,26 +3339,22 @@ void MediaFormatReader::GetDebugInfo(dom::MediaFormatReaderDebugInfo& aInfo) { aInfo.mVideoState.mWaitingPromise = !mVideo.mWaitingPromise.IsEmpty(); aInfo.mVideoState.mHasDemuxRequest = mVideo.mDemuxRequest.Exists(); aInfo.mVideoState.mDemuxQueueSize = - AssertedCast(mVideo.mQueuedSamples.Length()); + uint32_t(mVideo.mQueuedSamples.Length()); aInfo.mVideoState.mHasDecoder = mVideo.mDecodeRequest.Exists(); aInfo.mVideoState.mTimeTreshold = mVideo.mTimeThreshold ? mVideo.mTimeThreshold.ref().Time().ToSeconds() : -1.0; aInfo.mVideoState.mTimeTresholdHasSeeked = mVideo.mTimeThreshold ? mVideo.mTimeThreshold.ref().mHasSeeked : false; - aInfo.mVideoState.mNumSamplesInput = - AssertedCast(mVideo.mNumSamplesInput); - aInfo.mVideoState.mNumSamplesOutput = - AssertedCast(mVideo.mNumSamplesOutput); - aInfo.mVideoState.mQueueSize = - AssertedCast(size_t(mVideo.mSizeOfQueue)); - aInfo.mVideoState.mPending = AssertedCast(mVideo.mOutput.Length()); + aInfo.mVideoState.mNumSamplesInput = mVideo.mNumSamplesInput; + aInfo.mVideoState.mNumSamplesOutput = mVideo.mNumSamplesOutput; + aInfo.mVideoState.mQueueSize = size_t(mVideo.mSizeOfQueue); + aInfo.mVideoState.mPending = mVideo.mOutput.Length(); aInfo.mVideoState.mWaitingForData = mVideo.mWaitingForData; aInfo.mVideoState.mDemuxEOS = mVideo.mDemuxEOS; aInfo.mVideoState.mDrainState = int32_t(mVideo.mDrainState); aInfo.mVideoState.mWaitingForKey = mVideo.mWaitingForKey; - aInfo.mVideoState.mLastStreamSourceID = - AssertedCast(mVideo.mLastStreamSourceID); + aInfo.mVideoState.mLastStreamSourceID = mVideo.mLastStreamSourceID; } CopyUTF8toUTF16(videoDecoderName, aInfo.mVideoDecoderName); @@ -3376,19 +3365,14 @@ void MediaFormatReader::GetDebugInfo(dom::MediaFormatReaderDebugInfo& aInfo) { videoInfo.mDisplay.height < 0 ? 0 : videoInfo.mDisplay.height; aInfo.mVideoRate = mVideo.mMeanRate.Mean(); aInfo.mVideoHardwareAccelerated = VideoIsHardwareAccelerated(); - aInfo.mVideoNumSamplesOutputTotal = - AssertedCast(mVideo.mNumSamplesOutputTotal); - aInfo.mVideoNumSamplesSkippedTotal = - AssertedCast(mVideo.mNumSamplesSkippedTotal); + aInfo.mVideoNumSamplesOutputTotal = mVideo.mNumSamplesOutputTotal; + aInfo.mVideoNumSamplesSkippedTotal = mVideo.mNumSamplesSkippedTotal; // Looking at dropped frames FrameStatisticsData stats = mFrameStats->GetFrameStatisticsData(); - aInfo.mFrameStats.mDroppedDecodedFrames = - AssertedCast(stats.mDroppedDecodedFrames); - aInfo.mFrameStats.mDroppedSinkFrames = - AssertedCast(stats.mDroppedSinkFrames); - aInfo.mFrameStats.mDroppedCompositorFrames = - AssertedCast(stats.mDroppedCompositorFrames); + aInfo.mFrameStats.mDroppedDecodedFrames = stats.mDroppedDecodedFrames; + aInfo.mFrameStats.mDroppedSinkFrames = stats.mDroppedSinkFrames; + aInfo.mFrameStats.mDroppedCompositorFrames = stats.mDroppedCompositorFrames; } void MediaFormatReader::SetVideoNullDecode(bool aIsNullDecode) { @@ -3419,7 +3403,7 @@ void MediaFormatReader::SetNullDecode(TrackType aTrack, bool aIsNullDecode) { void MediaFormatReader::OnFirstDemuxCompleted( TrackInfo::TrackType aType, - const RefPtr& aSamples) { + RefPtr aSamples) { AUTO_PROFILER_LABEL("MediaFormatReader::OnFirstDemuxCompleted", MEDIA_PLAYBACK); MOZ_ASSERT(OnTaskQueue()); diff --git a/dom/media/MediaFormatReader.h b/dom/media/MediaFormatReader.h index fcc3f2003652..ebbca0e17931 100644 --- a/dom/media/MediaFormatReader.h +++ b/dom/media/MediaFormatReader.h @@ -56,7 +56,7 @@ struct MetadataHolder { UniquePtr mTags; }; -using MediaDecoderOwnerID = void*; +typedef void* MediaDecoderOwnerID; struct MOZ_STACK_CLASS MediaFormatReaderInit { MediaResource* mResource = nullptr; @@ -75,8 +75,8 @@ class MediaFormatReader final : public SupportsThreadSafeWeakPtr, public DecoderDoctorLifeLogger { static const bool IsExclusive = true; - using TrackType = TrackInfo::TrackType; - using NotifyDataArrivedPromise = MozPromise; + typedef TrackInfo::TrackType TrackType; + typedef MozPromise NotifyDataArrivedPromise; public: MOZ_DECLARE_REFCOUNTED_TYPENAME(MediaFormatReader) @@ -161,7 +161,7 @@ class MediaFormatReader final // // aParam is a set of TrackInfo::TrackType enums specifying which // queues need to be reset, defaulting to both audio and video tracks. - nsresult ResetDecode(const TrackSet& aTracks); + nsresult ResetDecode(TrackSet aTracks); // Destroys the decoding state. The reader cannot be made usable again. // This is different from ReleaseMediaResources() as it is irreversable, @@ -501,34 +501,31 @@ class MediaFormatReader final // if we have too many, or if warnings should be treated as errors. return mNumOfConsecutiveDecodingError > mMaxConsecutiveDecodingError || StaticPrefs::media_playback_warnings_as_errors(); - } - if (mError.ref() == NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER) { + } else if (mError.ref() == NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER) { // If the caller asked for a new decoder we shouldn't treat // it as fatal. return false; - } - if (mError.ref() == - NS_ERROR_DOM_MEDIA_REMOTE_DECODER_CRASHED_RDD_OR_GPU_ERR) { + } else if (mError.ref() == + NS_ERROR_DOM_MEDIA_REMOTE_DECODER_CRASHED_RDD_OR_GPU_ERR) { // Allow RDD crashes to be non-fatal, but give up // if we have too many, or if warnings should be treated as errors. return mNumOfConsecutiveRDDOrGPUCrashes > mMaxConsecutiveRDDOrGPUCrashes || StaticPrefs::media_playback_warnings_as_errors(); - } - if (mError.ref() == - NS_ERROR_DOM_MEDIA_REMOTE_DECODER_CRASHED_UTILITY_ERR) { + } else if (mError.ref() == + NS_ERROR_DOM_MEDIA_REMOTE_DECODER_CRASHED_UTILITY_ERR) { bool tooManyConsecutiveCrashes = mNumOfConsecutiveUtilityCrashes > mMaxConsecutiveUtilityCrashes; // TODO: Telemetry? return tooManyConsecutiveCrashes || StaticPrefs::media_playback_warnings_as_errors(); - } - if (mError.ref() == - NS_ERROR_DOM_MEDIA_REMOTE_DECODER_CRASHED_MF_CDM_ERR) { + } else if (mError.ref() == + NS_ERROR_DOM_MEDIA_REMOTE_DECODER_CRASHED_MF_CDM_ERR) { return false; + } else { + // All other error types are fatal + return true; } - // All other error types are fatal - return true; } // If set, all decoded samples prior mTimeThreshold will be dropped. @@ -653,8 +650,7 @@ class MediaFormatReader final if (aValue == media::TimeUnit::Zero()) { return; } - mMean += static_cast((1.0f / aValue.ToSeconds() - mMean) / - static_cast(++mCount)); + mMean += (1.0f / aValue.ToSeconds() - mMean) / ++mCount; } void Reset() { @@ -738,15 +734,13 @@ class MediaFormatReader final void OnDemuxFailed(TrackType aTrack, const MediaResult& aError); void DoDemuxVideo(); - void OnVideoDemuxCompleted( - const RefPtr& aSamples); + void OnVideoDemuxCompleted(RefPtr aSamples); void OnVideoDemuxFailed(const MediaResult& aError) { OnDemuxFailed(TrackType::kVideoTrack, aError); } void DoDemuxAudio(); - void OnAudioDemuxCompleted( - const RefPtr& aSamples); + void OnAudioDemuxCompleted(RefPtr aSamples); void OnAudioDemuxFailed(const MediaResult& aError) { OnDemuxFailed(TrackType::kAudioTrack, aError); } @@ -824,9 +818,8 @@ class MediaFormatReader final MediaEventListener mOnTrackWaitingForKeyListener; - void OnFirstDemuxCompleted( - TrackInfo::TrackType aType, - const RefPtr& aSamples); + void OnFirstDemuxCompleted(TrackInfo::TrackType aType, + RefPtr aSamples); void OnFirstDemuxFailed(TrackInfo::TrackType aType, const MediaResult& aError); diff --git a/dom/media/MediaInfo.h b/dom/media/MediaInfo.h index da0de17df2fb..c692b94d6463 100644 --- a/dom/media/MediaInfo.h +++ b/dom/media/MediaInfo.h @@ -37,7 +37,7 @@ class MetadataTag { } }; -using MetadataTags = nsTHashMap; +typedef nsTHashMap MetadataTags; // Start codec specific data structs. If modifying these remember to also // modify the MediaIPCUtils so that any new members are sent across IPC. @@ -128,10 +128,11 @@ struct Mp3CodecSpecificData { struct OpusCodecSpecificData { bool operator==(const OpusCodecSpecificData& rhs) const { - return mContainerCodecDelayFrames == rhs.mContainerCodecDelayFrames && + return mContainerCodecDelayMicroSeconds == + rhs.mContainerCodecDelayMicroSeconds && *mHeadersBinaryBlob == *rhs.mHeadersBinaryBlob; } - // The codec delay (aka pre-skip) in audio frames. + // The codec delay (aka pre-skip) in microseconds. // See https://tools.ietf.org/html/rfc7845#section-4.2 for more info. // This member should store the codec delay parsed from the container file. // In some cases (such as the ogg container), this information is derived @@ -139,7 +140,7 @@ struct OpusCodecSpecificData { // separately redundant. However, other containers store the delay in // addition to the header blob, in which case we can check this container // delay against the header delay to ensure they're consistent. - int64_t mContainerCodecDelayFrames{-1}; + int64_t mContainerCodecDelayMicroSeconds{-1}; // A binary blob of opus header data, specifically the Identification Header. // See https://datatracker.ietf.org/doc/html/rfc7845.html#section-5.1 @@ -400,10 +401,10 @@ class VideoInfo : public TrackInfo { return imageRect; } - imageRect.x = AssertedCast((imageRect.x * aWidth) / mImage.width); - imageRect.y = AssertedCast((imageRect.y * aHeight) / mImage.height); - imageRect.SetWidth(AssertedCast(w)); - imageRect.SetHeight(AssertedCast(h)); + imageRect.x = (imageRect.x * aWidth) / mImage.width; + imageRect.y = (imageRect.y * aHeight) / mImage.height; + imageRect.SetWidth(w); + imageRect.SetHeight(h); return imageRect; } @@ -540,7 +541,7 @@ class EncryptionInfo { // Encryption data. CopyableTArray mInitData; }; - using InitDatas = CopyableTArray; + typedef CopyableTArray InitDatas; // True if the stream has encryption metadata bool IsEncrypted() const { return mEncrypted; } diff --git a/dom/media/VideoUtils.cpp b/dom/media/VideoUtils.cpp index 296b97dadb07..485f426fcaf3 100644 --- a/dom/media/VideoUtils.cpp +++ b/dom/media/VideoUtils.cpp @@ -12,6 +12,7 @@ #include "MediaContainerType.h" #include "MediaResource.h" #include "TimeUnits.h" +#include "VorbisUtils.h" #include "mozilla/Base64.h" #include "mozilla/dom/ContentChild.h" #include "mozilla/SchedulerGroup.h" @@ -51,8 +52,8 @@ CheckedInt64 SaferMultDiv(int64_t aValue, uint64_t aMul, uint64_t aDiv) { if (aMul > INT64_MAX || aDiv > INT64_MAX) { return CheckedInt64(INT64_MAX) + 1; // Return an invalid checked int. } - int64_t mul = AssertedCast(aMul); - int64_t div = AssertedCast(aDiv); + int64_t mul = aMul; + int64_t div = aDiv; int64_t major = aValue / div; int64_t remainder = aValue % div; return CheckedInt64(remainder) * mul / div + CheckedInt64(major) * mul; @@ -95,12 +96,10 @@ static int32_t ConditionDimension(float aValue) { void ScaleDisplayByAspectRatio(gfx::IntSize& aDisplay, float aAspectRatio) { if (aAspectRatio > 1.0) { // Increase the intrinsic width - aDisplay.width = - ConditionDimension(aAspectRatio * AssertedCast(aDisplay.width)); + aDisplay.width = ConditionDimension(aAspectRatio * aDisplay.width); } else { // Increase the intrinsic height - aDisplay.height = - ConditionDimension(AssertedCast(aDisplay.height) / aAspectRatio); + aDisplay.height = ConditionDimension(aDisplay.height / aAspectRatio); } } @@ -1051,7 +1050,11 @@ bool ParseCodecsString(const nsAString& aCodecs, expectMoreTokens = tokenizer.separatorAfterCurrentToken(); aOutCodecs.AppendElement(token); } - return !expectMoreTokens; + if (expectMoreTokens) { + // Last codec name was empty + return false; + } + return true; } bool ParseMIMETypeString(const nsAString& aMIMEType, diff --git a/dom/media/VideoUtils.h b/dom/media/VideoUtils.h index cc2fb899620f..cd7251525d1e 100644 --- a/dom/media/VideoUtils.h +++ b/dom/media/VideoUtils.h @@ -437,8 +437,8 @@ enum class StringListRangeEmptyItems { template class StringListRange { - using CharType = typename String::char_type; - using Pointer = const CharType*; + typedef typename String::char_type CharType; + typedef const CharType* Pointer; public: // Iterator into range, trims items and optionally skips empty items. @@ -453,7 +453,7 @@ class StringListRange { } // DereferencedType should be 'const nsDependent[C]String' pointing into // mList (which is 'const ns[C]String&'). - using DereferencedType = decltype(Substring(Pointer(), Pointer())); + typedef decltype(Substring(Pointer(), Pointer())) DereferencedType; DereferencedType operator*() { return Substring(mStart, mEnd); } private: diff --git a/dom/media/VorbisUtils.h b/dom/media/VorbisUtils.h new file mode 100644 index 000000000000..3d8ac74b0078 --- /dev/null +++ b/dom/media/VorbisUtils.h @@ -0,0 +1,27 @@ +/* -*- 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/. */ + +#ifndef VORBISUTILS_H_ +#define VORBISUTILS_H_ + +#ifdef MOZ_SAMPLE_TYPE_S16 +# include +typedef ogg_int32_t VorbisPCMValue; + +# define MOZ_CLIP_TO_15(x) ((x) < -32768 ? -32768 : (x) <= 32767 ? (x) : 32767) +// Convert the output of vorbis_synthesis_pcmout to a AudioDataValue +# define MOZ_CONVERT_VORBIS_SAMPLE(x) \ + (static_cast(MOZ_CLIP_TO_15((x) >> 9))) + +#else /* MOZ_SAMPLE_TYPE_FLOAT32 */ + +typedef float VorbisPCMValue; + +# define MOZ_CONVERT_VORBIS_SAMPLE(x) (x) + +#endif + +#endif /* VORBISUTILS_H_ */ diff --git a/dom/media/encoder/OpusTrackEncoder.cpp b/dom/media/encoder/OpusTrackEncoder.cpp index 1238ef8ea01c..16b71d378e8f 100644 --- a/dom/media/encoder/OpusTrackEncoder.cpp +++ b/dom/media/encoder/OpusTrackEncoder.cpp @@ -338,10 +338,17 @@ nsresult OpusTrackEncoder::Encode(AudioSegment* aSegment) { // really predict the output frame count at each call. resamplingDest.SetLength(outframes * mChannels); +#if MOZ_SAMPLE_TYPE_S16 + short* in = reinterpret_cast(pcm.Elements()); + short* out = reinterpret_cast(resamplingDest.Elements()); + speex_resampler_process_interleaved_int(mResampler, in, &inframes, out, + &outframes); +#else float* in = reinterpret_cast(pcm.Elements()); float* out = reinterpret_cast(resamplingDest.Elements()); speex_resampler_process_interleaved_float(mResampler, in, &inframes, out, &outframes); +#endif MOZ_ASSERT(pcm.Length() >= mResampledLeftover.Length()); PodCopy(pcm.Elements(), mResampledLeftover.Elements(), @@ -399,9 +406,15 @@ nsresult OpusTrackEncoder::Encode(AudioSegment* aSegment) { frameData->SetLength(MAX_DATA_BYTES); // result is returned as opus error code if it is negative. result = 0; +#ifdef MOZ_SAMPLE_TYPE_S16 + const opus_int16* pcmBuf = static_cast(pcm.Elements()); + result = opus_encode(mEncoder, pcmBuf, NumOutputFramesPerPacket(), + frameData->Elements(), MAX_DATA_BYTES); +#else const float* pcmBuf = static_cast(pcm.Elements()); result = opus_encode_float(mEncoder, pcmBuf, NumOutputFramesPerPacket(), frameData->Elements(), MAX_DATA_BYTES); +#endif frameData->SetLength(result >= 0 ? result : 0); if (result < 0) { diff --git a/dom/media/ipc/MediaIPCUtils.h b/dom/media/ipc/MediaIPCUtils.h index 1a7ed735f2e1..ddf37bd6449b 100644 --- a/dom/media/ipc/MediaIPCUtils.h +++ b/dom/media/ipc/MediaIPCUtils.h @@ -146,11 +146,11 @@ struct ParamTraits { using paramType = mozilla::OpusCodecSpecificData; static void Write(MessageWriter* aWriter, const paramType& aParam) { - WriteParam(aWriter, aParam.mContainerCodecDelayFrames); + WriteParam(aWriter, aParam.mContainerCodecDelayMicroSeconds); WriteParam(aWriter, *aParam.mHeadersBinaryBlob); } static bool Read(MessageReader* aReader, paramType* aResult) { - return ReadParam(aReader, &aResult->mContainerCodecDelayFrames) && + return ReadParam(aReader, &aResult->mContainerCodecDelayMicroSeconds) && ReadParam(aReader, aResult->mHeadersBinaryBlob.get()); } }; diff --git a/dom/media/ipc/RemoteMediaData.cpp b/dom/media/ipc/RemoteMediaData.cpp index 6334a3bd6d55..bd323b733347 100644 --- a/dom/media/ipc/RemoteMediaData.cpp +++ b/dom/media/ipc/RemoteMediaData.cpp @@ -146,7 +146,8 @@ bool ArrayOfRemoteMediaRawData::Fill( mSamples.AppendElement(RemoteMediaRawData{ MediaDataIPDL(entry->mOffset, entry->mTime, entry->mTimecode, entry->mDuration, entry->mKeyframe), - entry->mEOS, height, entry->mOriginalPresentationWindow, + entry->mEOS, height, entry->mDiscardPadding, + entry->mOriginalPresentationWindow, entry->mCrypto.IsEncrypted() && entry->mShouldCopyCryptoToRemoteRawData ? Some(CryptoInfo{ entry->mCrypto.mCryptoScheme, @@ -210,6 +211,7 @@ already_AddRefed ArrayOfRemoteMediaRawData::ElementAt( rawData->mDuration = sample.mBase.duration(); rawData->mKeyframe = sample.mBase.keyframe(); rawData->mEOS = sample.mEOS; + rawData->mDiscardPadding = sample.mDiscardPadding; rawData->mExtraData = mExtraDatas.MediaByteBufferAt(aIndex); if (sample.mCryptoConfig) { CryptoSample& cypto = rawData->GetWritableCrypto(); @@ -254,6 +256,7 @@ ipc::IPDLParamTraits::Write( WriteIPDLParam(aWriter, aActor, aVar.mBase); WriteIPDLParam(aWriter, aActor, aVar.mEOS); WriteIPDLParam(aWriter, aActor, aVar.mHeight); + WriteIPDLParam(aWriter, aActor, aVar.mDiscardPadding); WriteIPDLParam(aWriter, aActor, aVar.mOriginalPresentationWindow); WriteIPDLParam(aWriter, aActor, aVar.mCryptoConfig); } @@ -265,6 +268,7 @@ ipc::IPDLParamTraits::Read( return ReadIPDLParam(aReader, aActor, &aVar->mBase) && ReadIPDLParam(aReader, aActor, &aVar->mEOS) && ReadIPDLParam(aReader, aActor, &aVar->mHeight) && + ReadIPDLParam(aReader, aActor, &aVar->mDiscardPadding) && ReadIPDLParam(aReader, aActor, &aVar->mOriginalPresentationWindow) && ReadIPDLParam(aReader, aActor, &aVar->mCryptoConfig); }; diff --git a/dom/media/ipc/RemoteMediaData.h b/dom/media/ipc/RemoteMediaData.h index 1797a81ea0dd..8055a397d9bb 100644 --- a/dom/media/ipc/RemoteMediaData.h +++ b/dom/media/ipc/RemoteMediaData.h @@ -234,6 +234,7 @@ class ArrayOfRemoteMediaRawData { bool mEOS; // This will be zero for audio. int32_t mHeight; + uint32_t mDiscardPadding; Maybe mOriginalPresentationWindow; Maybe mCryptoConfig; }; diff --git a/dom/media/mediasource/SourceBuffer.cpp b/dom/media/mediasource/SourceBuffer.cpp index 1414b2723acd..cc5293f27d8a 100644 --- a/dom/media/mediasource/SourceBuffer.cpp +++ b/dom/media/mediasource/SourceBuffer.cpp @@ -42,7 +42,7 @@ extern mozilla::LogModule* GetMediaSourceAPILog(); namespace mozilla { using media::TimeUnit; -using AppendState = SourceBufferAttributes::AppendState; +typedef SourceBufferAttributes::AppendState AppendState; namespace dom { diff --git a/dom/media/mediasource/TrackBuffersManager.cpp b/dom/media/mediasource/TrackBuffersManager.cpp index abf10032e458..5d32c8e3223e 100644 --- a/dom/media/mediasource/TrackBuffersManager.cpp +++ b/dom/media/mediasource/TrackBuffersManager.cpp @@ -49,8 +49,8 @@ using dom::SourceBufferAppendMode; using media::TimeInterval; using media::TimeIntervals; using media::TimeUnit; -using AppendBufferResult = SourceBufferTask::AppendBufferResult; -using AppendState = SourceBufferAttributes::AppendState; +typedef SourceBufferTask::AppendBufferResult AppendBufferResult; +typedef SourceBufferAttributes::AppendState AppendState; static const char* AppendStateToStr(AppendState aState) { switch (aState) { @@ -557,7 +557,7 @@ void TrackBuffersManager::DoEvictData(const TimeUnit& aPlaybackTime, if (frame->GetEndTime() >= lowerLimit) { break; } - partialEvict += AssertedCast(frame->ComputedSizeOfIncludingThis()); + partialEvict += frame->ComputedSizeOfIncludingThis(); } const int64_t finalSize = mSizeSourceBuffer - aSizeToEvict; @@ -596,7 +596,7 @@ void TrackBuffersManager::DoEvictData(const TimeUnit& aPlaybackTime, // Don't evict before the end of the current segment TimeUnit upperLimit = futureBuffered[0].mEnd; uint32_t evictedFramesStartIndex = buffer.Length(); - for (uint32_t i = buffer.Length() - 1; i-- > 0;) { + for (int32_t i = buffer.Length() - 1; i >= 0; i--) { const auto& frame = buffer[i]; if (frame->mTime <= upperLimit || toEvict < 0) { // We've reached a frame that shouldn't be evicted -> Evict after it -> @@ -605,7 +605,7 @@ void TrackBuffersManager::DoEvictData(const TimeUnit& aPlaybackTime, evictedFramesStartIndex = i + 1; break; } - toEvict -= AssertedCast(frame->ComputedSizeOfIncludingThis()); + toEvict -= frame->ComputedSizeOfIncludingThis(); } if (evictedFramesStartIndex < buffer.Length()) { MSE_DEBUG("Step2. Evicting %" PRId64 " bytes from trailing data", @@ -616,8 +616,7 @@ void TrackBuffersManager::DoEvictData(const TimeUnit& aPlaybackTime, } RefPtr -TrackBuffersManager::CodedFrameRemovalWithPromise( - const TimeInterval& aInterval) { +TrackBuffersManager::CodedFrameRemovalWithPromise(TimeInterval aInterval) { mTaskQueueCapability->AssertOnCurrentThread(); RefPtr task = new RangeRemovalTask(aInterval); @@ -627,7 +626,7 @@ TrackBuffersManager::CodedFrameRemovalWithPromise( return p; } -bool TrackBuffersManager::CodedFrameRemoval(const TimeInterval& aInterval) { +bool TrackBuffersManager::CodedFrameRemoval(TimeInterval aInterval) { MOZ_ASSERT(OnTaskQueue()); AUTO_PROFILER_LABEL("TrackBuffersManager::CodedFrameRemoval", MEDIA_PLAYBACK); MSE_DEBUG("From %.2fs to %.2f", aInterval.mStart.ToSeconds(), @@ -652,7 +651,7 @@ bool TrackBuffersManager::CodedFrameRemoval(const TimeInterval& aInterval) { bool dataRemoved = false; // 3. For each track buffer in this source buffer, run the following steps: - for (auto* track : GetTracksList()) { + for (auto track : GetTracksList()) { MSE_DEBUGV("Processing %s track", track->mInfo->mMimeType.get()); // 1. Let remove end timestamp be the current value of duration // See bug: https://www.w3.org/Bugs/Public/show_bug.cgi?id=28727 @@ -1625,7 +1624,7 @@ void TrackBuffersManager::MaybeDispatchEncryptedEvent( } void TrackBuffersManager::OnVideoDemuxCompleted( - const RefPtr& aSamples) { + RefPtr aSamples) { mTaskQueueCapability->AssertOnCurrentThread(); MSE_DEBUG("%zu video samples demuxed", aSamples->GetSamples().Length()); mVideoTracks.mDemuxRequest.Complete(); @@ -1649,7 +1648,7 @@ void TrackBuffersManager::DoDemuxAudio() { } void TrackBuffersManager::OnAudioDemuxCompleted( - const RefPtr& aSamples) { + RefPtr aSamples) { mTaskQueueCapability->AssertOnCurrentThread(); MSE_DEBUG("%zu audio samples demuxed", aSamples->GetSamples().Length()); // When using MSE, it's possible for each fragments to have their own @@ -1796,7 +1795,7 @@ TimeInterval TrackBuffersManager::PresentationInterval( TimeInterval(aSamples[0]->mTime, aSamples[0]->GetEndTime()); for (uint32_t i = 1; i < aSamples.Length(); i++) { - const auto& sample = aSamples[i]; + auto& sample = aSamples[i]; presentationInterval = presentationInterval.Span( TimeInterval(sample->mTime, sample->GetEndTime())); } @@ -2703,7 +2702,7 @@ uint32_t TrackBuffersManager::SkipToNextRandomAccessPoint( TimeUnit nextSampleTimecode = trackData.mNextSampleTimecode; TimeUnit nextSampleTime = trackData.mNextSampleTime; uint32_t i = trackData.mNextGetSampleIndex.ref(); - uint32_t originalPos = i; + int32_t originalPos = i; for (; i < track.Length(); i++) { const MediaRawData* sample = @@ -2730,7 +2729,7 @@ uint32_t TrackBuffersManager::SkipToNextRandomAccessPoint( } else if (i > 0) { // Go back to the previous keyframe or the original position so the next // demux can succeed and be decoded. - for (uint32_t j = i - 1; j-- > originalPos;) { + for (int j = i - 1; j >= originalPos; j--) { const RefPtr& sample = track[j]; if (sample->mKeyframe) { trackData.mNextSampleTimecode = sample->mTimecode; @@ -2866,12 +2865,11 @@ already_AddRefed TrackBuffersManager::GetSample( int32_t TrackBuffersManager::FindCurrentPosition(TrackInfo::TrackType aTrack, const TimeUnit& aFuzz) const { MOZ_ASSERT(OnTaskQueue()); - const auto& trackData = GetTracksData(aTrack); + auto& trackData = GetTracksData(aTrack); const TrackBuffer& track = GetTrackBuffer(aTrack); - int32_t trackLength = AssertedCast(track.Length()); // Perform an exact search first. - for (int32_t i = 0; i < trackLength; i++) { + for (uint32_t i = 0; i < track.Length(); i++) { const RefPtr& sample = track[i]; TimeInterval sampleInterval{sample->mTimecode, sample->GetEndTimecode()}; @@ -2885,7 +2883,7 @@ int32_t TrackBuffersManager::FindCurrentPosition(TrackInfo::TrackType aTrack, } } - for (int32_t i = 0; i < trackLength; i++) { + for (uint32_t i = 0; i < track.Length(); i++) { const RefPtr& sample = track[i]; TimeInterval sampleInterval{sample->mTimecode, sample->GetEndTimecode(), aFuzz}; @@ -2902,7 +2900,7 @@ int32_t TrackBuffersManager::FindCurrentPosition(TrackInfo::TrackType aTrack, // We couldn't find our sample by decode timestamp. Attempt to find it using // presentation timestamp. There will likely be small jerkiness. - for (int32_t i = 0; i < trackLength; i++) { + for (uint32_t i = 0; i < track.Length(); i++) { const RefPtr& sample = track[i]; TimeInterval sampleInterval{sample->mTime, sample->GetEndTime(), aFuzz}; @@ -3027,14 +3025,11 @@ void TrackBuffersManager::GetDebugInfo( if (HasAudio()) { aInfo.mNextSampleTime = mAudioTracks.mNextSampleTime.ToSeconds(); - aInfo.mNumSamples = - AssertedCast(mAudioTracks.mBuffers[0].Length()); - aInfo.mBufferSize = AssertedCast(mAudioTracks.mSizeBuffer); - aInfo.mEvictable = AssertedCast(Evictable(TrackInfo::kAudioTrack)); - aInfo.mNextGetSampleIndex = - AssertedCast(mAudioTracks.mNextGetSampleIndex.valueOr(-1)); - aInfo.mNextInsertionIndex = - AssertedCast(mAudioTracks.mNextInsertionIndex.valueOr(-1)); + aInfo.mNumSamples = mAudioTracks.mBuffers[0].Length(); + aInfo.mBufferSize = mAudioTracks.mSizeBuffer; + aInfo.mEvictable = Evictable(TrackInfo::kAudioTrack); + aInfo.mNextGetSampleIndex = mAudioTracks.mNextGetSampleIndex.valueOr(-1); + aInfo.mNextInsertionIndex = mAudioTracks.mNextInsertionIndex.valueOr(-1); media::TimeIntervals ranges = SafeBuffered(TrackInfo::kAudioTrack); dom::Sequence items; for (uint32_t i = 0; i < ranges.Length(); ++i) { @@ -3049,14 +3044,11 @@ void TrackBuffersManager::GetDebugInfo( aInfo.mRanges = std::move(items); } else if (HasVideo()) { aInfo.mNextSampleTime = mVideoTracks.mNextSampleTime.ToSeconds(); - aInfo.mNumSamples = - AssertedCast(mVideoTracks.mBuffers[0].Length()); - aInfo.mBufferSize = AssertedCast(mVideoTracks.mSizeBuffer); - aInfo.mEvictable = AssertedCast(Evictable(TrackInfo::kVideoTrack)); - aInfo.mNextGetSampleIndex = - AssertedCast(mVideoTracks.mNextGetSampleIndex.valueOr(-1)); - aInfo.mNextInsertionIndex = - AssertedCast(mVideoTracks.mNextInsertionIndex.valueOr(-1)); + aInfo.mNumSamples = mVideoTracks.mBuffers[0].Length(); + aInfo.mBufferSize = mVideoTracks.mSizeBuffer; + aInfo.mEvictable = Evictable(TrackInfo::kVideoTrack); + aInfo.mNextGetSampleIndex = mVideoTracks.mNextGetSampleIndex.valueOr(-1); + aInfo.mNextInsertionIndex = mVideoTracks.mNextInsertionIndex.valueOr(-1); media::TimeIntervals ranges = SafeBuffered(TrackInfo::kVideoTrack); dom::Sequence items; for (uint32_t i = 0; i < ranges.Length(); ++i) { diff --git a/dom/media/mediasource/TrackBuffersManager.h b/dom/media/mediasource/TrackBuffersManager.h index c72f2f5453a5..45f232065b6f 100644 --- a/dom/media/mediasource/TrackBuffersManager.h +++ b/dom/media/mediasource/TrackBuffersManager.h @@ -74,11 +74,11 @@ class TrackBuffersManager final BUFFER_FULL, }; - using TrackType = TrackInfo::TrackType; - using MediaType = MediaData::Type; - using TrackBuffer = nsTArray>; - using AppendPromise = SourceBufferTask::AppendPromise; - using RangeRemovalPromise = SourceBufferTask::RangeRemovalPromise; + typedef TrackInfo::TrackType TrackType; + typedef MediaData::Type MediaType; + typedef nsTArray> TrackBuffer; + typedef SourceBufferTask::AppendPromise AppendPromise; + typedef SourceBufferTask::RangeRemovalPromise RangeRemovalPromise; // Interface for SourceBuffer TrackBuffersManager(MediaSourceDecoder* aParentDecoder, @@ -182,7 +182,8 @@ class TrackBuffersManager final void AddSizeOfResources(MediaSourceDecoder::ResourceSizes* aSizes) const; private: - using CodedFrameProcessingPromise = MozPromise; + typedef MozPromise + CodedFrameProcessingPromise; ~TrackBuffersManager(); // All following functions run on the taskqueue. @@ -205,8 +206,8 @@ class TrackBuffersManager final // Called by ResetParserState. void CompleteResetParserState() MOZ_REQUIRES(mTaskQueueCapability); RefPtr CodedFrameRemovalWithPromise( - const media::TimeInterval& aInterval) MOZ_REQUIRES(mTaskQueueCapability); - bool CodedFrameRemoval(const media::TimeInterval& aInterval) + media::TimeInterval aInterval) MOZ_REQUIRES(mTaskQueueCapability); + bool CodedFrameRemoval(media::TimeInterval aInterval) MOZ_REQUIRES(mTaskQueueCapability); // Removes all coded frames -- this is not to spec and should be used as a // last resort to clear buffers only if other methods cannot. @@ -267,7 +268,7 @@ class TrackBuffersManager final MOZ_GUARDED_BY(mTaskQueueCapability); void OnDemuxerInitDone(const MediaResult& aResult); - void OnDemuxerInitFailed(const MediaResult& aError); + void OnDemuxerInitFailed(const MediaResult& aFailure); void OnDemuxerResetDone(const MediaResult& aResult) MOZ_REQUIRES(mTaskQueueCapability); MozPromiseRequestHolder mDemuxerInitRequest; @@ -275,16 +276,14 @@ class TrackBuffersManager final void OnDemuxFailed(TrackType aTrack, const MediaResult& aError) MOZ_REQUIRES(mTaskQueueCapability); void DoDemuxVideo() MOZ_REQUIRES(mTaskQueueCapability); - void OnVideoDemuxCompleted( - const RefPtr& aSamples); + void OnVideoDemuxCompleted(RefPtr aSamples); void OnVideoDemuxFailed(const MediaResult& aError) { mVideoTracks.mDemuxRequest.Complete(); mTaskQueueCapability->AssertOnCurrentThread(); OnDemuxFailed(TrackType::kVideoTrack, aError); } void DoDemuxAudio() MOZ_REQUIRES(mTaskQueueCapability); - void OnAudioDemuxCompleted( - const RefPtr& aSamples); + void OnAudioDemuxCompleted(RefPtr aSamples); void OnAudioDemuxFailed(const MediaResult& aError) { mAudioTracks.mDemuxRequest.Complete(); mTaskQueueCapability->AssertOnCurrentThread(); @@ -388,8 +387,8 @@ class TrackBuffersManager final mEvictable = 0; mLastIndex = 0; } - uint32_t mEvictable = 0; - uint32_t mLastIndex = 0; + uint32_t mEvictable; + uint32_t mLastIndex; }; // Size of data that can be safely evicted during the next eviction // cycle. diff --git a/dom/media/moz.build b/dom/media/moz.build index 3ea9d5ebec25..5762db10dc57 100644 --- a/dom/media/moz.build +++ b/dom/media/moz.build @@ -207,6 +207,7 @@ EXPORTS += [ "VideoLimits.h", "VideoSegment.h", "VideoUtils.h", + "VorbisUtils.h", "WavDumper.h", "XiphExtradata.h", ] diff --git a/dom/media/mp3/MP3Demuxer.cpp b/dom/media/mp3/MP3Demuxer.cpp index ad2c3c6f7041..25d878b3be5c 100644 --- a/dom/media/mp3/MP3Demuxer.cpp +++ b/dom/media/mp3/MP3Demuxer.cpp @@ -121,6 +121,13 @@ bool MP3TrackDemuxer::Init() { mInfo->mBitDepth = 16; mInfo->mMimeType = "audio/mpeg"; mInfo->mDuration = Duration().valueOr(TimeUnit::FromInfinity()); + Mp3CodecSpecificData mp3CodecData{}; + if (mEncoderDelay) { + mp3CodecData.mEncoderDelayFrames = mEncoderDelay; + mp3CodecData.mEncoderPaddingFrames = mEncoderPadding; + } + mInfo->mCodecSpecificConfig = + AudioCodecSpecificVariant{std::move(mp3CodecData)}; MP3LOG("Init mInfo={mRate=%d mChannels=%d mBitDepth=%d mDuration=%s (%lfs)}", mInfo->mRate, mInfo->mChannels, mInfo->mBitDepth, diff --git a/dom/media/mp4/DecoderData.cpp b/dom/media/mp4/DecoderData.cpp index ad79d7cfd4d4..b7c9c869545e 100644 --- a/dom/media/mp4/DecoderData.cpp +++ b/dom/media/mp4/DecoderData.cpp @@ -172,13 +172,14 @@ MediaResult MP4AudioInfo::Update(const Mp4parseTrackInfo* aTrack, mp4ParseSampleCodecSpecific.length >= 12) { uint16_t preskip = mozilla::LittleEndian::readUint16( mp4ParseSampleCodecSpecific.data + 10); - opusCodecSpecificData.mContainerCodecDelayFrames = preskip; + opusCodecSpecificData.mContainerCodecDelayMicroSeconds = + mozilla::FramesToUsecs(preskip, 48000).value(); LOG("Opus stream in MP4 container, %" PRId64 " microseconds of encoder delay (%" PRIu16 ").", - opusCodecSpecificData.mContainerCodecDelayFrames, preskip); + opusCodecSpecificData.mContainerCodecDelayMicroSeconds, preskip); } else { // This file will error later as it will be rejected by the opus decoder. - opusCodecSpecificData.mContainerCodecDelayFrames = 0; + opusCodecSpecificData.mContainerCodecDelayMicroSeconds = 0; } opusCodecSpecificData.mHeadersBinaryBlob->AppendElements( mp4ParseSampleCodecSpecific.data, mp4ParseSampleCodecSpecific.length); diff --git a/dom/media/mp4/MoofParser.cpp b/dom/media/mp4/MoofParser.cpp index d29f6839038a..71d39395029b 100644 --- a/dom/media/mp4/MoofParser.cpp +++ b/dom/media/mp4/MoofParser.cpp @@ -1044,12 +1044,7 @@ Result Edts::Parse(Box& aBox) { if (media_time == -1 && i) { LOG_WARN(Edts, "Multiple empty edit, not handled"); } else if (media_time == -1) { - if (segment_duration > std::numeric_limits::max()) { - NS_WARNING("Segment duration higher than int64_t max."); - mEmptyOffset = std::numeric_limits::max(); - } else { - mEmptyOffset = static_cast(segment_duration); - } + mEmptyOffset = segment_duration; emptyEntry = true; } else if (i > 1 || (i > 0 && !emptyEntry)) { LOG_WARN(Edts, diff --git a/dom/media/mp4/MoofParser.h b/dom/media/mp4/MoofParser.h index 1c3a1a5ce6c9..f644157308ab 100644 --- a/dom/media/mp4/MoofParser.h +++ b/dom/media/mp4/MoofParser.h @@ -235,7 +235,7 @@ struct SampleDescriptionEntry { // Used to indicate in variants if all tracks should be parsed. struct ParseAllTracks {}; -using TrackParseMode = Variant; +typedef Variant TrackParseMode; class Moof final : public Atom { public: diff --git a/dom/media/ogg/OggCodecState.cpp b/dom/media/ogg/OggCodecState.cpp index bc6bc888e5ff..c20a6a17bce8 100644 --- a/dom/media/ogg/OggCodecState.cpp +++ b/dom/media/ogg/OggCodecState.cpp @@ -13,7 +13,6 @@ #include #include #include -#include #include "OggCodecState.h" #include "OggRLBox.h" @@ -22,6 +21,7 @@ #include "VideoUtils.h" #include "XiphExtradata.h" #include "nsDebug.h" +#include "opus/opus_multistream.h" namespace mozilla { @@ -269,15 +269,15 @@ already_AddRefed OggCodecState::PacketOutAsMediaRawData() { return nullptr; } - TimeUnit endTimestamp = Time(packet->granulepos); - NS_ASSERTION(endTimestamp.IsPositiveOrZero(), "timestamp invalid"); + int64_t end_tstamp = Time(packet->granulepos); + NS_ASSERTION(end_tstamp >= 0, "timestamp invalid"); - TimeUnit duration = PacketDuration(packet.get()); - NS_ASSERTION(duration.IsPositiveOrZero(), "duration invalid"); + int64_t duration = PacketDuration(packet.get()); + NS_ASSERTION(duration >= 0, "duration invalid"); - sample->mTimecode = Time(packet->granulepos); - sample->mTime = endTimestamp - duration; - sample->mDuration = duration; + sample->mTimecode = TimeUnit::FromMicroseconds(packet->granulepos); + sample->mTime = TimeUnit::FromMicroseconds(end_tstamp - duration); + sample->mDuration = TimeUnit::FromMicroseconds(duration); sample->mKeyframe = IsKeyframe(packet.get()); sample->mEOS = packet->e_o_s; @@ -441,19 +441,18 @@ bool TheoraState::DecodeHeader(OggPacketPtr aPacket) { // header packets. Assume bad input. // Our caller will deactivate the bitstream. return false; - } - if (ret > 0 && isSetupHeader && mPacketCount == 3) { + } else if (ret > 0 && isSetupHeader && mPacketCount == 3) { // Successfully read the three header packets. mDoneReadingHeaders = true; } return true; } -TimeUnit TheoraState::Time(int64_t aGranulepos) { +int64_t TheoraState::Time(int64_t granulepos) { if (!mActive) { - return TimeUnit::Invalid(); + return -1; } - return TheoraState::Time(&mTheoraInfo, aGranulepos); + return TheoraState::Time(&mTheoraInfo, granulepos); } bool TheoraState::IsHeader(ogg_packet* aPacket) { @@ -465,9 +464,9 @@ bool TheoraState::IsHeader(ogg_packet* aPacket) { (((_info)->version_minor > (_min) || (_info)->version_minor == (_min)) && \ (_info)->version_subminor >= (_sub))) -TimeUnit TheoraState::Time(th_info* aInfo, int64_t aGranulepos) { +int64_t TheoraState::Time(th_info* aInfo, int64_t aGranulepos) { if (aGranulepos < 0 || aInfo->fps_numerator == 0) { - return TimeUnit::Invalid(); + return -1; } // Implementation of th_granule_frame inlined here to operate // on the th_info structure instead of the theora_state. @@ -478,38 +477,35 @@ TimeUnit TheoraState::Time(th_info* aInfo, int64_t aGranulepos) { CheckedInt64 t = ((CheckedInt64(frameno) + 1) * USECS_PER_S) * aInfo->fps_denominator; if (!t.isValid()) { - return TimeUnit::Invalid(); + return -1; } t /= aInfo->fps_numerator; - // TODO -- use rationals here - return TimeUnit::FromMicroseconds(t.value()); + return t.isValid() ? t.value() : -1; } -TimeUnit TheoraState::StartTime(int64_t aGranulepos) { - if (aGranulepos < 0 || !mActive || mTheoraInfo.fps_numerator == 0) { - return TimeUnit::Invalid(); +int64_t TheoraState::StartTime(int64_t granulepos) { + if (granulepos < 0 || !mActive || mTheoraInfo.fps_numerator == 0) { + return -1; } CheckedInt64 t = - (CheckedInt64(th_granule_frame(mCtx, aGranulepos)) * USECS_PER_S) * + (CheckedInt64(th_granule_frame(mCtx, granulepos)) * USECS_PER_S) * mTheoraInfo.fps_denominator; if (!t.isValid()) { - return TimeUnit::Invalid(); + return -1; } - // TODO -- use rationals here - return TimeUnit::FromMicroseconds(t.value() / mTheoraInfo.fps_numerator); + return t.value() / mTheoraInfo.fps_numerator; } -TimeUnit TheoraState::PacketDuration(ogg_packet* aPacket) { +int64_t TheoraState::PacketDuration(ogg_packet* aPacket) { if (!mActive || mTheoraInfo.fps_numerator == 0) { - return TimeUnit::Invalid(); + return -1; } CheckedInt64 t = SaferMultDiv(mTheoraInfo.fps_denominator, USECS_PER_S, mTheoraInfo.fps_numerator); - return t.isValid() ? TimeUnit::FromMicroseconds(t.value()) - : TimeUnit::Invalid(); + return t.isValid() ? t.value() : -1; } -TimeUnit TheoraState::MaxKeyframeOffset() { +int64_t TheoraState::MaxKeyframeOffset() { // Determine the maximum time in microseconds by which a key frame could // offset for the theora bitstream. Theora granulepos encode time as: // ((key_frame_number << granule_shift) + frame_offset). @@ -525,13 +521,13 @@ TimeUnit TheoraState::MaxKeyframeOffset() { (mTheoraInfo.fps_denominator * USECS_PER_S) / mTheoraInfo.fps_numerator; // Total time in usecs keyframe can be offset from any given frame. - return TimeUnit::FromMicroseconds(frameDuration * keyframeDiff); + return frameDuration * keyframeDiff; } -bool TheoraState::IsKeyframe(ogg_packet* aPacket) { +bool TheoraState::IsKeyframe(ogg_packet* pkt) { // first bit of packet is 1 for header, 0 for data // second bit of packet is 1 for inter frame, 0 for intra frame - return (aPacket->bytes >= 1 && (aPacket->packet[0] & 0x40) == 0x00); + return (pkt->bytes >= 1 && (pkt->packet[0] & 0x40) == 0x00); } nsresult TheoraState::PageIn(tainted_opaque_ogg aPage) { @@ -590,8 +586,7 @@ void TheoraState::ReconstructTheoraGranulepos() { ogg_int64_t version_3_2_1 = TheoraVersion(&mTheoraInfo, 3, 2, 1); ogg_int64_t lastFrame = th_granule_frame(mCtx, lastGranulepos) + version_3_2_1; - ogg_int64_t firstFrame = - AssertedCast(lastFrame - mUnstamped.Length() + 1); + ogg_int64_t firstFrame = lastFrame - mUnstamped.Length() + 1; // Until we encounter a keyframe, we'll assume that the "keyframe" // segment of the granulepos is the first frame, or if that causes @@ -721,8 +716,7 @@ bool VorbisState::DecodeHeader(OggPacketPtr aPacket) { // header packets. Assume bad input. Our caller will deactivate the // bitstream. return false; - } - if (!ret && isSetupHeader && mPacketCount == 3) { + } else if (!ret && isSetupHeader && mPacketCount == 3) { // Successfully read the three header packets. // The bitstream remains active. mDoneReadingHeaders = true; @@ -773,32 +767,33 @@ bool VorbisState::Init() { return true; } -TimeUnit VorbisState::Time(int64_t aGranulepos) { +int64_t VorbisState::Time(int64_t granulepos) { if (!mActive) { - return TimeUnit::Invalid(); + return -1; } - return VorbisState::Time(&mVorbisInfo, aGranulepos); + return VorbisState::Time(&mVorbisInfo, granulepos); } -TimeUnit VorbisState::Time(vorbis_info* aInfo, int64_t aGranulepos) { +int64_t VorbisState::Time(vorbis_info* aInfo, int64_t aGranulepos) { if (aGranulepos == -1 || aInfo->rate == 0) { - return TimeUnit::Invalid(); + return -1; } - return TimeUnit(aGranulepos, aInfo->rate); + CheckedInt64 t = SaferMultDiv(aGranulepos, USECS_PER_S, aInfo->rate); + return t.isValid() ? t.value() : 0; } -TimeUnit VorbisState::PacketDuration(ogg_packet* aPacket) { +int64_t VorbisState::PacketDuration(ogg_packet* aPacket) { if (!mActive) { - return TimeUnit::Invalid(); + return -1; } if (aPacket->granulepos == -1) { - return TimeUnit::Invalid(); + return -1; } // @FIXME store these in a more stable place if (mVorbisPacketSamples.count(aPacket) == 0) { // We haven't seen this packet, don't know its size? - return TimeUnit::Invalid(); + return -1; } long samples = mVorbisPacketSamples[aPacket]; @@ -905,8 +900,8 @@ void VorbisState::ReconstructVorbisGranulepos() { } bool unknownGranulepos = last->granulepos == -1; - int64_t totalSamples = 0; - for (int32_t i = AssertedCast(mUnstamped.Length() - 1); i > 0; i--) { + int totalSamples = 0; + for (int32_t i = mUnstamped.Length() - 1; i > 0; i--) { auto& packet = mUnstamped[i]; auto& prev = mUnstamped[i - 1]; ogg_int64_t granulepos = packet->granulepos; @@ -1030,7 +1025,7 @@ bool OpusState::Init(void) { mInfo.mBitDepth = 16; // Save preskip & the first header packet for the Opus decoder OpusCodecSpecificData opusData; - opusData.mContainerCodecDelayFrames = mParser->mPreSkip; + opusData.mContainerCodecDelayMicroSeconds = Time(0, mParser->mPreSkip); if (!mHeaders.PeekFront()) { return false; @@ -1086,22 +1081,22 @@ UniquePtr OpusState::GetTags() { } /* Return the timestamp (in microseconds) equivalent to a granulepos. */ -TimeUnit OpusState::Time(int64_t aGranulepos) { +int64_t OpusState::Time(int64_t aGranulepos) { if (!mActive) { - return TimeUnit::Invalid(); + return -1; } return Time(mParser->mPreSkip, aGranulepos); } -TimeUnit OpusState::Time(int aPreSkip, int64_t aGranulepos) { +int64_t OpusState::Time(int aPreSkip, int64_t aGranulepos) { if (aGranulepos < 0) { - return TimeUnit::Invalid(); + return -1; } - int64_t offsetGranulePos = aGranulepos - aPreSkip; // Ogg Opus always runs at a granule rate of 48 kHz. - return TimeUnit(offsetGranulePos, 48000); + CheckedInt64 t = SaferMultDiv(aGranulepos - aPreSkip, USECS_PER_S, 48000); + return t.isValid() ? t.value() : -1; } bool OpusState::IsHeader(ogg_packet* aPacket) { @@ -1147,8 +1142,7 @@ nsresult OpusState::PageIn(tainted_opaque_ogg aPage) { // It even works before we've created the actual Opus decoder. static int GetOpusDeltaGP(ogg_packet* packet) { int nframes; - nframes = opus_packet_get_nb_frames(packet->packet, - AssertedCast(packet->bytes)); + nframes = opus_packet_get_nb_frames(packet->packet, packet->bytes); if (nframes > 0) { return nframes * opus_packet_get_samples_per_frame(packet->packet, 48000); } @@ -1156,8 +1150,9 @@ static int GetOpusDeltaGP(ogg_packet* packet) { return nframes; } -TimeUnit OpusState::PacketDuration(ogg_packet* aPacket) { - return TimeUnit(GetOpusDeltaGP(aPacket), 48000); +int64_t OpusState::PacketDuration(ogg_packet* aPacket) { + CheckedInt64 t = SaferMultDiv(GetOpusDeltaGP(aPacket), USECS_PER_S, 48000); + return t.isValid() ? t.value() : -1; } bool OpusState::ReconstructOpusGranulepos(void) { @@ -1173,9 +1168,8 @@ bool OpusState::ReconstructOpusGranulepos(void) { if (mPrevPageGranulepos != -1) { // If this file only has one page and the final granule position is // smaller than the pre-skip amount, we MUST reject the stream. - if (!mDoneReadingHeaders && last->granulepos < mParser->mPreSkip) { + if (!mDoneReadingHeaders && last->granulepos < mParser->mPreSkip) return false; - } int64_t last_gp = last->granulepos; gp = mPrevPageGranulepos; // Loop through the packets forwards, adding the current packet's @@ -1201,11 +1195,12 @@ bool OpusState::ReconstructOpusGranulepos(void) { } mPrevPageGranulepos = last_gp; return true; + } else { + NS_WARNING("No previous granule position to use for Opus end trimming."); + // If we don't have a previous granule position, fall through. + // We simply won't trim any samples from the end. + // TODO: Are we guaranteed to have seen a previous page if there is one? } - NS_WARNING("No previous granule position to use for Opus end trimming."); - // If we don't have a previous granule position, fall through. - // We simply won't trim any samples from the end. - // TODO: Are we guaranteed to have seen a previous page if there is one? } auto& last = mUnstamped.LastElement(); @@ -1268,16 +1263,7 @@ already_AddRefed OpusState::PacketOutAsMediaRawData() { int64_t startFrame = mPrevPacketGranulepos; frames -= std::max( 0, std::min(endFrame - startFrame, static_cast(frames))); - TimeUnit toTrim = TimeUnit(frames, 48000); - LOG(LogLevel::Debug, - ("Trimming last opus packet: [%s, %s] to [%s, %s]", - data->mTime.ToString().get(), data->GetEndTime().ToString().get(), - data->mTime.ToString().get(), - (data->mTime + data->mDuration - toTrim).ToString().get())); - - data->mOriginalPresentationWindow = - Some(media::TimeInterval{data->mTime, data->mTime + data->mDuration}); - data->mDuration -= toTrim; + data->mDiscardPadding = frames; } // Save this packet's granule position in case we need to perform end @@ -1301,16 +1287,19 @@ bool FlacState::DecodeHeader(OggPacketPtr aPacket) { return true; } -TimeUnit FlacState::Time(int64_t aGranulepos) { +int64_t FlacState::Time(int64_t granulepos) { if (!mParser.mInfo.IsValid()) { - return TimeUnit::Invalid(); + return -1; } - return TimeUnit(aGranulepos, mParser.mInfo.mRate); + CheckedInt64 t = SaferMultDiv(granulepos, USECS_PER_S, mParser.mInfo.mRate); + if (!t.isValid()) { + return -1; + } + return t.value(); } -TimeUnit FlacState::PacketDuration(ogg_packet* aPacket) { - return TimeUnit(mParser.BlockDuration(aPacket->packet, aPacket->bytes), - mParser.mInfo.mRate); +int64_t FlacState::PacketDuration(ogg_packet* aPacket) { + return mParser.BlockDuration(aPacket->packet, aPacket->bytes); } bool FlacState::IsHeader(ogg_packet* aPacket) { @@ -1368,7 +1357,7 @@ bool FlacState::ReconstructFlacGranulepos(void) { // packet's duration from its granulepos to get the value // for the current packet. for (uint32_t i = mUnstamped.Length() - 1; i > 0; i--) { - int64_t offset = + int offset = mParser.BlockDuration(mUnstamped[i]->packet, mUnstamped[i]->bytes); // Check for error (negative offset) and overflow. if (offset >= 0) { @@ -1496,8 +1485,7 @@ bool SkeletonState::DecodeIndex(ogg_packet* aPacket) { int64_t numKeyPoints = LittleEndian::readInt64(aPacket->packet + INDEX_NUM_KEYPOINTS_OFFSET); - TimeUnit endTime = TimeUnit::Zero(); - TimeUnit startTime = TimeUnit::Zero(); + int64_t endTime = 0, startTime = 0; const unsigned char* p = aPacket->packet; int64_t timeDenom = @@ -1511,10 +1499,21 @@ bool SkeletonState::DecodeIndex(ogg_packet* aPacket) { // Extract the start time. int64_t timeRawInt = LittleEndian::readInt64(p + INDEX_FIRST_NUMER_OFFSET); - startTime = TimeUnit(timeRawInt, timeDenom); + CheckedInt64 t = SaferMultDiv(timeRawInt, USECS_PER_S, timeDenom); + if (!t.isValid()) { + return (mActive = false); + } else { + startTime = t.value(); + } + // Extract the end time. timeRawInt = LittleEndian::readInt64(p + INDEX_LAST_NUMER_OFFSET); - endTime = TimeUnit(timeRawInt, timeDenom); + t = SaferMultDiv(timeRawInt, USECS_PER_S, timeDenom); + if (!t.isValid()) { + return (mActive = false); + } else { + endTime = t.value(); + } // Check the numKeyPoints value read, ensure we're not going to run out of // memory while trying to decode the index packet. @@ -1524,10 +1523,8 @@ bool SkeletonState::DecodeIndex(ogg_packet* aPacket) { return (mActive = false); } - int64_t sizeofIndex = - AssertedCast(aPacket->bytes - INDEX_KEYPOINT_OFFSET); - int64_t maxNumKeyPoints = - AssertedCast(sizeofIndex / MIN_KEY_POINT_SIZE); + int64_t sizeofIndex = aPacket->bytes - INDEX_KEYPOINT_OFFSET; + int64_t maxNumKeyPoints = sizeofIndex / MIN_KEY_POINT_SIZE; if (aPacket->bytes < minPacketSize.value() || numKeyPoints > maxNumKeyPoints || numKeyPoints < 0) { // Packet size is less than the theoretical minimum size, or the packet is @@ -1548,7 +1545,7 @@ bool SkeletonState::DecodeIndex(ogg_packet* aPacket) { const unsigned char* limit = aPacket->packet + aPacket->bytes; int64_t numKeyPointsRead = 0; CheckedInt64 offset = 0; - TimeUnit time = TimeUnit::Zero(); + CheckedInt64 time = 0; while (p < limit && numKeyPointsRead < numKeyPoints) { int64_t delta = 0; p = ReadVariableLengthInt(p, limit, delta); @@ -1558,15 +1555,19 @@ bool SkeletonState::DecodeIndex(ogg_packet* aPacket) { return (mActive = false); } p = ReadVariableLengthInt(p, limit, delta); - time += TimeUnit(delta, timeDenom); - if (!time.IsValid() || time > endTime || time < startTime) { + time += delta; + if (!time.isValid() || time.value() > endTime || time.value() < startTime) { return (mActive = false); } - keyPoints->Add(offset.value(), time); + CheckedInt64 timeUsecs = SaferMultDiv(time.value(), USECS_PER_S, timeDenom); + if (!timeUsecs.isValid()) { + return (mActive = false); + } + keyPoints->Add(offset.value(), timeUsecs.value()); numKeyPointsRead++; } - uint32_t keyPointsRead = keyPoints->Length(); + int32_t keyPointsRead = keyPoints->Length(); if (keyPointsRead > 0) { mIndex.InsertOrUpdate(serialno, std::move(keyPoints)); } @@ -1577,7 +1578,7 @@ bool SkeletonState::DecodeIndex(ogg_packet* aPacket) { } nsresult SkeletonState::IndexedSeekTargetForTrack(uint32_t aSerialno, - const TimeUnit& aTarget, + int64_t aTarget, nsKeyPoint& aResult) { nsKeyFrameIndex* index = nullptr; mIndex.Get(aSerialno, &index); @@ -1588,15 +1589,14 @@ nsresult SkeletonState::IndexedSeekTargetForTrack(uint32_t aSerialno, } // Binary search to find the last key point with time less than target. - uint32_t start = 0; - uint32_t end = index->Length() - 1; + int start = 0; + int end = index->Length() - 1; while (end > start) { - uint32_t mid = start + ((end - start + 1) >> 1); + int mid = start + ((end - start + 1) >> 1); if (index->Get(mid).mTime == aTarget) { start = mid; break; - } - if (index->Get(mid).mTime < aTarget) { + } else if (index->Get(mid).mTime < aTarget) { start = mid; } else { end = mid - 1; @@ -1608,7 +1608,7 @@ nsresult SkeletonState::IndexedSeekTargetForTrack(uint32_t aSerialno, return NS_OK; } -nsresult SkeletonState::IndexedSeekTarget(const TimeUnit& aTarget, +nsresult SkeletonState::IndexedSeekTarget(int64_t aTarget, nsTArray& aTracks, nsSeekTarget& aResult) { if (!mActive || mVersion < SKELETON_VERSION(4, 0)) { @@ -1630,20 +1630,21 @@ nsresult SkeletonState::IndexedSeekTarget(const TimeUnit& aTarget, if (r.IsNull()) { return NS_ERROR_FAILURE; } - LOG(LogLevel::Debug, ("Indexed seek target for time %s is offset %" PRId64, - aTarget.ToString().get(), r.mKeyPoint.mOffset)); + LOG(LogLevel::Debug, + ("Indexed seek target for time %" PRId64 " is offset %" PRId64, aTarget, + r.mKeyPoint.mOffset)); aResult = r; return NS_OK; } nsresult SkeletonState::GetDuration(const nsTArray& aTracks, - TimeUnit& aDuration) { + int64_t& aDuration) { if (!mActive || mVersion < SKELETON_VERSION(4, 0) || !HasIndex() || aTracks.Length() == 0) { return NS_ERROR_FAILURE; } - TimeUnit endTime = TimeUnit::FromNegativeInfinity(); - TimeUnit startTime = TimeUnit::FromInfinity(); + int64_t endTime = INT64_MIN; + int64_t startTime = INT64_MAX; for (uint32_t i = 0; i < aTracks.Length(); i++) { nsKeyFrameIndex* index = nullptr; mIndex.Get(aTracks[i], &index); @@ -1659,8 +1660,9 @@ nsresult SkeletonState::GetDuration(const nsTArray& aTracks, } } NS_ASSERTION(endTime > startTime, "Duration must be positive"); - aDuration = endTime - startTime; - return aDuration.IsValid() ? NS_OK : NS_ERROR_FAILURE; + CheckedInt64 duration = CheckedInt64(endTime) - startTime; + aDuration = duration.isValid() ? duration.value() : 0; + return duration.isValid() ? NS_OK : NS_ERROR_FAILURE; } bool SkeletonState::DecodeFisbone(ogg_packet* aPacket) { @@ -1760,10 +1762,9 @@ bool SkeletonState::DecodeHeader(OggPacketPtr aPacket) { aPacket->packet + SKELETON_PRESENTATION_TIME_NUMERATOR_OFFSET); int64_t d = LittleEndian::readInt64( aPacket->packet + SKELETON_PRESENTATION_TIME_DENOMINATOR_OFFSET); - mPresentationTime = d == 0 ? 0 - : AssertedCast(static_cast(n) / - static_cast(d)) * - USECS_PER_S; + mPresentationTime = + d == 0 ? 0 + : (static_cast(n) / static_cast(d)) * USECS_PER_S; mVersion = SKELETON_VERSION(verMajor, verMinor); // We can only care to parse Skeleton version 4.0+. diff --git a/dom/media/ogg/OggCodecState.h b/dom/media/ogg/OggCodecState.h index 4133fd05072e..b8a38578759a 100644 --- a/dom/media/ogg/OggCodecState.h +++ b/dom/media/ogg/OggCodecState.h @@ -3,7 +3,6 @@ /* 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/. */ -#include "Intervals.h" #if !defined(OggCodecState_h_) # define OggCodecState_h_ @@ -17,7 +16,11 @@ # include # include -# include +# ifdef MOZ_TREMOR +# include +# else +# include +# endif // Uncomment the following to validate that we're predicting the number // of Vorbis samples in each packet correctly. @@ -100,7 +103,7 @@ class OggPacketQueue : private nsDeque { // converting granulepos to timestamps. class OggCodecState { public: - using MetadataTags = mozilla::MetadataTags; + typedef mozilla::MetadataTags MetadataTags; // Ogg types we know about enum CodecType { TYPE_VORBIS = 0, @@ -133,39 +136,28 @@ class OggCodecState { // Build a hash table with tag metadata parsed from the stream. virtual UniquePtr GetTags() { return nullptr; } - using TimeUnit = media::TimeUnit; - // Returns the end time that a granulepos represents. - virtual TimeUnit Time(int64_t aGranulepos) { return TimeUnit::Invalid(); } + virtual int64_t Time(int64_t granulepos) { return -1; } // Returns the start time that a granulepos represents. - virtual TimeUnit StartTime(int64_t aGranulepos) { - return TimeUnit::Invalid(); - } + virtual int64_t StartTime(int64_t granulepos) { return -1; } // Returns the duration of the given packet, if it can be determined. - virtual TimeUnit PacketDuration(ogg_packet* aPacket) { - return TimeUnit::Invalid(); - } + virtual int64_t PacketDuration(ogg_packet* aPacket) { return -1; } // Returns the start time of the given packet, if it can be determined. - virtual TimeUnit PacketStartTime(ogg_packet* aPacket) { + virtual int64_t PacketStartTime(ogg_packet* aPacket) { if (aPacket->granulepos < 0) { - return TimeUnit::Invalid(); - } - TimeUnit endTime = Time(aPacket->granulepos); - TimeUnit duration = PacketDuration(aPacket); - // When looping, it's possible to find header packets there because the - // demuxing restarts from the beginning of the stream. Just skip and retry - // with the next packet. - if (!duration.IsValid()) { - return TimeUnit::Invalid(); + return -1; } + int64_t endTime = Time(aPacket->granulepos); + int64_t duration = PacketDuration(aPacket); if (duration > endTime) { // Audio preskip may eat a whole packet or more. - return TimeUnit::Zero(); + return 0; + } else { + return endTime - duration; } - return endTime - duration; } // Initializes the codec state. @@ -231,7 +223,7 @@ class OggCodecState { // Returns the maximum number of microseconds which a keyframe can be offset // from any given interframe.b - virtual TimeUnit MaxKeyframeOffset() { return TimeUnit::Zero(); } + virtual int64_t MaxKeyframeOffset() { return 0; } // Public access for mTheoraInfo.keyframe_granule_shift virtual int32_t KeyFrameGranuleJobs() { return 0; } @@ -313,8 +305,8 @@ class VorbisState : public OggCodecState { CodecType GetType() override { return TYPE_VORBIS; } bool DecodeHeader(OggPacketPtr aPacket) override; - TimeUnit Time(int64_t aGranulepos) override; - TimeUnit PacketDuration(ogg_packet* aPacket) override; + int64_t Time(int64_t granulepos) override; + int64_t PacketDuration(ogg_packet* aPacket) override; bool Init() override; nsresult Reset() override; bool IsHeader(ogg_packet* aPacket) override; @@ -326,14 +318,14 @@ class VorbisState : public OggCodecState { private: AudioInfo mInfo; - vorbis_info mVorbisInfo = {}; - vorbis_comment mComment = {}; - vorbis_dsp_state mDsp = {}; - vorbis_block mBlock = {}; + vorbis_info mVorbisInfo; + vorbis_comment mComment; + vorbis_dsp_state mDsp; + vorbis_block mBlock; OggPacketQueue mHeaders; // Returns the end time that a granulepos represents. - static TimeUnit Time(vorbis_info* aInfo, int64_t aGranulePos); + static int64_t Time(vorbis_info* aInfo, int64_t aGranulePos); // Reconstructs the granulepos of Vorbis packets stored in the mUnstamped // array. @@ -388,26 +380,26 @@ class TheoraState : public OggCodecState { CodecType GetType() override { return TYPE_THEORA; } bool DecodeHeader(OggPacketPtr aPacket) override; - TimeUnit Time(int64_t aGranulepos) override; - TimeUnit StartTime(int64_t aGranulepos) override; - TimeUnit PacketDuration(ogg_packet* aPacket) override; + int64_t Time(int64_t granulepos) override; + int64_t StartTime(int64_t granulepos) override; + int64_t PacketDuration(ogg_packet* aPacket) override; bool Init() override; nsresult Reset() override; bool IsHeader(ogg_packet* aPacket) override; bool IsKeyframe(ogg_packet* aPacket) override; nsresult PageIn(tainted_opaque_ogg aPage) override; const TrackInfo* GetInfo() const override { return &mInfo; } - TimeUnit MaxKeyframeOffset() override; + int64_t MaxKeyframeOffset() override; int32_t KeyFrameGranuleJobs() override { return mTheoraInfo.keyframe_granule_shift; } private: // Returns the end time that a granulepos represents. - static TimeUnit Time(th_info* aInfo, int64_t aGranulePos); + static int64_t Time(th_info* aInfo, int64_t aGranulePos); - th_info mTheoraInfo = {}; - th_comment mComment = {}; + th_info mTheoraInfo; + th_comment mComment; th_setup_info* mSetup; th_dec_ctx* mCtx; @@ -430,8 +422,8 @@ class OpusState : public OggCodecState { CodecType GetType() override { return TYPE_OPUS; } bool DecodeHeader(OggPacketPtr aPacket) override; - TimeUnit Time(int64_t aGranulepos) override; - TimeUnit PacketDuration(ogg_packet* aPacket) override; + int64_t Time(int64_t aGranulepos) override; + int64_t PacketDuration(ogg_packet* aPacket) override; bool Init() override; nsresult Reset() override; nsresult Reset(bool aStart); @@ -441,7 +433,7 @@ class OpusState : public OggCodecState { const TrackInfo* GetInfo() const override { return &mInfo; } // Returns the end time that a granulepos represents. - static TimeUnit Time(int aPreSkip, int64_t aGranulepos); + static int64_t Time(int aPreSkip, int64_t aGranulepos); // Construct and return a table of tags from the metadata header. UniquePtr GetTags() override; @@ -506,7 +498,7 @@ class SkeletonState : public OggCodecState { CodecType GetType() override { return TYPE_SKELETON; } bool DecodeHeader(OggPacketPtr aPacket) override; - TimeUnit Time(int64_t aGranulepos) override { return TimeUnit::Invalid(); } + int64_t Time(int64_t granulepos) override { return -1; } bool IsHeader(ogg_packet* aPacket) override { return true; } // Return true if the given time (in milliseconds) is within @@ -517,18 +509,18 @@ class SkeletonState : public OggCodecState { // and its presentation time. class nsKeyPoint { public: - nsKeyPoint() : mOffset(INT64_MAX), mTime(TimeUnit::Invalid()) {} + nsKeyPoint() : mOffset(INT64_MAX), mTime(INT64_MAX) {} - nsKeyPoint(int64_t aOffset, TimeUnit aTime) + nsKeyPoint(int64_t aOffset, int64_t aTime) : mOffset(aOffset), mTime(aTime) {} // Offset from start of segment/link-in-the-chain in bytes. int64_t mOffset; - // Presentation time - TimeUnit mTime; + // Presentation time in usecs. + int64_t mTime; - bool IsNull() { return mOffset == INT64_MAX && !mTime.IsValid(); } + bool IsNull() { return mOffset == INT64_MAX && mTime == INT64_MAX; } }; // Stores a keyframe's byte-offset, presentation time and the serialno @@ -544,8 +536,7 @@ class SkeletonState : public OggCodecState { // Determines from the seek index the keyframe which you must seek back to // in order to get all keyframes required to render all streams with // serialnos in aTracks, at time aTarget. - nsresult IndexedSeekTarget(const TimeUnit& aTarget, - nsTArray& aTracks, + nsresult IndexedSeekTarget(int64_t aTarget, nsTArray& aTracks, nsSeekTarget& aResult); bool HasIndex() const { return mIndex.Count() > 0; } @@ -554,7 +545,7 @@ class SkeletonState : public OggCodecState { // an index. aTracks must be filled with the serialnos of the active tracks. // The duration is calculated as the greatest end time of all active tracks, // minus the smalled start time of all the active tracks. - nsresult GetDuration(const nsTArray& aTracks, TimeUnit& aDuration); + nsresult GetDuration(const nsTArray& aTracks, int64_t& aDuration); private: // Decodes an index packet. Returns false on failure. @@ -564,8 +555,7 @@ class SkeletonState : public OggCodecState { // Gets the keypoint you must seek to in order to get the keyframe required // to render the stream at time aTarget on stream with serial aSerialno. - nsresult IndexedSeekTargetForTrack(uint32_t aSerialno, - const TimeUnit& aTarget, + nsresult IndexedSeekTargetForTrack(uint32_t aSerialno, int64_t aTarget, nsKeyPoint& aResult); // Version of the decoded skeleton track, as per the SKELETON_VERSION macro. @@ -581,15 +571,15 @@ class SkeletonState : public OggCodecState { // stream. class nsKeyFrameIndex { public: - nsKeyFrameIndex(const TimeUnit& aStartTime, const TimeUnit& aEndTime) + nsKeyFrameIndex(int64_t aStartTime, int64_t aEndTime) : mStartTime(aStartTime), mEndTime(aEndTime) { MOZ_COUNT_CTOR(nsKeyFrameIndex); } MOZ_COUNTED_DTOR(nsKeyFrameIndex) - void Add(int64_t aOffset, const TimeUnit& aTime) { - mKeyPoints.AppendElement(nsKeyPoint(aOffset, aTime)); + void Add(int64_t aOffset, int64_t aTimeMs) { + mKeyPoints.AppendElement(nsKeyPoint(aOffset, aTimeMs)); } const nsKeyPoint& Get(uint32_t aIndex) const { return mKeyPoints[aIndex]; } @@ -597,10 +587,10 @@ class SkeletonState : public OggCodecState { uint32_t Length() const { return mKeyPoints.Length(); } // Presentation time of the first sample in this stream in usecs. - const TimeUnit mStartTime; + const int64_t mStartTime; // End time of the last sample in this stream in usecs. - const TimeUnit mEndTime; + const int64_t mEndTime; private: nsTArray mKeyPoints; @@ -617,8 +607,8 @@ class FlacState : public OggCodecState { CodecType GetType() override { return TYPE_FLAC; } bool DecodeHeader(OggPacketPtr aPacket) override; - TimeUnit Time(int64_t aGranulepos) override; - TimeUnit PacketDuration(ogg_packet* aPacket) override; + int64_t Time(int64_t granulepos) override; + int64_t PacketDuration(ogg_packet* aPacket) override; bool IsHeader(ogg_packet* aPacket) override; nsresult PageIn(tainted_opaque_ogg aPage) override; diff --git a/dom/media/ogg/OggDemuxer.cpp b/dom/media/ogg/OggDemuxer.cpp index 12fc7bfe9f5e..aaa9e8ea1490 100644 --- a/dom/media/ogg/OggDemuxer.cpp +++ b/dom/media/ogg/OggDemuxer.cpp @@ -8,7 +8,6 @@ #include "OggRLBox.h" #include "MediaDataDemuxer.h" #include "OggCodecState.h" -#include "TimeUnits.h" #include "XiphExtradata.h" #include "mozilla/AbstractThread.h" #include "mozilla/Atomics.h" @@ -18,7 +17,6 @@ #include "mozilla/SharedThreadPool.h" #include "mozilla/Telemetry.h" #include "mozilla/TimeStamp.h" -#include "nsDebug.h" #include "nsAutoRef.h" #include "nsError.h" @@ -57,7 +55,7 @@ using media::TimeUnit; // seek target. This is becaue it's usually quicker to just keep downloading // from an exisiting connection than to do another bisection inside that // small range, which would open a new HTTP connetion. -static const TimeUnit OGG_SEEK_FUZZ_USECS = TimeUnit::FromMicroseconds(500000); +static const uint32_t OGG_SEEK_FUZZ_USECS = 500000; // The number of microseconds of "pre-roll" we use for Opus streams. // The specification recommends 80 ms. @@ -188,16 +186,14 @@ bool OggDemuxer::HasVideo() const { return mTheoraState; } bool OggDemuxer::HaveStartTime() const { return mStartTime.isSome(); } -TimeUnit OggDemuxer::StartTime() const { - return mStartTime.refOr(TimeUnit::Zero()); -} +int64_t OggDemuxer::StartTime() const { return mStartTime.refOr(0); } bool OggDemuxer::HaveStartTime(TrackInfo::TrackType aType) { return OggState(aType).mStartTime.isSome(); } -TimeUnit OggDemuxer::StartTime(TrackInfo::TrackType aType) { - return OggState(aType).mStartTime.refOr(TimeUnit::Zero()); +int64_t OggDemuxer::StartTime(TrackInfo::TrackType aType) { + return OggState(aType).mStartTime.refOr(TimeUnit::Zero()).ToMicroseconds(); } RefPtr OggDemuxer::Init() { @@ -386,11 +382,10 @@ void OggDemuxer::SetupTargetSkeleton() { // the end of resource to get it. nsTArray tracks; BuildSerialList(tracks); - TimeUnit duration = TimeUnit::Zero(); + int64_t duration = 0; if (NS_SUCCEEDED(mSkeletonState->GetDuration(tracks, duration))) { - OGG_DEBUG("Got duration from Skeleton index %s", - duration.ToString().get()); - mInfo.mMetadataDuration.emplace(duration); + OGG_DEBUG("Got duration from Skeleton index %" PRId64, duration); + mInfo.mMetadataDuration.emplace(TimeUnit::FromMicroseconds(duration)); } } } @@ -570,10 +565,10 @@ nsresult OggDemuxer::ReadMetadata() { SetupMediaTracksInfo(serials); if (HasAudio() || HasVideo()) { - TimeUnit startTime = TimeUnit::Invalid(); + int64_t startTime = -1; FindStartTime(startTime); - if (startTime.IsValid()) { - OGG_DEBUG("Detected stream start time %s", startTime.ToString().get()); + if (startTime >= 0) { + OGG_DEBUG("Detected stream start time %" PRId64, startTime); mStartTime.emplace(startTime); } @@ -585,14 +580,14 @@ nsresult OggDemuxer::ReadMetadata() { MOZ_ASSERT(length > 0, "Must have a content length to get end time"); - TimeUnit endTime = RangeEndTime(TrackInfo::kAudioTrack, length); + int64_t endTime = RangeEndTime(TrackInfo::kAudioTrack, length); - if (endTime.IsValid()) { - mInfo.mUnadjustedMetadataEndTime.emplace(endTime); - mInfo.mMetadataDuration.emplace(endTime - - mStartTime.refOr(TimeUnit::Zero())); - OGG_DEBUG("Got Ogg duration from seeking to end %s", - endTime.ToString().get()); + if (endTime != -1) { + mInfo.mUnadjustedMetadataEndTime.emplace( + TimeUnit::FromMicroseconds(endTime)); + mInfo.mMetadataDuration.emplace( + TimeUnit::FromMicroseconds(endTime - mStartTime.refOr(0))); + OGG_DEBUG("Got Ogg duration from seeking to end %" PRId64, endTime); } } if (mInfo.mMetadataDuration.isNothing()) { @@ -935,7 +930,7 @@ TimeIntervals OggDemuxer::GetBuffered(TrackInfo::TrackType aType) { // we special-case (startOffset == 0) so that the first // buffered range always appears to be buffered from the media start // time, rather than from the end-time of the first page. - TimeUnit startTime = (startOffset == 0) ? StartTime() : TimeUnit::Invalid(); + int64_t startTime = (startOffset == 0) ? StartTime() : -1; // Find the start time of the range. Read pages until we find one with a // granulepos which we can convert into a timestamp to use as the time of @@ -947,7 +942,7 @@ TimeIntervals OggDemuxer::GetBuffered(TrackInfo::TrackType aType) { } auto clean_page = MakeScopeExit([&] { mSandbox->free_in_sandbox(page); }); - while (!startTime.IsValid()) { + while (startTime == -1) { int32_t discard; PageSyncResult pageSyncResult = PageSync(mSandbox.get(), Resource(aType), sync.mState, true, @@ -986,22 +981,22 @@ TimeIntervals OggDemuxer::GetBuffered(TrackInfo::TrackType aType) { (serial == mVorbisState->mSerial) .unverified_safe_because(time_interval_reason)) { startTime = mVorbisState->Time(granulepos); - MOZ_ASSERT(startTime.IsPositive(), "Must have positive start time"); + MOZ_ASSERT(startTime > 0, "Must have positive start time"); } else if (aType == TrackInfo::kAudioTrack && mOpusState && (serial == mOpusState->mSerial) .unverified_safe_because(time_interval_reason)) { startTime = mOpusState->Time(granulepos); - MOZ_ASSERT(startTime.IsPositive(), "Must have positive start time"); + MOZ_ASSERT(startTime > 0, "Must have positive start time"); } else if (aType == TrackInfo::kAudioTrack && mFlacState && (serial == mFlacState->mSerial) .unverified_safe_because(time_interval_reason)) { startTime = mFlacState->Time(granulepos); - MOZ_ASSERT(startTime.IsPositive(), "Must have positive start time"); + MOZ_ASSERT(startTime > 0, "Must have positive start time"); } else if (aType == TrackInfo::kVideoTrack && mTheoraState && (serial == mTheoraState->mSerial) .unverified_safe_because(time_interval_reason)) { startTime = mTheoraState->Time(granulepos); - MOZ_ASSERT(startTime.IsPositive(), "Must have positive start time"); + MOZ_ASSERT(startTime > 0, "Must have positive start time"); } else if (mCodecStore.Contains( serial.unverified_safe_because(time_interval_reason))) { // Stream is not the theora or vorbis stream we're playing, @@ -1029,13 +1024,14 @@ TimeIntervals OggDemuxer::GetBuffered(TrackInfo::TrackType aType) { } } - if (startTime.IsValid()) { + if (startTime != -1) { // We were able to find a start time for that range, see if we can // find an end time. - TimeUnit endTime = RangeEndTime(aType, startOffset, endOffset, true); - if (endTime.IsValid() && endTime > startTime) { + int64_t endTime = RangeEndTime(aType, startOffset, endOffset, true); + if (endTime > startTime) { buffered += - TimeInterval(startTime - StartTime(), endTime - StartTime()); + TimeInterval(TimeUnit::FromMicroseconds(startTime - StartTime()), + TimeUnit::FromMicroseconds(endTime - StartTime())); } } } @@ -1043,38 +1039,38 @@ TimeIntervals OggDemuxer::GetBuffered(TrackInfo::TrackType aType) { return buffered; } -void OggDemuxer::FindStartTime(TimeUnit& aOutStartTime) { +void OggDemuxer::FindStartTime(int64_t& aOutStartTime) { // Extract the start times of the bitstreams in order to calculate // the duration. - TimeUnit videoStartTime = TimeUnit::FromInfinity(); - TimeUnit audioStartTime = TimeUnit::FromInfinity(); + int64_t videoStartTime = INT64_MAX; + int64_t audioStartTime = INT64_MAX; if (HasVideo()) { FindStartTime(TrackInfo::kVideoTrack, videoStartTime); - if (!videoStartTime.IsPosInf()) { - OGG_DEBUG("OggDemuxer::FindStartTime() video=%s", - videoStartTime.ToString().get()); - mVideoOggState.mStartTime = Some(videoStartTime); + if (videoStartTime != INT64_MAX) { + OGG_DEBUG("OggDemuxer::FindStartTime() video=%" PRId64, videoStartTime); + mVideoOggState.mStartTime = + Some(TimeUnit::FromMicroseconds(videoStartTime)); } } if (HasAudio()) { FindStartTime(TrackInfo::kAudioTrack, audioStartTime); - if (!audioStartTime.IsPosInf()) { - OGG_DEBUG("OggDemuxer::FindStartTime() audio=%s", - audioStartTime.ToString().get()); - mAudioOggState.mStartTime = Some(audioStartTime); + if (audioStartTime != INT64_MAX) { + OGG_DEBUG("OggDemuxer::FindStartTime() audio=%" PRId64, audioStartTime); + mAudioOggState.mStartTime = + Some(TimeUnit::FromMicroseconds(audioStartTime)); } } - TimeUnit startTime = std::min(videoStartTime, audioStartTime); - if (!startTime.IsPosInf()) { + int64_t startTime = std::min(videoStartTime, audioStartTime); + if (startTime != INT64_MAX) { aOutStartTime = startTime; } } void OggDemuxer::FindStartTime(TrackInfo::TrackType aType, - TimeUnit& aOutStartTime) { - TimeUnit startTime = TimeUnit::FromInfinity(); + int64_t& aOutStartTime) { + int64_t startTime = INT64_MAX; OggCodecState* state = GetTrackCodecState(aType); ogg_packet* pkt = GetNextPacket(aType); @@ -1082,21 +1078,22 @@ void OggDemuxer::FindStartTime(TrackInfo::TrackType aType, startTime = state->PacketStartTime(pkt); } - if (!startTime.IsInfinite()) { + if (startTime != INT64_MAX) { aOutStartTime = startTime; } } nsresult OggDemuxer::SeekInternal(TrackInfo::TrackType aType, const TimeUnit& aTarget) { - OGG_DEBUG("About to seek to %s", aTarget.ToString().get()); + int64_t target = aTarget.ToMicroseconds(); + OGG_DEBUG("About to seek to %" PRId64, target); nsresult res; - TimeUnit adjustedTarget = aTarget; - TimeUnit startTime = StartTime(aType); - TimeUnit endTime = - mInfo.mMetadataDuration.valueOr(TimeUnit::Zero()) + startTime; + int64_t adjustedTarget = target; + int64_t startTime = StartTime(aType); + int64_t endTime = mInfo.mMetadataDuration->ToMicroseconds() + startTime; if (aType == TrackInfo::kAudioTrack && mOpusState) { - adjustedTarget = std::max(startTime, aTarget - OGG_SEEK_OPUS_PREROLL); + adjustedTarget = + std::max(startTime, target - OGG_SEEK_OPUS_PREROLL.ToMicroseconds()); } if (!HaveStartTime(aType) || adjustedTarget == startTime) { @@ -1123,19 +1120,19 @@ nsresult OggDemuxer::SeekInternal(TrackInfo::TrackType aType, // Figure out if the seek target lies in a buffered range. SeekRange r = - SelectSeekRange(aType, ranges, aTarget, startTime, endTime, true); + SelectSeekRange(aType, ranges, target, startTime, endTime, true); if (!r.IsNull()) { // We know the buffered range in which the seek target lies, do a // bisection search in that buffered range. - res = SeekInBufferedRange(aType, aTarget, adjustedTarget, startTime, + res = SeekInBufferedRange(aType, target, adjustedTarget, startTime, endTime, ranges, r); NS_ENSURE_SUCCESS(res, res); } else { // The target doesn't lie in a buffered range. Perform a bisection // search over the whole media, using the known buffered ranges to // reduce the search space. - res = SeekInUnbuffered(aType, aTarget, startTime, endTime, ranges); + res = SeekInUnbuffered(aType, target, startTime, endTime, ranges); NS_ENSURE_SUCCESS(res, res); } } @@ -1158,19 +1155,12 @@ nsresult OggDemuxer::SeekInternal(TrackInfo::TrackType aType, OGG_DEBUG("End of stream reached before keyframe found in indexed seek"); break; } - // Skip any header packet, this can be the case when looping and not parsing - // the headers again. - if (state->IsHeader(packet)) { - OggPacketPtr drop(state->PacketOut()); - continue; - } - TimeUnit startTstamp = state->PacketStartTime(packet); + int64_t startTstamp = state->PacketStartTime(packet); if (foundKeyframe && startTstamp > adjustedTarget) { break; } if (state->IsKeyframe(packet)) { - OGG_DEBUG("keyframe found after seeking at %s", - startTstamp.ToString().get()); + OGG_DEBUG("keyframe found after seeking at %" PRId64, startTstamp); tempPackets.Erase(); foundKeyframe = true; } @@ -1201,7 +1191,7 @@ OggDemuxer::IndexedSeekResult OggDemuxer::RollbackIndexedSeek( } OggDemuxer::IndexedSeekResult OggDemuxer::SeekToKeyframeUsingIndex( - TrackInfo::TrackType aType, const TimeUnit& aTarget) { + TrackInfo::TrackType aType, int64_t aTarget) { if (!HasSkeleton() || !mSkeletonState->HasIndex()) { return SEEK_INDEX_FAIL; } @@ -1407,14 +1397,12 @@ RefPtr OggTrackDemuxer::Seek( } RefPtr OggTrackDemuxer::NextSample() { - OGG_DEBUG("OggTrackDemuxer::NextSample"); if (mQueuedSample) { RefPtr nextSample = mQueuedSample; mQueuedSample = nullptr; if (mType == TrackInfo::kAudioTrack) { nextSample->mTrackInfo = mParent->mSharedAudioTrackInfo; } - OGG_DEBUG("OggTrackDemuxer::NextSample (queued)"); return nextSample; } ogg_packet* packet = mParent->GetNextPacket(mType); @@ -1447,41 +1435,6 @@ RefPtr OggTrackDemuxer::NextSample() { if (!data->mTime.IsValid()) { return nullptr; } - TimeUnit mediaStartTime = mParent->mStartTime.valueOr(TimeUnit::Zero()); - TimeUnit mediaEndTime = - mediaStartTime + - mParent->mInfo.mMetadataDuration.valueOr(TimeUnit::FromInfinity()); - // Trim packets that end after the media duration. - if (mType == TrackInfo::kAudioTrack) { - OGG_DEBUG("Check trimming %s > %s", data->GetEndTime().ToString().get(), - mediaEndTime.ToString().get()); - // Because of a quirk of this demuxer, this needs to be >=. It looks - // useless, because `toTrim` is going to be 0, but it allows setting - // `mOriginalPresentationWindow`, so that the trimming logic will later - // remove extraneous frames. - // This demuxer sets the end time of a packet to be the end time that - // should be played, not the end time that corresponds to the number of - // decoded frames, that we can only have after decoding. - // >= allows detecting the last packet, and trimming it appropriately, - // after decoding has happened, with the AudioTrimmer. - if (data->GetEndTime() >= mediaEndTime) { - TimeUnit toTrim = data->GetEndTime() - mediaEndTime; - TimeUnit originalDuration = data->mDuration; - OGG_DEBUG( - "Demuxed past media end time, trimming: packet [%s,%s] to [%s,%s]", - data->mTime.ToString().get(), data->GetEndTime().ToString().get(), - data->mTime.ToString().get(), - (data->mTime + originalDuration).ToString().get()); - data->mOriginalPresentationWindow = - Some(TimeInterval{data->mTime, data->GetEndTime()}); - data->mDuration -= toTrim; - } - } - - OGG_DEBUG("OGG packet demuxed: [%s,%s] (duration: %s, type: %s)", - data->mTime.ToString().get(), data->GetEndTime().ToString().get(), - data->mDuration.ToString().get(), - mType == TrackInfo::kAudioTrack ? "audio" : "video"); return data; } @@ -1580,15 +1533,15 @@ tainted_opaque_ogg OggDemuxer::GetPageChecksum( return ret.to_opaque(); } -TimeUnit OggDemuxer::RangeStartTime(TrackInfo::TrackType aType, - int64_t aOffset) { +int64_t OggDemuxer::RangeStartTime(TrackInfo::TrackType aType, + int64_t aOffset) { int64_t position = Resource(aType)->Tell(); nsresult res = Resource(aType)->Seek(nsISeekableStream::NS_SEEK_SET, aOffset); - NS_ENSURE_SUCCESS(res, TimeUnit::Zero()); - TimeUnit startTime = TimeUnit::Zero(); + NS_ENSURE_SUCCESS(res, 0); + int64_t startTime = 0; FindStartTime(aType, startTime); res = Resource(aType)->Seek(nsISeekableStream::NS_SEEK_SET, position); - NS_ENSURE_SUCCESS(res, TimeUnit::Invalid()); + NS_ENSURE_SUCCESS(res, -1); return startTime; } @@ -1607,19 +1560,19 @@ struct nsDemuxerAutoOggSyncState { tainted_ogg mState; }; -TimeUnit OggDemuxer::RangeEndTime(TrackInfo::TrackType aType, - int64_t aEndOffset) { +int64_t OggDemuxer::RangeEndTime(TrackInfo::TrackType aType, + int64_t aEndOffset) { int64_t position = Resource(aType)->Tell(); - TimeUnit endTime = RangeEndTime(aType, 0, aEndOffset, false); + int64_t endTime = RangeEndTime(aType, 0, aEndOffset, false); nsresult res = Resource(aType)->Seek(nsISeekableStream::NS_SEEK_SET, position); - NS_ENSURE_SUCCESS(res, TimeUnit::Invalid()); + NS_ENSURE_SUCCESS(res, -1); return endTime; } -TimeUnit OggDemuxer::RangeEndTime(TrackInfo::TrackType aType, - int64_t aStartOffset, int64_t aEndOffset, - bool aCachedDataOnly) { +int64_t OggDemuxer::RangeEndTime(TrackInfo::TrackType aType, + int64_t aStartOffset, int64_t aEndOffset, + bool aCachedDataOnly) { nsDemuxerAutoOggSyncState sync(*mSandbox); // We need to find the last page which ends before aEndOffset that @@ -1633,13 +1586,13 @@ TimeUnit OggDemuxer::RangeEndTime(TrackInfo::TrackType aType, int64_t readStartOffset = aEndOffset; int64_t readLimitOffset = aEndOffset; int64_t readHead = aEndOffset; - TimeUnit endTime = TimeUnit::Invalid(); + int64_t endTime = -1; uint32_t checksumAfterSeek = 0; uint32_t prevChecksumAfterSeek = 0; bool mustBackOff = false; tainted_ogg page = mSandbox->malloc_in_sandbox(); if (!page) { - return TimeUnit::Invalid(); + return -1; } auto clean_page = MakeScopeExit([&] { mSandbox->free_in_sandbox(page); }); while (true) { @@ -1656,14 +1609,14 @@ TimeUnit OggDemuxer::RangeEndTime(TrackInfo::TrackType aType, seek_ret, (static_cast(checker = val), checker.isValid()), &failedVerify); if (failedVerify) { - return TimeUnit::Invalid(); + return -1; } if (ret.unverified_safe_because(RLBOX_OGG_STATE_ASSERT_REASON) == 0) { // We need more data if we've not encountered a page we've seen before, // or we've read to the end of file. if (mustBackOff || readHead == aEndOffset || readHead == aStartOffset) { - if (endTime.IsValid() || readStartOffset == 0) { + if (endTime != -1 || readStartOffset == 0) { // We have encountered a page before, or we're at the end of file. break; } @@ -1698,15 +1651,15 @@ TimeUnit OggDemuxer::RangeEndTime(TrackInfo::TrackType aType, if (aCachedDataOnly) { res = Resource(aType)->GetResource()->ReadFromCache(buffer, readHead, bytesToRead); - NS_ENSURE_SUCCESS(res, TimeUnit::Invalid()); + NS_ENSURE_SUCCESS(res, -1); bytesRead = bytesToRead; } else { MOZ_ASSERT(readHead < aEndOffset, "resource pos must be before range end"); res = Resource(aType)->Seek(nsISeekableStream::NS_SEEK_SET, readHead); - NS_ENSURE_SUCCESS(res, TimeUnit::Invalid()); + NS_ENSURE_SUCCESS(res, -1); res = Resource(aType)->Read(buffer, bytesToRead, &bytesRead); - NS_ENSURE_SUCCESS(res, TimeUnit::Invalid()); + NS_ENSURE_SUCCESS(res, -1); } readHead += bytesRead; if (readHead > readLimitOffset) { @@ -1720,11 +1673,11 @@ TimeUnit OggDemuxer::RangeEndTime(TrackInfo::TrackType aType, int wrote_success = CopyAndVerifyOrFail(ret, val == 0 || val == -1, &failedWroteVerify); if (failedWroteVerify) { - return TimeUnit::Invalid(); + return -1; } if (wrote_success != 0) { - endTime = TimeUnit::Invalid(); + endTime = -1; break; } continue; @@ -1774,12 +1727,12 @@ TimeUnit OggDemuxer::RangeEndTime(TrackInfo::TrackType aType, // It's probably from a new "link" in a "chained" ogg. Don't // bother even trying to find a duration... SetChained(); - endTime = TimeUnit::Invalid(); + endTime = -1; break; } - TimeUnit t = codecState->Time(granulepos); - if (t.IsValid()) { + int64_t t = codecState->Time(granulepos); + if (t != -1) { endTime = t; } } @@ -1796,16 +1749,15 @@ nsresult OggDemuxer::GetSeekRanges(TrackInfo::TrackType aType, for (uint32_t index = 0; index < cached.Length(); index++) { auto& range = cached[index]; - TimeUnit startTime = TimeUnit::Invalid(); - TimeUnit endTime = TimeUnit::Invalid(); + int64_t startTime = -1; + int64_t endTime = -1; if (NS_FAILED(Reset(aType))) { return NS_ERROR_FAILURE; } int64_t startOffset = range.mStart; int64_t endOffset = range.mEnd; startTime = RangeStartTime(aType, startOffset); - if (startTime.IsValid() && - ((endTime = RangeEndTime(aType, endOffset)).IsValid())) { + if (startTime != -1 && ((endTime = RangeEndTime(aType, endOffset)) != -1)) { NS_WARNING_ASSERTION(startTime < endTime, "Start time must be before end time"); aRanges.AppendElement( @@ -1820,12 +1772,11 @@ nsresult OggDemuxer::GetSeekRanges(TrackInfo::TrackType aType, OggDemuxer::SeekRange OggDemuxer::SelectSeekRange( TrackInfo::TrackType aType, const nsTArray& ranges, - const TimeUnit& aTarget, const TimeUnit& aStartTime, - const TimeUnit& aEndTime, bool aExact) { + int64_t aTarget, int64_t aStartTime, int64_t aEndTime, bool aExact) { int64_t so = 0; int64_t eo = Resource(aType)->GetLength(); - TimeUnit st = aStartTime; - TimeUnit et = aEndTime; + int64_t st = aStartTime; + int64_t et = aEndTime; for (uint32_t i = 0; i < ranges.Length(); i++) { const SeekRange& r = ranges[i]; if (r.mTimeStart < aTarget) { @@ -1849,18 +1800,17 @@ OggDemuxer::SeekRange OggDemuxer::SelectSeekRange( } nsresult OggDemuxer::SeekInBufferedRange(TrackInfo::TrackType aType, - const TimeUnit& aTarget, - TimeUnit& aAdjustedTarget, - const TimeUnit& aStartTime, - const TimeUnit& aEndTime, + int64_t aTarget, + int64_t aAdjustedTarget, + int64_t aStartTime, int64_t aEndTime, const nsTArray& aRanges, const SeekRange& aRange) { - OGG_DEBUG("Seeking in buffered data to %s using bisection search", - aTarget.ToString().get()); + OGG_DEBUG("Seeking in buffered data to %" PRId64 " using bisection search", + aTarget); if (aType == TrackInfo::kVideoTrack || aAdjustedTarget >= aTarget) { // We know the exact byte range in which the target must lie. It must // be buffered in the media cache. Seek there. - nsresult res = SeekBisection(aType, aTarget, aRange, TimeUnit::Zero()); + nsresult res = SeekBisection(aType, aTarget, aRange, 0); if (NS_FAILED(res) || aType != TrackInfo::kVideoTrack) { return res; } @@ -1875,7 +1825,7 @@ nsresult OggDemuxer::SeekInBufferedRange(TrackInfo::TrackType aType, MOZ_ASSERT(packet->granulepos != -1, "Must have a granulepos"); int shift = mTheoraState->KeyFrameGranuleJobs(); int64_t keyframeGranulepos = (packet->granulepos >> shift) << shift; - TimeUnit keyframeTime = mTheoraState->StartTime(keyframeGranulepos); + int64_t keyframeTime = mTheoraState->StartTime(keyframeGranulepos); SEEK_LOG(LogLevel::Debug, ("Keyframe for %lld is at %lld, seeking back to it", frameTime, keyframeTime)); @@ -1893,12 +1843,11 @@ nsresult OggDemuxer::SeekInBufferedRange(TrackInfo::TrackType aType, } nsresult OggDemuxer::SeekInUnbuffered(TrackInfo::TrackType aType, - const TimeUnit& aTarget, - const TimeUnit& aStartTime, - const TimeUnit& aEndTime, + int64_t aTarget, int64_t aStartTime, + int64_t aEndTime, const nsTArray& aRanges) { - OGG_DEBUG("Seeking in unbuffered data to %s using bisection search", - aTarget.ToString().get()); + OGG_DEBUG("Seeking in unbuffered data to %" PRId64 " using bisection search", + aTarget); // If we've got an active Theora bitstream, determine the maximum possible // time in usecs which a keyframe could be before a given interframe. We @@ -1912,15 +1861,16 @@ nsresult OggDemuxer::SeekInUnbuffered(TrackInfo::TrackType aType, // as the extra decoding causes a noticeable speed hit when all the data // is buffered (compared to just doing a bisection to exactly find the // keyframe). - TimeUnit keyframeOffset = TimeUnit::Zero(); + int64_t keyframeOffsetMs = 0; if (aType == TrackInfo::kVideoTrack && mTheoraState) { - keyframeOffset = mTheoraState->MaxKeyframeOffset(); + keyframeOffsetMs = mTheoraState->MaxKeyframeOffset(); } // Add in the Opus pre-roll if necessary, as well. if (aType == TrackInfo::kAudioTrack && mOpusState) { - keyframeOffset = std::max(keyframeOffset, OGG_SEEK_OPUS_PREROLL); + keyframeOffsetMs = + std::max(keyframeOffsetMs, OGG_SEEK_OPUS_PREROLL.ToMilliseconds()); } - TimeUnit seekTarget = std::max(aStartTime, aTarget - keyframeOffset); + int64_t seekTarget = std::max(aStartTime, aTarget - keyframeOffsetMs); // Minimize the bisection search space using the known timestamps from the // buffered ranges. SeekRange k = @@ -1928,10 +1878,8 @@ nsresult OggDemuxer::SeekInUnbuffered(TrackInfo::TrackType aType, return SeekBisection(aType, seekTarget, k, OGG_SEEK_FUZZ_USECS); } -nsresult OggDemuxer::SeekBisection(TrackInfo::TrackType aType, - const TimeUnit& aTarget, - const SeekRange& aRange, - const TimeUnit& aFuzz) { +nsresult OggDemuxer::SeekBisection(TrackInfo::TrackType aType, int64_t aTarget, + const SeekRange& aRange, uint32_t aFuzz) { nsresult res; if (aTarget <= aRange.mTimeStart) { @@ -1946,15 +1894,13 @@ nsresult OggDemuxer::SeekBisection(TrackInfo::TrackType aType, // Bisection search, find start offset of last page with end time less than // the seek target. ogg_int64_t startOffset = aRange.mOffsetStart; - ogg_int64_t startTime = aRange.mTimeStart.ToMicroseconds(); + ogg_int64_t startTime = aRange.mTimeStart; ogg_int64_t startLength = 0; // Length of the page at startOffset. ogg_int64_t endOffset = aRange.mOffsetEnd; - ogg_int64_t endTime = aRange.mTimeEnd.ToMicroseconds(); + ogg_int64_t endTime = aRange.mTimeEnd; - ogg_int64_t seekTarget = aTarget.ToMicroseconds(); - int64_t seekLowerBound = - std::max(static_cast(0), - aTarget.ToMicroseconds() - aFuzz.ToMicroseconds()); + ogg_int64_t seekTarget = aTarget; + int64_t seekLowerBound = std::max(static_cast(0), aTarget - aFuzz); int hops = 0; DebugOnly previousGuess = -1; int backsteps = 0; @@ -2112,17 +2058,17 @@ nsresult OggDemuxer::SeekBisection(TrackInfo::TrackType aType, if (aType == TrackInfo::kAudioTrack && granulepos > 0 && audioTime == -1) { if (mVorbisState && serial == mVorbisState->mSerial) { - audioTime = mVorbisState->Time(granulepos).ToMicroseconds(); + audioTime = mVorbisState->Time(granulepos); } else if (mOpusState && serial == mOpusState->mSerial) { - audioTime = mOpusState->Time(granulepos).ToMicroseconds(); + audioTime = mOpusState->Time(granulepos); } else if (mFlacState && serial == mFlacState->mSerial) { - audioTime = mFlacState->Time(granulepos).ToMicroseconds(); + audioTime = mFlacState->Time(granulepos); } } if (aType == TrackInfo::kVideoTrack && granulepos > 0 && serial == mTheoraState->mSerial && videoTime == -1) { - videoTime = mTheoraState->Time(granulepos).ToMicroseconds(); + videoTime = mTheoraState->Time(granulepos); } if (pageOffset + pageLength >= endOffset) { @@ -2169,7 +2115,7 @@ nsresult OggDemuxer::SeekBisection(TrackInfo::TrackType aType, // last page before the target, and the first page after the target. SEEK_LOG(LogLevel::Debug, ("Terminating seek at offset=%lld", startOffset)); - MOZ_ASSERT(startTime < aTarget.ToMicroseconds(), + MOZ_ASSERT(startTime < aTarget, "Start time must always be less than target"); res = Resource(aType)->Seek(nsISeekableStream::NS_SEEK_SET, startOffset); NS_ENSURE_SUCCESS(res, res); diff --git a/dom/media/ogg/OggDemuxer.h b/dom/media/ogg/OggDemuxer.h index 03c4dc1b2520..8a65398cf9dd 100644 --- a/dom/media/ogg/OggDemuxer.h +++ b/dom/media/ogg/OggDemuxer.h @@ -54,8 +54,8 @@ class OggDemuxer : public MediaDataDemuxer, tainted_opaque_ogg mState; }; media::TimeIntervals GetBuffered(TrackInfo::TrackType aType); - void FindStartTime(media::TimeUnit& aOutStartTime); - void FindStartTime(TrackInfo::TrackType, media::TimeUnit& aOutStartTime); + void FindStartTime(int64_t& aOutStartTime); + void FindStartTime(TrackInfo::TrackType, int64_t& aOutStartTime); nsresult SeekInternal(TrackInfo::TrackType aType, const media::TimeUnit& aTarget); @@ -68,7 +68,7 @@ class OggDemuxer : public MediaDataDemuxer, SEEK_FATAL_ERROR // Error returned by a stream operation. }; IndexedSeekResult SeekToKeyframeUsingIndex(TrackInfo::TrackType aType, - const media::TimeUnit& aTarget); + int64_t aTarget); // Rolls back a seek-using-index attempt, returning a failure error code. IndexedSeekResult RollbackIndexedSeek(TrackInfo::TrackType aType, @@ -80,36 +80,29 @@ class OggDemuxer : public MediaDataDemuxer, // (because it's cached). class SeekRange { public: - SeekRange() - : mOffsetStart(0), - mOffsetEnd(0), - mTimeStart(media::TimeUnit::Zero()), - mTimeEnd(media::TimeUnit::Zero()) {} + SeekRange() : mOffsetStart(0), mOffsetEnd(0), mTimeStart(0), mTimeEnd(0) {} - SeekRange(int64_t aOffsetStart, int64_t aOffsetEnd, - const media::TimeUnit& aTimeStart, - const media::TimeUnit& aTimeEnd) + SeekRange(int64_t aOffsetStart, int64_t aOffsetEnd, int64_t aTimeStart, + int64_t aTimeEnd) : mOffsetStart(aOffsetStart), mOffsetEnd(aOffsetEnd), mTimeStart(aTimeStart), mTimeEnd(aTimeEnd) {} bool IsNull() const { - return mOffsetStart == 0 && mOffsetEnd == 0 && mTimeStart.IsZero() && - mTimeEnd.IsZero(); + return mOffsetStart == 0 && mOffsetEnd == 0 && mTimeStart == 0 && + mTimeEnd == 0; } int64_t mOffsetStart, mOffsetEnd; // in bytes. - media::TimeUnit mTimeStart, mTimeEnd; + int64_t mTimeStart, mTimeEnd; // in usecs. }; nsresult GetSeekRanges(TrackInfo::TrackType aType, nsTArray& aRanges); SeekRange SelectSeekRange(TrackInfo::TrackType aType, - const nsTArray& ranges, - const media::TimeUnit& aTarget, - const media::TimeUnit& aStartTime, - const media::TimeUnit& aEndTime, bool aExact); + const nsTArray& ranges, int64_t aTarget, + int64_t aStartTime, int64_t aEndTime, bool aExact); // Seeks to aTarget usecs in the buffered range aRange using bisection search, // or to the keyframe prior to aTarget if we have video. aAdjustedTarget is @@ -117,11 +110,9 @@ class OggDemuxer : public MediaDataDemuxer, // necessary. aStartTime must be the presentation time at the start of media, // and aEndTime the time at end of media. aRanges must be the time/byte ranges // buffered in the media cache as per GetSeekRanges(). - nsresult SeekInBufferedRange(TrackInfo::TrackType aType, - const media::TimeUnit& aTarget, - media::TimeUnit& aAdjustedTarget, - const media::TimeUnit& aStartTime, - const media::TimeUnit& aEndTime, + nsresult SeekInBufferedRange(TrackInfo::TrackType aType, int64_t aTarget, + int64_t aAdjustedTarget, int64_t aStartTime, + int64_t aEndTime, const nsTArray& aRanges, const SeekRange& aRange); @@ -131,10 +122,8 @@ class OggDemuxer : public MediaDataDemuxer, // search space. aStartTime must be the presentation time at the start of // media, and aEndTime the time at end of media. aRanges must be the time/byte // ranges buffered in the media cache as per GetSeekRanges(). - nsresult SeekInUnbuffered(TrackInfo::TrackType aType, - const media::TimeUnit& aTarget, - const media::TimeUnit& aStartTime, - const media::TimeUnit& aEndTime, + nsresult SeekInUnbuffered(TrackInfo::TrackType aType, int64_t aTarget, + int64_t aStartTime, int64_t aEndTime, const nsTArray& aRanges); // Performs a seek bisection to move the media stream's read cursor to the @@ -143,9 +132,8 @@ class OggDemuxer : public MediaDataDemuxer, // i.e. it will only read inside of the aRange's start and end offsets. // aFuzz is the number of usecs of leniency we'll allow; we'll terminate the // seek when we land in the range (aTime - aFuzz, aTime) usecs. - nsresult SeekBisection(TrackInfo::TrackType aType, - const media::TimeUnit& aTarget, - const SeekRange& aRange, const media::TimeUnit& aFuzz); + nsresult SeekBisection(TrackInfo::TrackType aType, int64_t aTarget, + const SeekRange& aRange, uint32_t aFuzz); // Chunk size to read when reading Ogg files. Average Ogg page length // is about 4300 bytes, so we read the file in chunks larger than that. @@ -223,7 +211,7 @@ class OggDemuxer : public MediaDataDemuxer, // Get the end time of aEndOffset. This is the playback position we'd reach // after playback finished at aEndOffset. - media::TimeUnit RangeEndTime(TrackInfo::TrackType aType, int64_t aEndOffset); + int64_t RangeEndTime(TrackInfo::TrackType aType, int64_t aEndOffset); // Get the end time of aEndOffset, without reading before aStartOffset. // This is the playback position we'd reach after playback finished at @@ -232,13 +220,13 @@ class OggDemuxer : public MediaDataDemuxer, // regular blocking reads from the media stream. If bool aCachedDataOnly // is true, this can safely be called on the main thread, otherwise it // must be called on the state machine thread. - media::TimeUnit RangeEndTime(TrackInfo::TrackType aType, int64_t aStartOffset, - int64_t aEndOffset, bool aCachedDataOnly); + int64_t RangeEndTime(TrackInfo::TrackType aType, int64_t aStartOffset, + int64_t aEndOffset, bool aCachedDataOnly); // Get the start time of the range beginning at aOffset. This is the start // time of the first aType sample we'd be able to play if we // started playback at aOffset. - media::TimeUnit RangeStartTime(TrackInfo::TrackType aType, int64_t aOffset); + int64_t RangeStartTime(TrackInfo::TrackType aType, int64_t aOffset); // All invocations of libogg functionality from the demuxer is sandboxed using // wasm library sandboxes on supported platforms. These functions that create @@ -301,7 +289,7 @@ class OggDemuxer : public MediaDataDemuxer, OggStateContext mAudioOggState; OggStateContext mVideoOggState; - Maybe mStartTime; + Maybe mStartTime; // Booleans to indicate if we have audio and/or video data bool HasVideo() const; @@ -311,8 +299,8 @@ class OggDemuxer : public MediaDataDemuxer, } bool HaveStartTime() const; bool HaveStartTime(TrackInfo::TrackType aType); - media::TimeUnit StartTime() const; - media::TimeUnit StartTime(TrackInfo::TrackType aType); + int64_t StartTime() const; + int64_t StartTime(TrackInfo::TrackType aType); // The picture region inside Theora frame to be displayed, if we have // a Theora video track. diff --git a/dom/media/ogg/OpusParser.cpp b/dom/media/ogg/OpusParser.cpp index 69389f81724b..918888ea8c8a 100644 --- a/dom/media/ogg/OpusParser.cpp +++ b/dom/media/ogg/OpusParser.cpp @@ -10,9 +10,9 @@ #include "OpusParser.h" #include "VideoUtils.h" -#include +#include "opus/opus.h" extern "C" { -#include +#include "opus/opus_multistream.h" } #include @@ -39,7 +39,7 @@ OpusParser::OpusParser() } bool OpusParser::DecodeHeader(unsigned char* aData, size_t aLength) { - if (aLength < 19 || memcmp(aData, "OpusHead", 8) != 0) { + if (aLength < 19 || memcmp(aData, "OpusHead", 8)) { OPUS_LOG(LogLevel::Debug, ("Invalid Opus file: unrecognized header")); return false; } @@ -143,9 +143,7 @@ bool OpusParser::DecodeHeader(unsigned char* aData, size_t aLength) { } bool OpusParser::DecodeTags(unsigned char* aData, size_t aLength) { - if (aLength < 16 || memcmp(aData, "OpusTags", 8) != 0) { - return false; - } + if (aLength < 16 || memcmp(aData, "OpusTags", 8)) return false; // Copy out the raw comment lines, but only do basic validation // checks against the string packing: too little data, too many diff --git a/dom/media/ogg/OpusParser.h b/dom/media/ogg/OpusParser.h index 10a7ef285fd0..fc2fc5094d15 100644 --- a/dom/media/ogg/OpusParser.h +++ b/dom/media/ogg/OpusParser.h @@ -32,7 +32,7 @@ class OpusParser { int mChannelMapping; // Channel mapping family. int mStreams; // Number of packed streams in each packet. int mCoupledStreams; // Number of packed coupled streams in each packet. - unsigned char mMappingTable[255] = {}; // Channel mapping table. + unsigned char mMappingTable[255]; // Channel mapping table. // Granule position (end sample) of the last decoded Opus packet. This is // used to calculate the amount we should trim from the last packet. diff --git a/dom/media/platforms/agnostic/OpusDecoder.cpp b/dom/media/platforms/agnostic/OpusDecoder.cpp index 130f25ab9f8e..715fa848dc4a 100644 --- a/dom/media/platforms/agnostic/OpusDecoder.cpp +++ b/dom/media/platforms/agnostic/OpusDecoder.cpp @@ -12,12 +12,13 @@ #include "TimeUnits.h" #include "VideoUtils.h" #include "VorbisDecoder.h" // For VorbisLayout +#include "VorbisUtils.h" #include "mozilla/EndianUtils.h" #include "mozilla/PodOperations.h" #include "mozilla/SyncRunnable.h" -#include +#include "opus/opus.h" extern "C" { -#include +#include "opus/opus_multistream.h" } #define OPUS_DEBUG(arg, ...) \ @@ -102,14 +103,14 @@ RefPtr OpusDataDecoder::Init() { mSkip = mOpusParser->mPreSkip; mPaddingDiscarded = false; - if (opusCodecSpecificData.mContainerCodecDelayFrames != - mOpusParser->mPreSkip) { + if (opusCodecSpecificData.mContainerCodecDelayMicroSeconds != + FramesToUsecs(mOpusParser->mPreSkip, mOpusParser->mRate).value()) { NS_WARNING( "Invalid Opus header: container CodecDelay and Opus pre-skip do not " "match!"); } - OPUS_DEBUG("Opus preskip in extradata: %" PRId64 " frames", - opusCodecSpecificData.mContainerCodecDelayFrames); + OPUS_DEBUG("Opus preskip in extradata: %" PRId64 "us", + opusCodecSpecificData.mContainerCodecDelayMicroSeconds); if (mInfo.mRate != (uint32_t)mOpusParser->mRate) { NS_WARNING("Invalid Opus header: container and codec rate do not match!"); @@ -275,6 +276,25 @@ RefPtr OpusDataDecoder::Decode( aSample->mTime.ToSeconds(), aSample->GetEndTime().ToSeconds()); } + if (aSample->mDiscardPadding > 0) { + OPUS_DEBUG("Opus decoder discarding %u of %d frames", + aSample->mDiscardPadding, frames); + // Padding discard is only supposed to happen on the final packet. + // Record the discard so we can return an error if another packet is + // decoded. + if (aSample->mDiscardPadding > uint32_t(frames)) { + // Discarding more than the entire packet is invalid. + OPUS_DEBUG("Opus error, discard padding larger than packet"); + return DecodePromise::CreateAndReject( + MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, + RESULT_DETAIL("Discard padding larger than packet")), + __func__); + } + + mPaddingDiscarded = true; + frames = frames - aSample->mDiscardPadding; + } + // Apply the header gain if one was specified. #ifdef MOZ_SAMPLE_TYPE_FLOAT32 if (mOpusParser->mGain != 1.0f) { diff --git a/dom/media/platforms/agnostic/TheoraDecoder.cpp b/dom/media/platforms/agnostic/TheoraDecoder.cpp index 2b63e9a67bc9..468eda901411 100644 --- a/dom/media/platforms/agnostic/TheoraDecoder.cpp +++ b/dom/media/platforms/agnostic/TheoraDecoder.cpp @@ -7,7 +7,6 @@ #include "TheoraDecoder.h" #include -#include #include "ImageContainer.h" #include "TimeUnits.h" diff --git a/dom/media/platforms/agnostic/TheoraDecoder.h b/dom/media/platforms/agnostic/TheoraDecoder.h index f209bb61ec4d..23e994b667a1 100644 --- a/dom/media/platforms/agnostic/TheoraDecoder.h +++ b/dom/media/platforms/agnostic/TheoraDecoder.h @@ -9,7 +9,8 @@ # include # include "PlatformDecoderModule.h" -# include +# include "ogg/ogg.h" +# include "theora/theoradec.h" namespace mozilla { diff --git a/dom/media/platforms/agnostic/VorbisDecoder.cpp b/dom/media/platforms/agnostic/VorbisDecoder.cpp index fe1498174909..01c0e8dbe534 100644 --- a/dom/media/platforms/agnostic/VorbisDecoder.cpp +++ b/dom/media/platforms/agnostic/VorbisDecoder.cpp @@ -7,6 +7,7 @@ #include "VorbisDecoder.h" #include "VideoUtils.h" +#include "VorbisUtils.h" #include "XiphExtradata.h" #include "mozilla/Logging.h" #include "mozilla/PodOperations.h" @@ -178,7 +179,7 @@ RefPtr VorbisDataDecoder::Decode( LOG(LogLevel::Warning, ("vorbis_synthesis_blockin returned an error")); } - float** pcm = 0; + VorbisPCMValue** pcm = 0; int32_t frames = vorbis_synthesis_pcmout(&mVorbisDsp, &pcm); if (frames == 0) { return DecodePromise::CreateAndResolve(DecodedData(), __func__); @@ -195,9 +196,9 @@ RefPtr VorbisDataDecoder::Decode( MediaResult(NS_ERROR_OUT_OF_MEMORY, __func__), __func__); } for (uint32_t j = 0; j < channels; ++j) { - float* channel = pcm[j]; + VorbisPCMValue* channel = pcm[j]; for (uint32_t i = 0; i < uint32_t(frames); ++i) { - buffer[i * channels + j] = channel[i]; + buffer[i * channels + j] = MOZ_CONVERT_VORBIS_SAMPLE(channel[i]); } } diff --git a/dom/media/platforms/agnostic/VorbisDecoder.h b/dom/media/platforms/agnostic/VorbisDecoder.h index b460fbb6c26a..ce61ccdcad52 100644 --- a/dom/media/platforms/agnostic/VorbisDecoder.h +++ b/dom/media/platforms/agnostic/VorbisDecoder.h @@ -10,7 +10,11 @@ # include "PlatformDecoderModule.h" # include "mozilla/Maybe.h" -# include +# ifdef MOZ_TREMOR +# include "tremor/ivorbiscodec.h" +# else +# include "vorbis/codec.h" +# endif namespace mozilla { diff --git a/dom/media/platforms/android/RemoteDataDecoder.cpp b/dom/media/platforms/android/RemoteDataDecoder.cpp index 3dd7083e5b6e..5233f9ac90b0 100644 --- a/dom/media/platforms/android/RemoteDataDecoder.cpp +++ b/dom/media/platforms/android/RemoteDataDecoder.cpp @@ -248,17 +248,15 @@ class RemoteVideoDecoder final : public RemoteDataDecoder { nsCString GetCodecName() const override { if (mMediaInfoFlag & MediaInfoFlag::VIDEO_H264) { return "h264"_ns; - } - if (mMediaInfoFlag & MediaInfoFlag::VIDEO_VP8) { + } else if (mMediaInfoFlag & MediaInfoFlag::VIDEO_VP8) { return "vp8"_ns; - } - if (mMediaInfoFlag & MediaInfoFlag::VIDEO_VP9) { + } else if (mMediaInfoFlag & MediaInfoFlag::VIDEO_VP9) { return "vp9"_ns; - } - if (mMediaInfoFlag & MediaInfoFlag::VIDEO_AV1) { + } else if (mMediaInfoFlag & MediaInfoFlag::VIDEO_AV1) { return "av1"_ns; + } else { + return "unknown"_ns; } - return "unknown"_ns; } RefPtr Decode( @@ -728,11 +726,8 @@ class RemoteAudioDecoder final : public RemoteDataDecoder { AssertOnThread(); - LOG("ProcessOutput"); - if (ShouldDiscardSample(aSample->Session()) || !aBuffer->IsValid()) { aSample->Dispose(); - LOG("Discarding sample"); return; } @@ -757,44 +752,34 @@ class RemoteAudioDecoder final : public RemoteDataDecoder { if (!ok || (IsSampleTimeSmallerThanFirstDemuxedSampleTime(presentationTimeUs) && !isEOS)) { - LOG("ProcessOutput: decoding error ok[%s], pts[%" PRId64 "], eos[%s]", - ok ? "true" : "false", presentationTimeUs, isEOS ? "true" : "false"); Error(MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, __func__)); return; } if (size > 0) { - const int32_t sampleSize = sizeof(int16_t); - const int32_t numSamples = size / sampleSize; +#ifdef MOZ_SAMPLE_TYPE_S16 + const int32_t numSamples = size / 2; +#else +# error We only support 16-bit integer PCM +#endif - InflatableShortBuffer audio(numSamples); + AlignedAudioBuffer audio(numSamples); if (!audio) { Error(MediaResult(NS_ERROR_OUT_OF_MEMORY, __func__)); - LOG("OOM while allocating temporary output buffer"); return; } + jni::ByteBuffer::LocalRef dest = jni::ByteBuffer::New(audio.get(), size); aBuffer->WriteToByteBuffer(dest, offset, size); - AlignedFloatBuffer converted = audio.Inflate(); - TimeUnit pts = TimeUnit::FromMicroseconds(presentationTimeUs); - - LOG("Decoded: %u frames of %s audio, pts: %s, %d channels, %" PRId32 - " Hz", - numSamples / mOutputChannels, - sampleSize == sizeof(int16_t) ? "int16" : "f32", pts.ToString().get(), - mOutputChannels, mOutputSampleRate); - - RefPtr data = new AudioData( - 0, pts, std::move(converted), mOutputChannels, mOutputSampleRate); + RefPtr data = + new AudioData(0, TimeUnit::FromMicroseconds(presentationTimeUs), + std::move(audio), mOutputChannels, mOutputSampleRate); UpdateOutputStatus(std::move(data)); - } else { - LOG("ProcessOutput but size 0"); } if (isEOS) { - LOG("EOS: drain complete"); DrainComplete(); } } @@ -830,8 +815,6 @@ already_AddRefed RemoteDataDecoder::CreateAudioDecoder( java::sdk::MediaFormat::CreateAudioFormat(config.mMimeType, config.mRate, config.mChannels, &format), nullptr); - // format->SetInteger(java::sdk::MediaFormat::KEY_PCM_ENCODING, - // java::sdk::AudioFormat::ENCODING_PCM_FLOAT); RefPtr decoder = new RemoteAudioDecoder(config, format, aDrmStubId); @@ -910,7 +893,7 @@ RefPtr RemoteDataDecoder::Drain() { } RefPtr RemoteDataDecoder::Shutdown() { - LOG("Shutdown"); + LOG(""); AssertOnThread(); SetState(State::SHUTDOWN); if (mJavaDecoder) { @@ -1084,14 +1067,10 @@ void RemoteDataDecoder::UpdateInputStatus(int64_t aTimestamp, bool aProcessed) { void RemoteDataDecoder::UpdateOutputStatus(RefPtr&& aSample) { AssertOnThread(); if (GetState() == State::SHUTDOWN) { - LOG("Update output status, but decoder has been shut down, dropping the " - "decoded results"); return; } if (IsUsefulData(aSample)) { mDecodedData.AppendElement(std::move(aSample)); - } else { - LOG("Decoded data, but not considered useful"); } ReturnDecodedData(); } diff --git a/dom/media/platforms/apple/AppleATDecoder.cpp b/dom/media/platforms/apple/AppleATDecoder.cpp index ed64b62d6063..13a6be3e3187 100644 --- a/dom/media/platforms/apple/AppleATDecoder.cpp +++ b/dom/media/platforms/apple/AppleATDecoder.cpp @@ -545,8 +545,15 @@ MediaResult AppleATDecoder::SetupDecoder(MediaRawData* aSample) { mOutputFormat.mFormatID = kAudioFormatLinearPCM; mOutputFormat.mSampleRate = inputFormat.mSampleRate; mOutputFormat.mChannelsPerFrame = inputFormat.mChannelsPerFrame; +#if defined(MOZ_SAMPLE_TYPE_FLOAT32) mOutputFormat.mBitsPerChannel = 32; mOutputFormat.mFormatFlags = kLinearPCMFormatFlagIsFloat | 0; +#elif defined(MOZ_SAMPLE_TYPE_S16) + mOutputFormat.mBitsPerChannel = 16; + mOutputFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger | 0; +#else +# error Unknown audio sample type +#endif // Set up the decoder so it gives us one sample per frame mOutputFormat.mFramesPerPacket = 1; mOutputFormat.mBytesPerPacket = mOutputFormat.mBytesPerFrame = diff --git a/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.cpp index 98310eecd241..b6b3d7687eab 100644 --- a/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.cpp +++ b/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.cpp @@ -5,16 +5,10 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "FFmpegAudioDecoder.h" -#include "AudioSampleFormat.h" #include "FFmpegLog.h" #include "TimeUnits.h" #include "VideoUtils.h" #include "BufferReader.h" -#include "libavutil/dict.h" -#include "libavutil/samplefmt.h" -#if defined(FFVPX_VERSION) -# include "libavutil/channel_layout.h" -#endif #include "mozilla/StaticPrefs_media.h" #include "mozilla/Telemetry.h" @@ -22,39 +16,56 @@ namespace mozilla { using TimeUnit = media::TimeUnit; -FFmpegAudioDecoder::FFmpegAudioDecoder( - FFmpegLibWrapper* aLib, const CreateDecoderParams& aDecoderParams) - : FFmpegDataDecoder(aLib, GetCodecId(aDecoderParams.AudioConfig().mMimeType, - aDecoderParams.AudioConfig())), - mAudioInfo(aDecoderParams.AudioConfig()) { +FFmpegAudioDecoder::FFmpegAudioDecoder(FFmpegLibWrapper* aLib, + const AudioInfo& aConfig) + : FFmpegDataDecoder(aLib, GetCodecId(aConfig.mMimeType)) { MOZ_COUNT_CTOR(FFmpegAudioDecoder); if (mCodecID == AV_CODEC_ID_AAC && - mAudioInfo.mCodecSpecificConfig.is()) { + aConfig.mCodecSpecificConfig.is()) { const AacCodecSpecificData& aacCodecSpecificData = - mAudioInfo.mCodecSpecificConfig.as(); + aConfig.mCodecSpecificConfig.as(); mExtraData = new MediaByteBuffer; // Ffmpeg expects the DecoderConfigDescriptor blob. mExtraData->AppendElements( *aacCodecSpecificData.mDecoderConfigDescriptorBinaryBlob); - FFMPEG_LOG("FFmpegAudioDecoder ctor (aac)"); + mEncoderDelay = aacCodecSpecificData.mEncoderDelayFrames; + mEncoderPaddingOrTotalFrames = aacCodecSpecificData.mMediaFrameCount; + FFMPEG_LOG("FFmpegAudioDecoder (aac), found encoder delay (%" PRIu32 + ") and total frame count (%" PRIu64 + ") in codec-specific side data", + mEncoderDelay, TotalFrames()); return; } if (mCodecID == AV_CODEC_ID_MP3) { - // Nothing to do - return; + // Downgraded from diagnostic assert due to BMO 1776524 on Android. + MOZ_ASSERT(aConfig.mCodecSpecificConfig.is()); + // Gracefully handle bad data. If don't hit the preceding assert once this + // has been shipped for awhile, we can remove it and make the following code + // non-conditional. + if (aConfig.mCodecSpecificConfig.is()) { + const Mp3CodecSpecificData& mp3CodecSpecificData = + aConfig.mCodecSpecificConfig.as(); + mEncoderDelay = mp3CodecSpecificData.mEncoderDelayFrames; + mEncoderPaddingOrTotalFrames = mp3CodecSpecificData.mEncoderPaddingFrames; + FFMPEG_LOG("FFmpegAudioDecoder (mp3), found encoder delay (%" PRIu32 + ")" + "and padding values (%" PRIu64 ") in codec-specific side-data", + mEncoderDelay, Padding()); + return; + } } if (mCodecID == AV_CODEC_ID_FLAC) { MOZ_DIAGNOSTIC_ASSERT( - mAudioInfo.mCodecSpecificConfig.is()); + aConfig.mCodecSpecificConfig.is()); // Gracefully handle bad data. If don't hit the preceding assert once this // has been shipped for awhile, we can remove it and make the following code // non-conditional. - if (mAudioInfo.mCodecSpecificConfig.is()) { + if (aConfig.mCodecSpecificConfig.is()) { const FlacCodecSpecificData& flacCodecSpecificData = - mAudioInfo.mCodecSpecificConfig.as(); + aConfig.mCodecSpecificConfig.as(); if (flacCodecSpecificData.mStreamInfoBinaryBlob->IsEmpty()) { // Flac files without headers will be missing stream info. In this case // we don't want to feed ffmpeg empty extra data as it will fail, just @@ -69,39 +80,21 @@ FFmpegAudioDecoder::FFmpegAudioDecoder( } } - // Vorbis and Opus are handled by this case. + // Gracefully handle failure to cover all codec specific cases above. Once + // we're confident there is no fall through from these cases above, we should + // remove this code. RefPtr audioCodecSpecificBinaryBlob = - GetAudioCodecSpecificBlob(mAudioInfo.mCodecSpecificConfig); + GetAudioCodecSpecificBlob(aConfig.mCodecSpecificConfig); if (audioCodecSpecificBinaryBlob && audioCodecSpecificBinaryBlob->Length()) { // Use a new MediaByteBuffer as the object will be modified during // initialization. mExtraData = new MediaByteBuffer; mExtraData->AppendElements(*audioCodecSpecificBinaryBlob); } - - if (mCodecID == AV_CODEC_ID_OPUS) { - mDefaultPlaybackDeviceMono = aDecoderParams.mOptions.contains( - CreateDecoderParams::Option::DefaultPlaybackDeviceMono); - } } RefPtr FFmpegAudioDecoder::Init() { - AVDictionary* options = nullptr; - if (mCodecID == AV_CODEC_ID_OPUS) { - // Opus has a special feature for stereo coding where it represent wide - // stereo channels by 180-degree out of phase. This improves quality, but - // needs to be disabled when the output is downmixed to mono. Playback - // number of channels are set in AudioSink, using the same method - // `DecideAudioPlaybackChannels()`, and triggers downmix if needed. - if (mDefaultPlaybackDeviceMono || - DecideAudioPlaybackChannels(mAudioInfo) == 1) { - mLib->av_dict_set(&options, "apply_phase_inv", "false", 0); - } - } - - MediaResult rv = InitDecoder(&options); - - mLib->av_dict_free(&options); + MediaResult rv = InitDecoder(); return NS_SUCCEEDED(rv) ? InitPromise::CreateAndResolve(TrackInfo::kAudioTrack, __func__) @@ -117,22 +110,11 @@ void FFmpegAudioDecoder::InitCodecContext() { // FFmpeg takes this as a suggestion for what format to use for audio samples. // LibAV 0.8 produces rubbish float interleaved samples, request 16 bits // audio. +#ifdef MOZ_SAMPLE_TYPE_S16 + mCodecContext->request_sample_fmt = AV_SAMPLE_FMT_S16; +#else mCodecContext->request_sample_fmt = (mLib->mVersion == 53) ? AV_SAMPLE_FMT_S16 : AV_SAMPLE_FMT_FLT; -#ifdef FFVPX_VERSION - // AudioInfo's layout first 32-bits are bit-per-bit compatible with - // WAVEFORMATEXTENSIBLE and FFmpeg's AVChannel enum. We can cast here. - mCodecContext->ch_layout.nb_channels = - AssertedCast(mAudioInfo.mChannels); - if (mAudioInfo.mChannelMap != AudioConfig::ChannelLayout::UNKNOWN_MAP) { - mLib->av_channel_layout_from_mask( - &mCodecContext->ch_layout, - AssertedCast(mAudioInfo.mChannelMap)); - } else { - mLib->av_channel_layout_default(&mCodecContext->ch_layout, - AssertedCast(mAudioInfo.mChannels)); - } - mCodecContext->sample_rate = AssertedCast(mAudioInfo.mRate); #endif } @@ -144,6 +126,61 @@ static AlignedAudioBuffer CopyAndPackAudio(AVFrame* aFrame, return audio; } +#ifdef MOZ_SAMPLE_TYPE_S16 + if (aFrame->format == AV_SAMPLE_FMT_FLT) { + // Audio data already packed. Need to convert from 32 bits Float to S16 + AudioDataValue* tmp = audio.get(); + float* data = reinterpret_cast(aFrame->data)[0]; + for (uint32_t frame = 0; frame < aNumAFrames; frame++) { + for (uint32_t channel = 0; channel < aNumChannels; channel++) { + *tmp++ = FloatToAudioSample(*data++); + } + } + } else if (aFrame->format == AV_SAMPLE_FMT_FLTP) { + // Planar audio data. Convert it from 32 bits float to S16 + // and pack it into something we can understand. + AudioDataValue* tmp = audio.get(); + float** data = reinterpret_cast(aFrame->data); + for (uint32_t frame = 0; frame < aNumAFrames; frame++) { + for (uint32_t channel = 0; channel < aNumChannels; channel++) { + *tmp++ = FloatToAudioSample(data[channel][frame]); + } + } + } else if (aFrame->format == AV_SAMPLE_FMT_S16) { + // Audio data already packed. No need to do anything other than copy it + // into a buffer we own. + memcpy(audio.get(), aFrame->data[0], + aNumChannels * aNumAFrames * sizeof(AudioDataValue)); + } else if (aFrame->format == AV_SAMPLE_FMT_S16P) { + // Planar audio data. Pack it into something we can understand. + AudioDataValue* tmp = audio.get(); + AudioDataValue** data = reinterpret_cast(aFrame->data); + for (uint32_t frame = 0; frame < aNumAFrames; frame++) { + for (uint32_t channel = 0; channel < aNumChannels; channel++) { + *tmp++ = data[channel][frame]; + } + } + } else if (aFrame->format == AV_SAMPLE_FMT_S32) { + // Audio data already packed. Need to convert from S32 to S16 + AudioDataValue* tmp = audio.get(); + int32_t* data = reinterpret_cast(aFrame->data)[0]; + for (uint32_t frame = 0; frame < aNumAFrames; frame++) { + for (uint32_t channel = 0; channel < aNumChannels; channel++) { + *tmp++ = *data++ / (1U << 16); + } + } + } else if (aFrame->format == AV_SAMPLE_FMT_S32P) { + // Planar audio data. Convert it from S32 to S16 + // and pack it into something we can understand. + AudioDataValue* tmp = audio.get(); + int32_t** data = reinterpret_cast(aFrame->data); + for (uint32_t frame = 0; frame < aNumAFrames; frame++) { + for (uint32_t channel = 0; channel < aNumChannels; channel++) { + *tmp++ = data[channel][frame] / (1U << 16); + } + } + } +#else if (aFrame->format == AV_SAMPLE_FMT_FLT) { // Audio data already packed. No need to do anything other than copy it // into a buffer we own. @@ -196,193 +233,22 @@ static AlignedAudioBuffer CopyAndPackAudio(AVFrame* aFrame, *tmp++ = AudioSampleToFloat(data[channel][frame]); } } - } else if (aFrame->format == AV_SAMPLE_FMT_U8) { - // Interleaved audio data. Convert it from u8 to the expected sample-format - AudioDataValue* tmp = audio.get(); - uint8_t* data = reinterpret_cast(aFrame->data)[0]; - for (uint32_t frame = 0; frame < aNumAFrames; frame++) { - for (uint32_t channel = 0; channel < aNumChannels; channel++) { - *tmp++ = UInt8bitToAudioSample(*data++); - } - } - } else if (aFrame->format == AV_SAMPLE_FMT_U8P) { - // Planar audio data. Convert it from u8 to the expected sample-format - // and pack it into something we can understand. - AudioDataValue* tmp = audio.get(); - uint8_t** data = reinterpret_cast(aFrame->data); - for (uint32_t frame = 0; frame < aNumAFrames; frame++) { - for (uint32_t channel = 0; channel < aNumChannels; channel++) { - *tmp++ = UInt8bitToAudioSample(data[channel][frame]); - } - } } +#endif return audio; } using ChannelLayout = AudioConfig::ChannelLayout; -MediaResult FFmpegAudioDecoder::PostProcessOutput( - bool aDecoded, MediaRawData* aSample, DecodedData& aResults, - bool* aGotFrame, int32_t aSubmitted) { - media::TimeUnit pts = aSample->mTime; - - if (mFrame->format != AV_SAMPLE_FMT_FLT && - mFrame->format != AV_SAMPLE_FMT_FLTP && - mFrame->format != AV_SAMPLE_FMT_S16 && - mFrame->format != AV_SAMPLE_FMT_S16P && - mFrame->format != AV_SAMPLE_FMT_S32 && - mFrame->format != AV_SAMPLE_FMT_S32P && - mFrame->format != AV_SAMPLE_FMT_U8 && - mFrame->format != AV_SAMPLE_FMT_U8P) { - return MediaResult( - NS_ERROR_DOM_MEDIA_DECODE_ERR, - RESULT_DETAIL("FFmpeg audio decoder outputs unsupported audio format")); - } - - if (aSubmitted < 0) { - FFMPEG_LOG("Got %d more frame from packet", mFrame->nb_samples); - } - - FFMPEG_LOG("FFmpegAudioDecoder decoded: [%s,%s] (Duration: %s) [%s]", - aSample->mTime.ToString().get(), - aSample->GetEndTime().ToString().get(), - aSample->mDuration.ToString().get(), - mLib->av_get_sample_fmt_name(mFrame->format)); - - uint32_t numChannels = mCodecContext->channels; - uint32_t samplingRate = mCodecContext->sample_rate; - - AlignedAudioBuffer audio = - CopyAndPackAudio(mFrame, numChannels, mFrame->nb_samples); - if (!audio) { - FFMPEG_LOG("CopyAndPackAudio error (OOM)"); - return MediaResult(NS_ERROR_OUT_OF_MEMORY, __func__); - } - - media::TimeUnit duration = TimeUnit(mFrame->nb_samples, samplingRate); - if (!duration.IsValid()) { - FFMPEG_LOG("Duration isn't valid (%d + %d)", mFrame->nb_samples, - samplingRate); - return MediaResult(NS_ERROR_DOM_MEDIA_OVERFLOW_ERR, - RESULT_DETAIL("Invalid sample duration")); - } - - media::TimeUnit newpts = pts + duration; - if (!newpts.IsValid()) { - FFMPEG_LOG("New pts isn't valid (%lf + %lf)", pts.ToSeconds(), - duration.ToSeconds()); - return MediaResult( - NS_ERROR_DOM_MEDIA_OVERFLOW_ERR, - RESULT_DETAIL("Invalid count of accumulated audio samples")); - } - - RefPtr data = - new AudioData(aSample->mOffset, pts, std::move(audio), numChannels, - samplingRate, mCodecContext->channel_layout); - MOZ_ASSERT(duration == data->mDuration, "must be equal"); - aResults.AppendElement(std::move(data)); - - pts = newpts; - - if (aGotFrame) { - *aGotFrame = true; - } - return NS_OK; +uint64_t FFmpegAudioDecoder::Padding() const { + MOZ_ASSERT(mCodecID == AV_CODEC_ID_MP3); + return mEncoderPaddingOrTotalFrames; } - -#if LIBAVCODEC_VERSION_MAJOR < 59 -MediaResult FFmpegAudioDecoder::DecodeUsingFFmpeg( - AVPacket* aPacket, bool& aDecoded, MediaRawData* aSample, - DecodedData& aResults, bool* aGotFrame) { - int decoded = 0; - int rv = - mLib->avcodec_decode_audio4(mCodecContext, mFrame, &decoded, aPacket); - aDecoded = decoded == 1; - if (rv < 0) { - NS_WARNING("FFmpeg audio decoder error."); - return MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, - RESULT_DETAIL("FFmpeg audio error")); - } - PostProcessOutput(decoded, aSample, aResults, aGotFrame, 0); - return NS_OK; +uint64_t FFmpegAudioDecoder::TotalFrames() const { + MOZ_ASSERT(mCodecID == AV_CODEC_ID_AAC); + return mEncoderPaddingOrTotalFrames; } -#else -# define AVRESULT_OK 0 - -MediaResult FFmpegAudioDecoder::DecodeUsingFFmpeg( - AVPacket* aPacket, bool& aDecoded, MediaRawData* aSample, - DecodedData& aResults, bool* aGotFrame) { - // This in increment whenever avcodec_send_packet succeeds, and decremented - // whenever avcodec_receive_frame succeeds. Because it is possible to have - // multiple AVFrames from a single AVPacket, this number can be negative. - // This is used to ensure that pts and duration are correctly set on the - // resulting audio buffers. - int32_t submitted = 0; - int ret = mLib->avcodec_send_packet(mCodecContext, aPacket); - switch (ret) { - case AVRESULT_OK: - submitted++; - break; - case AVERROR(EAGAIN): - FFMPEG_LOG(" av_codec_send_packet: EAGAIN."); - MOZ_ASSERT(false, "EAGAIN"); - break; - case AVERROR_EOF: - FFMPEG_LOG(" End of stream."); - return MediaResult(NS_ERROR_DOM_MEDIA_END_OF_STREAM, - RESULT_DETAIL("End of stream")); - default: - NS_WARNING("FFmpeg audio decoder error (avcodec_send_packet)."); - return MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, - RESULT_DETAIL("FFmpeg audio error")); - } - - MediaResult rv; - - while (ret == 0) { - aDecoded = false; - ret = mLib->avcodec_receive_frame(mCodecContext, mFrame); - switch (ret) { - case AVRESULT_OK: - aDecoded = true; - submitted--; - if (submitted < 0) { - FFMPEG_LOG("Multiple AVFrame from a single AVPacket"); - } - break; - case AVERROR(EAGAIN): { - // Quirk of the vorbis decoder -- the first packet doesn't return audio. - if (submitted == 1 && mCodecID == AV_CODEC_ID_VORBIS) { - AlignedAudioBuffer buf; - aResults.AppendElement( - new AudioData(0, TimeUnit::Zero(), std::move(buf), - mAudioInfo.mChannels, mAudioInfo.mRate)); - } - FFMPEG_LOG(" EAGAIN (packets submitted: %" PRIu32 ").", submitted); - rv = NS_OK; - break; - } - case AVERROR_EOF: { - FFMPEG_LOG(" End of stream."); - rv = MediaResult(NS_ERROR_DOM_MEDIA_END_OF_STREAM, - RESULT_DETAIL("End of stream")); - break; - } - default: - FFMPEG_LOG(" avcodec_receive_packet error."); - NS_WARNING("FFmpeg audio decoder error (avcodec_receive_packet)."); - rv = MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, - RESULT_DETAIL("FFmpeg audio error")); - } - if (aDecoded) { - PostProcessOutput(aDecoded, aSample, aResults, aGotFrame, submitted); - } - } - - return NS_OK; -} -#endif MediaResult FFmpegAudioDecoder::DoDecode(MediaRawData* aSample, uint8_t* aData, int aSize, @@ -393,11 +259,6 @@ MediaResult FFmpegAudioDecoder::DoDecode(MediaRawData* aSample, AVPacket packet; mLib->av_init_packet(&packet); - FFMPEG_LOG("FFmpegAudioDecoder::DoDecode: %d bytes, [%s,%s] (Duration: %s)", - aSize, aSample->mTime.ToString().get(), - aSample->GetEndTime().ToString().get(), - aSample->mDuration.ToString().get()); - packet.data = const_cast(aData); packet.size = aSize; @@ -412,14 +273,121 @@ MediaResult FFmpegAudioDecoder::DoDecode(MediaRawData* aSample, RESULT_DETAIL("FFmpeg audio decoder failed to allocate frame")); } - bool decoded = false; - auto rv = DecodeUsingFFmpeg(&packet, decoded, aSample, aResults, aGotFrame); - NS_ENSURE_SUCCESS(rv, rv); + int64_t samplePosition = aSample->mOffset; + + while (packet.size > 0) { + int decoded = false; + int bytesConsumed = -1; +#if LIBAVCODEC_VERSION_MAJOR < 59 + bytesConsumed = + mLib->avcodec_decode_audio4(mCodecContext, mFrame, &decoded, &packet); + if (bytesConsumed < 0) { + NS_WARNING("FFmpeg audio decoder error."); + return MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, + RESULT_DETAIL("FFmpeg audio error:%d", bytesConsumed)); + } +#else +# define AVRESULT_OK 0 + int ret = mLib->avcodec_send_packet(mCodecContext, &packet); + switch (ret) { + case AVRESULT_OK: + bytesConsumed = packet.size; + break; + case AVERROR(EAGAIN): + break; + case AVERROR_EOF: + FFMPEG_LOG(" End of stream."); + return MediaResult(NS_ERROR_DOM_MEDIA_END_OF_STREAM, + RESULT_DETAIL("End of stream")); + default: + NS_WARNING("FFmpeg audio decoder error."); + return MediaResult(NS_ERROR_DOM_MEDIA_DECODE_ERR, + RESULT_DETAIL("FFmpeg audio error")); + } + + ret = mLib->avcodec_receive_frame(mCodecContext, mFrame); + switch (ret) { + case AVRESULT_OK: + decoded = true; + break; + case AVERROR(EAGAIN): + break; + case AVERROR_EOF: { + FFMPEG_LOG(" End of stream."); + return MediaResult(NS_ERROR_DOM_MEDIA_END_OF_STREAM, + RESULT_DETAIL("End of stream")); + } + } +#endif + + if (decoded) { + if (mFrame->format != AV_SAMPLE_FMT_FLT && + mFrame->format != AV_SAMPLE_FMT_FLTP && + mFrame->format != AV_SAMPLE_FMT_S16 && + mFrame->format != AV_SAMPLE_FMT_S16P && + mFrame->format != AV_SAMPLE_FMT_S32 && + mFrame->format != AV_SAMPLE_FMT_S32P) { + return MediaResult( + NS_ERROR_DOM_MEDIA_DECODE_ERR, + RESULT_DETAIL( + "FFmpeg audio decoder outputs unsupported audio format")); + } + uint32_t numChannels = mCodecContext->channels; + uint32_t samplingRate = mCodecContext->sample_rate; + + AlignedAudioBuffer audio = + CopyAndPackAudio(mFrame, numChannels, mFrame->nb_samples); + if (!audio) { + FFMPEG_LOG("FFmpegAudioDecoder: OOM"); + return MediaResult(NS_ERROR_OUT_OF_MEMORY, __func__); + } + + FFMPEG_LOG("Packet decoded: [%s, %s] (%" PRId64 "us, %d frames)", + aSample->mTime.ToString().get(), + aSample->GetEndTime().ToString().get(), + aSample->mDuration.ToMicroseconds(), mFrame->nb_samples); + + media::TimeUnit duration = TimeUnit(mFrame->nb_samples, samplingRate); + if (!duration.IsValid()) { + FFMPEG_LOG("FFmpegAudioDecoder: invalid duration"); + return MediaResult(NS_ERROR_DOM_MEDIA_OVERFLOW_ERR, + RESULT_DETAIL("Invalid sample duration")); + } + + media::TimeUnit pts = aSample->mTime; + media::TimeUnit newpts = pts + duration; + if (!newpts.IsValid()) { + FFMPEG_LOG("FFmpegAudioDecoder: invalid PTS."); + return MediaResult( + NS_ERROR_DOM_MEDIA_OVERFLOW_ERR, + RESULT_DETAIL("Invalid count of accumulated audio samples")); + } + + RefPtr data = + new AudioData(samplePosition, pts, std::move(audio), numChannels, + samplingRate, mCodecContext->channel_layout); + MOZ_ASSERT(duration == data->mDuration, "must be equal"); + aResults.AppendElement(std::move(data)); + + pts = newpts; + + if (aGotFrame) { + *aGotFrame = true; + } + } + // The packet wasn't sent to ffmpeg, another attempt will happen next + // iteration. + if (bytesConsumed != -1) { + packet.data += bytesConsumed; + packet.size -= bytesConsumed; + samplePosition += bytesConsumed; + } + } return NS_OK; } -AVCodecID FFmpegAudioDecoder::GetCodecId(const nsACString& aMimeType, - const AudioInfo& aInfo) { +AVCodecID FFmpegAudioDecoder::GetCodecId( + const nsACString& aMimeType) { if (aMimeType.EqualsLiteral("audio/mpeg")) { #ifdef FFVPX_VERSION if (!StaticPrefs::media_ffvpx_mp3_enabled()) { @@ -434,65 +402,6 @@ AVCodecID FFmpegAudioDecoder::GetCodecId(const nsACString& aMimeType, if (aMimeType.EqualsLiteral("audio/mp4a-latm")) { return AV_CODEC_ID_AAC; } - if (aMimeType.EqualsLiteral("audio/vorbis")) { -#ifdef FFVPX_VERSION - if (!StaticPrefs::media_ffvpx_vorbis_enabled()) { - return AV_CODEC_ID_NONE; - } -#endif - return AV_CODEC_ID_VORBIS; - } -#ifdef FFVPX_VERSION - if (aMimeType.EqualsLiteral("audio/opus")) { - if (!StaticPrefs::media_ffvpx_opus_enabled()) { - return AV_CODEC_ID_NONE; - } - return AV_CODEC_ID_OPUS; - } -#endif -#ifdef FFVPX_VERSION - if (aMimeType.Find("wav") != kNotFound) { - if (!StaticPrefs::media_ffvpx_wav_enabled()) { - return AV_CODEC_ID_NONE; - } - if (aMimeType.EqualsLiteral("audio/x-wav") || - aMimeType.EqualsLiteral("audio/wave; codecs=1") || - aMimeType.EqualsLiteral("audio/wave; codecs=65534")) { - // find the pcm format - switch (aInfo.mBitDepth) { - case 8: - return AV_CODEC_ID_PCM_U8; - case 16: - return AV_CODEC_ID_PCM_S16LE; - case 24: - return AV_CODEC_ID_PCM_S24LE; - case 32: - return AV_CODEC_ID_PCM_S32LE; - case 0: - // ::Init will find and use the right type here, this is just - // returning something that means that this media type can be decoded. - // This happens when attempting to find what decoder to use for a - // media type, without actually having looked at the actual - // bytestream. This decoder can decode all usual PCM bytestream - // anyway. - return AV_CODEC_ID_PCM_S16LE; - default: - return AV_CODEC_ID_NONE; - }; - } - if (aMimeType.EqualsLiteral("audio/wave; codecs=3")) { - return AV_CODEC_ID_PCM_F32LE; - } - // A-law - if (aMimeType.EqualsLiteral("audio/wave; codecs=6")) { - return AV_CODEC_ID_PCM_MULAW; - } - // Mu-law - if (aMimeType.EqualsLiteral("audio/wave; codecs=7")) { - return AV_CODEC_ID_PCM_MULAW; - } - } -#endif return AV_CODEC_ID_NONE; } diff --git a/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.h b/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.h index a86fb72edd08..63f7f463b265 100644 --- a/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.h +++ b/dom/media/platforms/ffmpeg/FFmpegAudioDecoder.h @@ -25,14 +25,12 @@ class FFmpegAudioDecoder : public FFmpegDataDecoder, public DecoderDoctorLifeLogger> { public: - FFmpegAudioDecoder(FFmpegLibWrapper* aLib, - const CreateDecoderParams& aDecoderParams); + FFmpegAudioDecoder(FFmpegLibWrapper* aLib, const AudioInfo& aConfig); virtual ~FFmpegAudioDecoder(); RefPtr Init() override; void InitCodecContext() MOZ_REQUIRES(sMutex) override; - static AVCodecID GetCodecId(const nsACString& aMimeType, - const AudioInfo& aInfo); + static AVCodecID GetCodecId(const nsACString& aMimeType); nsCString GetDescriptionName() const override { #ifdef USING_MOZFFVPX return "ffvpx audio decoder"_ns; @@ -45,15 +43,21 @@ class FFmpegAudioDecoder private: MediaResult DoDecode(MediaRawData* aSample, uint8_t* aData, int aSize, bool* aGotFrame, DecodedData& aResults) override; - MediaResult DecodeUsingFFmpeg(AVPacket* aPacket, bool& aDecoded, - MediaRawData* aSample, DecodedData& aResults, - bool* aGotFrame); - MediaResult PostProcessOutput(bool aDecoded, MediaRawData* aSample, - DecodedData& aResults, bool* aGotFrame, - int32_t aSubmitted); - const AudioInfo mAudioInfo; - // True if the audio will be downmixed and rendered in mono. - bool mDefaultPlaybackDeviceMono; + // This method is to be called only when decoding mp3, in order to correctly + // discard padding frames. + uint64_t Padding() const; + // This method is to be called only when decoding AAC, in order to correctly + // discard padding frames, based on the number of frames decoded and the total + // frame count of the media. + uint64_t TotalFrames() const; + // The number of frames of encoder delay, that need to be discarded at the + // beginning of the stream. + uint32_t mEncoderDelay = 0; + // This holds either the encoder padding (when this decoder decodes mp3), or + // the total frame count of the media (when this decoder decodes AAC). + // It is best accessed via the `Padding` and `TotalFrames` methods, for + // clarity. + uint64_t mEncoderPaddingOrTotalFrames = 0; }; } // namespace mozilla diff --git a/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp index 3443af555233..c9dafba40caa 100644 --- a/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp +++ b/dom/media/platforms/ffmpeg/FFmpegDataDecoder.cpp @@ -5,7 +5,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include -#include "libavutil/dict.h" #ifdef __GNUC__ # include #endif @@ -73,7 +72,7 @@ MediaResult FFmpegDataDecoder::AllocateExtraData() { // Note: This doesn't run on the ffmpeg TaskQueue, it runs on some other media // taskqueue -MediaResult FFmpegDataDecoder::InitDecoder(AVDictionary** aOptions) { +MediaResult FFmpegDataDecoder::InitDecoder() { FFMPEG_LOG("Initialising FFmpeg decoder"); AVCodec* codec = FindAVCodec(mLib, mCodecID); @@ -125,10 +124,7 @@ MediaResult FFmpegDataDecoder::InitDecoder(AVDictionary** aOptions) { } #endif - if (mLib->avcodec_open2(mCodecContext, codec, aOptions) < 0) { - if (mCodecContext->extradata) { - mLib->av_freep(&mCodecContext->extradata); - } + if (mLib->avcodec_open2(mCodecContext, codec, nullptr) < 0) { mLib->av_freep(&mCodecContext); FFMPEG_LOG(" Couldn't open avcodec"); return MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR, @@ -221,7 +217,6 @@ RefPtr FFmpegDataDecoder::Drain() { RefPtr FFmpegDataDecoder::ProcessDrain() { MOZ_ASSERT(mTaskQueue->IsOnCurrentThread()); - FFMPEG_LOG("FFmpegDataDecoder: draining buffers"); RefPtr empty(new MediaRawData()); empty->mTimecode = mLastInputDts; bool gotFrame = false; diff --git a/dom/media/platforms/ffmpeg/FFmpegDataDecoder.h b/dom/media/platforms/ffmpeg/FFmpegDataDecoder.h index 732b4bf777a2..e68588157b34 100644 --- a/dom/media/platforms/ffmpeg/FFmpegDataDecoder.h +++ b/dom/media/platforms/ffmpeg/FFmpegDataDecoder.h @@ -51,7 +51,7 @@ class FFmpegDataDecoder virtual void ProcessShutdown(); virtual void InitCodecContext() MOZ_REQUIRES(sMutex) {} AVFrame* PrepareFrame(); - MediaResult InitDecoder(AVDictionary** aOptions); + MediaResult InitDecoder(); MediaResult AllocateExtraData(); MediaResult DoDecode(MediaRawData* aSample, bool* aGotFrame, DecodedData& aResults); diff --git a/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h b/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h index ed61fc6fc587..3b1a5b673abf 100644 --- a/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h +++ b/dom/media/platforms/ffmpeg/FFmpegDecoderModule.h @@ -52,7 +52,8 @@ class FFmpegDecoderModule : public PlatformDecoderModule { media::DecodeSupport::Unsupported) { return nullptr; } - RefPtr decoder = new FFmpegAudioDecoder(mLib, aParams); + RefPtr decoder = + new FFmpegAudioDecoder(mLib, aParams.AudioConfig()); return decoder.forget(); } @@ -89,9 +90,7 @@ class FFmpegDecoderModule : public PlatformDecoderModule { } AVCodecID videoCodec = FFmpegVideoDecoder::GetCodecId(mimeType); - AVCodecID audioCodec = FFmpegAudioDecoder::GetCodecId( - mimeType, - trackInfo.GetAsAudioInfo() ? *trackInfo.GetAsAudioInfo() : AudioInfo()); + AVCodecID audioCodec = FFmpegAudioDecoder::GetCodecId(mimeType); if (audioCodec == AV_CODEC_ID_NONE && videoCodec == AV_CODEC_ID_NONE) { MOZ_LOG(sPDMLog, LogLevel::Debug, ("FFmpeg decoder rejects requested type '%s'", diff --git a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp index f2cbe0f425d1..c5e1d5244fce 100644 --- a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp +++ b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.cpp @@ -117,12 +117,12 @@ FFmpegLibWrapper::LinkResult FFmpegLibWrapper::Link() { #define AV_FUNC_OPTION_SILENT(func, ver) \ if ((ver)&version) { \ - if (!((func) = (decltype(func))PR_FindSymbol( \ + if (!(func = (decltype(func))PR_FindSymbol( \ ((ver)&AV_FUNC_AVUTIL_MASK) ? mAVUtilLib : mAVCodecLib, \ #func))) { \ } \ } else { \ - (func) = (decltype(func))nullptr; \ + func = (decltype(func))nullptr; \ } #define AV_FUNC_OPTION(func, ver) \ @@ -133,7 +133,7 @@ FFmpegLibWrapper::LinkResult FFmpegLibWrapper::Link() { #define AV_FUNC(func, ver) \ AV_FUNC_OPTION(func, ver) \ - if ((ver)&version && !(func)) { \ + if ((ver)&version && !func) { \ Unlink(); \ return isFFMpeg ? LinkResult::MissingFFMpegFunction \ : LinkResult::MissingLibAVFunction; \ @@ -182,8 +182,6 @@ FFmpegLibWrapper::LinkResult FFmpegLibWrapper::Link() { AV_FUNC_AVUTIL_58 | AV_FUNC_AVUTIL_59 | AV_FUNC_AVUTIL_60)) AV_FUNC(av_image_check_size, AV_FUNC_AVUTIL_ALL) AV_FUNC(av_image_get_buffer_size, AV_FUNC_AVUTIL_ALL) - AV_FUNC_OPTION(av_channel_layout_default, AV_FUNC_AVUTIL_60) - AV_FUNC_OPTION(av_channel_layout_from_mask, AV_FUNC_AVUTIL_60) AV_FUNC_OPTION(av_buffer_get_opaque, (AV_FUNC_AVUTIL_56 | AV_FUNC_AVUTIL_57 | AV_FUNC_AVUTIL_58 | AV_FUNC_AVUTIL_59 | AV_FUNC_AVUTIL_60)) @@ -201,11 +199,6 @@ FFmpegLibWrapper::LinkResult FFmpegLibWrapper::Link() { AV_FUNC(avcodec_descriptor_get, AV_FUNC_53 | AV_FUNC_55 | AV_FUNC_56 | AV_FUNC_57 | AV_FUNC_58 | AV_FUNC_59 | AV_FUNC_60) - AV_FUNC(av_get_sample_fmt_name, AV_FUNC_AVUTIL_ALL); - AV_FUNC(av_dict_set, AV_FUNC_AVUTIL_57 | AV_FUNC_AVUTIL_58 | - AV_FUNC_AVUTIL_59 | AV_FUNC_AVUTIL_60) - AV_FUNC(av_dict_free, AV_FUNC_AVUTIL_57 | AV_FUNC_AVUTIL_58 | - AV_FUNC_AVUTIL_59 | AV_FUNC_AVUTIL_60) #ifdef MOZ_WIDGET_GTK AV_FUNC_OPTION_SILENT(avcodec_get_hw_config, @@ -233,8 +226,9 @@ FFmpegLibWrapper::LinkResult FFmpegLibWrapper::Link() { AV_FUNC_58 | AV_FUNC_59 | AV_FUNC_60) AV_FUNC_OPTION_SILENT(av_hwframe_ctx_alloc, AV_FUNC_58 | AV_FUNC_59 | AV_FUNC_60) - AV_FUNC_OPTION_SILENT(avcodec_get_name, - AV_FUNC_57 | AV_FUNC_58 | AV_FUNC_59 | AV_FUNC_60) + AV_FUNC_OPTION_SILENT(av_dict_set, AV_FUNC_58 | AV_FUNC_59 | AV_FUNC_60) + AV_FUNC_OPTION_SILENT(av_dict_free, AV_FUNC_58 | AV_FUNC_59 | AV_FUNC_60) + AV_FUNC_OPTION_SILENT(avcodec_get_name, AV_FUNC_58 | AV_FUNC_59 | AV_FUNC_60) AV_FUNC_OPTION_SILENT(av_get_pix_fmt_string, AV_FUNC_AVUTIL_58 | AV_FUNC_AVUTIL_59 | AV_FUNC_AVUTIL_60) @@ -243,9 +237,9 @@ FFmpegLibWrapper::LinkResult FFmpegLibWrapper::Link() { #undef AV_FUNC_OPTION #ifdef MOZ_WIDGET_GTK -# define VA_FUNC_OPTION_SILENT(func) \ - if (!((func) = (decltype(func))PR_FindSymbol(mVALib, #func))) { \ - (func) = (decltype(func))nullptr; \ +# define VA_FUNC_OPTION_SILENT(func) \ + if (!(func = (decltype(func))PR_FindSymbol(mVALib, #func))) { \ + func = (decltype(func))nullptr; \ } // mVALib is optional and may not be present. @@ -257,9 +251,9 @@ FFmpegLibWrapper::LinkResult FFmpegLibWrapper::Link() { } # undef VA_FUNC_OPTION_SILENT -# define VAD_FUNC_OPTION_SILENT(func) \ - if (!((func) = (decltype(func))PR_FindSymbol(mVALibDrm, #func))) { \ - FFMPEG_LOG("Couldn't load function " #func); \ +# define VAD_FUNC_OPTION_SILENT(func) \ + if (!(func = (decltype(func))PR_FindSymbol(mVALibDrm, #func))) { \ + FFMPEG_LOG("Couldn't load function " #func); \ } // mVALibDrm is optional and may not be present. @@ -343,7 +337,7 @@ void FFmpegLibWrapper::LinkVAAPILibs() { #ifdef MOZ_WIDGET_GTK bool FFmpegLibWrapper::IsVAAPIAvailable() { -# define VA_FUNC_LOADED(func) ((func) != nullptr) +# define VA_FUNC_LOADED(func) (func != nullptr) return VA_FUNC_LOADED(avcodec_get_hw_config) && VA_FUNC_LOADED(av_hwdevice_ctx_alloc) && VA_FUNC_LOADED(av_hwdevice_ctx_init) && diff --git a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.h b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.h index cbde46d8fe4f..957cac0c79ba 100644 --- a/dom/media/platforms/ffmpeg/FFmpegLibWrapper.h +++ b/dom/media/platforms/ffmpeg/FFmpegLibWrapper.h @@ -17,7 +17,6 @@ struct AVPacket; struct AVDictionary; struct AVCodecParserContext; struct PRLibrary; -struct AVChannelLayout; #ifdef MOZ_WIDGET_GTK struct AVCodecHWConfig; struct AVVAAPIHWConfig; @@ -123,14 +122,6 @@ struct MOZ_ONLY_USED_TO_AVOID_STATIC_CONSTRUCTORS FFmpegLibWrapper { void* log_ctx); int (*av_image_get_buffer_size)(int pix_fmt, int width, int height, int align); - const char* (*av_get_sample_fmt_name)(int sample_fmt); - void (*av_channel_layout_default)(AVChannelLayout* ch_layout, - int nb_channels); - void (*av_channel_layout_from_mask)(AVChannelLayout* ch_layout, - uint64_t mask); - int (*av_dict_set)(AVDictionary** pm, const char* key, const char* value, - int flags); - void (*av_dict_free)(AVDictionary** m); // libavutil v55 and later only AVFrame* (*av_frame_alloc)(); @@ -164,6 +155,9 @@ struct MOZ_ONLY_USED_TO_AVOID_STATIC_CONSTRUCTORS FFmpegLibWrapper { int (*av_hwdevice_ctx_create_derived)(AVBufferRef** dst_ctx, int type, AVBufferRef* src_ctx, int flags); AVBufferRef* (*av_hwframe_ctx_alloc)(AVBufferRef* device_ctx); + int (*av_dict_set)(AVDictionary** pm, const char* key, const char* value, + int flags); + void (*av_dict_free)(AVDictionary** m); const char* (*avcodec_get_name)(int id); char* (*av_get_pix_fmt_string)(char* buf, int buf_size, int pix_fmt); diff --git a/dom/media/platforms/ffmpeg/FFmpegLibs.h b/dom/media/platforms/ffmpeg/FFmpegLibs.h index 6fd55c4360d8..1c185cb95d90 100644 --- a/dom/media/platforms/ffmpeg/FFmpegLibs.h +++ b/dom/media/platforms/ffmpeg/FFmpegLibs.h @@ -28,13 +28,9 @@ extern "C" { #endif // LIBAVCODEC_VERSION_MAJOR >= 58 #if LIBAVCODEC_VERSION_MAJOR < 55 -// This value is not defined in older version of libavcodec -# define CODEC_ID_OPUS 86076 # define AV_CODEC_ID_VP6F CODEC_ID_VP6F # define AV_CODEC_ID_H264 CODEC_ID_H264 # define AV_CODEC_ID_AAC CODEC_ID_AAC -# define AV_CODEC_ID_VORBIS CODEC_ID_VORBIS -# define AV_CODEC_ID_OPUS CODEC_ID_OPUS # define AV_CODEC_ID_MP3 CODEC_ID_MP3 # define AV_CODEC_ID_VP8 CODEC_ID_VP8 # define AV_CODEC_ID_NONE CODEC_ID_NONE diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp index 749a27ee5e22..05c6281daea4 100644 --- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp +++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp @@ -588,7 +588,7 @@ RefPtr FFmpegVideoDecoder::Init() { } #endif // MOZ_WAYLAND_USE_HWDECODE - rv = InitDecoder(nullptr); + rv = InitDecoder(); if (NS_SUCCEEDED(rv)) { return InitPromise::CreateAndResolve(TrackInfo::kVideoTrack, __func__); } diff --git a/dom/media/platforms/wrappers/AudioTrimmer.cpp b/dom/media/platforms/wrappers/AudioTrimmer.cpp index f23e6868464d..8ed466001b13 100644 --- a/dom/media/platforms/wrappers/AudioTrimmer.cpp +++ b/dom/media/platforms/wrappers/AudioTrimmer.cpp @@ -28,13 +28,13 @@ RefPtr AudioTrimmer::Decode( MediaRawData* aSample) { MOZ_ASSERT(mThread->IsOnCurrentThread(), "We're not on the thread we were first initialized on"); - LOG("AudioTrimmer::Decode"); - PrepareTrimmers(aSample); + RefPtr sample = aSample; + PrepareTrimmers(sample); RefPtr self = this; - RefPtr p = mDecoder->Decode(aSample)->Then( + RefPtr p = mDecoder->Decode(sample)->Then( GetCurrentSerialEventTarget(), __func__, - [self](DecodePromise::ResolveOrRejectValue&& aValue) { - return self->HandleDecodedResult(std::move(aValue)); + [self, sample](DecodePromise::ResolveOrRejectValue&& aValue) { + return self->HandleDecodedResult(std::move(aValue), sample); }); return p; } @@ -42,7 +42,6 @@ RefPtr AudioTrimmer::Decode( RefPtr AudioTrimmer::Flush() { MOZ_ASSERT(mThread->IsOnCurrentThread(), "We're not on the thread we were first initialized on"); - LOG("Flushing"); RefPtr p = mDecoder->Flush(); mTrimmers.Clear(); return p; @@ -55,7 +54,7 @@ RefPtr AudioTrimmer::Drain() { RefPtr p = mDecoder->Drain()->Then( GetCurrentSerialEventTarget(), __func__, [self = RefPtr{this}](DecodePromise::ResolveOrRejectValue&& aValue) { - return self->HandleDecodedResult(std::move(aValue)); + return self->HandleDecodedResult(std::move(aValue), nullptr); }); return p; } @@ -95,37 +94,32 @@ MediaDataDecoder::ConversionRequired AudioTrimmer::NeedsConversion() const { } RefPtr AudioTrimmer::HandleDecodedResult( - DecodePromise::ResolveOrRejectValue&& aValue) { + DecodePromise::ResolveOrRejectValue&& aValue, MediaRawData* aRaw) { MOZ_ASSERT(mThread->IsOnCurrentThread(), "We're not on the thread we were first initialized on"); if (aValue.IsReject()) { return DecodePromise::CreateAndReject(std::move(aValue.RejectValue()), __func__); } + TimeUnit rawStart = aRaw ? aRaw->mTime : TimeUnit::Zero(); + TimeUnit rawEnd = aRaw ? aRaw->GetEndTime() : TimeUnit::Zero(); MediaDataDecoder::DecodedData results = std::move(aValue.ResolveValue()); - LOG("HandleDecodedResults: %zu decoded data, %zu trimmers", results.Length(), - mTrimmers.Length()); if (results.IsEmpty()) { // No samples returned, we assume this is due to the latency of the // decoder and that the related decoded sample will be returned during // the next call to Decode(). - LOGV("No sample returned -- decoder has latency"); - return DecodePromise::CreateAndResolve(std::move(results), __func__); + LOGV("No sample returned for sample[%s, %s]", rawStart.ToString().get(), + rawEnd.ToString().get()); } - for (uint32_t i = 0; i < results.Length();) { const RefPtr& data = results[i]; MOZ_ASSERT(data->mType == MediaData::Type::AUDIO_DATA); - - if (!data->mDuration.IsValid()) { - return DecodePromise::CreateAndReject(std::move(aValue.RejectValue()), - __func__); - } TimeInterval sampleInterval(data->mTime, data->GetEndTime()); if (mTrimmers.IsEmpty()) { // mTrimmers being empty can only occurs if the decoder returned more // frames than we pushed in. We can't handle this case, abort trimming. - LOG("decoded buffer [%s, %s] has no trimming information)", + LOG("sample[%s, %s] (decoded[%s, %s] no trimming information)", + rawStart.ToString().get(), rawEnd.ToString().get(), sampleInterval.mStart.ToString().get(), sampleInterval.mEnd.ToString().get()); i++; @@ -136,23 +130,28 @@ RefPtr AudioTrimmer::HandleDecodedResult( mTrimmers.RemoveElementAt(0); if (!trimmer) { // Those frames didn't need trimming. - LOGV("decoded buffer [%s, %s] doesn't need trimming", + LOGV("sample[%s, %s] (decoded[%s, %s] no trimming needed", + rawStart.ToString().get(), rawEnd.ToString().get(), sampleInterval.mStart.ToString().get(), sampleInterval.mEnd.ToString().get()); i++; continue; } if (!trimmer->Intersects(sampleInterval)) { - LOGV("decoded buffer [%s, %s] would be empty after trimming, dropping it", - sampleInterval.mStart.ToString().get(), - sampleInterval.mEnd.ToString().get()); + LOGV( + "sample[%s, %s] (decoded[%s, %s] would be empty after trimming, " + "dropping it", + rawStart.ToString().get(), rawEnd.ToString().get(), + sampleInterval.mStart.ToString().get(), + sampleInterval.mEnd.ToString().get()); results.RemoveElementAt(i); continue; } - LOGV("Trimming sample[%s,%s] to [%s,%s]", + LOGV("Trimming sample[%s,%s] to [%s,%s] (raw was:[%s, %s])", sampleInterval.mStart.ToString().get(), sampleInterval.mEnd.ToString().get(), trimmer->mStart.ToString().get(), - trimmer->mEnd.ToString().get()); + trimmer->mEnd.ToString().get(), rawStart.ToString().get(), + rawEnd.ToString().get()); TimeInterval trim({std::max(trimmer->mStart, sampleInterval.mStart), std::min(trimmer->mEnd, sampleInterval.mEnd)}); @@ -162,8 +161,7 @@ RefPtr AudioTrimmer::HandleDecodedResult( Unused << ok; if (sample->Frames() == 0) { LOGV("sample[%s, %s] is empty after trimming, dropping it", - sampleInterval.mStart.ToString().get(), - sampleInterval.mEnd.ToString().get()); + rawStart.ToString().get(), rawEnd.ToString().get()); results.RemoveElementAt(i); continue; } @@ -186,7 +184,12 @@ RefPtr AudioTrimmer::DecodeBatch( ->Then(GetCurrentSerialEventTarget(), __func__, [self = RefPtr{this}]( DecodePromise::ResolveOrRejectValue&& aValue) { - return self->HandleDecodedResult(std::move(aValue)); + // If the decoder returned less samples than what we fed it. + // We can assume that this is due to the decoder encoding + // delay and that all decoded frames have been shifted by n = + // compressedSamples.Length() - decodedSamples.Length() and + // that the first n compressed samples returned nothing. + return self->HandleDecodedResult(std::move(aValue), nullptr); }); return p; } diff --git a/dom/media/platforms/wrappers/AudioTrimmer.h b/dom/media/platforms/wrappers/AudioTrimmer.h index afaf6ac23d17..e841a5919f82 100644 --- a/dom/media/platforms/wrappers/AudioTrimmer.h +++ b/dom/media/platforms/wrappers/AudioTrimmer.h @@ -41,9 +41,10 @@ class AudioTrimmer final : public MediaDataDecoder { private: ~AudioTrimmer() = default; - // Apply trimming information on decoded data. + // Apply trimming information on decoded data. aRaw can be null as it's only + // used for logging purposes. RefPtr HandleDecodedResult( - DecodePromise::ResolveOrRejectValue&& aValue); + DecodePromise::ResolveOrRejectValue&& aValue, MediaRawData* aRaw); void PrepareTrimmers(MediaRawData* aRaw); const RefPtr mDecoder; nsCOMPtr mThread; diff --git a/dom/media/test/bug603918.webm b/dom/media/test/bug603918.webm new file mode 100644 index 000000000000..c430e97f404b Binary files /dev/null and b/dom/media/test/bug603918.webm differ diff --git a/dom/media/test/bug603918.webm^headers^ b/dom/media/test/bug603918.webm^headers^ new file mode 100644 index 000000000000..4030ea1d3ddb --- /dev/null +++ b/dom/media/test/bug603918.webm^headers^ @@ -0,0 +1 @@ +Cache-Control: no-store diff --git a/dom/media/test/manifest.js b/dom/media/test/manifest.js index fd1259434a66..1cbc6b70b680 100644 --- a/dom/media/test/manifest.js +++ b/dom/media/test/manifest.js @@ -929,15 +929,19 @@ var gErrorTests = [ { name: "448636.ogv", type: "video/ogg" }, { name: "bug504843.ogv", type: "video/ogg" }, { name: "bug501279.ogg", type: "audio/ogg" }, + { name: "bug603918.webm", type: "video/webm" }, { name: "bug604067.webm", type: "video/webm" }, { name: "bug1535980.webm", type: "video/webm" }, { name: "bug1799787.webm", type: "video/webm" }, { name: "bogus.duh", type: "bogus/duh" }, ]; -// Playing this file errors out after receiving "loadedmetadata", we still want -// to check the duration in "onerror" and make sure it is still available. -var gDurationTests = [{ name: "bug604067.webm", duration: 6.076 }]; +// These files would get error after receiving "loadedmetadata", we would like +// to check duration in "onerror" and make sure the duration is still available. +var gDurationTests = [ + { name: "bug603918.webm", duration: 6.076 }, + { name: "bug604067.webm", duration: 6.076 }, +]; // These are files that have nontrivial duration and are useful for seeking within. var gSeekTests = [ diff --git a/dom/media/test/mochitest.ini b/dom/media/test/mochitest.ini index 449c12aa5d5d..42f8bf6c0982 100644 --- a/dom/media/test/mochitest.ini +++ b/dom/media/test/mochitest.ini @@ -462,6 +462,8 @@ support-files = bug556821.ogv^headers^ bug557094.ogv bug557094.ogv^headers^ + bug603918.webm + bug603918.webm^headers^ bug604067.webm bug604067.webm^headers^ bug1066943.webm diff --git a/dom/media/test/mochitest_background_video.ini b/dom/media/test/mochitest_background_video.ini index 1a2d85c8c1ad..bc65f6372652 100644 --- a/dom/media/test/mochitest_background_video.ini +++ b/dom/media/test/mochitest_background_video.ini @@ -460,6 +460,8 @@ support-files = bug556821.ogv^headers^ bug557094.ogv bug557094.ogv^headers^ + bug603918.webm + bug603918.webm^headers^ bug604067.webm bug604067.webm^headers^ bug1066943.webm diff --git a/dom/media/test/mochitest_bugs.ini b/dom/media/test/mochitest_bugs.ini index 29b8d36fff3f..26693a416c7d 100644 --- a/dom/media/test/mochitest_bugs.ini +++ b/dom/media/test/mochitest_bugs.ini @@ -459,6 +459,8 @@ support-files = bug556821.ogv^headers^ bug557094.ogv bug557094.ogv^headers^ + bug603918.webm + bug603918.webm^headers^ bug604067.webm bug604067.webm^headers^ bug1066943.webm diff --git a/dom/media/test/mochitest_compat.ini b/dom/media/test/mochitest_compat.ini index 9a8e89df2d39..14257aae326f 100644 --- a/dom/media/test/mochitest_compat.ini +++ b/dom/media/test/mochitest_compat.ini @@ -468,6 +468,8 @@ support-files = bug556821.ogv^headers^ bug557094.ogv bug557094.ogv^headers^ + bug603918.webm + bug603918.webm^headers^ bug604067.webm bug604067.webm^headers^ bug1066943.webm diff --git a/dom/media/test/mochitest_eme.ini b/dom/media/test/mochitest_eme.ini index 9e0d06ef4ad4..f17644799e1b 100644 --- a/dom/media/test/mochitest_eme.ini +++ b/dom/media/test/mochitest_eme.ini @@ -461,6 +461,8 @@ support-files = bug556821.ogv^headers^ bug557094.ogv bug557094.ogv^headers^ + bug603918.webm + bug603918.webm^headers^ bug604067.webm bug604067.webm^headers^ bug1066943.webm diff --git a/dom/media/test/mochitest_media_recorder.ini b/dom/media/test/mochitest_media_recorder.ini index 9a3a9edfa743..066f7ba980a2 100644 --- a/dom/media/test/mochitest_media_recorder.ini +++ b/dom/media/test/mochitest_media_recorder.ini @@ -460,6 +460,8 @@ support-files = bug556821.ogv^headers^ bug557094.ogv bug557094.ogv^headers^ + bug603918.webm + bug603918.webm^headers^ bug604067.webm bug604067.webm^headers^ bug1066943.webm diff --git a/dom/media/test/mochitest_seek.ini b/dom/media/test/mochitest_seek.ini index 38da40dd7d98..7ee0501e96e9 100644 --- a/dom/media/test/mochitest_seek.ini +++ b/dom/media/test/mochitest_seek.ini @@ -460,6 +460,8 @@ support-files = bug556821.ogv^headers^ bug557094.ogv bug557094.ogv^headers^ + bug603918.webm + bug603918.webm^headers^ bug604067.webm bug604067.webm^headers^ bug1066943.webm diff --git a/dom/media/test/mochitest_stream.ini b/dom/media/test/mochitest_stream.ini index 75aa88292dc7..0ecb048cd87a 100644 --- a/dom/media/test/mochitest_stream.ini +++ b/dom/media/test/mochitest_stream.ini @@ -461,6 +461,8 @@ support-files = bug556821.ogv^headers^ bug557094.ogv bug557094.ogv^headers^ + bug603918.webm + bug603918.webm^headers^ bug604067.webm bug604067.webm^headers^ bug1066943.webm diff --git a/dom/media/wave/WaveDemuxer.cpp b/dom/media/wave/WaveDemuxer.cpp index 760745d8e18e..814883dc541a 100644 --- a/dom/media/wave/WaveDemuxer.cpp +++ b/dom/media/wave/WaveDemuxer.cpp @@ -94,30 +94,30 @@ bool WAVTrackDemuxer::Init() { return false; } - uint32_t chunkName = mHeaderParser.GiveHeader().ChunkName(); - uint32_t chunkSize = mHeaderParser.GiveHeader().ChunkSize(); + uint32_t aChunkName = mHeaderParser.GiveHeader().ChunkName(); + uint32_t aChunkSize = mHeaderParser.GiveHeader().ChunkSize(); - if (chunkName == FRMT_CODE) { + if (aChunkName == FRMT_CODE) { if (!FmtChunkParserInit()) { return false; } - } else if (chunkName == LIST_CODE) { + } else if (aChunkName == LIST_CODE) { mHeaderParser.Reset(); - uint64_t endOfListChunk = static_cast(mOffset) + chunkSize; + uint64_t endOfListChunk = static_cast(mOffset) + aChunkSize; if (endOfListChunk > UINT32_MAX) { return false; } - if (!ListChunkParserInit(chunkSize)) { + if (!ListChunkParserInit(aChunkSize)) { mOffset = endOfListChunk; } - } else if (chunkName == DATA_CODE) { - mDataLength = chunkSize; + } else if (aChunkName == DATA_CODE) { + mDataLength = aChunkSize; if (mFirstChunkOffset != mOffset) { mFirstChunkOffset = mOffset; } break; } else { - mOffset += chunkSize; // Skip other irrelevant chunks. + mOffset += aChunkSize; // Skip other irrelevant chunks. } if (mOffset & 1) { // Wave files are 2-byte aligned so we need to round up @@ -138,25 +138,22 @@ bool WAVTrackDemuxer::Init() { } } - mSamplesPerSecond = mFmtChunk.SampleRate(); - mChannels = mFmtChunk.Channels(); - if (!mSamplesPerSecond || !mChannels || !mFmtChunk.ValidBitsPerSamples()) { + mSamplesPerSecond = mFmtParser.FmtChunk().SampleRate(); + mChannels = mFmtParser.FmtChunk().Channels(); + mSampleFormat = mFmtParser.FmtChunk().SampleFormat(); + if (!mSamplesPerSecond || !mChannels || !mSampleFormat) { return false; } - mSamplesPerChunk = - DATA_CHUNK_SIZE * 8 / mChannels / mFmtChunk.ValidBitsPerSamples(); - mSampleFormat = mFmtChunk.ValidBitsPerSamples(); + mSamplesPerChunk = DATA_CHUNK_SIZE * 8 / mChannels / mSampleFormat; mInfo->mRate = mSamplesPerSecond; mInfo->mChannels = mChannels; - mInfo->mBitDepth = mFmtChunk.ValidBitsPerSamples(); - mInfo->mProfile = AssertedCast(mFmtChunk.WaveFormat() & 0x00FF); - mInfo->mExtendedProfile = - AssertedCast(mFmtChunk.WaveFormat() & 0xFF00 >> 8); + mInfo->mBitDepth = mSampleFormat; + mInfo->mProfile = mFmtParser.FmtChunk().WaveFormat() & 0x00FF; + mInfo->mExtendedProfile = (mFmtParser.FmtChunk().WaveFormat() & 0xFF00) >> 8; mInfo->mMimeType = "audio/wave; codecs="; - mInfo->mMimeType.AppendInt(mFmtChunk.WaveFormat()); + mInfo->mMimeType.AppendInt(mFmtParser.FmtChunk().WaveFormat()); mInfo->mDuration = Duration(); - mInfo->mChannelMap = mFmtChunk.ChannelMap(); return mInfo->mDuration.IsPositive(); } @@ -176,8 +173,8 @@ bool WAVTrackDemuxer::HeaderParserInit() { if (!header) { return false; } - BufferReader headerReader(header->Data(), 8); - Unused << mHeaderParser.Parse(headerReader); + BufferReader HeaderReader(header->Data(), 8); + Unused << mHeaderParser.Parse(HeaderReader); return true; } @@ -186,8 +183,9 @@ bool WAVTrackDemuxer::FmtChunkParserInit() { if (!fmtChunk) { return false; } - nsTArray fmtChunkData(fmtChunk->Data(), fmtChunk->Size()); - mFmtChunk.Init(std::move(fmtChunkData)); + BufferReader fmtReader(fmtChunk->Data(), + mHeaderParser.GiveHeader().ChunkSize()); + Unused << mFmtParser.Parse(fmtReader); return true; } @@ -347,6 +345,7 @@ void WAVTrackDemuxer::Reset() { mParser.Reset(); mHeaderParser.Reset(); mRIFFParser.Reset(); + mFmtParser.Reset(); } RefPtr @@ -355,9 +354,7 @@ WAVTrackDemuxer::SkipToNextRandomAccessPoint(const TimeUnit& aTimeThreshold) { SkipFailureHolder(NS_ERROR_DOM_MEDIA_DEMUXER_ERR, 0), __func__); } -int64_t WAVTrackDemuxer::GetResourceOffset() const { - return AssertedCast(mOffset); -} +int64_t WAVTrackDemuxer::GetResourceOffset() const { return mOffset; } TimeIntervals WAVTrackDemuxer::GetBuffered() { TimeUnit duration = Duration(); @@ -393,8 +390,9 @@ TimeUnit WAVTrackDemuxer::Duration(int64_t aNumDataChunks) const { if (!mSamplesPerSecond || !mSamplesPerChunk) { return TimeUnit(); } - const int64_t frames = mSamplesPerChunk * aNumDataChunks; - return TimeUnit(frames, mSamplesPerSecond); + const double usPerDataChunk = + USECS_PER_S * static_cast(mSamplesPerChunk) / mSamplesPerSecond; + return TimeUnit::FromMicroseconds(aNumDataChunks * usPerDataChunk); } TimeUnit WAVTrackDemuxer::DurationFromBytes(uint32_t aNumBytes) const { @@ -404,14 +402,21 @@ TimeUnit WAVTrackDemuxer::DurationFromBytes(uint32_t aNumBytes) const { uint64_t numSamples = aNumBytes * 8 / mChannels / mSampleFormat; - return TimeUnit(numSamples, mSamplesPerSecond); + uint64_t numUSeconds = USECS_PER_S * numSamples / mSamplesPerSecond; + + if (USECS_PER_S * numSamples % mSamplesPerSecond > mSamplesPerSecond / 2) { + numUSeconds++; + } + + return TimeUnit::FromMicroseconds(numUSeconds); } MediaByteRange WAVTrackDemuxer::FindNextChunk() { if (mOffset + DATA_CHUNK_SIZE < mFirstChunkOffset + mDataLength) { return {mOffset, mOffset + DATA_CHUNK_SIZE}; + } else { + return {mOffset, mFirstChunkOffset + mDataLength}; } - return {mOffset, mFirstChunkOffset + mDataLength}; } MediaByteRange WAVTrackDemuxer::FindChunkHeader() { @@ -451,8 +456,8 @@ already_AddRefed WAVTrackDemuxer::GetNextChunk( return nullptr; } - const uint32_t read = Read(chunkWriter->Data(), datachunk->mOffset, - AssertedCast(datachunk->Size())); + const uint32_t read = + Read(chunkWriter->Data(), datachunk->mOffset, datachunk->Size()); if (read != aRange.Length()) { return nullptr; @@ -493,8 +498,8 @@ already_AddRefed WAVTrackDemuxer::GetFileHeader( return nullptr; } - const uint32_t read = Read(headerWriter->Data(), fileHeader->mOffset, - AssertedCast(fileHeader->Size())); + const uint32_t read = + Read(headerWriter->Data(), fileHeader->mOffset, fileHeader->Size()); if (read != aRange.Length()) { return nullptr; @@ -514,9 +519,8 @@ uint64_t WAVTrackDemuxer::ChunkIndexFromTime( if (!mSamplesPerChunk || !mSamplesPerSecond) { return 0; } - double chunkDurationS = - mSamplesPerChunk / static_cast(mSamplesPerSecond); - int64_t chunkIndex = std::floor(aTime.ToSeconds() / chunkDurationS); + uint64_t chunkIndex = + (aTime.ToSeconds() * mSamplesPerSecond / mSamplesPerChunk) - 1; return chunkIndex; } @@ -526,12 +530,12 @@ void WAVTrackDemuxer::UpdateState(const MediaByteRange& aRange) { mTotalChunkLen += static_cast(aRange.Length()); } -int64_t WAVTrackDemuxer::Read(uint8_t* aBuffer, int64_t aOffset, - int64_t aSize) { +uint32_t WAVTrackDemuxer::Read(uint8_t* aBuffer, int64_t aOffset, + int32_t aSize) { const int64_t streamLen = StreamLength(); if (mInfo && streamLen > 0) { int64_t max = streamLen > aOffset ? streamLen - aOffset : 0; - aSize = std::min(aSize, max); + aSize = std::min(aSize, max); } uint32_t read = 0; const nsresult rv = mSource.ReadAt(aOffset, reinterpret_cast(aBuffer), @@ -583,11 +587,11 @@ bool RIFFParser::RIFFHeader::ParseNext(uint8_t c) { bool RIFFParser::RIFFHeader::IsValid(int aPos) const { if (aPos > -1 && aPos < 4) { return RIFF[aPos] == mRaw[aPos]; - } - if (aPos > 7 && aPos < 12) { + } else if (aPos > 7 && aPos < 12) { return WAVE[aPos - 8] == mRaw[aPos]; + } else { + return true; } - return true; } bool RIFFParser::RIFFHeader::IsValid() const { return mPos >= RIFF_CHUNK_SIZE; } @@ -653,62 +657,71 @@ void HeaderParser::ChunkHeader::Update(uint8_t c) { } } -// FormatChunk +// FormatParser -void FormatChunk::Init(nsTArray&& aData) { mRaw = std::move(aData); } +Result FormatParser::Parse(BufferReader& aReader) { + for (auto res = aReader.ReadU8(); + res.isOk() && !mFmtChunk.ParseNext(res.unwrap()); + res = aReader.ReadU8()) { + } -uint16_t FormatChunk::WaveFormat() const { return (mRaw[1] << 8) | (mRaw[0]); } + if (mFmtChunk.IsValid()) { + return FMT_CHUNK_MIN_SIZE; + } -uint16_t FormatChunk::Channels() const { return (mRaw[3] << 8) | (mRaw[2]); } + return 0; +} -uint32_t FormatChunk::SampleRate() const { +void FormatParser::Reset() { mFmtChunk.Reset(); } + +const FormatParser::FormatChunk& FormatParser::FmtChunk() const { + return mFmtChunk; +} + +// FormatParser::FormatChunk + +FormatParser::FormatChunk::FormatChunk() { Reset(); } + +void FormatParser::FormatChunk::Reset() { + memset(mRaw, 0, sizeof(mRaw)); + mPos = 0; +} + +uint16_t FormatParser::FormatChunk::WaveFormat() const { + return (mRaw[1] << 8) | (mRaw[0]); +} + +uint16_t FormatParser::FormatChunk::Channels() const { + return (mRaw[3] << 8) | (mRaw[2]); +} + +uint32_t FormatParser::FormatChunk::SampleRate() const { return static_cast((mRaw[7] << 24) | (mRaw[6] << 16) | (mRaw[5] << 8) | (mRaw[4])); } -uint16_t FormatChunk::AverageBytesPerSec() const { - return static_cast((mRaw[11] << 24) | (mRaw[10] << 16) | - (mRaw[9] << 8) | (mRaw[8])); +uint16_t FormatParser::FormatChunk::FrameSize() const { + return (mRaw[13] << 8) | (mRaw[12]); } -uint16_t FormatChunk::BlockAlign() const { - return static_cast(mRaw[13] << 8) | (mRaw[12]); -} - -uint16_t FormatChunk::ValidBitsPerSamples() const { +uint16_t FormatParser::FormatChunk::SampleFormat() const { return (mRaw[15] << 8) | (mRaw[14]); } -uint16_t FormatChunk::ExtraFormatInfoSize() const { - uint16_t value = static_cast(mRaw[17] << 8) | (mRaw[16]); - if (WaveFormat() != 0xFFFE && value != 0) { - NS_WARNING( - "Found non-zero extra format info length and the wave format" - " isn't WAVEFORMATEXTENSIBLE."); - return 0; - } - if (WaveFormat() == 0xFFFE && value < 22) { - NS_WARNING( - "Wave format is WAVEFORMATEXTENSIBLE and extra data size isn't at" - " least 22 bytes"); - return 0; - } - return value; +bool FormatParser::FormatChunk::ParseNext(uint8_t c) { + Update(c); + return IsValid(); } -AudioConfig::ChannelLayout::ChannelMap FormatChunk::ChannelMap() const { - // Integer or float files -- regular mapping - if (WaveFormat() == 1 || WaveFormat() == 2) { - return AudioConfig::ChannelLayout(Channels()).Map(); +bool FormatParser::FormatChunk::IsValid() const { + return (FrameSize() == SampleRate() * Channels() / 8) && + (mPos >= FMT_CHUNK_MIN_SIZE); +} + +void FormatParser::FormatChunk::Update(uint8_t c) { + if (mPos < FMT_CHUNK_MIN_SIZE) { + mRaw[mPos++] = c; } - if (ExtraFormatInfoSize() < 22) { - MOZ_ASSERT(Channels() <= 2); - return AudioConfig::ChannelLayout::UNKNOWN_MAP; - } - // ChannelLayout::ChannelMap is by design bit-per-bit compatible with - // WAVEFORMATEXTENSIBLE's dwChannelMask attribute, we can just cast here. - return static_cast( - mRaw[21] | mRaw[20] | mRaw[19] | mRaw[18]); } // DataParser diff --git a/dom/media/wave/WaveDemuxer.h b/dom/media/wave/WaveDemuxer.h index 09393ad4a490..a7ab65c00259 100644 --- a/dom/media/wave/WaveDemuxer.h +++ b/dom/media/wave/WaveDemuxer.h @@ -73,9 +73,9 @@ class RIFFParser { private: bool Update(uint8_t c); - uint8_t mRaw[RIFF_CHUNK_SIZE] = {}; + uint8_t mRaw[RIFF_CHUNK_SIZE]; - int mPos = 0; + int mPos; }; RIFFHeader mRiffHeader; @@ -108,32 +108,49 @@ class HeaderParser { private: void Update(uint8_t c); - uint8_t mRaw[CHUNK_HEAD_SIZE] = {}; + uint8_t mRaw[CHUNK_HEAD_SIZE]; - int mPos = 0; + int mPos; }; ChunkHeader mHeader; }; -class FormatChunk { - public: - FormatChunk() = default; - void Init(nsTArray&& aData); - bool IsValid() const; +class FormatParser { + private: + class FormatChunk; - uint16_t WaveFormat() const; - uint16_t Channels() const; - uint32_t SampleRate() const; - uint16_t ExtraFormatInfoSize() const; - uint16_t SampleFormat() const; - uint16_t AverageBytesPerSec() const; - uint16_t BlockAlign() const; - uint16_t ValidBitsPerSamples() const; - AudioConfig::ChannelLayout::ChannelMap ChannelMap() const; + public: + const FormatChunk& FmtChunk() const; + + Result Parse(BufferReader& aReader); + + void Reset(); private: - nsTArray mRaw; + class FormatChunk { + public: + FormatChunk(); + void Reset(); + + uint16_t WaveFormat() const; + uint16_t Channels() const; + uint32_t SampleRate() const; + uint16_t FrameSize() const; + uint16_t SampleFormat() const; + + bool IsValid() const; + bool ParseNext(uint8_t c); + + private: + void Update(uint8_t c); + + uint8_t mRaw[FMT_CHUNK_MIN_SIZE]; + + int mPos; + }; + + FormatChunk mFmtChunk; }; class DataParser { @@ -153,7 +170,7 @@ class DataParser { void Reset(); private: - int mPos = 0; // To Check Alignment + int mPos; // To Check Alignment }; DataChunk mChunk; @@ -215,7 +232,7 @@ class WAVTrackDemuxer : public MediaTrackDemuxer, uint64_t OffsetFromChunkIndex(uint32_t aChunkIndex) const; uint64_t ChunkIndexFromTime(const media::TimeUnit& aTime) const; - int64_t Read(uint8_t* aBuffer, int64_t aOffset, int64_t aSize); + uint32_t Read(uint8_t* aBuffer, int64_t aOffset, int32_t aSize); MediaResourceIndex mSource; @@ -223,7 +240,7 @@ class WAVTrackDemuxer : public MediaTrackDemuxer, RIFFParser mRIFFParser; HeaderParser mHeaderParser; - FormatChunk mFmtChunk; + FormatParser mFmtParser; // ListChunkParser mListChunkParser; uint64_t mOffset; diff --git a/dom/media/webaudio/WebAudioUtils.cpp b/dom/media/webaudio/WebAudioUtils.cpp index 928cc8955df7..699f39753298 100644 --- a/dom/media/webaudio/WebAudioUtils.cpp +++ b/dom/media/webaudio/WebAudioUtils.cpp @@ -38,8 +38,20 @@ int WebAudioUtils::SpeexResamplerProcess(SpeexResamplerState* aResampler, uint32_t aChannel, const float* aIn, uint32_t* aInLen, float* aOut, uint32_t* aOutLen) { +#ifdef MOZ_SAMPLE_TYPE_S16 + AutoTArray tmp1; + AutoTArray tmp2; + tmp1.SetLength(*aInLen); + tmp2.SetLength(*aOutLen); + ConvertAudioSamples(aIn, tmp1.Elements(), *aInLen); + int result = speex_resampler_process_int( + aResampler, aChannel, tmp1.Elements(), aInLen, tmp2.Elements(), aOutLen); + ConvertAudioSamples(tmp2.Elements(), aOut, *aOutLen); + return result; +#else return speex_resampler_process_float(aResampler, aChannel, aIn, aInLen, aOut, aOutLen); +#endif } int WebAudioUtils::SpeexResamplerProcess(SpeexResamplerState* aResampler, @@ -47,17 +59,29 @@ int WebAudioUtils::SpeexResamplerProcess(SpeexResamplerState* aResampler, uint32_t* aInLen, float* aOut, uint32_t* aOutLen) { AutoTArray tmp; +#ifdef MOZ_SAMPLE_TYPE_S16 + tmp.SetLength(*aOutLen); + int result = speex_resampler_process_int(aResampler, aChannel, aIn, aInLen, + tmp.Elements(), aOutLen); + ConvertAudioSamples(tmp.Elements(), aOut, *aOutLen); + return result; +#else tmp.SetLength(*aInLen); ConvertAudioSamples(aIn, tmp.Elements(), *aInLen); int result = speex_resampler_process_float( aResampler, aChannel, tmp.Elements(), aInLen, aOut, aOutLen); return result; +#endif } int WebAudioUtils::SpeexResamplerProcess(SpeexResamplerState* aResampler, uint32_t aChannel, const int16_t* aIn, uint32_t* aInLen, int16_t* aOut, uint32_t* aOutLen) { +#ifdef MOZ_SAMPLE_TYPE_S16 + return speex_resampler_process_int(aResampler, aChannel, aIn, aInLen, aOut, + aOutLen); +#else AutoTArray tmp1; AutoTArray tmp2; tmp1.SetLength(*aInLen); @@ -67,6 +91,7 @@ int WebAudioUtils::SpeexResamplerProcess(SpeexResamplerState* aResampler, aResampler, aChannel, tmp1.Elements(), aInLen, tmp2.Elements(), aOutLen); ConvertAudioSamples(tmp2.Elements(), aOut, *aOutLen); return result; +#endif } void WebAudioUtils::LogToDeveloperConsole(uint64_t aWindowID, diff --git a/dom/media/webaudio/blink/HRTFElevation.cpp b/dom/media/webaudio/blink/HRTFElevation.cpp index 38ac0f8614ac..af4e52038404 100644 --- a/dom/media/webaudio/blink/HRTFElevation.cpp +++ b/dom/media/webaudio/blink/HRTFElevation.cpp @@ -109,9 +109,20 @@ nsReturnRef HRTFElevation::calculateKernelForAzimuthElevation( const int16_t(&impulse_response_data)[ResponseFrameSize] = irc_composite_c_r0195[elevationIndex].azimuths[azimuthIndex]; + // When libspeex_resampler is compiled with FIXED_POINT, samples in + // speex_resampler_process_float are rounded directly to int16_t, which + // only works well if the floats are in the range +/-32767. On such + // platforms it's better to resample before converting to float anyway. +#ifdef MOZ_SAMPLE_TYPE_S16 +# define RESAMPLER_PROCESS speex_resampler_process_int + const int16_t* response = impulse_response_data; + const int16_t* resampledResponse; +#else +# define RESAMPLER_PROCESS speex_resampler_process_float float response[ResponseFrameSize]; ConvertAudioSamples(impulse_response_data, response, ResponseFrameSize); float* resampledResponse; +#endif // Note that depending on the fftSize returned by the panner, we may be // truncating the impulse response. @@ -129,8 +140,8 @@ nsReturnRef HRTFElevation::calculateKernelForAzimuthElevation( // Feed the input buffer into the resampler. spx_uint32_t in_len = ResponseFrameSize; spx_uint32_t out_len = resampled.Length(); - speex_resampler_process_float(resampler, 0, response, &in_len, - resampled.Elements(), &out_len); + RESAMPLER_PROCESS(resampler, 0, response, &in_len, resampled.Elements(), + &out_len); if (out_len < resampled.Length()) { // The input should have all been processed. @@ -139,8 +150,8 @@ nsReturnRef HRTFElevation::calculateKernelForAzimuthElevation( spx_uint32_t out_index = out_len; in_len = speex_resampler_get_input_latency(resampler); out_len = resampled.Length() - out_index; - speex_resampler_process_float(resampler, 0, nullptr, &in_len, - resampled.Elements() + out_index, &out_len); + RESAMPLER_PROCESS(resampler, 0, nullptr, &in_len, + resampled.Elements() + out_index, &out_len); out_index += out_len; // There may be some uninitialized samples remaining for very low // sample rates. @@ -150,8 +161,18 @@ nsReturnRef HRTFElevation::calculateKernelForAzimuthElevation( speex_resampler_reset_mem(resampler); } - return HRTFKernel::create(resampledResponse, resampledResponseLength, - sampleRate); +#ifdef MOZ_SAMPLE_TYPE_S16 + AutoTArray floatArray; + floatArray.SetLength(resampledResponseLength); + float* floatResponse = floatArray.Elements(); + ConvertAudioSamples(resampledResponse, floatResponse, + resampledResponseLength); +#else + float* floatResponse = resampledResponse; +#endif +#undef RESAMPLER_PROCESS + + return HRTFKernel::create(floatResponse, resampledResponseLength, sampleRate); } // The range of elevations for the IRCAM impulse responses varies depending on diff --git a/dom/media/webaudio/test/audio-expected.wav b/dom/media/webaudio/test/audio-expected.wav index 384f76318a88..1519270776f9 100644 Binary files a/dom/media/webaudio/test/audio-expected.wav and b/dom/media/webaudio/test/audio-expected.wav differ diff --git a/dom/media/webaudio/test/test_mediaDecoding.html b/dom/media/webaudio/test/test_mediaDecoding.html index 6ee9b24215ef..d796ef6add4c 100644 --- a/dom/media/webaudio/test/test_mediaDecoding.html +++ b/dom/media/webaudio/test/test_mediaDecoding.html @@ -1,25 +1,24 @@ - + - - Test the decodeAudioData API and Resampling - - - - - -
+
+  Test the decodeAudioData API and Resampling
+  
+  
+
+
+
 
 
 
 
- + diff --git a/dom/media/webaudio/test/ting-44.1k-1ch.wav b/dom/media/webaudio/test/ting-44.1k-1ch.wav index dd731e354c56..6854c9d8983f 100644 Binary files a/dom/media/webaudio/test/ting-44.1k-1ch.wav and b/dom/media/webaudio/test/ting-44.1k-1ch.wav differ diff --git a/dom/media/webaudio/test/ting-44.1k-2ch.wav b/dom/media/webaudio/test/ting-44.1k-2ch.wav index b2ef11ecbe2f..703d8858928d 100644 Binary files a/dom/media/webaudio/test/ting-44.1k-2ch.wav and b/dom/media/webaudio/test/ting-44.1k-2ch.wav differ diff --git a/dom/media/webaudio/test/ting-48k-1ch.wav b/dom/media/webaudio/test/ting-48k-1ch.wav index 91874dfbb270..8fe471666c49 100644 Binary files a/dom/media/webaudio/test/ting-48k-1ch.wav and b/dom/media/webaudio/test/ting-48k-1ch.wav differ diff --git a/dom/media/webaudio/test/ting-48k-2ch.wav b/dom/media/webaudio/test/ting-48k-2ch.wav index 6adb8d3e5d8c..ad4d0466da0d 100644 Binary files a/dom/media/webaudio/test/ting-48k-2ch.wav and b/dom/media/webaudio/test/ting-48k-2ch.wav differ diff --git a/dom/media/webm/WebMDemuxer.cpp b/dom/media/webm/WebMDemuxer.cpp index 0ef8f790c171..fce8f0e51290 100644 --- a/dom/media/webm/WebMDemuxer.cpp +++ b/dom/media/webm/WebMDemuxer.cpp @@ -235,7 +235,6 @@ already_AddRefed WebMDemuxer::GetTrackDemuxer( } void WebMDemuxer::Reset(TrackInfo::TrackType aType) { - mProcessedDiscardPadding = false; if (aType == TrackInfo::kVideoTrack) { mVideoPackets.Reset(); } else { @@ -417,12 +416,11 @@ nsresult WebMDemuxer::ReadMetadata() { uint64_t codecDelayUs = params.codec_delay / 1000; mInfo.mAudio.mMimeType = "audio/opus"; OpusCodecSpecificData opusCodecSpecificData; - opusCodecSpecificData.mContainerCodecDelayFrames = - AssertedCast(USECS_PER_S * codecDelayUs / 48000); + opusCodecSpecificData.mContainerCodecDelayMicroSeconds = + AssertedCast(codecDelayUs); mInfo.mAudio.mCodecSpecificConfig = AudioCodecSpecificVariant{std::move(opusCodecSpecificData)}; - WEBM_DEBUG("Preroll for Opus: %" PRIu64 " frames", - opusCodecSpecificData.mContainerCodecDelayFrames); + WEBM_DEBUG("Preroll for Opus: %" PRIu64, codecDelayUs); } mSeekPreroll = params.seek_preroll; mInfo.mAudio.mRate = AssertedCast(params.rate); @@ -584,7 +582,6 @@ nsresult WebMDemuxer::GetNextPacket(TrackInfo::TrackType aType, unsigned int count = 0; r = nestegg_packet_count(holder->Packet(), &count); if (r == -1) { - WEBM_DEBUG("nestegg_packet_count: error"); return NS_ERROR_DOM_MEDIA_DEMUXER_ERR; } int64_t tstamp = holder->Timestamp(); @@ -597,7 +594,6 @@ nsresult WebMDemuxer::GetNextPacket(TrackInfo::TrackType aType, RefPtr next_holder; rv = NextPacket(aType, next_holder); if (NS_FAILED(rv) && rv != NS_ERROR_DOM_MEDIA_END_OF_STREAM) { - WEBM_DEBUG("NextPacket: error"); return rv; } @@ -639,7 +635,6 @@ nsresult WebMDemuxer::GetNextPacket(TrackInfo::TrackType aType, } if (mIsMediaSource && next_tstamp == INT64_MIN) { - WEBM_DEBUG("WebM is a media source, and next timestamp computation filed."); return NS_ERROR_DOM_MEDIA_END_OF_STREAM; } @@ -726,13 +721,13 @@ nsresult WebMDemuxer::GetNextPacket(TrackInfo::TrackType aType, sample = new MediaRawData(data, length, alphaData, alphaLength); if ((length && !sample->Data()) || (alphaLength && !sample->AlphaData())) { - WEBM_DEBUG("Couldn't allocate MediaRawData: OOM"); + // OOM. return NS_ERROR_OUT_OF_MEMORY; } } else { sample = new MediaRawData(data, length); if (length && !sample->Data()) { - WEBM_DEBUG("Couldn't allocate MediaRawData: OOM"); + // OOM. return NS_ERROR_OUT_OF_MEMORY; } } @@ -744,25 +739,20 @@ nsresult WebMDemuxer::GetNextPacket(TrackInfo::TrackType aType, sample->mOffset = holder->Offset(); sample->mKeyframe = isKeyframe; if (discardPadding && i == count - 1) { - sample->mOriginalPresentationWindow = - Some(media::TimeInterval{sample->mTime, sample->GetEndTime()}); + CheckedInt64 discardFrames; if (discardPadding < 0) { - // This will ensure decoding will error out, and the file is rejected. - sample->mDuration = TimeUnit::Invalid(); + // This is an invalid value as discard padding should never be negative. + // Set to maximum value so that the decoder will reject it as it's + // greater than the number of frames available. + discardFrames = INT32_MAX; + WEBM_DEBUG("Invalid negative discard padding"); } else { - TimeUnit padding = TimeUnit::FromNanoseconds(discardPadding); - if (padding > sample->mDuration || mProcessedDiscardPadding) { - WEBM_DEBUG( - "Padding frames larger than packet size, flagging the packet for " - "error (padding: %s, duration: %s, already processed: %s)", - padding.ToString().get(), sample->mDuration.ToString().get(), - mProcessedDiscardPadding ? "true" : "false"); - sample->mDuration = TimeUnit::Invalid(); - } else { - sample->mDuration -= padding; - } + discardFrames = TimeUnitToFrames( + TimeUnit::FromNanoseconds(discardPadding), mInfo.mAudio.mRate); + } + if (discardFrames.isValid()) { + sample->mDiscardPadding = discardFrames.value(); } - mProcessedDiscardPadding = true; } if (packetEncryption == NESTEGG_PACKET_HAS_SIGNAL_BYTE_ENCRYPTED || @@ -876,7 +866,6 @@ nsresult WebMDemuxer::NextPacket(TrackInfo::TrackType aType, bool hasType = isVideo ? mHasVideo : mHasAudio; if (!hasType) { - WEBM_DEBUG("No media type found"); return NS_ERROR_DOM_MEDIA_DEMUXER_ERR; } @@ -898,7 +887,6 @@ nsresult WebMDemuxer::NextPacket(TrackInfo::TrackType aType, return rv; } if (!holder) { - WEBM_DEBUG("Couldn't demux packet"); return NS_ERROR_DOM_MEDIA_DEMUXER_ERR; } @@ -915,24 +903,20 @@ nsresult WebMDemuxer::DemuxPacket(TrackInfo::TrackType aType, int r = nestegg_read_packet(Context(aType), &packet); if (r == 0) { nestegg_read_reset(Context(aType)); - WEBM_DEBUG("EOS"); return NS_ERROR_DOM_MEDIA_END_OF_STREAM; } else if (r < 0) { - WEBM_DEBUG("nestegg_read_packet: error"); return NS_ERROR_DOM_MEDIA_DEMUXER_ERR; } unsigned int track = 0; r = nestegg_packet_track(packet, &track); if (r == -1) { - WEBM_DEBUG("nestegg_packet_track: error"); return NS_ERROR_DOM_MEDIA_DEMUXER_ERR; } int64_t offset = Resource(aType).Tell(); RefPtr holder = new NesteggPacketHolder(); if (!holder->Init(packet, offset, track, false)) { - WEBM_DEBUG("NesteggPacketHolder::Init: error"); return NS_ERROR_DOM_MEDIA_DEMUXER_ERR; } @@ -1172,7 +1156,6 @@ nsresult WebMTrackDemuxer::NextSample(RefPtr& aData) { aData = mSamples.PopFront(); return NS_OK; } - WEBM_DEBUG("WebMTrackDemuxer::NextSample: error"); return rv; } diff --git a/dom/media/webm/WebMDemuxer.h b/dom/media/webm/WebMDemuxer.h index 3b3bdc21e2b4..3d8ff67f9ede 100644 --- a/dom/media/webm/WebMDemuxer.h +++ b/dom/media/webm/WebMDemuxer.h @@ -238,11 +238,6 @@ class WebMDemuxer : public MediaDataDemuxer, // as nestegg only performs 1-byte read at a time. int64_t mLastWebMBlockOffset; const bool mIsMediaSource; - // Discard padding in WebM cannot occur more than once. This is set to true if - // a discard padding element has been found and processed, and the decoding is - // expected to error out if another discard padding element is found - // subsequently in the byte stream. - bool mProcessedDiscardPadding = false; EncryptionInfo mCrypto; }; diff --git a/dom/webidl/MediaDebugInfo.webidl b/dom/webidl/MediaDebugInfo.webidl index 46192d8e5989..21140e9b8b18 100644 --- a/dom/webidl/MediaDebugInfo.webidl +++ b/dom/webidl/MediaDebugInfo.webidl @@ -169,7 +169,7 @@ dictionary MediaStateDebugInfo { long demuxEOS = 0; long drainState = 0; boolean waitingForKey = false; - long long lastStreamSourceID = 0; + long lastStreamSourceID = 0; }; dictionary MediaFrameStats { diff --git a/ipc/glue/test/browser/browser_utility_audio_shutdown.js b/ipc/glue/test/browser/browser_utility_audio_shutdown.js index a0a4be63f6f6..31811cfd5567 100644 --- a/ipc/glue/test/browser/browser_utility_audio_shutdown.js +++ b/ipc/glue/test/browser/browser_utility_audio_shutdown.js @@ -42,7 +42,7 @@ add_setup(async function setup() { }); add_task(async function testKill() { - await runTest("small-shot.ogg", "Utility Generic", "ffvpx audio decoder"); + await runTest("small-shot.ogg", "Utility Generic", "vorbis audio decoder"); await cleanUtilityProcessShutdown( "audioDecoder_Generic", @@ -59,7 +59,7 @@ add_task(async function testKill() { }); add_task(async function testShutdown() { - await runTest("small-shot.ogg", "Utility Generic", "ffvpx audio decoder"); + await runTest("small-shot.ogg", "Utility Generic", "vorbis audio decoder"); const audioDecoderPid = await findGenericAudioDecoder(); ok(audioDecoderPid > 0, `Valid PID found: ${audioDecoderPid}`); diff --git a/ipc/glue/test/browser/head.js b/ipc/glue/test/browser/head.js index e51885754b8c..3b4f6361c170 100644 --- a/ipc/glue/test/browser/head.js +++ b/ipc/glue/test/browser/head.js @@ -110,19 +110,19 @@ function audioTestData() { expectations: { Android: { process: "Utility Generic", - decoder: "ffvpx audio decoder", + decoder: "vorbis audio decoder", }, Linux: { process: "Utility Generic", - decoder: "ffvpx audio decoder", + decoder: "vorbis audio decoder", }, WINNT: { process: "Utility Generic", - decoder: "ffvpx audio decoder", + decoder: "vorbis audio decoder", }, Darwin: { process: "Utility Generic", - decoder: "ffvpx audio decoder", + decoder: "vorbis audio decoder", }, }, }, diff --git a/media/ffvpx/README_MOZILLA b/media/ffvpx/README_MOZILLA index a05244d842a8..fdd0bc3531aa 100644 --- a/media/ffvpx/README_MOZILLA +++ b/media/ffvpx/README_MOZILLA @@ -2,20 +2,16 @@ This directory contains files used in gecko builds from FFmpeg (http://ffmpeg.org). The current files are from FFmpeg as of -revision -37cde570bc2dcd64a15c5d9a37b9fa0d78d84f9f +revision fed07efcde72824ac1ada80d4af4e91ac4fcfc14 git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg -git checkout 37cde570bc2dcd64a15c5d9a37b9fa0d78d84f9f +git checkout fed07efcde72824ac1ada80d4af4e91ac4fcfc14 All source files match their path from the library's source archive. -Currently, we only use the vp8, vp9, av1 (via libdav1d), mp3, flac, vorbis (via -libvorbis), opus (via libopus) and PCM portion of the library. If this changes, -configuration files will most likely need to be updated. - -Decoding AV1 via libdav1d and libvorbis is supported, although the decoder -libraries are vendored separately, `ffvpx` only contains the code to use -those libraries through the `ffmpeg` API. +Currently, we only use the vp8, vp9, av1 (libdav1d), mp3, and flac portion of +the library. If this changes, configuration files will most likely need to be +updated. Decoding AV1 via libdav1d is supported, although the decoder +(libdav1d) is vendored separately, `ffvpx` only contains the code to use `libdav1d` through the `ffmpeg` API. The ffmpeg project recommends to use ffmpeg's tip, not a particular release. diff --git a/media/ffvpx/config_components_audio_only.h b/media/ffvpx/config_components_audio_only.h index 4aafc5c339c8..6ca57dbaebb2 100644 --- a/media/ffvpx/config_components_audio_only.h +++ b/media/ffvpx/config_components_audio_only.h @@ -424,34 +424,34 @@ #define CONFIG_WS_SND1_DECODER 0 #define CONFIG_XMA1_DECODER 0 #define CONFIG_XMA2_DECODER 0 -#define CONFIG_PCM_ALAW_DECODER 1 +#define CONFIG_PCM_ALAW_DECODER 0 #define CONFIG_PCM_BLURAY_DECODER 0 #define CONFIG_PCM_DVD_DECODER 0 #define CONFIG_PCM_F16LE_DECODER 0 #define CONFIG_PCM_F24LE_DECODER 0 #define CONFIG_PCM_F32BE_DECODER 0 -#define CONFIG_PCM_F32LE_DECODER 1 +#define CONFIG_PCM_F32LE_DECODER 0 #define CONFIG_PCM_F64BE_DECODER 0 #define CONFIG_PCM_F64LE_DECODER 0 #define CONFIG_PCM_LXF_DECODER 0 -#define CONFIG_PCM_MULAW_DECODER 1 +#define CONFIG_PCM_MULAW_DECODER 0 #define CONFIG_PCM_S8_DECODER 0 #define CONFIG_PCM_S8_PLANAR_DECODER 0 #define CONFIG_PCM_S16BE_DECODER 0 #define CONFIG_PCM_S16BE_PLANAR_DECODER 0 -#define CONFIG_PCM_S16LE_DECODER 1 +#define CONFIG_PCM_S16LE_DECODER 0 #define CONFIG_PCM_S16LE_PLANAR_DECODER 0 #define CONFIG_PCM_S24BE_DECODER 0 #define CONFIG_PCM_S24DAUD_DECODER 0 -#define CONFIG_PCM_S24LE_DECODER 1 +#define CONFIG_PCM_S24LE_DECODER 0 #define CONFIG_PCM_S24LE_PLANAR_DECODER 0 #define CONFIG_PCM_S32BE_DECODER 0 -#define CONFIG_PCM_S32LE_DECODER 1 +#define CONFIG_PCM_S32LE_DECODER 0 #define CONFIG_PCM_S32LE_PLANAR_DECODER 0 #define CONFIG_PCM_S64BE_DECODER 0 #define CONFIG_PCM_S64LE_DECODER 0 #define CONFIG_PCM_SGA_DECODER 0 -#define CONFIG_PCM_U8_DECODER 1 +#define CONFIG_PCM_U8_DECODER 0 #define CONFIG_PCM_U16BE_DECODER 0 #define CONFIG_PCM_U16LE_DECODER 0 #define CONFIG_PCM_U24BE_DECODER 0 @@ -567,11 +567,11 @@ #define CONFIG_LIBOPENCORE_AMRNB_DECODER 0 #define CONFIG_LIBOPENCORE_AMRWB_DECODER 0 #define CONFIG_LIBOPENJPEG_DECODER 0 -#define CONFIG_LIBOPUS_DECODER 1 +#define CONFIG_LIBOPUS_DECODER 0 #define CONFIG_LIBRSVG_DECODER 0 #define CONFIG_LIBSPEEX_DECODER 0 #define CONFIG_LIBUAVS3D_DECODER 0 -#define CONFIG_LIBVORBIS_DECODER 1 +#define CONFIG_LIBVORBIS_DECODER 0 #define CONFIG_LIBVPX_VP8_DECODER 0 #define CONFIG_LIBVPX_VP9_DECODER 0 #define CONFIG_LIBZVBI_TELETEXT_DECODER 0 diff --git a/media/ffvpx/config_components_audio_video.h b/media/ffvpx/config_components_audio_video.h index 95df8a4bacab..31547214e041 100644 --- a/media/ffvpx/config_components_audio_video.h +++ b/media/ffvpx/config_components_audio_video.h @@ -8,7 +8,6 @@ #define CONFIG_CHOMP_BSF 0 #define CONFIG_DUMP_EXTRADATA_BSF 0 #define CONFIG_DCA_CORE_BSF 0 -#define CONFIG_DTS2PTS_BSF 0 #define CONFIG_DV_ERROR_MARKER_BSF 0 #define CONFIG_EAC3_CORE_BSF 0 #define CONFIG_EXTRACT_EXTRADATA_BSF 0 @@ -20,7 +19,6 @@ #define CONFIG_HEVC_METADATA_BSF 0 #define CONFIG_HEVC_MP4TOANNEXB_BSF 0 #define CONFIG_IMX_DUMP_HEADER_BSF 0 -#define CONFIG_MEDIA100_TO_MJPEGB_BSF 0 #define CONFIG_MJPEG2JPEG_BSF 0 #define CONFIG_MJPEGA_DUMP_HEADER_BSF 0 #define CONFIG_MP3_HEADER_DECOMPRESS_BSF 0 @@ -164,7 +162,6 @@ #define CONFIG_M101_DECODER 0 #define CONFIG_MAGICYUV_DECODER 0 #define CONFIG_MDEC_DECODER 0 -#define CONFIG_MEDIA100_DECODER 0 #define CONFIG_MIMIC_DECODER 0 #define CONFIG_MJPEG_DECODER 0 #define CONFIG_MJPEGB_DECODER 0 @@ -214,7 +211,6 @@ #define CONFIG_PGM_DECODER 0 #define CONFIG_PGMYUV_DECODER 0 #define CONFIG_PGX_DECODER 0 -#define CONFIG_PHM_DECODER 0 #define CONFIG_PHOTOCD_DECODER 0 #define CONFIG_PICTOR_DECODER 0 #define CONFIG_PIXLET_DECODER 0 @@ -232,7 +228,6 @@ #define CONFIG_R210_DECODER 0 #define CONFIG_RASC_DECODER 0 #define CONFIG_RAWVIDEO_DECODER 0 -#define CONFIG_RKA_DECODER 0 #define CONFIG_RL2_DECODER 0 #define CONFIG_ROQ_DECODER 0 #define CONFIG_RPZA_DECODER 0 @@ -308,8 +303,6 @@ #define CONFIG_VP9_RKMPP_DECODER 0 #define CONFIG_VP9_V4L2M2M_DECODER 0 #define CONFIG_VQA_DECODER 0 -#define CONFIG_VQC_DECODER 0 -#define CONFIG_WBMP_DECODER 0 #define CONFIG_WEBP_DECODER 0 #define CONFIG_WCMV_DECODER 0 #define CONFIG_WRAPPED_AVFRAME_DECODER 0 @@ -344,7 +337,6 @@ #define CONFIG_ALS_DECODER 0 #define CONFIG_AMRNB_DECODER 0 #define CONFIG_AMRWB_DECODER 0 -#define CONFIG_APAC_DECODER 0 #define CONFIG_APE_DECODER 0 #define CONFIG_APTX_DECODER 0 #define CONFIG_APTX_HD_DECODER 0 @@ -357,7 +349,6 @@ #define CONFIG_BINKAUDIO_DCT_DECODER 0 #define CONFIG_BINKAUDIO_RDFT_DECODER 0 #define CONFIG_BMV_AUDIO_DECODER 0 -#define CONFIG_BONK_DECODER 0 #define CONFIG_COOK_DECODER 0 #define CONFIG_DCA_DECODER 0 #define CONFIG_DFPWM_DECODER 0 @@ -374,14 +365,12 @@ #define CONFIG_FASTAUDIO_DECODER 0 #define CONFIG_FFWAVESYNTH_DECODER 0 #define CONFIG_FLAC_DECODER 1 -#define CONFIG_FTR_DECODER 0 #define CONFIG_G723_1_DECODER 0 #define CONFIG_G729_DECODER 0 #define CONFIG_GSM_DECODER 0 #define CONFIG_GSM_MS_DECODER 0 #define CONFIG_HCA_DECODER 0 #define CONFIG_HCOM_DECODER 0 -#define CONFIG_HDR_DECODER 0 #define CONFIG_IAC_DECODER 0 #define CONFIG_ILBC_DECODER 0 #define CONFIG_IMC_DECODER 0 @@ -389,7 +378,6 @@ #define CONFIG_MACE3_DECODER 0 #define CONFIG_MACE6_DECODER 0 #define CONFIG_METASOUND_DECODER 0 -#define CONFIG_MISC4_DECODER 0 #define CONFIG_MLP_DECODER 0 #define CONFIG_MP1_DECODER 0 #define CONFIG_MP1FLOAT_DECODER 0 @@ -426,8 +414,7 @@ #define CONFIG_TTA_DECODER 0 #define CONFIG_TWINVQ_DECODER 0 #define CONFIG_VMDAUDIO_DECODER 0 -#define CONFIG_VORBIS_DECODER 1 -#define CONFIG_WAVARC_DECODER 0 +#define CONFIG_VORBIS_DECODER 0 #define CONFIG_WAVPACK_DECODER 0 #define CONFIG_WMALOSSLESS_DECODER 0 #define CONFIG_WMAPRO_DECODER 0 @@ -437,34 +424,34 @@ #define CONFIG_WS_SND1_DECODER 0 #define CONFIG_XMA1_DECODER 0 #define CONFIG_XMA2_DECODER 0 -#define CONFIG_PCM_ALAW_DECODER 1 +#define CONFIG_PCM_ALAW_DECODER 0 #define CONFIG_PCM_BLURAY_DECODER 0 #define CONFIG_PCM_DVD_DECODER 0 #define CONFIG_PCM_F16LE_DECODER 0 #define CONFIG_PCM_F24LE_DECODER 0 #define CONFIG_PCM_F32BE_DECODER 0 -#define CONFIG_PCM_F32LE_DECODER 1 +#define CONFIG_PCM_F32LE_DECODER 0 #define CONFIG_PCM_F64BE_DECODER 0 #define CONFIG_PCM_F64LE_DECODER 0 #define CONFIG_PCM_LXF_DECODER 0 -#define CONFIG_PCM_MULAW_DECODER 1 +#define CONFIG_PCM_MULAW_DECODER 0 #define CONFIG_PCM_S8_DECODER 0 #define CONFIG_PCM_S8_PLANAR_DECODER 0 #define CONFIG_PCM_S16BE_DECODER 0 #define CONFIG_PCM_S16BE_PLANAR_DECODER 0 -#define CONFIG_PCM_S16LE_DECODER 1 +#define CONFIG_PCM_S16LE_DECODER 0 #define CONFIG_PCM_S16LE_PLANAR_DECODER 0 #define CONFIG_PCM_S24BE_DECODER 0 #define CONFIG_PCM_S24DAUD_DECODER 0 -#define CONFIG_PCM_S24LE_DECODER 1 +#define CONFIG_PCM_S24LE_DECODER 0 #define CONFIG_PCM_S24LE_PLANAR_DECODER 0 #define CONFIG_PCM_S32BE_DECODER 0 -#define CONFIG_PCM_S32LE_DECODER 1 +#define CONFIG_PCM_S32LE_DECODER 0 #define CONFIG_PCM_S32LE_PLANAR_DECODER 0 #define CONFIG_PCM_S64BE_DECODER 0 #define CONFIG_PCM_S64LE_DECODER 0 #define CONFIG_PCM_SGA_DECODER 0 -#define CONFIG_PCM_U8_DECODER 1 +#define CONFIG_PCM_U8_DECODER 0 #define CONFIG_PCM_U16BE_DECODER 0 #define CONFIG_PCM_U16LE_DECODER 0 #define CONFIG_PCM_U24BE_DECODER 0 @@ -472,7 +459,6 @@ #define CONFIG_PCM_U32BE_DECODER 0 #define CONFIG_PCM_U32LE_DECODER 0 #define CONFIG_PCM_VIDC_DECODER 0 -#define CONFIG_CBD2_DPCM_DECODER 0 #define CONFIG_DERF_DPCM_DECODER 0 #define CONFIG_GREMLIN_DPCM_DECODER 0 #define CONFIG_INTERPLAY_DPCM_DECODER 0 @@ -480,7 +466,6 @@ #define CONFIG_SDX2_DPCM_DECODER 0 #define CONFIG_SOL_DPCM_DECODER 0 #define CONFIG_XAN_DPCM_DECODER 0 -#define CONFIG_WADY_DPCM_DECODER 0 #define CONFIG_ADPCM_4XM_DECODER 0 #define CONFIG_ADPCM_ADX_DECODER 0 #define CONFIG_ADPCM_AFC_DECODER 0 @@ -530,7 +515,6 @@ #define CONFIG_ADPCM_THP_LE_DECODER 0 #define CONFIG_ADPCM_VIMA_DECODER 0 #define CONFIG_ADPCM_XA_DECODER 0 -#define CONFIG_ADPCM_XMD_DECODER 0 #define CONFIG_ADPCM_YAMAHA_DECODER 0 #define CONFIG_ADPCM_ZORK_DECODER 0 #define CONFIG_SSA_DECODER 0 @@ -583,11 +567,11 @@ #define CONFIG_LIBOPENCORE_AMRNB_DECODER 0 #define CONFIG_LIBOPENCORE_AMRWB_DECODER 0 #define CONFIG_LIBOPENJPEG_DECODER 0 -#define CONFIG_LIBOPUS_DECODER 1 +#define CONFIG_LIBOPUS_DECODER 0 #define CONFIG_LIBRSVG_DECODER 0 #define CONFIG_LIBSPEEX_DECODER 0 #define CONFIG_LIBUAVS3D_DECODER 0 -#define CONFIG_LIBVORBIS_DECODER 1 +#define CONFIG_LIBVORBIS_DECODER 0 #define CONFIG_LIBVPX_VP8_DECODER 0 #define CONFIG_LIBVPX_VP9_DECODER 0 #define CONFIG_LIBZVBI_TELETEXT_DECODER 0 @@ -597,7 +581,6 @@ #define CONFIG_LIBAOM_AV1_DECODER 0 #define CONFIG_AV1_DECODER 1 #define CONFIG_AV1_CUVID_DECODER 0 -#define CONFIG_AV1_MEDIACODEC_DECODER 0 #define CONFIG_AV1_QSV_DECODER 0 #define CONFIG_LIBOPENH264_DECODER 0 #define CONFIG_H264_CUVID_DECODER 0 @@ -616,8 +599,6 @@ #define CONFIG_VP9_CUVID_DECODER 0 #define CONFIG_VP9_MEDIACODEC_DECODER 0 #define CONFIG_VP9_QSV_DECODER 0 -#define CONFIG_VNULL_DECODER 0 -#define CONFIG_ANULL_DECODER 0 #define CONFIG_A64MULTI_ENCODER 0 #define CONFIG_A64MULTI5_ENCODER 0 #define CONFIG_ALIAS_PIX_ENCODER 0 @@ -648,7 +629,6 @@ #define CONFIG_H261_ENCODER 0 #define CONFIG_H263_ENCODER 0 #define CONFIG_H263P_ENCODER 0 -#define CONFIG_H264_MEDIACODEC_ENCODER 0 #define CONFIG_HAP_ENCODER 0 #define CONFIG_HUFFYUV_ENCODER 0 #define CONFIG_JPEG2000_ENCODER 0 @@ -668,7 +648,6 @@ #define CONFIG_PFM_ENCODER 0 #define CONFIG_PGM_ENCODER 0 #define CONFIG_PGMYUV_ENCODER 0 -#define CONFIG_PHM_ENCODER 0 #define CONFIG_PNG_ENCODER 0 #define CONFIG_PPM_ENCODER 0 #define CONFIG_PRORES_ENCODER 0 @@ -699,7 +678,6 @@ #define CONFIG_V410_ENCODER 0 #define CONFIG_VBN_ENCODER 0 #define CONFIG_VC2_ENCODER 0 -#define CONFIG_WBMP_ENCODER 0 #define CONFIG_WRAPPED_AVFRAME_ENCODER 0 #define CONFIG_WMV1_ENCODER 0 #define CONFIG_WMV2_ENCODER 0 @@ -721,7 +699,6 @@ #define CONFIG_EAC3_ENCODER 0 #define CONFIG_FLAC_ENCODER 0 #define CONFIG_G723_1_ENCODER 0 -#define CONFIG_HDR_ENCODER 0 #define CONFIG_MLP_ENCODER 0 #define CONFIG_MP2_ENCODER 0 #define CONFIG_MP2FIXED_ENCODER 0 @@ -833,9 +810,6 @@ #define CONFIG_AAC_MF_ENCODER 0 #define CONFIG_AC3_MF_ENCODER 0 #define CONFIG_H263_V4L2M2M_ENCODER 0 -#define CONFIG_AV1_NVENC_ENCODER 0 -#define CONFIG_AV1_QSV_ENCODER 0 -#define CONFIG_AV1_AMF_ENCODER 0 #define CONFIG_LIBOPENH264_ENCODER 0 #define CONFIG_H264_AMF_ENCODER 0 #define CONFIG_H264_MF_ENCODER 0 @@ -846,7 +820,6 @@ #define CONFIG_H264_VAAPI_ENCODER 0 #define CONFIG_H264_VIDEOTOOLBOX_ENCODER 0 #define CONFIG_HEVC_AMF_ENCODER 0 -#define CONFIG_HEVC_MEDIACODEC_ENCODER 0 #define CONFIG_HEVC_MF_ENCODER 0 #define CONFIG_HEVC_NVENC_ENCODER 0 #define CONFIG_HEVC_QSV_ENCODER 0 @@ -866,8 +839,6 @@ #define CONFIG_VP8_VAAPI_ENCODER 0 #define CONFIG_VP9_VAAPI_ENCODER 0 #define CONFIG_VP9_QSV_ENCODER 0 -#define CONFIG_VNULL_ENCODER 0 -#define CONFIG_ANULL_ENCODER 0 #define CONFIG_AV1_D3D11VA_HWACCEL 0 #define CONFIG_AV1_D3D11VA2_HWACCEL 0 #define CONFIG_AV1_DXVA2_HWACCEL 0 @@ -950,7 +921,6 @@ #define CONFIG_DVDSUB_PARSER 0 #define CONFIG_DVD_NAV_PARSER 0 #define CONFIG_FLAC_PARSER 0 -#define CONFIG_FTR_PARSER 0 #define CONFIG_G723_1_PARSER 0 #define CONFIG_G729_PARSER 0 #define CONFIG_GIF_PARSER 0 @@ -959,10 +929,8 @@ #define CONFIG_H263_PARSER 0 #define CONFIG_H264_PARSER 0 #define CONFIG_HEVC_PARSER 0 -#define CONFIG_HDR_PARSER 0 #define CONFIG_IPU_PARSER 0 #define CONFIG_JPEG2000_PARSER 0 -#define CONFIG_MISC4_PARSER 0 #define CONFIG_MJPEG_PARSER 0 #define CONFIG_MLP_PARSER 0 #define CONFIG_MPEG4VIDEO_PARSER 0 @@ -985,7 +953,6 @@ #define CONFIG_WEBP_PARSER 0 #define CONFIG_XBM_PARSER 0 #define CONFIG_XMA_PARSER 0 -#define CONFIG_XWD_PARSER 0 #define CONFIG_ALSA_INDEV 0 #define CONFIG_ANDROID_CAMERA_INDEV 0 #define CONFIG_AVFOUNDATION_INDEV 0 @@ -1033,7 +1000,6 @@ #define CONFIG_ADELAY_FILTER 0 #define CONFIG_ADENORM_FILTER 0 #define CONFIG_ADERIVATIVE_FILTER 0 -#define CONFIG_ADRC_FILTER 0 #define CONFIG_ADYNAMICEQUALIZER_FILTER 0 #define CONFIG_ADYNAMICSMOOTH_FILTER 0 #define CONFIG_AECHO_FILTER 0 @@ -1156,7 +1122,6 @@ #define CONFIG_VOLUME_FILTER 0 #define CONFIG_VOLUMEDETECT_FILTER 0 #define CONFIG_AEVALSRC_FILTER 0 -#define CONFIG_AFDELAYSRC_FILTER 0 #define CONFIG_AFIRSRC_FILTER 0 #define CONFIG_ANOISESRC_FILTER 0 #define CONFIG_ANULLSRC_FILTER 0 @@ -1174,11 +1139,9 @@ #define CONFIG_AVGBLUR_FILTER 0 #define CONFIG_AVGBLUR_OPENCL_FILTER 0 #define CONFIG_AVGBLUR_VULKAN_FILTER 0 -#define CONFIG_BACKGROUNDKEY_FILTER 0 #define CONFIG_BBOX_FILTER 0 #define CONFIG_BENCH_FILTER 0 #define CONFIG_BILATERAL_FILTER 0 -#define CONFIG_BILATERAL_CUDA_FILTER 0 #define CONFIG_BITPLANENOISE_FILTER 0 #define CONFIG_BLACKDETECT_FILTER 0 #define CONFIG_BLACKFRAME_FILTER 0 @@ -1194,7 +1157,6 @@ #define CONFIG_CHROMABER_VULKAN_FILTER 0 #define CONFIG_CHROMAHOLD_FILTER 0 #define CONFIG_CHROMAKEY_FILTER 0 -#define CONFIG_CHROMAKEY_CUDA_FILTER 0 #define CONFIG_CHROMANR_FILTER 0 #define CONFIG_CHROMASHIFT_FILTER 0 #define CONFIG_CIESCOPE_FILTER 0 @@ -1211,14 +1173,12 @@ #define CONFIG_COLORMAP_FILTER 0 #define CONFIG_COLORMATRIX_FILTER 0 #define CONFIG_COLORSPACE_FILTER 0 -#define CONFIG_COLORSPACE_CUDA_FILTER 0 #define CONFIG_COLORTEMPERATURE_FILTER 0 #define CONFIG_CONVOLUTION_FILTER 0 #define CONFIG_CONVOLUTION_OPENCL_FILTER 0 #define CONFIG_CONVOLVE_FILTER 0 #define CONFIG_COPY_FILTER 0 #define CONFIG_COREIMAGE_FILTER 0 -#define CONFIG_CORR_FILTER 0 #define CONFIG_COVER_RECT_FILTER 0 #define CONFIG_CROP_FILTER 0 #define CONFIG_CROPDETECT_FILTER 0 @@ -1401,7 +1361,6 @@ #define CONFIG_READVITC_FILTER 0 #define CONFIG_REALTIME_FILTER 0 #define CONFIG_REMAP_FILTER 0 -#define CONFIG_REMAP_OPENCL_FILTER 0 #define CONFIG_REMOVEGRAIN_FILTER 0 #define CONFIG_REMOVELOGO_FILTER 0 #define CONFIG_REPEATFIELDS_FILTER 0 @@ -1453,7 +1412,6 @@ #define CONFIG_SPP_FILTER 0 #define CONFIG_SR_FILTER 0 #define CONFIG_SSIM_FILTER 0 -#define CONFIG_SSIM360_FILTER 0 #define CONFIG_STEREO3D_FILTER 0 #define CONFIG_STREAMSELECT_FILTER 0 #define CONFIG_SUBTITLES_FILTER 0 @@ -1518,12 +1476,6 @@ #define CONFIG_ZMQ_FILTER 0 #define CONFIG_ZOOMPAN_FILTER 0 #define CONFIG_ZSCALE_FILTER 0 -#define CONFIG_HSTACK_VAAPI_FILTER 0 -#define CONFIG_VSTACK_VAAPI_FILTER 0 -#define CONFIG_XSTACK_VAAPI_FILTER 0 -#define CONFIG_HSTACK_QSV_FILTER 0 -#define CONFIG_VSTACK_QSV_FILTER 0 -#define CONFIG_XSTACK_QSV_FILTER 0 #define CONFIG_ALLRGB_FILTER 0 #define CONFIG_ALLYUV_FILTER 0 #define CONFIG_CELLAUTO_FILTER 0 @@ -1531,7 +1483,6 @@ #define CONFIG_COLORCHART_FILTER 0 #define CONFIG_COLORSPECTRUM_FILTER 0 #define CONFIG_COREIMAGESRC_FILTER 0 -#define CONFIG_DDAGRAB_FILTER 0 #define CONFIG_FREI0R_SRC_FILTER 0 #define CONFIG_GRADIENTS_FILTER 0 #define CONFIG_HALDCLUTSRC_FILTER 0 @@ -1550,7 +1501,6 @@ #define CONFIG_TESTSRC2_FILTER 0 #define CONFIG_YUVTESTSRC_FILTER 0 #define CONFIG_NULLSINK_FILTER 0 -#define CONFIG_A3DSCOPE_FILTER 0 #define CONFIG_ABITSCOPE_FILTER 0 #define CONFIG_ADRAWGRAPH_FILTER 0 #define CONFIG_AGRAPHMONITOR_FILTER 0 @@ -1559,7 +1509,6 @@ #define CONFIG_AVECTORSCOPE_FILTER 0 #define CONFIG_CONCAT_FILTER 0 #define CONFIG_SHOWCQT_FILTER 0 -#define CONFIG_SHOWCWT_FILTER 0 #define CONFIG_SHOWFREQS_FILTER 0 #define CONFIG_SHOWSPATIAL_FILTER 0 #define CONFIG_SHOWSPECTRUM_FILTER 0 @@ -1593,7 +1542,6 @@ #define CONFIG_AMRNB_DEMUXER 0 #define CONFIG_AMRWB_DEMUXER 0 #define CONFIG_ANM_DEMUXER 0 -#define CONFIG_APAC_DEMUXER 0 #define CONFIG_APC_DEMUXER 0 #define CONFIG_APE_DEMUXER 0 #define CONFIG_APM_DEMUXER 0 @@ -1627,7 +1575,6 @@ #define CONFIG_BFSTM_DEMUXER 0 #define CONFIG_BRSTM_DEMUXER 0 #define CONFIG_BOA_DEMUXER 0 -#define CONFIG_BONK_DEMUXER 0 #define CONFIG_C93_DEMUXER 0 #define CONFIG_CAF_DEMUXER 0 #define CONFIG_CAVSVIDEO_DEMUXER 0 @@ -1712,7 +1659,6 @@ #define CONFIG_JV_DEMUXER 0 #define CONFIG_KUX_DEMUXER 0 #define CONFIG_KVAG_DEMUXER 0 -#define CONFIG_LAF_DEMUXER 0 #define CONFIG_LMLM4_DEMUXER 0 #define CONFIG_LOAS_DEMUXER 0 #define CONFIG_LUODAT_DEMUXER 0 @@ -1795,7 +1741,6 @@ #define CONFIG_RAWVIDEO_DEMUXER 0 #define CONFIG_REALTEXT_DEMUXER 0 #define CONFIG_REDSPARK_DEMUXER 0 -#define CONFIG_RKA_DEMUXER 0 #define CONFIG_RL2_DEMUXER 0 #define CONFIG_RM_DEMUXER 0 #define CONFIG_ROQ_DEMUXER 0 @@ -1811,7 +1756,6 @@ #define CONFIG_SBG_DEMUXER 0 #define CONFIG_SCC_DEMUXER 0 #define CONFIG_SCD_DEMUXER 0 -#define CONFIG_SDNS_DEMUXER 0 #define CONFIG_SDP_DEMUXER 0 #define CONFIG_SDR2_DEMUXER 0 #define CONFIG_SDS_DEMUXER 0 @@ -1863,8 +1807,6 @@ #define CONFIG_VPLAYER_DEMUXER 0 #define CONFIG_VQF_DEMUXER 0 #define CONFIG_W64_DEMUXER 0 -#define CONFIG_WADY_DEMUXER 0 -#define CONFIG_WAVARC_DEMUXER 0 #define CONFIG_WAV_DEMUXER 0 #define CONFIG_WC3_DEMUXER 0 #define CONFIG_WEBM_DASH_MANIFEST_DEMUXER 0 @@ -1877,7 +1819,6 @@ #define CONFIG_WV_DEMUXER 0 #define CONFIG_XA_DEMUXER 0 #define CONFIG_XBIN_DEMUXER 0 -#define CONFIG_XMD_DEMUXER 0 #define CONFIG_XMV_DEMUXER 0 #define CONFIG_XVAG_DEMUXER 0 #define CONFIG_XWMA_DEMUXER 0 @@ -1890,7 +1831,6 @@ #define CONFIG_IMAGE_EXR_PIPE_DEMUXER 0 #define CONFIG_IMAGE_GEM_PIPE_DEMUXER 0 #define CONFIG_IMAGE_GIF_PIPE_DEMUXER 0 -#define CONFIG_IMAGE_HDR_PIPE_DEMUXER 0 #define CONFIG_IMAGE_J2K_PIPE_DEMUXER 0 #define CONFIG_IMAGE_JPEG_PIPE_DEMUXER 0 #define CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER 0 @@ -1898,11 +1838,9 @@ #define CONFIG_IMAGE_PAM_PIPE_DEMUXER 0 #define CONFIG_IMAGE_PBM_PIPE_DEMUXER 0 #define CONFIG_IMAGE_PCX_PIPE_DEMUXER 0 -#define CONFIG_IMAGE_PFM_PIPE_DEMUXER 0 #define CONFIG_IMAGE_PGMYUV_PIPE_DEMUXER 0 #define CONFIG_IMAGE_PGM_PIPE_DEMUXER 0 #define CONFIG_IMAGE_PGX_PIPE_DEMUXER 0 -#define CONFIG_IMAGE_PHM_PIPE_DEMUXER 0 #define CONFIG_IMAGE_PHOTOCD_PIPE_DEMUXER 0 #define CONFIG_IMAGE_PICTOR_PIPE_DEMUXER 0 #define CONFIG_IMAGE_PNG_PIPE_DEMUXER 0 @@ -2105,7 +2043,6 @@ #define CONFIG_CONCATF_PROTOCOL 0 #define CONFIG_CRYPTO_PROTOCOL 0 #define CONFIG_DATA_PROTOCOL 0 -#define CONFIG_FD_PROTOCOL 0 #define CONFIG_FFRTMPCRYPT_PROTOCOL 0 #define CONFIG_FFRTMPHTTP_PROTOCOL 0 #define CONFIG_FILE_PROTOCOL 0 @@ -2149,6 +2086,6 @@ #define CONFIG_LIBSSH_PROTOCOL 0 #define CONFIG_LIBSMBCLIENT_PROTOCOL 0 #define CONFIG_LIBZMQ_PROTOCOL 0 -#define CONFIG_IPFS_GATEWAY_PROTOCOL 0 -#define CONFIG_IPNS_GATEWAY_PROTOCOL 0 +#define CONFIG_IPFS_PROTOCOL 0 +#define CONFIG_IPNS_PROTOCOL 0 #endif /* FFMPEG_CONFIG_COMPONENTS_H */ diff --git a/media/ffvpx/ffvpxcommon.mozbuild b/media/ffvpx/ffvpxcommon.mozbuild index 96a69b27f3a1..3035d9da0e4f 100644 --- a/media/ffvpx/ffvpxcommon.mozbuild +++ b/media/ffvpx/ffvpxcommon.mozbuild @@ -22,8 +22,6 @@ if CONFIG['FFVPX_ASFLAGS']: LOCAL_INCLUDES += ['/media/ffvpx'] -USE_LIBS += [ 'gkcodecs' ] - # We allow warnings for third-party code that can be updated from upstream. AllowCompilerWarnings() diff --git a/media/ffvpx/libavcodec/aarch64/neon.S b/media/ffvpx/libavcodec/aarch64/neon.S index bc105e48619c..1ad32c359d41 100644 --- a/media/ffvpx/libavcodec/aarch64/neon.S +++ b/media/ffvpx/libavcodec/aarch64/neon.S @@ -1,8 +1,6 @@ /* * This file is part of FFmpeg. * - * Copyright (c) 2023 J. Dekker - * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -18,15 +16,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -.macro clip min, max, regs:vararg -.irp x, \regs - smax \x, \x, \min -.endr -.irp x, \regs - smin \x, \x, \max -.endr -.endm - .macro transpose_8x8B r0, r1, r2, r3, r4, r5, r6, r7, r8, r9 trn1 \r8\().8B, \r0\().8B, \r1\().8B trn2 \r9\().8B, \r0\().8B, \r1\().8B diff --git a/media/ffvpx/libavcodec/allcodecs.c b/media/ffvpx/libavcodec/allcodecs.c index 385ee348035d..e593ad19afc1 100644 --- a/media/ffvpx/libavcodec/allcodecs.c +++ b/media/ffvpx/libavcodec/allcodecs.c @@ -798,7 +798,7 @@ extern const FFCodec ff_libvorbis_decoder; extern const FFCodec ff_libvpx_vp8_encoder; extern const FFCodec ff_libvpx_vp8_decoder; extern FFCodec ff_libvpx_vp9_encoder; -extern const FFCodec ff_libvpx_vp9_decoder; +extern FFCodec ff_libvpx_vp9_decoder; /* preferred over libwebp */ extern const FFCodec ff_libwebp_anim_encoder; extern const FFCodec ff_libwebp_encoder; diff --git a/media/ffvpx/libavcodec/av1dec.c b/media/ffvpx/libavcodec/av1dec.c index 807852e317e8..d83c902f1f82 100644 --- a/media/ffvpx/libavcodec/av1dec.c +++ b/media/ffvpx/libavcodec/av1dec.c @@ -20,14 +20,11 @@ #include "config_components.h" -#include "libavutil/hdr_dynamic_metadata.h" #include "libavutil/film_grain_params.h" -#include "libavutil/mastering_display_metadata.h" #include "libavutil/pixdesc.h" #include "libavutil/opt.h" #include "avcodec.h" #include "av1dec.h" -#include "atsc_a53.h" #include "bytestream.h" #include "codec_internal.h" #include "decode.h" @@ -648,7 +645,6 @@ fail: static av_cold int av1_decode_free(AVCodecContext *avctx) { AV1DecContext *s = avctx->priv_data; - AV1RawMetadataITUTT35 itut_t35; for (int i = 0; i < FF_ARRAY_ELEMS(s->ref); i++) { av1_frame_unref(avctx, &s->ref[i]); @@ -659,14 +655,8 @@ static av_cold int av1_decode_free(AVCodecContext *avctx) av_buffer_unref(&s->seq_ref); av_buffer_unref(&s->header_ref); - av_buffer_unref(&s->cll_ref); - av_buffer_unref(&s->mdcv_ref); av_freep(&s->tile_group_info); - while (s->itut_t35_fifo && av_fifo_read(s->itut_t35_fifo, &itut_t35, 1) >= 0) - av_buffer_unref(&itut_t35.payload_ref); - av_fifo_freep2(&s->itut_t35_fifo); - ff_cbs_fragment_free(&s->current_obu); ff_cbs_close(&s->cbc); @@ -752,16 +742,6 @@ static int update_context_with_frame_header(AVCodecContext *avctx, return 0; } -static const CodedBitstreamUnitType decompose_unit_types[] = { - AV1_OBU_FRAME, - AV1_OBU_FRAME_HEADER, - AV1_OBU_METADATA, - AV1_OBU_REDUNDANT_FRAME_HEADER, - AV1_OBU_SEQUENCE_HEADER, - AV1_OBU_TEMPORAL_DELIMITER, - AV1_OBU_TILE_GROUP, -}; - static av_cold int av1_decode_init(AVCodecContext *avctx) { AV1DecContext *s = avctx->priv_data; @@ -791,14 +771,6 @@ static av_cold int av1_decode_init(AVCodecContext *avctx) if (ret < 0) return ret; - s->cbc->decompose_unit_types = decompose_unit_types; - s->cbc->nb_decompose_unit_types = FF_ARRAY_ELEMS(decompose_unit_types); - - s->itut_t35_fifo = av_fifo_alloc2(1, sizeof(AV1RawMetadataITUTT35), - AV_FIFO_FLAG_AUTO_GROW); - if (!s->itut_t35_fifo) - return AVERROR(ENOMEM); - av_opt_set_int(s->cbc->priv_data, "operating_point", s->operating_point, 0); if (avctx->extradata && avctx->extradata_size) { @@ -880,108 +852,6 @@ fail: return ret; } -static int export_itut_t35(AVCodecContext *avctx, AVFrame *frame, - const AV1RawMetadataITUTT35 *itut_t35) -{ - GetByteContext gb; - int ret, provider_code; - - bytestream2_init(&gb, itut_t35->payload, itut_t35->payload_size); - - provider_code = bytestream2_get_be16(&gb); - switch (provider_code) { - case 0x31: { // atsc_provider_code - uint32_t user_identifier = bytestream2_get_be32(&gb); - switch (user_identifier) { - case MKBETAG('G', 'A', '9', '4'): { // closed captions - AVBufferRef *buf = NULL; - - ret = ff_parse_a53_cc(&buf, gb.buffer, bytestream2_get_bytes_left(&gb)); - if (ret < 0) - return ret; - if (!ret) - break; - - if (!av_frame_new_side_data_from_buf(frame, AV_FRAME_DATA_A53_CC, buf)) - av_buffer_unref(&buf); - - avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS; - break; - } - default: // ignore unsupported identifiers - break; - } - break; - } - case 0x3C: { // smpte_provider_code - AVDynamicHDRPlus *hdrplus; - int provider_oriented_code = bytestream2_get_be16(&gb); - int application_identifier = bytestream2_get_byte(&gb); - - if (itut_t35->itu_t_t35_country_code != 0xB5 || - provider_oriented_code != 1 || application_identifier != 4) - break; - - hdrplus = av_dynamic_hdr_plus_create_side_data(frame); - if (!hdrplus) - return AVERROR(ENOMEM); - - ret = av_dynamic_hdr_plus_from_t35(hdrplus, gb.buffer, - bytestream2_get_bytes_left(&gb)); - if (ret < 0) - return ret; - break; - } - default: // ignore unsupported provider codes - break; - } - - return 0; -} - -static int export_metadata(AVCodecContext *avctx, AVFrame *frame) -{ - AV1DecContext *s = avctx->priv_data; - AV1RawMetadataITUTT35 itut_t35; - int ret = 0; - - if (s->mdcv) { - AVMasteringDisplayMetadata *mastering = av_mastering_display_metadata_create_side_data(frame); - if (!mastering) - return AVERROR(ENOMEM); - - for (int i = 0; i < 3; i++) { - mastering->display_primaries[i][0] = av_make_q(s->mdcv->primary_chromaticity_x[i], 1 << 16); - mastering->display_primaries[i][1] = av_make_q(s->mdcv->primary_chromaticity_y[i], 1 << 16); - } - mastering->white_point[0] = av_make_q(s->mdcv->white_point_chromaticity_x, 1 << 16); - mastering->white_point[1] = av_make_q(s->mdcv->white_point_chromaticity_y, 1 << 16); - - mastering->max_luminance = av_make_q(s->mdcv->luminance_max, 1 << 8); - mastering->min_luminance = av_make_q(s->mdcv->luminance_min, 1 << 14); - - mastering->has_primaries = 1; - mastering->has_luminance = 1; - } - - if (s->cll) { - AVContentLightMetadata *light = av_content_light_metadata_create_side_data(frame); - if (!light) - return AVERROR(ENOMEM); - - light->MaxCLL = s->cll->max_cll; - light->MaxFALL = s->cll->max_fall; - } - - while (av_fifo_read(s->itut_t35_fifo, &itut_t35, 1) >= 0) { - if (ret >= 0) - ret = export_itut_t35(avctx, frame, &itut_t35); - av_buffer_unref(&itut_t35.payload_ref); - } - - return ret; -} - static int export_film_grain(AVCodecContext *avctx, AVFrame *frame) { AV1DecContext *s = avctx->priv_data; @@ -1058,12 +928,6 @@ static int set_output_frame(AVCodecContext *avctx, AVFrame *frame, if (ret < 0) return ret; - ret = export_metadata(avctx, frame); - if (ret < 0) { - av_frame_unref(frame); - return ret; - } - if (avctx->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN) { ret = export_film_grain(avctx, frame); if (ret < 0) { @@ -1074,11 +938,7 @@ static int set_output_frame(AVCodecContext *avctx, AVFrame *frame, frame->pts = pkt->pts; frame->pkt_dts = pkt->dts; -#if FF_API_FRAME_PKT -FF_DISABLE_DEPRECATION_WARNINGS frame->pkt_size = pkt->size; -FF_ENABLE_DEPRECATION_WARNINGS -#endif *got_frame = 1; @@ -1313,47 +1173,7 @@ static int av1_decode_frame(AVCodecContext *avctx, AVFrame *frame, case AV1_OBU_TILE_LIST: case AV1_OBU_TEMPORAL_DELIMITER: case AV1_OBU_PADDING: - break; case AV1_OBU_METADATA: - switch (obu->obu.metadata.metadata_type) { - case AV1_METADATA_TYPE_HDR_CLL: - av_buffer_unref(&s->cll_ref); - s->cll_ref = av_buffer_ref(unit->content_ref); - if (!s->cll_ref) { - s->cll = NULL; - ret = AVERROR(ENOMEM); - goto end; - } - s->cll = &obu->obu.metadata.metadata.hdr_cll; - break; - case AV1_METADATA_TYPE_HDR_MDCV: - av_buffer_unref(&s->mdcv_ref); - s->mdcv_ref = av_buffer_ref(unit->content_ref); - if (!s->mdcv_ref) { - s->mdcv = NULL; - ret = AVERROR(ENOMEM); - goto end; - } - s->mdcv = &obu->obu.metadata.metadata.hdr_mdcv; - break; - case AV1_METADATA_TYPE_ITUT_T35: { - AV1RawMetadataITUTT35 itut_t35; - memcpy(&itut_t35, &obu->obu.metadata.metadata.itut_t35, sizeof(itut_t35)); - itut_t35.payload_ref = av_buffer_ref(obu->obu.metadata.metadata.itut_t35.payload_ref); - if (!itut_t35.payload_ref) { - ret = AVERROR(ENOMEM); - goto end; - } - ret = av_fifo_write(s->itut_t35_fifo, &itut_t35, 1); - if (ret < 0) { - av_buffer_unref(&itut_t35.payload_ref); - goto end; - } - break; - } - default: - break; - } break; default: av_log(avctx, AV_LOG_DEBUG, @@ -1398,7 +1218,6 @@ end: static void av1_decode_flush(AVCodecContext *avctx) { AV1DecContext *s = avctx->priv_data; - AV1RawMetadataITUTT35 itut_t35; for (int i = 0; i < FF_ARRAY_ELEMS(s->ref); i++) av1_frame_unref(avctx, &s->ref[i]); @@ -1407,10 +1226,6 @@ static void av1_decode_flush(AVCodecContext *avctx) s->operating_point_idc = 0; s->raw_frame_header = NULL; s->raw_seq = NULL; - s->cll = NULL; - s->mdcv = NULL; - while (av_fifo_read(s->itut_t35_fifo, &itut_t35, 1) >= 0) - av_buffer_unref(&itut_t35.payload_ref); ff_cbs_flush(s->cbc); } diff --git a/media/ffvpx/libavcodec/av1dec.h b/media/ffvpx/libavcodec/av1dec.h index cef899f81f7d..82c7084e99fb 100644 --- a/media/ffvpx/libavcodec/av1dec.h +++ b/media/ffvpx/libavcodec/av1dec.h @@ -23,7 +23,6 @@ #include -#include "libavutil/fifo.h" #include "libavutil/buffer.h" #include "libavutil/frame.h" #include "libavutil/pixfmt.h" @@ -74,13 +73,6 @@ typedef struct AV1DecContext { AVBufferRef *header_ref; AV1RawFrameHeader *raw_frame_header; TileGroupInfo *tile_group_info; - - AVBufferRef *cll_ref; - AV1RawMetadataHDRCLL *cll; - AVBufferRef *mdcv_ref; - AV1RawMetadataHDRMDCV *mdcv; - AVFifo *itut_t35_fifo; - uint16_t tile_num; uint16_t tg_start; uint16_t tg_end; diff --git a/media/ffvpx/libavcodec/avcodec.h b/media/ffvpx/libavcodec/avcodec.h index 30f1d312f4eb..9a0fe97cad10 100644 --- a/media/ffvpx/libavcodec/avcodec.h +++ b/media/ffvpx/libavcodec/avcodec.h @@ -771,13 +771,11 @@ typedef struct AVCodecContext { */ float dark_masking; -#if FF_API_SLICE_OFFSET /** * slice count * - encoding: Set by libavcodec. * - decoding: Set by user (or 0). */ - attribute_deprecated int slice_count; /** @@ -785,9 +783,7 @@ typedef struct AVCodecContext { * - encoding: Set/allocated by libavcodec. * - decoding: Set/allocated by user (or NULL). */ - attribute_deprecated int *slice_offset; -#endif /** * sample aspect ratio (0 if unknown) @@ -1588,19 +1584,12 @@ typedef struct AVCodecContext { #define FF_PROFILE_DNXHR_HQX 4 #define FF_PROFILE_DNXHR_444 5 -#define FF_PROFILE_DTS 20 -#define FF_PROFILE_DTS_ES 30 -#define FF_PROFILE_DTS_96_24 40 -#define FF_PROFILE_DTS_HD_HRA 50 -#define FF_PROFILE_DTS_HD_MA 60 -#define FF_PROFILE_DTS_EXPRESS 70 -#define FF_PROFILE_DTS_HD_MA_X 61 -#define FF_PROFILE_DTS_HD_MA_X_IMAX 62 - - -#define FF_PROFILE_EAC3_DDP_ATMOS 30 - -#define FF_PROFILE_TRUEHD_ATMOS 30 +#define FF_PROFILE_DTS 20 +#define FF_PROFILE_DTS_ES 30 +#define FF_PROFILE_DTS_96_24 40 +#define FF_PROFILE_DTS_HD_HRA 50 +#define FF_PROFILE_DTS_HD_MA 60 +#define FF_PROFILE_DTS_EXPRESS 70 #define FF_PROFILE_MPEG2_422 0 #define FF_PROFILE_MPEG2_HIGH 1 @@ -2429,16 +2418,9 @@ int avcodec_parameters_to_context(AVCodecContext *codec, * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for * retrieving a codec. * - * Depending on the codec, you might need to set options in the codec context - * also for decoding (e.g. width, height, or the pixel or audio sample format in - * the case the information is not available in the bitstream, as when decoding - * raw audio or video). + * @note Always call this function before using decoding routines (such as + * @ref avcodec_receive_frame()). * - * Options in the codec context can be set either by setting them in the options - * AVDictionary, or by setting the values in the context itself, directly or by - * using the av_opt_set() API before calling this function. - * - * Example: * @code * av_dict_set(&opts, "b", "2.5M", 0); * codec = avcodec_find_decoder(AV_CODEC_ID_H264); @@ -2451,36 +2433,17 @@ int avcodec_parameters_to_context(AVCodecContext *codec, * exit(1); * @endcode * - * In the case AVCodecParameters are available (e.g. when demuxing a stream - * using libavformat, and accessing the AVStream contained in the demuxer), the - * codec parameters can be copied to the codec context using - * avcodec_parameters_to_context(), as in the following example: - * - * @code - * AVStream *stream = ...; - * context = avcodec_alloc_context3(codec); - * if (avcodec_parameters_to_context(context, stream->codecpar) < 0) - * exit(1); - * if (avcodec_open2(context, codec, NULL) < 0) - * exit(1); - * @endcode - * - * @note Always call this function before using decoding routines (such as - * @ref avcodec_receive_frame()). - * * @param avctx The context to initialize. * @param codec The codec to open this context for. If a non-NULL codec has been * previously passed to avcodec_alloc_context3() or * for this context, then this parameter MUST be either NULL or * equal to the previously passed codec. - * @param options A dictionary filled with AVCodecContext and codec-private - * options, which are set on top of the options already set in - * avctx, can be NULL. On return this object will be filled with - * options that were not found in the avctx codec context. + * @param options A dictionary filled with AVCodecContext and codec-private options. + * On return this object will be filled with options that were not found. * * @return zero on success, a negative value on error * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(), - * av_dict_set(), av_opt_set(), av_opt_find(), avcodec_parameters_to_context() + * av_dict_set(), av_opt_find(). */ int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options); diff --git a/media/ffvpx/libavcodec/codec_desc.c b/media/ffvpx/libavcodec/codec_desc.c index e80ac0770064..199f62df15b1 100644 --- a/media/ffvpx/libavcodec/codec_desc.c +++ b/media/ffvpx/libavcodec/codec_desc.c @@ -2931,7 +2931,6 @@ static const AVCodecDescriptor codec_descriptors[] = { .name = "eac3", .long_name = NULL_IF_CONFIG_SMALL("ATSC A/52B (AC-3, E-AC-3)"), .props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY, - .profiles = NULL_IF_CONFIG_SMALL(ff_eac3_profiles), }, { .id = AV_CODEC_ID_SIPR, @@ -2960,7 +2959,6 @@ static const AVCodecDescriptor codec_descriptors[] = { .name = "truehd", .long_name = NULL_IF_CONFIG_SMALL("TrueHD"), .props = AV_CODEC_PROP_LOSSLESS, - .profiles = NULL_IF_CONFIG_SMALL(ff_truehd_profiles), }, { .id = AV_CODEC_ID_MP4ALS, diff --git a/media/ffvpx/libavcodec/codec_list.c b/media/ffvpx/libavcodec/codec_list.c index 60df66a4b759..db49c8fffb06 100644 --- a/media/ffvpx/libavcodec/codec_list.c +++ b/media/ffvpx/libavcodec/codec_list.c @@ -16,32 +16,5 @@ static const FFCodec * const codec_list[] = { #endif #if CONFIG_AV1_DECODER &ff_av1_decoder, -#endif -#if CONFIG_LIBVORBIS_DECODER - &ff_libvorbis_decoder, -#endif -#if CONFIG_PCM_ALAW_DECODER - &ff_pcm_alaw_decoder, -#endif -#if CONFIG_PCM_F32LE_DECODER - &ff_pcm_f32le_decoder, -#endif -#if CONFIG_PCM_MULAW_DECODER - &ff_pcm_mulaw_decoder, -#endif -#if CONFIG_PCM_S16LE_DECODER - &ff_pcm_s16le_decoder, -#endif -#if CONFIG_PCM_S24LE_DECODER - &ff_pcm_s24le_decoder, -#endif -#if CONFIG_PCM_S32LE_DECODER - &ff_pcm_s32le_decoder, -#endif -#if CONFIG_PCM_U8_DECODER - &ff_pcm_u8_decoder, -#endif -#if CONFIG_LIBOPUS_DECODER - &ff_libopus_decoder, #endif NULL }; diff --git a/media/ffvpx/libavcodec/decode.c b/media/ffvpx/libavcodec/decode.c index 40f5a3ba5989..be2be81089fc 100644 --- a/media/ffvpx/libavcodec/decode.c +++ b/media/ffvpx/libavcodec/decode.c @@ -139,10 +139,8 @@ static int extract_packet_props(AVCodecInternal *avci, const AVPacket *pkt) av_packet_unref(avci->last_pkt_props); if (pkt) { ret = av_packet_copy_props(avci->last_pkt_props, pkt); -#if FF_API_FRAME_PKT if (!ret) - avci->last_pkt_props->stream_index = pkt->size; // Needed for ff_decode_frame_props(). -#endif + avci->last_pkt_props->opaque = (void *)(intptr_t)pkt->size; // Needed for ff_decode_frame_props(). } return ret; } @@ -289,12 +287,8 @@ static inline int decode_simple_internal(AVCodecContext *avctx, AVFrame *frame, if (!(codec->caps_internal & FF_CODEC_CAP_SETS_PKT_DTS)) frame->pkt_dts = pkt->dts; if (avctx->codec->type == AVMEDIA_TYPE_VIDEO) { -#if FF_API_FRAME_PKT -FF_DISABLE_DEPRECATION_WARNINGS if(!avctx->has_b_frames) frame->pkt_pos = pkt->pos; -FF_ENABLE_DEPRECATION_WARNINGS -#endif //FIXME these should be under if(!avctx->has_b_frames) /* get_buffer is supposed to set frame parameters */ if (!(avctx->codec->capabilities & AV_CODEC_CAP_DR1)) { @@ -466,10 +460,8 @@ FF_ENABLE_DEPRECATION_WARNINGS pkt->pts = AV_NOPTS_VALUE; pkt->dts = AV_NOPTS_VALUE; if (!(codec->caps_internal & FF_CODEC_CAP_SETS_FRAME_PROPS)) { -#if FF_API_FRAME_PKT // See extract_packet_props() comment. - avci->last_pkt_props->stream_index = avci->last_pkt_props->stream_index - consumed; -#endif + avci->last_pkt_props->opaque = (void *)((intptr_t)avci->last_pkt_props->opaque - consumed); avci->last_pkt_props->pts = AV_NOPTS_VALUE; avci->last_pkt_props->dts = AV_NOPTS_VALUE; } @@ -555,7 +547,6 @@ static int decode_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame) if (codec->cb_type == FF_CODEC_CB_TYPE_RECEIVE_FRAME) { ret = codec->cb.receive_frame(avctx, frame); - emms_c(); } else ret = decode_simple_receive_frame(avctx, frame); @@ -1321,13 +1312,9 @@ int ff_decode_frame_props_from_pkt(const AVCodecContext *avctx, }; frame->pts = pkt->pts; - frame->duration = pkt->duration; -#if FF_API_FRAME_PKT -FF_DISABLE_DEPRECATION_WARNINGS frame->pkt_pos = pkt->pos; + frame->duration = pkt->duration; frame->pkt_size = pkt->size; -FF_ENABLE_DEPRECATION_WARNINGS -#endif for (int i = 0; i < FF_ARRAY_ELEMS(sd); i++) { size_t size; @@ -1368,11 +1355,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame *frame) int ret = ff_decode_frame_props_from_pkt(avctx, frame, pkt); if (ret < 0) return ret; -#if FF_API_FRAME_PKT -FF_DISABLE_DEPRECATION_WARNINGS - frame->pkt_size = pkt->stream_index; -FF_ENABLE_DEPRECATION_WARNINGS -#endif + frame->pkt_size = (int)(intptr_t)pkt->opaque; } #if FF_API_REORDERED_OPAQUE FF_DISABLE_DEPRECATION_WARNINGS diff --git a/media/ffvpx/libavcodec/libdav1d.c b/media/ffvpx/libavcodec/libdav1d.c index ddf2311a41a7..2488a709c722 100644 --- a/media/ffvpx/libavcodec/libdav1d.c +++ b/media/ffvpx/libavcodec/libdav1d.c @@ -24,7 +24,6 @@ #include "libavutil/avassert.h" #include "libavutil/cpu.h" #include "libavutil/film_grain_params.h" -#include "libavutil/hdr_dynamic_metadata.h" #include "libavutil/mastering_display_metadata.h" #include "libavutil/imgutils.h" #include "libavutil/opt.h" @@ -512,57 +511,29 @@ FF_ENABLE_DEPRECATION_WARNINGS } if (p->itut_t35) { GetByteContext gb; - int provider_code; + unsigned int user_identifier; bytestream2_init(&gb, p->itut_t35->payload, p->itut_t35->payload_size); + bytestream2_skip(&gb, 1); // terminal provider code + bytestream2_skip(&gb, 1); // terminal provider oriented code + user_identifier = bytestream2_get_be32(&gb); + switch (user_identifier) { + case MKBETAG('G', 'A', '9', '4'): { // closed captions + AVBufferRef *buf = NULL; - provider_code = bytestream2_get_be16(&gb); - switch (provider_code) { - case 0x31: { // atsc_provider_code - uint32_t user_identifier = bytestream2_get_be32(&gb); - switch (user_identifier) { - case MKBETAG('G', 'A', '9', '4'): { // closed captions - AVBufferRef *buf = NULL; - - res = ff_parse_a53_cc(&buf, gb.buffer, bytestream2_get_bytes_left(&gb)); - if (res < 0) - goto fail; - if (!res) - break; - - if (!av_frame_new_side_data_from_buf(frame, AV_FRAME_DATA_A53_CC, buf)) - av_buffer_unref(&buf); - - c->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS; - break; - } - default: // ignore unsupported identifiers - break; - } - break; - } - case 0x3C: { // smpte_provider_code - AVDynamicHDRPlus *hdrplus; - int provider_oriented_code = bytestream2_get_be16(&gb); - int application_identifier = bytestream2_get_byte(&gb); - - if (p->itut_t35->country_code != 0xB5 || - provider_oriented_code != 1 || application_identifier != 4) - break; - - hdrplus = av_dynamic_hdr_plus_create_side_data(frame); - if (!hdrplus) { - res = AVERROR(ENOMEM); - goto fail; - } - - res = av_dynamic_hdr_plus_from_t35(hdrplus, gb.buffer, - bytestream2_get_bytes_left(&gb)); + res = ff_parse_a53_cc(&buf, gb.buffer, bytestream2_get_bytes_left(&gb)); if (res < 0) goto fail; + if (!res) + break; + + if (!av_frame_new_side_data_from_buf(frame, AV_FRAME_DATA_A53_CC, buf)) + av_buffer_unref(&buf); + + c->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS; break; } - default: // ignore unsupported provider codes + default: // ignore unsupported identifiers break; } } diff --git a/media/ffvpx/libavcodec/libopus.c b/media/ffvpx/libavcodec/libopus.c deleted file mode 100644 index 3d3b740a83c3..000000000000 --- a/media/ffvpx/libavcodec/libopus.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * libopus encoder/decoder common code - * Copyright (c) 2012 Nicolas George - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include - -#include "libavutil/error.h" -#include "libopus.h" - -int ff_opus_error_to_averror(int err) -{ - switch (err) { - case OPUS_BAD_ARG: - return AVERROR(EINVAL); - case OPUS_BUFFER_TOO_SMALL: - return AVERROR_UNKNOWN; - case OPUS_INTERNAL_ERROR: - return AVERROR(EFAULT); - case OPUS_INVALID_PACKET: - return AVERROR_INVALIDDATA; - case OPUS_UNIMPLEMENTED: - return AVERROR(ENOSYS); - case OPUS_INVALID_STATE: - return AVERROR_UNKNOWN; - case OPUS_ALLOC_FAIL: - return AVERROR(ENOMEM); - default: - return AVERROR(EINVAL); - } -} diff --git a/media/ffvpx/libavcodec/libopus.h b/media/ffvpx/libavcodec/libopus.h deleted file mode 100644 index a8223d1d6f1d..000000000000 --- a/media/ffvpx/libavcodec/libopus.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * libopus encoder/decoder common code - * Copyright (c) 2012 Nicolas George - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVCODEC_LIBOPUS_H -#define AVCODEC_LIBOPUS_H - -int ff_opus_error_to_averror(int err); - -#endif /* AVCODEC_LIBOPUS_H */ diff --git a/media/ffvpx/libavcodec/libopusdec.c b/media/ffvpx/libavcodec/libopusdec.c deleted file mode 100644 index 9b9a61034308..000000000000 --- a/media/ffvpx/libavcodec/libopusdec.c +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Opus decoder using libopus - * Copyright (c) 2012 Nicolas George - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include -#include - -#include "libavutil/internal.h" -#include "libavutil/intreadwrite.h" -#include "libavutil/ffmath.h" -#include "libavutil/opt.h" - -#include "avcodec.h" -#include "codec_internal.h" -#include "decode.h" -#include "internal.h" -#include "mathops.h" -#include "libopus.h" -#include "vorbis_data.h" - -struct libopus_context { - AVClass *class; - OpusMSDecoder *dec; - int pre_skip; -#ifndef OPUS_SET_GAIN - union { int i; double d; } gain; -#endif -#ifdef OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST - int apply_phase_inv; -#endif -}; - -#define OPUS_HEAD_SIZE 19 - -static av_cold int libopus_decode_init(AVCodecContext *avc) -{ - struct libopus_context *opus = avc->priv_data; - int ret, channel_map = 0, gain_db = 0, nb_streams, nb_coupled, channels; - uint8_t mapping_arr[8] = { 0, 1 }, *mapping; - - channels = avc->extradata_size >= 10 ? avc->extradata[9] : (avc->ch_layout.nb_channels == 1) ? 1 : 2; - if (channels <= 0) { - av_log(avc, AV_LOG_WARNING, - "Invalid number of channels %d, defaulting to stereo\n", channels); - channels = 2; - } - - avc->sample_rate = 48000; - avc->sample_fmt = avc->request_sample_fmt == AV_SAMPLE_FMT_FLT ? - AV_SAMPLE_FMT_FLT : AV_SAMPLE_FMT_S16; - av_channel_layout_uninit(&avc->ch_layout); - if (channels > 8) { - avc->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; - avc->ch_layout.nb_channels = channels; - } else { - av_channel_layout_copy(&avc->ch_layout, &ff_vorbis_ch_layouts[channels - 1]); - } - - if (avc->extradata_size >= OPUS_HEAD_SIZE) { - opus->pre_skip = AV_RL16(avc->extradata + 10); - gain_db = sign_extend(AV_RL16(avc->extradata + 16), 16); - channel_map = AV_RL8 (avc->extradata + 18); - } - if (avc->extradata_size >= OPUS_HEAD_SIZE + 2 + channels) { - nb_streams = avc->extradata[OPUS_HEAD_SIZE + 0]; - nb_coupled = avc->extradata[OPUS_HEAD_SIZE + 1]; - if (nb_streams + nb_coupled != channels) - av_log(avc, AV_LOG_WARNING, "Inconsistent channel mapping.\n"); - mapping = avc->extradata + OPUS_HEAD_SIZE + 2; - } else { - if (channels > 2 || channel_map) { - av_log(avc, AV_LOG_ERROR, - "No channel mapping for %d channels.\n", channels); - return AVERROR(EINVAL); - } - nb_streams = 1; - nb_coupled = channels > 1; - mapping = mapping_arr; - } - - if (channels > 2 && channels <= 8) { - const uint8_t *vorbis_offset = ff_vorbis_channel_layout_offsets[channels - 1]; - int ch; - - /* Remap channels from Vorbis order to ffmpeg order */ - for (ch = 0; ch < channels; ch++) - mapping_arr[ch] = mapping[vorbis_offset[ch]]; - mapping = mapping_arr; - } - - opus->dec = opus_multistream_decoder_create(avc->sample_rate, channels, - nb_streams, nb_coupled, - mapping, &ret); - if (!opus->dec) { - av_log(avc, AV_LOG_ERROR, "Unable to create decoder: %s\n", - opus_strerror(ret)); - return ff_opus_error_to_averror(ret); - } - -#ifdef OPUS_SET_GAIN - ret = opus_multistream_decoder_ctl(opus->dec, OPUS_SET_GAIN(gain_db)); - if (ret != OPUS_OK) - av_log(avc, AV_LOG_WARNING, "Failed to set gain: %s\n", - opus_strerror(ret)); -#else - { - double gain_lin = ff_exp10(gain_db / (20.0 * 256)); - if (avc->sample_fmt == AV_SAMPLE_FMT_FLT) - opus->gain.d = gain_lin; - else - opus->gain.i = FFMIN(gain_lin * 65536, INT_MAX); - } -#endif - -#ifdef OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST - ret = opus_multistream_decoder_ctl(opus->dec, - OPUS_SET_PHASE_INVERSION_DISABLED(!opus->apply_phase_inv)); - if (ret != OPUS_OK) - av_log(avc, AV_LOG_WARNING, - "Unable to set phase inversion: %s\n", - opus_strerror(ret)); -#endif - - /* Decoder delay (in samples) at 48kHz */ - avc->delay = avc->internal->skip_samples = opus->pre_skip; - - return 0; -} - -static av_cold int libopus_decode_close(AVCodecContext *avc) -{ - struct libopus_context *opus = avc->priv_data; - - if (opus->dec) { - opus_multistream_decoder_destroy(opus->dec); - opus->dec = NULL; - } - return 0; -} - -#define MAX_FRAME_SIZE (960 * 6) - -static int libopus_decode(AVCodecContext *avc, AVFrame *frame, - int *got_frame_ptr, AVPacket *pkt) -{ - struct libopus_context *opus = avc->priv_data; - int ret, nb_samples; - - frame->nb_samples = MAX_FRAME_SIZE; - if ((ret = ff_get_buffer(avc, frame, 0)) < 0) - return ret; - - if (avc->sample_fmt == AV_SAMPLE_FMT_S16) - nb_samples = opus_multistream_decode(opus->dec, pkt->data, pkt->size, - (opus_int16 *)frame->data[0], - frame->nb_samples, 0); - else - nb_samples = opus_multistream_decode_float(opus->dec, pkt->data, pkt->size, - (float *)frame->data[0], - frame->nb_samples, 0); - - if (nb_samples < 0) { - av_log(avc, AV_LOG_ERROR, "Decoding error: %s\n", - opus_strerror(nb_samples)); - return ff_opus_error_to_averror(nb_samples); - } - -#ifndef OPUS_SET_GAIN - { - int i = avc->ch_layout.nb_channels * nb_samples; - if (avc->sample_fmt == AV_SAMPLE_FMT_FLT) { - float *pcm = (float *)frame->data[0]; - for (; i > 0; i--, pcm++) - *pcm = av_clipf(*pcm * opus->gain.d, -1, 1); - } else { - int16_t *pcm = (int16_t *)frame->data[0]; - for (; i > 0; i--, pcm++) - *pcm = av_clip_int16(((int64_t)opus->gain.i * *pcm) >> 16); - } - } -#endif - - frame->nb_samples = nb_samples; - *got_frame_ptr = 1; - - return pkt->size; -} - -static void libopus_flush(AVCodecContext *avc) -{ - struct libopus_context *opus = avc->priv_data; - - opus_multistream_decoder_ctl(opus->dec, OPUS_RESET_STATE); - /* The stream can have been extracted by a tool that is not Opus-aware. - Therefore, any packet can become the first of the stream. */ - avc->internal->skip_samples = opus->pre_skip; -} - - -#define OFFSET(x) offsetof(struct libopus_context, x) -#define FLAGS AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM -static const AVOption libopusdec_options[] = { -#ifdef OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST - { "apply_phase_inv", "Apply intensity stereo phase inversion", OFFSET(apply_phase_inv), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, FLAGS }, -#endif - { NULL }, -}; - -static const AVClass libopusdec_class = { - .class_name = "libopusdec", - .item_name = av_default_item_name, - .option = libopusdec_options, - .version = LIBAVUTIL_VERSION_INT, -}; - - -const FFCodec ff_libopus_decoder = { - .p.name = "libopus", - CODEC_LONG_NAME("libopus Opus"), - .p.type = AVMEDIA_TYPE_AUDIO, - .p.id = AV_CODEC_ID_OPUS, - .priv_data_size = sizeof(struct libopus_context), - .init = libopus_decode_init, - .close = libopus_decode_close, - FF_CODEC_DECODE_CB(libopus_decode), - .flush = libopus_flush, - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | - FF_CODEC_CAP_INIT_CLEANUP, - .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT, - AV_SAMPLE_FMT_S16, - AV_SAMPLE_FMT_NONE }, - .p.priv_class = &libopusdec_class, - .p.wrapper_name = "libopus", -}; diff --git a/media/ffvpx/libavcodec/libvorbisdec.c b/media/ffvpx/libavcodec/libvorbisdec.c deleted file mode 100644 index a5e7a691d66f..000000000000 --- a/media/ffvpx/libavcodec/libvorbisdec.c +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright (c) 2002 Mark Hills - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include - -#include "avcodec.h" -#include "bytestream.h" -#include "codec_internal.h" -#include "decode.h" - -typedef struct OggVorbisDecContext { - vorbis_info vi; /**< vorbis_info used during init */ - vorbis_dsp_state vd; /**< DSP state used for analysis */ - vorbis_block vb; /**< vorbis_block used for analysis */ - vorbis_comment vc; /**< VorbisComment info */ - ogg_packet op; /**< ogg packet */ -} OggVorbisDecContext; - -static int oggvorbis_decode_close(AVCodecContext *avccontext); - -static int oggvorbis_decode_init(AVCodecContext *avccontext) { - OggVorbisDecContext *context = avccontext->priv_data ; - uint8_t *p= avccontext->extradata; - int i, hsizes[3], ret; - unsigned char *headers[3], *extradata = avccontext->extradata; - - if(! avccontext->extradata_size || ! p) { - av_log(avccontext, AV_LOG_ERROR, "vorbis extradata absent\n"); - return AVERROR(EINVAL); - } - - vorbis_info_init(&context->vi) ; - vorbis_comment_init(&context->vc) ; - - if(p[0] == 0 && p[1] == 30) { - int sizesum = 0; - for(i = 0; i < 3; i++){ - hsizes[i] = bytestream_get_be16((const uint8_t **)&p); - sizesum += 2 + hsizes[i]; - if (sizesum > avccontext->extradata_size) { - av_log(avccontext, AV_LOG_ERROR, "vorbis extradata too small\n"); - ret = AVERROR_INVALIDDATA; - goto error; - } - - headers[i] = p; - p += hsizes[i]; - } - } else if(*p == 2) { - unsigned int offset = 1; - unsigned int sizesum = 1; - p++; - for(i=0; i<2; i++) { - hsizes[i] = 0; - while((*p == 0xFF) && (sizesum < avccontext->extradata_size)) { - hsizes[i] += 0xFF; - offset++; - sizesum += 1 + 0xFF; - p++; - } - hsizes[i] += *p; - offset++; - sizesum += 1 + *p; - if(sizesum > avccontext->extradata_size) { - av_log(avccontext, AV_LOG_ERROR, - "vorbis header sizes damaged\n"); - ret = AVERROR_INVALIDDATA; - goto error; - } - p++; - } - hsizes[2] = avccontext->extradata_size - hsizes[0]-hsizes[1]-offset; -#if 0 - av_log(avccontext, AV_LOG_DEBUG, - "vorbis header sizes: %d, %d, %d, / extradata_len is %d \n", - hsizes[0], hsizes[1], hsizes[2], avccontext->extradata_size); -#endif - headers[0] = extradata + offset; - headers[1] = extradata + offset + hsizes[0]; - headers[2] = extradata + offset + hsizes[0] + hsizes[1]; - } else { - av_log(avccontext, AV_LOG_ERROR, - "vorbis initial header len is wrong: %d\n", *p); - ret = AVERROR_INVALIDDATA; - goto error; - } - - for(i=0; i<3; i++){ - context->op.b_o_s= i==0; - context->op.bytes = hsizes[i]; - context->op.packet = headers[i]; - if(vorbis_synthesis_headerin(&context->vi, &context->vc, &context->op)<0){ - av_log(avccontext, AV_LOG_ERROR, "%d. vorbis header damaged\n", i+1); - ret = AVERROR_INVALIDDATA; - goto error; - } - } - - av_channel_layout_uninit(&avccontext->ch_layout); - avccontext->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; - avccontext->ch_layout.nb_channels = context->vi.channels; - avccontext->sample_rate = context->vi.rate; - avccontext->sample_fmt = AV_SAMPLE_FMT_S16; - avccontext->time_base= (AVRational){1, avccontext->sample_rate}; - - vorbis_synthesis_init(&context->vd, &context->vi); - vorbis_block_init(&context->vd, &context->vb); - - return 0 ; - - error: - oggvorbis_decode_close(avccontext); - return ret; -} - - -static inline int conv(int samples, float **pcm, char *buf, int channels) { - int i, j; - ogg_int16_t *ptr, *data = (ogg_int16_t*)buf ; - float *mono ; - - for(i = 0 ; i < channels ; i++){ - ptr = &data[i]; - mono = pcm[i] ; - - for(j = 0 ; j < samples ; j++) { - *ptr = av_clip_int16(mono[j] * 32767.f); - ptr += channels; - } - } - - return 0 ; -} - -static int oggvorbis_decode_frame(AVCodecContext *avccontext, AVFrame *frame, - int *got_frame_ptr, AVPacket *avpkt) -{ - OggVorbisDecContext *context = avccontext->priv_data ; - float **pcm ; - ogg_packet *op= &context->op; - int samples, total_samples, total_bytes; - int ret; - int16_t *output; - - if(!avpkt->size){ - //FIXME flush - return 0; - } - - frame->nb_samples = 8192*4; - if ((ret = ff_get_buffer(avccontext, frame, 0)) < 0) - return ret; - output = (int16_t *)frame->data[0]; - - - op->packet = avpkt->data; - op->bytes = avpkt->size; - -// av_log(avccontext, AV_LOG_DEBUG, "%d %d %d %"PRId64" %"PRId64" %d %d\n", op->bytes, op->b_o_s, op->e_o_s, op->granulepos, op->packetno, buf_size, context->vi.rate); - -/* for(i=0; ibytes; i++) - av_log(avccontext, AV_LOG_DEBUG, "%02X ", op->packet[i]); - av_log(avccontext, AV_LOG_DEBUG, "\n");*/ - - if(vorbis_synthesis(&context->vb, op) == 0) - vorbis_synthesis_blockin(&context->vd, &context->vb) ; - - total_samples = 0 ; - total_bytes = 0 ; - - while((samples = vorbis_synthesis_pcmout(&context->vd, &pcm)) > 0) { - conv(samples, pcm, (char*)output + total_bytes, context->vi.channels) ; - total_bytes += samples * 2 * context->vi.channels ; - total_samples += samples ; - vorbis_synthesis_read(&context->vd, samples) ; - } - - frame->nb_samples = total_samples; - *got_frame_ptr = total_samples > 0; - return avpkt->size; -} - - -static int oggvorbis_decode_close(AVCodecContext *avccontext) { - OggVorbisDecContext *context = avccontext->priv_data ; - - vorbis_block_clear(&context->vb); - vorbis_dsp_clear(&context->vd); - vorbis_info_clear(&context->vi) ; - vorbis_comment_clear(&context->vc) ; - - return 0 ; -} - - -const FFCodec ff_libvorbis_decoder = { - .p.name = "libvorbis", - CODEC_LONG_NAME("libvorbis"), - .p.type = AVMEDIA_TYPE_AUDIO, - .p.id = AV_CODEC_ID_VORBIS, - .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_CHANNEL_CONF, - .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, - .priv_data_size = sizeof(OggVorbisDecContext), - .init = oggvorbis_decode_init, - FF_CODEC_DECODE_CB(oggvorbis_decode_frame), - .close = oggvorbis_decode_close, -}; diff --git a/media/ffvpx/libavcodec/moz.build b/media/ffvpx/libavcodec/moz.build index 750def0cb3fc..5675c28234a1 100644 --- a/media/ffvpx/libavcodec/moz.build +++ b/media/ffvpx/libavcodec/moz.build @@ -46,9 +46,6 @@ SOURCES += [ 'jfdctfst.c', 'jfdctint.c', 'jrevdct.c', - 'libopus.c', - 'libopusdec.c', - 'libvorbisdec.c', 'log2_tab.c', 'mpegaudio.c', 'mpegaudiodata.c', @@ -64,7 +61,6 @@ SOURCES += [ 'options.c', 'parser.c', 'parsers.c', - 'pcm.c', 'profiles.c', 'pthread.c', 'pthread_frame.c', @@ -75,7 +71,6 @@ SOURCES += [ 'utils.c', 'version.c', 'vlc.c', - 'vorbis_data.c', 'vorbis_parser.c', 'xiph.c' ] @@ -130,11 +125,6 @@ if not CONFIG['MOZ_FFVPX_AUDIOONLY']: 'mozva' ] -LOCAL_INCLUDES += [ - '/media/libopus/include', - '/media/libvorbis', -] - if CONFIG['MOZ_LIBAV_FFT']: SOURCES += [ 'avfft.c', diff --git a/media/ffvpx/libavcodec/options_table.h b/media/ffvpx/libavcodec/options_table.h index f331ce28619d..4fea57673ad0 100644 --- a/media/ffvpx/libavcodec/options_table.h +++ b/media/ffvpx/libavcodec/options_table.h @@ -177,9 +177,7 @@ static const AVOption avcodec_options[] = { {"xvidmmx", "deprecated, for compatibility only", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_XVID }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"faani", "floating point AAN IDCT", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_FAAN }, INT_MIN, INT_MAX, V|D|E, "idct"}, {"simpleauto", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEAUTO }, INT_MIN, INT_MAX, V|E|D, "idct"}, -#if FF_API_SLICE_OFFSET {"slice_count", NULL, OFFSET(slice_count), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX}, -#endif {"ec", "set error concealment strategy", OFFSET(error_concealment), AV_OPT_TYPE_FLAGS, {.i64 = 3 }, INT_MIN, INT_MAX, V|D, "ec"}, {"guess_mvs", "iterative motion vector (MV) search (slow)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_EC_GUESS_MVS }, INT_MIN, INT_MAX, V|D, "ec"}, {"deblock", "use strong deblock filter for damaged MBs", 0, AV_OPT_TYPE_CONST, {.i64 = FF_EC_DEBLOCK }, INT_MIN, INT_MAX, V|D, "ec"}, diff --git a/media/ffvpx/libavcodec/pcm.c b/media/ffvpx/libavcodec/pcm.c deleted file mode 100644 index 23955ba2ddfd..000000000000 --- a/media/ffvpx/libavcodec/pcm.c +++ /dev/null @@ -1,630 +0,0 @@ -/* - * PCM codecs - * Copyright (c) 2001 Fabrice Bellard - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/** - * @file - * PCM codecs - */ - -#include "config.h" -#include "config_components.h" -#include "libavutil/attributes.h" -#include "libavutil/float_dsp.h" -#include "libavutil/reverse.h" -#include "libavutil/thread.h" -#include "avcodec.h" -#include "bytestream.h" -#include "codec_internal.h" -#include "decode.h" -#include "encode.h" -#include "pcm_tablegen.h" - -static av_cold int pcm_encode_init(AVCodecContext *avctx) -{ - avctx->frame_size = 0; -#if !CONFIG_HARDCODED_TABLES - switch (avctx->codec->id) { -#define INIT_ONCE(id, name) \ - case AV_CODEC_ID_PCM_ ## id: \ - if (CONFIG_PCM_ ## id ## _ENCODER) { \ - static AVOnce init_static_once = AV_ONCE_INIT; \ - ff_thread_once(&init_static_once, pcm_ ## name ## _tableinit); \ - } \ - break - INIT_ONCE(ALAW, alaw); - INIT_ONCE(MULAW, ulaw); - INIT_ONCE(VIDC, vidc); - default: - break; - } -#endif - - avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id); - avctx->block_align = avctx->ch_layout.nb_channels * avctx->bits_per_coded_sample / 8; - avctx->bit_rate = avctx->block_align * 8LL * avctx->sample_rate; - - return 0; -} - -/** - * Write PCM samples macro - * @param type Datatype of native machine format - * @param endian bytestream_put_xxx() suffix - * @param src Source pointer (variable name) - * @param dst Destination pointer (variable name) - * @param n Total number of samples (variable name) - * @param shift Bitshift (bits) - * @param offset Sample value offset - */ -#define ENCODE(type, endian, src, dst, n, shift, offset) \ - samples_ ## type = (const type *) src; \ - for (; n > 0; n--) { \ - register type v = (*samples_ ## type++ >> shift) + offset; \ - bytestream_put_ ## endian(&dst, v); \ - } - -#define ENCODE_PLANAR(type, endian, dst, n, shift, offset) \ - n /= avctx->ch_layout.nb_channels; \ - for (c = 0; c < avctx->ch_layout.nb_channels; c++) { \ - int i; \ - samples_ ## type = (const type *) frame->extended_data[c]; \ - for (i = n; i > 0; i--) { \ - register type v = (*samples_ ## type++ >> shift) + offset; \ - bytestream_put_ ## endian(&dst, v); \ - } \ - } - -static int pcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, - const AVFrame *frame, int *got_packet_ptr) -{ - int n, c, sample_size, v, ret; - const short *samples; - unsigned char *dst; - const uint8_t *samples_uint8_t; - const int16_t *samples_int16_t; - const int32_t *samples_int32_t; - const int64_t *samples_int64_t; - const uint16_t *samples_uint16_t; - const uint32_t *samples_uint32_t; - - sample_size = av_get_bits_per_sample(avctx->codec->id) / 8; - n = frame->nb_samples * avctx->ch_layout.nb_channels; - samples = (const short *)frame->data[0]; - - if ((ret = ff_get_encode_buffer(avctx, avpkt, n * sample_size, 0)) < 0) - return ret; - dst = avpkt->data; - - switch (avctx->codec->id) { - case AV_CODEC_ID_PCM_U32LE: - ENCODE(uint32_t, le32, samples, dst, n, 0, 0x80000000) - break; - case AV_CODEC_ID_PCM_U32BE: - ENCODE(uint32_t, be32, samples, dst, n, 0, 0x80000000) - break; - case AV_CODEC_ID_PCM_S24LE: - ENCODE(int32_t, le24, samples, dst, n, 8, 0) - break; - case AV_CODEC_ID_PCM_S24LE_PLANAR: - ENCODE_PLANAR(int32_t, le24, dst, n, 8, 0) - break; - case AV_CODEC_ID_PCM_S24BE: - ENCODE(int32_t, be24, samples, dst, n, 8, 0) - break; - case AV_CODEC_ID_PCM_U24LE: - ENCODE(uint32_t, le24, samples, dst, n, 8, 0x800000) - break; - case AV_CODEC_ID_PCM_U24BE: - ENCODE(uint32_t, be24, samples, dst, n, 8, 0x800000) - break; - case AV_CODEC_ID_PCM_S24DAUD: - for (; n > 0; n--) { - uint32_t tmp = ff_reverse[(*samples >> 8) & 0xff] + - (ff_reverse[*samples & 0xff] << 8); - tmp <<= 4; // sync flags would go here - bytestream_put_be24(&dst, tmp); - samples++; - } - break; - case AV_CODEC_ID_PCM_U16LE: - ENCODE(uint16_t, le16, samples, dst, n, 0, 0x8000) - break; - case AV_CODEC_ID_PCM_U16BE: - ENCODE(uint16_t, be16, samples, dst, n, 0, 0x8000) - break; - case AV_CODEC_ID_PCM_S8: - ENCODE(uint8_t, byte, samples, dst, n, 0, -128) - break; - case AV_CODEC_ID_PCM_S8_PLANAR: - ENCODE_PLANAR(uint8_t, byte, dst, n, 0, -128) - break; -#if HAVE_BIGENDIAN - case AV_CODEC_ID_PCM_S64LE: - case AV_CODEC_ID_PCM_F64LE: - ENCODE(int64_t, le64, samples, dst, n, 0, 0) - break; - case AV_CODEC_ID_PCM_S32LE: - case AV_CODEC_ID_PCM_F32LE: - ENCODE(int32_t, le32, samples, dst, n, 0, 0) - break; - case AV_CODEC_ID_PCM_S32LE_PLANAR: - ENCODE_PLANAR(int32_t, le32, dst, n, 0, 0) - break; - case AV_CODEC_ID_PCM_S16LE: - ENCODE(int16_t, le16, samples, dst, n, 0, 0) - break; - case AV_CODEC_ID_PCM_S16LE_PLANAR: - ENCODE_PLANAR(int16_t, le16, dst, n, 0, 0) - break; - case AV_CODEC_ID_PCM_F64BE: - case AV_CODEC_ID_PCM_F32BE: - case AV_CODEC_ID_PCM_S64BE: - case AV_CODEC_ID_PCM_S32BE: - case AV_CODEC_ID_PCM_S16BE: -#else - case AV_CODEC_ID_PCM_S64BE: - case AV_CODEC_ID_PCM_F64BE: - ENCODE(int64_t, be64, samples, dst, n, 0, 0) - break; - case AV_CODEC_ID_PCM_F32BE: - case AV_CODEC_ID_PCM_S32BE: - ENCODE(int32_t, be32, samples, dst, n, 0, 0) - break; - case AV_CODEC_ID_PCM_S16BE: - ENCODE(int16_t, be16, samples, dst, n, 0, 0) - break; - case AV_CODEC_ID_PCM_S16BE_PLANAR: - ENCODE_PLANAR(int16_t, be16, dst, n, 0, 0) - break; - case AV_CODEC_ID_PCM_F64LE: - case AV_CODEC_ID_PCM_F32LE: - case AV_CODEC_ID_PCM_S64LE: - case AV_CODEC_ID_PCM_S32LE: - case AV_CODEC_ID_PCM_S16LE: -#endif /* HAVE_BIGENDIAN */ - case AV_CODEC_ID_PCM_U8: - memcpy(dst, samples, n * sample_size); - break; -#if HAVE_BIGENDIAN - case AV_CODEC_ID_PCM_S16BE_PLANAR: -#else - case AV_CODEC_ID_PCM_S16LE_PLANAR: - case AV_CODEC_ID_PCM_S32LE_PLANAR: -#endif /* HAVE_BIGENDIAN */ - n /= avctx->ch_layout.nb_channels; - for (c = 0; c < avctx->ch_layout.nb_channels; c++) { - const uint8_t *src = frame->extended_data[c]; - bytestream_put_buffer(&dst, src, n * sample_size); - } - break; - case AV_CODEC_ID_PCM_ALAW: - for (; n > 0; n--) { - v = *samples++; - *dst++ = linear_to_alaw[(v + 32768) >> 2]; - } - break; - case AV_CODEC_ID_PCM_MULAW: - for (; n > 0; n--) { - v = *samples++; - *dst++ = linear_to_ulaw[(v + 32768) >> 2]; - } - break; - case AV_CODEC_ID_PCM_VIDC: - for (; n > 0; n--) { - v = *samples++; - *dst++ = linear_to_vidc[(v + 32768) >> 2]; - } - break; - default: - return -1; - } - - *got_packet_ptr = 1; - return 0; -} - -typedef struct PCMDecode { - short table[256]; - void (*vector_fmul_scalar)(float *dst, const float *src, float mul, - int len); - float scale; -} PCMDecode; - -static av_cold int pcm_decode_init(AVCodecContext *avctx) -{ - PCMDecode *s = avctx->priv_data; - AVFloatDSPContext *fdsp; - int i; - - switch (avctx->codec_id) { - case AV_CODEC_ID_PCM_ALAW: - for (i = 0; i < 256; i++) - s->table[i] = alaw2linear(i); - break; - case AV_CODEC_ID_PCM_MULAW: - for (i = 0; i < 256; i++) - s->table[i] = ulaw2linear(i); - break; - case AV_CODEC_ID_PCM_VIDC: - for (i = 0; i < 256; i++) - s->table[i] = vidc2linear(i); - break; - case AV_CODEC_ID_PCM_F16LE: - case AV_CODEC_ID_PCM_F24LE: - if (avctx->bits_per_coded_sample < 1 || avctx->bits_per_coded_sample > 24) - return AVERROR_INVALIDDATA; - - s->scale = 1. / (1 << (avctx->bits_per_coded_sample - 1)); - fdsp = avpriv_float_dsp_alloc(0); - if (!fdsp) - return AVERROR(ENOMEM); - s->vector_fmul_scalar = fdsp->vector_fmul_scalar; - av_free(fdsp); - break; - default: - break; - } - - avctx->sample_fmt = avctx->codec->sample_fmts[0]; - - if (avctx->sample_fmt == AV_SAMPLE_FMT_S32) - avctx->bits_per_raw_sample = av_get_bits_per_sample(avctx->codec_id); - - return 0; -} - -/** - * Read PCM samples macro - * @param size Data size of native machine format - * @param endian bytestream_get_xxx() endian suffix - * @param src Source pointer (variable name) - * @param dst Destination pointer (variable name) - * @param n Total number of samples (variable name) - * @param shift Bitshift (bits) - * @param offset Sample value offset - */ -#define DECODE(size, endian, src, dst, n, shift, offset) \ - for (; n > 0; n--) { \ - uint ## size ## _t v = bytestream_get_ ## endian(&src); \ - AV_WN ## size ## A(dst, (uint ## size ## _t)(v - offset) << shift); \ - dst += size / 8; \ - } - -#define DECODE_PLANAR(size, endian, src, dst, n, shift, offset) \ - n /= channels; \ - for (c = 0; c < avctx->ch_layout.nb_channels; c++) { \ - int i; \ - dst = frame->extended_data[c]; \ - for (i = n; i > 0; i--) { \ - uint ## size ## _t v = bytestream_get_ ## endian(&src); \ - AV_WN ## size ## A(dst, (uint ## size ##_t)(v - offset) << shift); \ - dst += size / 8; \ - } \ - } - -static int pcm_decode_frame(AVCodecContext *avctx, AVFrame *frame, - int *got_frame_ptr, AVPacket *avpkt) -{ - const uint8_t *src = avpkt->data; - int buf_size = avpkt->size; - PCMDecode *s = avctx->priv_data; - int channels = avctx->ch_layout.nb_channels; - int sample_size, c, n, ret, samples_per_block; - uint8_t *samples; - int32_t *dst_int32_t; - - sample_size = av_get_bits_per_sample(avctx->codec_id) / 8; - - /* av_get_bits_per_sample returns 0 for AV_CODEC_ID_PCM_DVD */ - samples_per_block = 1; - if (avctx->codec_id == AV_CODEC_ID_PCM_LXF) { - /* we process 40-bit blocks per channel for LXF */ - samples_per_block = 2; - sample_size = 5; - } - - if (sample_size == 0) { - av_log(avctx, AV_LOG_ERROR, "Invalid sample_size\n"); - return AVERROR(EINVAL); - } - - if (channels == 0) { - av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n"); - return AVERROR(EINVAL); - } - - if (avctx->codec_id != avctx->codec->id) { - av_log(avctx, AV_LOG_ERROR, "codec ids mismatch\n"); - return AVERROR(EINVAL); - } - - n = channels * sample_size; - - if (n && buf_size % n) { - if (buf_size < n) { - av_log(avctx, AV_LOG_ERROR, - "Invalid PCM packet, data has size %d but at least a size of %d was expected\n", - buf_size, n); - return AVERROR_INVALIDDATA; - } else - buf_size -= buf_size % n; - } - - n = buf_size / sample_size; - - /* get output buffer */ - frame->nb_samples = n * samples_per_block / channels; - if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) - return ret; - samples = frame->data[0]; - - switch (avctx->codec_id) { - case AV_CODEC_ID_PCM_U32LE: - DECODE(32, le32, src, samples, n, 0, 0x80000000) - break; - case AV_CODEC_ID_PCM_U32BE: - DECODE(32, be32, src, samples, n, 0, 0x80000000) - break; - case AV_CODEC_ID_PCM_S24LE: - DECODE(32, le24, src, samples, n, 8, 0) - break; - case AV_CODEC_ID_PCM_S24LE_PLANAR: - DECODE_PLANAR(32, le24, src, samples, n, 8, 0); - break; - case AV_CODEC_ID_PCM_S24BE: - DECODE(32, be24, src, samples, n, 8, 0) - break; - case AV_CODEC_ID_PCM_U24LE: - DECODE(32, le24, src, samples, n, 8, 0x800000) - break; - case AV_CODEC_ID_PCM_U24BE: - DECODE(32, be24, src, samples, n, 8, 0x800000) - break; - case AV_CODEC_ID_PCM_S24DAUD: - for (; n > 0; n--) { - uint32_t v = bytestream_get_be24(&src); - v >>= 4; // sync flags are here - AV_WN16A(samples, ff_reverse[(v >> 8) & 0xff] + - (ff_reverse[v & 0xff] << 8)); - samples += 2; - } - break; - case AV_CODEC_ID_PCM_U16LE: - DECODE(16, le16, src, samples, n, 0, 0x8000) - break; - case AV_CODEC_ID_PCM_U16BE: - DECODE(16, be16, src, samples, n, 0, 0x8000) - break; - case AV_CODEC_ID_PCM_S8: - for (; n > 0; n--) - *samples++ = *src++ + 128; - break; - case AV_CODEC_ID_PCM_SGA: - for (; n > 0; n--) { - int sign = *src >> 7; - int magn = *src & 0x7f; - *samples++ = sign ? 128 - magn : 128 + magn; - src++; - } - break; - case AV_CODEC_ID_PCM_S8_PLANAR: - n /= avctx->ch_layout.nb_channels; - for (c = 0; c < avctx->ch_layout.nb_channels; c++) { - int i; - samples = frame->extended_data[c]; - for (i = n; i > 0; i--) - *samples++ = *src++ + 128; - } - break; -#if HAVE_BIGENDIAN - case AV_CODEC_ID_PCM_S64LE: - case AV_CODEC_ID_PCM_F64LE: - DECODE(64, le64, src, samples, n, 0, 0) - break; - case AV_CODEC_ID_PCM_S32LE: - case AV_CODEC_ID_PCM_F32LE: - case AV_CODEC_ID_PCM_F24LE: - case AV_CODEC_ID_PCM_F16LE: - DECODE(32, le32, src, samples, n, 0, 0) - break; - case AV_CODEC_ID_PCM_S32LE_PLANAR: - DECODE_PLANAR(32, le32, src, samples, n, 0, 0); - break; - case AV_CODEC_ID_PCM_S16LE: - DECODE(16, le16, src, samples, n, 0, 0) - break; - case AV_CODEC_ID_PCM_S16LE_PLANAR: - DECODE_PLANAR(16, le16, src, samples, n, 0, 0); - break; - case AV_CODEC_ID_PCM_F64BE: - case AV_CODEC_ID_PCM_F32BE: - case AV_CODEC_ID_PCM_S64BE: - case AV_CODEC_ID_PCM_S32BE: - case AV_CODEC_ID_PCM_S16BE: -#else - case AV_CODEC_ID_PCM_S64BE: - case AV_CODEC_ID_PCM_F64BE: - DECODE(64, be64, src, samples, n, 0, 0) - break; - case AV_CODEC_ID_PCM_F32BE: - case AV_CODEC_ID_PCM_S32BE: - DECODE(32, be32, src, samples, n, 0, 0) - break; - case AV_CODEC_ID_PCM_S16BE: - DECODE(16, be16, src, samples, n, 0, 0) - break; - case AV_CODEC_ID_PCM_S16BE_PLANAR: - DECODE_PLANAR(16, be16, src, samples, n, 0, 0); - break; - case AV_CODEC_ID_PCM_F64LE: - case AV_CODEC_ID_PCM_F32LE: - case AV_CODEC_ID_PCM_F24LE: - case AV_CODEC_ID_PCM_F16LE: - case AV_CODEC_ID_PCM_S64LE: - case AV_CODEC_ID_PCM_S32LE: - case AV_CODEC_ID_PCM_S16LE: -#endif /* HAVE_BIGENDIAN */ - case AV_CODEC_ID_PCM_U8: - memcpy(samples, src, n * sample_size); - break; -#if HAVE_BIGENDIAN - case AV_CODEC_ID_PCM_S16BE_PLANAR: -#else - case AV_CODEC_ID_PCM_S16LE_PLANAR: - case AV_CODEC_ID_PCM_S32LE_PLANAR: -#endif /* HAVE_BIGENDIAN */ - n /= avctx->ch_layout.nb_channels; - for (c = 0; c < avctx->ch_layout.nb_channels; c++) { - samples = frame->extended_data[c]; - bytestream_get_buffer(&src, samples, n * sample_size); - } - break; - case AV_CODEC_ID_PCM_ALAW: - case AV_CODEC_ID_PCM_MULAW: - case AV_CODEC_ID_PCM_VIDC: - for (; n > 0; n--) { - AV_WN16A(samples, s->table[*src++]); - samples += 2; - } - break; - case AV_CODEC_ID_PCM_LXF: - { - int i; - n /= channels; - for (c = 0; c < channels; c++) { - dst_int32_t = (int32_t *)frame->extended_data[c]; - for (i = 0; i < n; i++) { - // extract low 20 bits and expand to 32 bits - *dst_int32_t++ = ((uint32_t)src[2]<<28) | - (src[1] << 20) | - (src[0] << 12) | - ((src[2] & 0x0F) << 8) | - src[1]; - // extract high 20 bits and expand to 32 bits - *dst_int32_t++ = ((uint32_t)src[4]<<24) | - (src[3] << 16) | - ((src[2] & 0xF0) << 8) | - (src[4] << 4) | - (src[3] >> 4); - src += 5; - } - } - break; - } - default: - return -1; - } - - if (avctx->codec_id == AV_CODEC_ID_PCM_F16LE || - avctx->codec_id == AV_CODEC_ID_PCM_F24LE) { - s->vector_fmul_scalar((float *)frame->extended_data[0], - (const float *)frame->extended_data[0], - s->scale, FFALIGN(frame->nb_samples * avctx->ch_layout.nb_channels, 4)); - emms_c(); - } - - *got_frame_ptr = 1; - - return buf_size; -} - -#define PCM_ENCODER_0(id_, sample_fmt_, name_, long_name_) -#define PCM_ENCODER_1(id_, sample_fmt_, name_, long_name_) \ -const FFCodec ff_ ## name_ ## _encoder = { \ - .p.name = #name_, \ - CODEC_LONG_NAME(long_name_), \ - .p.type = AVMEDIA_TYPE_AUDIO, \ - .p.id = AV_CODEC_ID_ ## id_, \ - .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_VARIABLE_FRAME_SIZE | \ - AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, \ - .init = pcm_encode_init, \ - FF_CODEC_ENCODE_CB(pcm_encode_frame), \ - .p.sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \ - AV_SAMPLE_FMT_NONE }, \ -} - -#define PCM_ENCODER_2(cf, id, sample_fmt, name, long_name) \ - PCM_ENCODER_ ## cf(id, sample_fmt, name, long_name) -#define PCM_ENCODER_3(cf, id, sample_fmt, name, long_name) \ - PCM_ENCODER_2(cf, id, sample_fmt, name, long_name) -#define PCM_ENCODER(id, sample_fmt, name, long_name) \ - PCM_ENCODER_3(CONFIG_ ## id ## _ENCODER, id, sample_fmt, name, long_name) - -#define PCM_DECODER_0(id, sample_fmt, name, long_name) -#define PCM_DECODER_1(id_, sample_fmt_, name_, long_name_) \ -const FFCodec ff_ ## name_ ## _decoder = { \ - .p.name = #name_, \ - CODEC_LONG_NAME(long_name_), \ - .p.type = AVMEDIA_TYPE_AUDIO, \ - .p.id = AV_CODEC_ID_ ## id_, \ - .priv_data_size = sizeof(PCMDecode), \ - .init = pcm_decode_init, \ - FF_CODEC_DECODE_CB(pcm_decode_frame), \ - .p.capabilities = AV_CODEC_CAP_DR1, \ - .p.sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \ - AV_SAMPLE_FMT_NONE }, \ -} - -#define PCM_DECODER_2(cf, id, sample_fmt, name, long_name) \ - PCM_DECODER_ ## cf(id, sample_fmt, name, long_name) -#define PCM_DECODER_3(cf, id, sample_fmt, name, long_name) \ - PCM_DECODER_2(cf, id, sample_fmt, name, long_name) -#define PCM_DECODER(id, sample_fmt, name, long_name) \ - PCM_DECODER_3(CONFIG_ ## id ## _DECODER, id, sample_fmt, name, long_name) - -#define PCM_CODEC(id, sample_fmt_, name, long_name_) \ - PCM_ENCODER(id, sample_fmt_, name, long_name_); \ - PCM_DECODER(id, sample_fmt_, name, long_name_) - -/* Note: Do not forget to add new entries to the Makefile as well. */ -PCM_CODEC (PCM_ALAW, AV_SAMPLE_FMT_S16, pcm_alaw, "PCM A-law / G.711 A-law"); -PCM_DECODER(PCM_F16LE, AV_SAMPLE_FMT_FLT, pcm_f16le, "PCM 16.8 floating point little-endian"); -PCM_DECODER(PCM_F24LE, AV_SAMPLE_FMT_FLT, pcm_f24le, "PCM 24.0 floating point little-endian"); -PCM_CODEC (PCM_F32BE, AV_SAMPLE_FMT_FLT, pcm_f32be, "PCM 32-bit floating point big-endian"); -PCM_CODEC (PCM_F32LE, AV_SAMPLE_FMT_FLT, pcm_f32le, "PCM 32-bit floating point little-endian"); -PCM_CODEC (PCM_F64BE, AV_SAMPLE_FMT_DBL, pcm_f64be, "PCM 64-bit floating point big-endian"); -PCM_CODEC (PCM_F64LE, AV_SAMPLE_FMT_DBL, pcm_f64le, "PCM 64-bit floating point little-endian"); -PCM_DECODER(PCM_LXF, AV_SAMPLE_FMT_S32P,pcm_lxf, "PCM signed 20-bit little-endian planar"); -PCM_CODEC (PCM_MULAW, AV_SAMPLE_FMT_S16, pcm_mulaw, "PCM mu-law / G.711 mu-law"); -PCM_CODEC (PCM_S8, AV_SAMPLE_FMT_U8, pcm_s8, "PCM signed 8-bit"); -PCM_CODEC (PCM_S8_PLANAR, AV_SAMPLE_FMT_U8P, pcm_s8_planar, "PCM signed 8-bit planar"); -PCM_CODEC (PCM_S16BE, AV_SAMPLE_FMT_S16, pcm_s16be, "PCM signed 16-bit big-endian"); -PCM_CODEC (PCM_S16BE_PLANAR, AV_SAMPLE_FMT_S16P,pcm_s16be_planar, "PCM signed 16-bit big-endian planar"); -PCM_CODEC (PCM_S16LE, AV_SAMPLE_FMT_S16, pcm_s16le, "PCM signed 16-bit little-endian"); -PCM_CODEC (PCM_S16LE_PLANAR, AV_SAMPLE_FMT_S16P,pcm_s16le_planar, "PCM signed 16-bit little-endian planar"); -PCM_CODEC (PCM_S24BE, AV_SAMPLE_FMT_S32, pcm_s24be, "PCM signed 24-bit big-endian"); -PCM_CODEC (PCM_S24DAUD, AV_SAMPLE_FMT_S16, pcm_s24daud, "PCM D-Cinema audio signed 24-bit"); -PCM_CODEC (PCM_S24LE, AV_SAMPLE_FMT_S32, pcm_s24le, "PCM signed 24-bit little-endian"); -PCM_CODEC (PCM_S24LE_PLANAR, AV_SAMPLE_FMT_S32P,pcm_s24le_planar, "PCM signed 24-bit little-endian planar"); -PCM_CODEC (PCM_S32BE, AV_SAMPLE_FMT_S32, pcm_s32be, "PCM signed 32-bit big-endian"); -PCM_CODEC (PCM_S32LE, AV_SAMPLE_FMT_S32, pcm_s32le, "PCM signed 32-bit little-endian"); -PCM_CODEC (PCM_S32LE_PLANAR, AV_SAMPLE_FMT_S32P,pcm_s32le_planar, "PCM signed 32-bit little-endian planar"); -PCM_CODEC (PCM_U8, AV_SAMPLE_FMT_U8, pcm_u8, "PCM unsigned 8-bit"); -PCM_CODEC (PCM_U16BE, AV_SAMPLE_FMT_S16, pcm_u16be, "PCM unsigned 16-bit big-endian"); -PCM_CODEC (PCM_U16LE, AV_SAMPLE_FMT_S16, pcm_u16le, "PCM unsigned 16-bit little-endian"); -PCM_CODEC (PCM_U24BE, AV_SAMPLE_FMT_S32, pcm_u24be, "PCM unsigned 24-bit big-endian"); -PCM_CODEC (PCM_U24LE, AV_SAMPLE_FMT_S32, pcm_u24le, "PCM unsigned 24-bit little-endian"); -PCM_CODEC (PCM_U32BE, AV_SAMPLE_FMT_S32, pcm_u32be, "PCM unsigned 32-bit big-endian"); -PCM_CODEC (PCM_U32LE, AV_SAMPLE_FMT_S32, pcm_u32le, "PCM unsigned 32-bit little-endian"); -PCM_CODEC (PCM_S64BE, AV_SAMPLE_FMT_S64, pcm_s64be, "PCM signed 64-bit big-endian"); -PCM_CODEC (PCM_S64LE, AV_SAMPLE_FMT_S64, pcm_s64le, "PCM signed 64-bit little-endian"); -PCM_CODEC (PCM_VIDC, AV_SAMPLE_FMT_S16, pcm_vidc, "PCM Archimedes VIDC"); -PCM_DECODER(PCM_SGA, AV_SAMPLE_FMT_U8, pcm_sga, "PCM SGA"); diff --git a/media/ffvpx/libavcodec/pcm_tablegen.h b/media/ffvpx/libavcodec/pcm_tablegen.h deleted file mode 100644 index 7274c3cd1722..000000000000 --- a/media/ffvpx/libavcodec/pcm_tablegen.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Header file for hardcoded PCM tables - * - * Copyright (c) 2010 Reimar Döffinger - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVCODEC_PCM_TABLEGEN_H -#define AVCODEC_PCM_TABLEGEN_H - -#include -#include "libavutil/attributes.h" - -/* from g711.c by SUN microsystems (unrestricted use) */ - -#define SIGN_BIT (0x80) /* Sign bit for a A-law byte. */ -#define QUANT_MASK (0xf) /* Quantization field mask. */ -#define NSEGS (8) /* Number of A-law segments. */ -#define SEG_SHIFT (4) /* Left shift for segment number. */ -#define SEG_MASK (0x70) /* Segment field mask. */ - -#define BIAS (0x84) /* Bias for linear code. */ - -#define VIDC_SIGN_BIT (1) -#define VIDC_QUANT_MASK (0x1E) -#define VIDC_QUANT_SHIFT (1) -#define VIDC_SEG_SHIFT (5) -#define VIDC_SEG_MASK (0xE0) - -/* alaw2linear() - Convert an A-law value to 16-bit linear PCM */ -static av_cold int alaw2linear(unsigned char a_val) -{ - int t; - int seg; - - a_val ^= 0x55; - - t = a_val & QUANT_MASK; - seg = ((unsigned)a_val & SEG_MASK) >> SEG_SHIFT; - if(seg) t= (t + t + 1 + 32) << (seg + 2); - else t= (t + t + 1 ) << 3; - - return (a_val & SIGN_BIT) ? t : -t; -} - -static av_cold int ulaw2linear(unsigned char u_val) -{ - int t; - - /* Complement to obtain normal u-law value. */ - u_val = ~u_val; - - /* - * Extract and bias the quantization bits. Then - * shift up by the segment number and subtract out the bias. - */ - t = ((u_val & QUANT_MASK) << 3) + BIAS; - t <<= ((unsigned)u_val & SEG_MASK) >> SEG_SHIFT; - - return (u_val & SIGN_BIT) ? (BIAS - t) : (t - BIAS); -} - -static av_cold int vidc2linear(unsigned char u_val) -{ - int t; - - /* - * Extract and bias the quantization bits. Then - * shift up by the segment number and subtract out the bias. - */ - t = (((u_val & VIDC_QUANT_MASK) >> VIDC_QUANT_SHIFT) << 3) + BIAS; - t <<= ((unsigned)u_val & VIDC_SEG_MASK) >> VIDC_SEG_SHIFT; - - return (u_val & VIDC_SIGN_BIT) ? (BIAS - t) : (t - BIAS); -} - -#if CONFIG_HARDCODED_TABLES -#define pcm_alaw_tableinit() -#define pcm_ulaw_tableinit() -#define pcm_vidc_tableinit() -#include "libavcodec/pcm_tables.h" -#else -/* 16384 entries per table */ -static uint8_t linear_to_alaw[16384]; -static uint8_t linear_to_ulaw[16384]; -static uint8_t linear_to_vidc[16384]; - -static av_cold void build_xlaw_table(uint8_t *linear_to_xlaw, - int (*xlaw2linear)(unsigned char), - int mask) -{ - int i, j, v, v1, v2; - - j = 1; - linear_to_xlaw[8192] = mask; - for(i=0;i<127;i++) { - v1 = xlaw2linear(i ^ mask); - v2 = xlaw2linear((i + 1) ^ mask); - v = (v1 + v2 + 4) >> 3; - for(;jslice_count && src->slice_offset) { if (dst->slice_count < src->slice_count) { int err = av_reallocp_array(&dst->slice_offset, src->slice_count, @@ -387,8 +385,6 @@ FF_DISABLE_DEPRECATION_WARNINGS src->slice_count * sizeof(*dst->slice_offset)); } dst->slice_count = src->slice_count; -FF_ENABLE_DEPRECATION_WARNINGS -#endif av_packet_unref(dst->internal->last_pkt_props); err = av_packet_copy_props(dst->internal->last_pkt_props, src->internal->last_pkt_props); @@ -690,11 +686,7 @@ void ff_frame_thread_free(AVCodecContext *avctx, int thread_count) av_freep(&ctx->priv_data); } -#if FF_API_SLICE_OFFSET -FF_DISABLE_DEPRECATION_WARNINGS av_freep(&ctx->slice_offset); -FF_ENABLE_DEPRECATION_WARNINGS -#endif av_buffer_unref(&ctx->internal->pool); av_packet_free(&ctx->internal->last_pkt_props); @@ -911,8 +903,10 @@ static int thread_get_buffer_internal(AVCodecContext *avctx, AVFrame *f, int fla return ff_get_buffer(avctx, f, flags); p = avctx->internal->thread_ctx; +FF_DISABLE_DEPRECATION_WARNINGS if (atomic_load(&p->state) != STATE_SETTING_UP && ffcodec(avctx->codec)->update_thread_context) { +FF_ENABLE_DEPRECATION_WARNINGS av_log(avctx, AV_LOG_ERROR, "get_buffer() cannot be called after ff_thread_finish_setup()\n"); return -1; } diff --git a/media/ffvpx/libavcodec/version.h b/media/ffvpx/libavcodec/version.h index 39dbec020812..7aa95fc3f1c1 100644 --- a/media/ffvpx/libavcodec/version.h +++ b/media/ffvpx/libavcodec/version.h @@ -29,8 +29,8 @@ #include "version_major.h" -#define LIBAVCODEC_VERSION_MINOR 6 -#define LIBAVCODEC_VERSION_MICRO 101 +#define LIBAVCODEC_VERSION_MINOR 5 +#define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ diff --git a/media/ffvpx/libavcodec/version_major.h b/media/ffvpx/libavcodec/version_major.h index 40db213499a6..c2f118b26204 100644 --- a/media/ffvpx/libavcodec/version_major.h +++ b/media/ffvpx/libavcodec/version_major.h @@ -45,7 +45,6 @@ #define FF_API_AVCODEC_CHROMA_POS (LIBAVCODEC_VERSION_MAJOR < 61) #define FF_API_VT_HWACCEL_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 61) #define FF_API_AVCTX_FRAME_NUMBER (LIBAVCODEC_VERSION_MAJOR < 61) -#define FF_API_SLICE_OFFSET (LIBAVCODEC_VERSION_MAJOR < 61) // reminder to remove CrystalHD decoders on next major bump #define FF_CODEC_CRYSTAL_HD (LIBAVCODEC_VERSION_MAJOR < 61) diff --git a/media/ffvpx/libavcodec/vorbis_data.c b/media/ffvpx/libavcodec/vorbis_data.c deleted file mode 100644 index 1ebe146d8f35..000000000000 --- a/media/ffvpx/libavcodec/vorbis_data.c +++ /dev/null @@ -1,2201 +0,0 @@ -/* - * copyright (c) 2005 Denes Balatoni ( dbalatoni programozo hu ) - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "libavutil/channel_layout.h" -#include "libavutil/mem_internal.h" - -#include "vorbis_data.h" - -const uint8_t ff_vorbis_channel_layout_offsets[8][8] = { - { 0 }, - { 0, 1 }, - { 0, 2, 1 }, - { 0, 1, 2, 3 }, - { 0, 2, 1, 3, 4 }, - { 0, 2, 1, 5, 3, 4 }, - { 0, 2, 1, 6, 5, 3, 4 }, - { 0, 2, 1, 7, 5, 6, 3, 4 }, -}; - -#if FF_API_OLD_CHANNEL_LAYOUT -const uint64_t ff_vorbis_channel_layouts[9] = { - AV_CH_LAYOUT_MONO, - AV_CH_LAYOUT_STEREO, - AV_CH_LAYOUT_SURROUND, - AV_CH_LAYOUT_QUAD, - AV_CH_LAYOUT_5POINT0_BACK, - AV_CH_LAYOUT_5POINT1_BACK, - AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER, - AV_CH_LAYOUT_7POINT1, - 0 -}; -#endif - -const AVChannelLayout ff_vorbis_ch_layouts[9] = { - AV_CHANNEL_LAYOUT_MONO, - AV_CHANNEL_LAYOUT_STEREO, - AV_CHANNEL_LAYOUT_SURROUND, - AV_CHANNEL_LAYOUT_QUAD, - AV_CHANNEL_LAYOUT_5POINT0_BACK, - AV_CHANNEL_LAYOUT_5POINT1_BACK, - { - .nb_channels = 7, - .order = AV_CHANNEL_ORDER_NATIVE, - .u.mask = AV_CH_LAYOUT_5POINT1 | AV_CH_BACK_CENTER, - }, - AV_CHANNEL_LAYOUT_7POINT1, - { 0 } -}; - -DECLARE_ALIGNED(16, static const float, vwin64)[32] = { - 0.0009460463F, 0.0085006468F, 0.0235352254F, 0.0458950567F, - 0.0753351908F, 0.1115073077F, 0.1539457973F, 0.2020557475F, - 0.2551056759F, 0.3122276645F, 0.3724270287F, 0.4346027792F, - 0.4975789974F, 0.5601459521F, 0.6211085051F, 0.6793382689F, - 0.7338252629F, 0.7837245849F, 0.8283939355F, 0.8674186656F, - 0.9006222429F, 0.9280614787F, 0.9500073081F, 0.9669131782F, - 0.9793740220F, 0.9880792941F, 0.9937636139F, 0.9971582668F, - 0.9989462667F, 0.9997230082F, 0.9999638688F, 0.9999995525F, -}; - -DECLARE_ALIGNED(16, static const float, vwin128)[64] = { - 0.0002365472F, 0.0021280687F, 0.0059065254F, 0.0115626550F, - 0.0190823442F, 0.0284463735F, 0.0396300935F, 0.0526030430F, - 0.0673285281F, 0.0837631763F, 0.1018564887F, 0.1215504095F, - 0.1427789367F, 0.1654677960F, 0.1895342001F, 0.2148867160F, - 0.2414252576F, 0.2690412240F, 0.2976177952F, 0.3270303960F, - 0.3571473350F, 0.3878306189F, 0.4189369387F, 0.4503188188F, - 0.4818259135F, 0.5133064334F, 0.5446086751F, 0.5755826278F, - 0.6060816248F, 0.6359640047F, 0.6650947483F, 0.6933470543F, - 0.7206038179F, 0.7467589810F, 0.7717187213F, 0.7954024542F, - 0.8177436264F, 0.8386902831F, 0.8582053981F, 0.8762669622F, - 0.8928678298F, 0.9080153310F, 0.9217306608F, 0.9340480615F, - 0.9450138200F, 0.9546851041F, 0.9631286621F, 0.9704194171F, - 0.9766389810F, 0.9818741197F, 0.9862151938F, 0.9897546035F, - 0.9925852598F, 0.9947991032F, 0.9964856900F, 0.9977308602F, - 0.9986155015F, 0.9992144193F, 0.9995953200F, 0.9998179155F, - 0.9999331503F, 0.9999825563F, 0.9999977357F, 0.9999999720F, -}; - -DECLARE_ALIGNED(16, static const float, vwin256)[128] = { - 0.0000591390F, 0.0005321979F, 0.0014780301F, 0.0028960636F, - 0.0047854363F, 0.0071449926F, 0.0099732775F, 0.0132685298F, - 0.0170286741F, 0.0212513119F, 0.0259337111F, 0.0310727950F, - 0.0366651302F, 0.0427069140F, 0.0491939614F, 0.0561216907F, - 0.0634851102F, 0.0712788035F, 0.0794969160F, 0.0881331402F, - 0.0971807028F, 0.1066323515F, 0.1164803426F, 0.1267164297F, - 0.1373318534F, 0.1483173323F, 0.1596630553F, 0.1713586755F, - 0.1833933062F, 0.1957555184F, 0.2084333404F, 0.2214142599F, - 0.2346852280F, 0.2482326664F, 0.2620424757F, 0.2761000481F, - 0.2903902813F, 0.3048975959F, 0.3196059553F, 0.3344988887F, - 0.3495595160F, 0.3647705766F, 0.3801144597F, 0.3955732382F, - 0.4111287047F, 0.4267624093F, 0.4424557009F, 0.4581897696F, - 0.4739456913F, 0.4897044744F, 0.5054471075F, 0.5211546088F, - 0.5368080763F, 0.5523887395F, 0.5678780103F, 0.5832575361F, - 0.5985092508F, 0.6136154277F, 0.6285587300F, 0.6433222619F, - 0.6578896175F, 0.6722449294F, 0.6863729144F, 0.7002589187F, - 0.7138889597F, 0.7272497662F, 0.7403288154F, 0.7531143679F, - 0.7655954985F, 0.7777621249F, 0.7896050322F, 0.8011158947F, - 0.8122872932F, 0.8231127294F, 0.8335866365F, 0.8437043850F, - 0.8534622861F, 0.8628575905F, 0.8718884835F, 0.8805540765F, - 0.8888543947F, 0.8967903616F, 0.9043637797F, 0.9115773078F, - 0.9184344360F, 0.9249394562F, 0.9310974312F, 0.9369141608F, - 0.9423961446F, 0.9475505439F, 0.9523851406F, 0.9569082947F, - 0.9611289005F, 0.9650563408F, 0.9687004405F, 0.9720714191F, - 0.9751798427F, 0.9780365753F, 0.9806527301F, 0.9830396204F, - 0.9852087111F, 0.9871715701F, 0.9889398207F, 0.9905250941F, - 0.9919389832F, 0.9931929973F, 0.9942985174F, 0.9952667537F, - 0.9961087037F, 0.9968351119F, 0.9974564312F, 0.9979827858F, - 0.9984239359F, 0.9987892441F, 0.9990876435F, 0.9993276081F, - 0.9995171241F, 0.9996636648F, 0.9997741654F, 0.9998550016F, - 0.9999119692F, 0.9999502656F, 0.9999744742F, 0.9999885497F, - 0.9999958064F, 0.9999989077F, 0.9999998584F, 0.9999999983F, -}; - -DECLARE_ALIGNED(16, static const float, vwin512)[256] = { - 0.0000147849F, 0.0001330607F, 0.0003695946F, 0.0007243509F, - 0.0011972759F, 0.0017882983F, 0.0024973285F, 0.0033242588F, - 0.0042689632F, 0.0053312973F, 0.0065110982F, 0.0078081841F, - 0.0092223540F, 0.0107533880F, 0.0124010466F, 0.0141650703F, - 0.0160451800F, 0.0180410758F, 0.0201524373F, 0.0223789233F, - 0.0247201710F, 0.0271757958F, 0.0297453914F, 0.0324285286F, - 0.0352247556F, 0.0381335972F, 0.0411545545F, 0.0442871045F, - 0.0475306997F, 0.0508847676F, 0.0543487103F, 0.0579219038F, - 0.0616036982F, 0.0653934164F, 0.0692903546F, 0.0732937809F, - 0.0774029356F, 0.0816170305F, 0.0859352485F, 0.0903567428F, - 0.0948806375F, 0.0995060259F, 0.1042319712F, 0.1090575056F, - 0.1139816300F, 0.1190033137F, 0.1241214941F, 0.1293350764F, - 0.1346429333F, 0.1400439046F, 0.1455367974F, 0.1511203852F, - 0.1567934083F, 0.1625545735F, 0.1684025537F, 0.1743359881F, - 0.1803534820F, 0.1864536069F, 0.1926349000F, 0.1988958650F, - 0.2052349715F, 0.2116506555F, 0.2181413191F, 0.2247053313F, - 0.2313410275F, 0.2380467105F, 0.2448206500F, 0.2516610835F, - 0.2585662164F, 0.2655342226F, 0.2725632448F, 0.2796513950F, - 0.2867967551F, 0.2939973773F, 0.3012512852F, 0.3085564739F, - 0.3159109111F, 0.3233125375F, 0.3307592680F, 0.3382489922F, - 0.3457795756F, 0.3533488602F, 0.3609546657F, 0.3685947904F, - 0.3762670121F, 0.3839690896F, 0.3916987634F, 0.3994537572F, - 0.4072317788F, 0.4150305215F, 0.4228476653F, 0.4306808783F, - 0.4385278181F, 0.4463861329F, 0.4542534630F, 0.4621274424F, - 0.4700057001F, 0.4778858615F, 0.4857655502F, 0.4936423891F, - 0.5015140023F, 0.5093780165F, 0.5172320626F, 0.5250737772F, - 0.5329008043F, 0.5407107971F, 0.5485014192F, 0.5562703465F, - 0.5640152688F, 0.5717338914F, 0.5794239366F, 0.5870831457F, - 0.5947092801F, 0.6023001235F, 0.6098534829F, 0.6173671907F, - 0.6248391059F, 0.6322671161F, 0.6396491384F, 0.6469831217F, - 0.6542670475F, 0.6614989319F, 0.6686768267F, 0.6757988210F, - 0.6828630426F, 0.6898676592F, 0.6968108799F, 0.7036909564F, - 0.7105061843F, 0.7172549043F, 0.7239355032F, 0.7305464154F, - 0.7370861235F, 0.7435531598F, 0.7499461068F, 0.7562635986F, - 0.7625043214F, 0.7686670148F, 0.7747504721F, 0.7807535410F, - 0.7866751247F, 0.7925141825F, 0.7982697296F, 0.8039408387F, - 0.8095266395F, 0.8150263196F, 0.8204391248F, 0.8257643590F, - 0.8310013848F, 0.8361496236F, 0.8412085555F, 0.8461777194F, - 0.8510567129F, 0.8558451924F, 0.8605428730F, 0.8651495278F, - 0.8696649882F, 0.8740891432F, 0.8784219392F, 0.8826633797F, - 0.8868135244F, 0.8908724888F, 0.8948404441F, 0.8987176157F, - 0.9025042831F, 0.9062007791F, 0.9098074886F, 0.9133248482F, - 0.9167533451F, 0.9200935163F, 0.9233459472F, 0.9265112712F, - 0.9295901680F, 0.9325833632F, 0.9354916263F, 0.9383157705F, - 0.9410566504F, 0.9437151618F, 0.9462922398F, 0.9487888576F, - 0.9512060252F, 0.9535447882F, 0.9558062262F, 0.9579914516F, - 0.9601016078F, 0.9621378683F, 0.9641014348F, 0.9659935361F, - 0.9678154261F, 0.9695683830F, 0.9712537071F, 0.9728727198F, - 0.9744267618F, 0.9759171916F, 0.9773453842F, 0.9787127293F, - 0.9800206298F, 0.9812705006F, 0.9824637665F, 0.9836018613F, - 0.9846862258F, 0.9857183066F, 0.9866995544F, 0.9876314227F, - 0.9885153662F, 0.9893528393F, 0.9901452948F, 0.9908941823F, - 0.9916009470F, 0.9922670279F, 0.9928938570F, 0.9934828574F, - 0.9940354423F, 0.9945530133F, 0.9950369595F, 0.9954886562F, - 0.9959094633F, 0.9963007242F, 0.9966637649F, 0.9969998925F, - 0.9973103939F, 0.9975965351F, 0.9978595598F, 0.9981006885F, - 0.9983211172F, 0.9985220166F, 0.9987045311F, 0.9988697776F, - 0.9990188449F, 0.9991527924F, 0.9992726499F, 0.9993794157F, - 0.9994740570F, 0.9995575079F, 0.9996306699F, 0.9996944099F, - 0.9997495605F, 0.9997969190F, 0.9998372465F, 0.9998712678F, - 0.9998996704F, 0.9999231041F, 0.9999421807F, 0.9999574732F, - 0.9999695157F, 0.9999788026F, 0.9999857885F, 0.9999908879F, - 0.9999944746F, 0.9999968817F, 0.9999984010F, 0.9999992833F, - 0.9999997377F, 0.9999999317F, 0.9999999911F, 0.9999999999F, -}; - -DECLARE_ALIGNED(16, static const float, vwin1024)[512] = { - 0.0000036962F, 0.0000332659F, 0.0000924041F, 0.0001811086F, - 0.0002993761F, 0.0004472021F, 0.0006245811F, 0.0008315063F, - 0.0010679699F, 0.0013339631F, 0.0016294757F, 0.0019544965F, - 0.0023090133F, 0.0026930125F, 0.0031064797F, 0.0035493989F, - 0.0040217533F, 0.0045235250F, 0.0050546946F, 0.0056152418F, - 0.0062051451F, 0.0068243817F, 0.0074729278F, 0.0081507582F, - 0.0088578466F, 0.0095941655F, 0.0103596863F, 0.0111543789F, - 0.0119782122F, 0.0128311538F, 0.0137131701F, 0.0146242260F, - 0.0155642855F, 0.0165333111F, 0.0175312640F, 0.0185581042F, - 0.0196137903F, 0.0206982797F, 0.0218115284F, 0.0229534910F, - 0.0241241208F, 0.0253233698F, 0.0265511886F, 0.0278075263F, - 0.0290923308F, 0.0304055484F, 0.0317471241F, 0.0331170013F, - 0.0345151222F, 0.0359414274F, 0.0373958560F, 0.0388783456F, - 0.0403888325F, 0.0419272511F, 0.0434935347F, 0.0450876148F, - 0.0467094213F, 0.0483588828F, 0.0500359261F, 0.0517404765F, - 0.0534724575F, 0.0552317913F, 0.0570183983F, 0.0588321971F, - 0.0606731048F, 0.0625410369F, 0.0644359070F, 0.0663576272F, - 0.0683061077F, 0.0702812571F, 0.0722829821F, 0.0743111878F, - 0.0763657775F, 0.0784466526F, 0.0805537129F, 0.0826868561F, - 0.0848459782F, 0.0870309736F, 0.0892417345F, 0.0914781514F, - 0.0937401128F, 0.0960275056F, 0.0983402145F, 0.1006781223F, - 0.1030411101F, 0.1054290568F, 0.1078418397F, 0.1102793336F, - 0.1127414119F, 0.1152279457F, 0.1177388042F, 0.1202738544F, - 0.1228329618F, 0.1254159892F, 0.1280227980F, 0.1306532471F, - 0.1333071937F, 0.1359844927F, 0.1386849970F, 0.1414085575F, - 0.1441550230F, 0.1469242403F, 0.1497160539F, 0.1525303063F, - 0.1553668381F, 0.1582254875F, 0.1611060909F, 0.1640084822F, - 0.1669324936F, 0.1698779549F, 0.1728446939F, 0.1758325362F, - 0.1788413055F, 0.1818708232F, 0.1849209084F, 0.1879913785F, - 0.1910820485F, 0.1941927312F, 0.1973232376F, 0.2004733764F, - 0.2036429541F, 0.2068317752F, 0.2100396421F, 0.2132663552F, - 0.2165117125F, 0.2197755102F, 0.2230575422F, 0.2263576007F, - 0.2296754753F, 0.2330109540F, 0.2363638225F, 0.2397338646F, - 0.2431208619F, 0.2465245941F, 0.2499448389F, 0.2533813719F, - 0.2568339669F, 0.2603023956F, 0.2637864277F, 0.2672858312F, - 0.2708003718F, 0.2743298135F, 0.2778739186F, 0.2814324472F, - 0.2850051576F, 0.2885918065F, 0.2921921485F, 0.2958059366F, - 0.2994329219F, 0.3030728538F, 0.3067254799F, 0.3103905462F, - 0.3140677969F, 0.3177569747F, 0.3214578205F, 0.3251700736F, - 0.3288934718F, 0.3326277513F, 0.3363726468F, 0.3401278914F, - 0.3438932168F, 0.3476683533F, 0.3514530297F, 0.3552469734F, - 0.3590499106F, 0.3628615659F, 0.3666816630F, 0.3705099239F, - 0.3743460698F, 0.3781898204F, 0.3820408945F, 0.3858990095F, - 0.3897638820F, 0.3936352274F, 0.3975127601F, 0.4013961936F, - 0.4052852405F, 0.4091796123F, 0.4130790198F, 0.4169831732F, - 0.4208917815F, 0.4248045534F, 0.4287211965F, 0.4326414181F, - 0.4365649248F, 0.4404914225F, 0.4444206167F, 0.4483522125F, - 0.4522859146F, 0.4562214270F, 0.4601584538F, 0.4640966984F, - 0.4680358644F, 0.4719756548F, 0.4759157726F, 0.4798559209F, - 0.4837958024F, 0.4877351199F, 0.4916735765F, 0.4956108751F, - 0.4995467188F, 0.5034808109F, 0.5074128550F, 0.5113425550F, - 0.5152696149F, 0.5191937395F, 0.5231146336F, 0.5270320028F, - 0.5309455530F, 0.5348549910F, 0.5387600239F, 0.5426603597F, - 0.5465557070F, 0.5504457754F, 0.5543302752F, 0.5582089175F, - 0.5620814145F, 0.5659474793F, 0.5698068262F, 0.5736591704F, - 0.5775042283F, 0.5813417176F, 0.5851713571F, 0.5889928670F, - 0.5928059689F, 0.5966103856F, 0.6004058415F, 0.6041920626F, - 0.6079687761F, 0.6117357113F, 0.6154925986F, 0.6192391705F, - 0.6229751612F, 0.6267003064F, 0.6304143441F, 0.6341170137F, - 0.6378080569F, 0.6414872173F, 0.6451542405F, 0.6488088741F, - 0.6524508681F, 0.6560799742F, 0.6596959469F, 0.6632985424F, - 0.6668875197F, 0.6704626398F, 0.6740236662F, 0.6775703649F, - 0.6811025043F, 0.6846198554F, 0.6881221916F, 0.6916092892F, - 0.6950809269F, 0.6985368861F, 0.7019769510F, 0.7054009085F, - 0.7088085484F, 0.7121996632F, 0.7155740484F, 0.7189315023F, - 0.7222718263F, 0.7255948245F, 0.7289003043F, 0.7321880760F, - 0.7354579530F, 0.7387097518F, 0.7419432921F, 0.7451583966F, - 0.7483548915F, 0.7515326059F, 0.7546913723F, 0.7578310265F, - 0.7609514077F, 0.7640523581F, 0.7671337237F, 0.7701953535F, - 0.7732371001F, 0.7762588195F, 0.7792603711F, 0.7822416178F, - 0.7852024259F, 0.7881426654F, 0.7910622097F, 0.7939609356F, - 0.7968387237F, 0.7996954579F, 0.8025310261F, 0.8053453193F, - 0.8081382324F, 0.8109096638F, 0.8136595156F, 0.8163876936F, - 0.8190941071F, 0.8217786690F, 0.8244412960F, 0.8270819086F, - 0.8297004305F, 0.8322967896F, 0.8348709171F, 0.8374227481F, - 0.8399522213F, 0.8424592789F, 0.8449438672F, 0.8474059356F, - 0.8498454378F, 0.8522623306F, 0.8546565748F, 0.8570281348F, - 0.8593769787F, 0.8617030779F, 0.8640064080F, 0.8662869477F, - 0.8685446796F, 0.8707795899F, 0.8729916682F, 0.8751809079F, - 0.8773473059F, 0.8794908626F, 0.8816115819F, 0.8837094713F, - 0.8857845418F, 0.8878368079F, 0.8898662874F, 0.8918730019F, - 0.8938569760F, 0.8958182380F, 0.8977568194F, 0.8996727552F, - 0.9015660837F, 0.9034368465F, 0.9052850885F, 0.9071108577F, - 0.9089142057F, 0.9106951869F, 0.9124538591F, 0.9141902832F, - 0.9159045233F, 0.9175966464F, 0.9192667228F, 0.9209148257F, - 0.9225410313F, 0.9241454187F, 0.9257280701F, 0.9272890704F, - 0.9288285075F, 0.9303464720F, 0.9318430576F, 0.9333183603F, - 0.9347724792F, 0.9362055158F, 0.9376175745F, 0.9390087622F, - 0.9403791881F, 0.9417289644F, 0.9430582055F, 0.9443670283F, - 0.9456555521F, 0.9469238986F, 0.9481721917F, 0.9494005577F, - 0.9506091252F, 0.9517980248F, 0.9529673894F, 0.9541173540F, - 0.9552480557F, 0.9563596334F, 0.9574522282F, 0.9585259830F, - 0.9595810428F, 0.9606175542F, 0.9616356656F, 0.9626355274F, - 0.9636172915F, 0.9645811114F, 0.9655271425F, 0.9664555414F, - 0.9673664664F, 0.9682600774F, 0.9691365355F, 0.9699960034F, - 0.9708386448F, 0.9716646250F, 0.9724741103F, 0.9732672685F, - 0.9740442683F, 0.9748052795F, 0.9755504729F, 0.9762800205F, - 0.9769940950F, 0.9776928703F, 0.9783765210F, 0.9790452223F, - 0.9796991504F, 0.9803384823F, 0.9809633954F, 0.9815740679F, - 0.9821706784F, 0.9827534063F, 0.9833224312F, 0.9838779332F, - 0.9844200928F, 0.9849490910F, 0.9854651087F, 0.9859683274F, - 0.9864589286F, 0.9869370940F, 0.9874030054F, 0.9878568447F, - 0.9882987937F, 0.9887290343F, 0.9891477481F, 0.9895551169F, - 0.9899513220F, 0.9903365446F, 0.9907109658F, 0.9910747662F, - 0.9914281260F, 0.9917712252F, 0.9921042433F, 0.9924273593F, - 0.9927407516F, 0.9930445982F, 0.9933390763F, 0.9936243626F, - 0.9939006331F, 0.9941680631F, 0.9944268269F, 0.9946770982F, - 0.9949190498F, 0.9951528537F, 0.9953786808F, 0.9955967011F, - 0.9958070836F, 0.9960099963F, 0.9962056061F, 0.9963940787F, - 0.9965755786F, 0.9967502693F, 0.9969183129F, 0.9970798704F, - 0.9972351013F, 0.9973841640F, 0.9975272151F, 0.9976644103F, - 0.9977959036F, 0.9979218476F, 0.9980423932F, 0.9981576901F, - 0.9982678862F, 0.9983731278F, 0.9984735596F, 0.9985693247F, - 0.9986605645F, 0.9987474186F, 0.9988300248F, 0.9989085193F, - 0.9989830364F, 0.9990537085F, 0.9991206662F, 0.9991840382F, - 0.9992439513F, 0.9993005303F, 0.9993538982F, 0.9994041757F, - 0.9994514817F, 0.9994959330F, 0.9995376444F, 0.9995767286F, - 0.9996132960F, 0.9996474550F, 0.9996793121F, 0.9997089710F, - 0.9997365339F, 0.9997621003F, 0.9997857677F, 0.9998076311F, - 0.9998277836F, 0.9998463156F, 0.9998633155F, 0.9998788692F, - 0.9998930603F, 0.9999059701F, 0.9999176774F, 0.9999282586F, - 0.9999377880F, 0.9999463370F, 0.9999539749F, 0.9999607685F, - 0.9999667820F, 0.9999720773F, 0.9999767136F, 0.9999807479F, - 0.9999842344F, 0.9999872249F, 0.9999897688F, 0.9999919127F, - 0.9999937009F, 0.9999951749F, 0.9999963738F, 0.9999973342F, - 0.9999980900F, 0.9999986724F, 0.9999991103F, 0.9999994297F, - 0.9999996543F, 0.9999998049F, 0.9999999000F, 0.9999999552F, - 0.9999999836F, 0.9999999957F, 0.9999999994F, 1.0000000000F, -}; - -DECLARE_ALIGNED(16, static const float, vwin2048)[1024] = { - 0.0000009241F, 0.0000083165F, 0.0000231014F, 0.0000452785F, - 0.0000748476F, 0.0001118085F, 0.0001561608F, 0.0002079041F, - 0.0002670379F, 0.0003335617F, 0.0004074748F, 0.0004887765F, - 0.0005774661F, 0.0006735427F, 0.0007770054F, 0.0008878533F, - 0.0010060853F, 0.0011317002F, 0.0012646969F, 0.0014050742F, - 0.0015528307F, 0.0017079650F, 0.0018704756F, 0.0020403610F, - 0.0022176196F, 0.0024022497F, 0.0025942495F, 0.0027936173F, - 0.0030003511F, 0.0032144490F, 0.0034359088F, 0.0036647286F, - 0.0039009061F, 0.0041444391F, 0.0043953253F, 0.0046535621F, - 0.0049191472F, 0.0051920781F, 0.0054723520F, 0.0057599664F, - 0.0060549184F, 0.0063572052F, 0.0066668239F, 0.0069837715F, - 0.0073080449F, 0.0076396410F, 0.0079785566F, 0.0083247884F, - 0.0086783330F, 0.0090391871F, 0.0094073470F, 0.0097828092F, - 0.0101655700F, 0.0105556258F, 0.0109529726F, 0.0113576065F, - 0.0117695237F, 0.0121887200F, 0.0126151913F, 0.0130489335F, - 0.0134899422F, 0.0139382130F, 0.0143937415F, 0.0148565233F, - 0.0153265536F, 0.0158038279F, 0.0162883413F, 0.0167800889F, - 0.0172790660F, 0.0177852675F, 0.0182986882F, 0.0188193231F, - 0.0193471668F, 0.0198822141F, 0.0204244594F, 0.0209738974F, - 0.0215305225F, 0.0220943289F, 0.0226653109F, 0.0232434627F, - 0.0238287784F, 0.0244212519F, 0.0250208772F, 0.0256276481F, - 0.0262415582F, 0.0268626014F, 0.0274907711F, 0.0281260608F, - 0.0287684638F, 0.0294179736F, 0.0300745833F, 0.0307382859F, - 0.0314090747F, 0.0320869424F, 0.0327718819F, 0.0334638860F, - 0.0341629474F, 0.0348690586F, 0.0355822122F, 0.0363024004F, - 0.0370296157F, 0.0377638502F, 0.0385050960F, 0.0392533451F, - 0.0400085896F, 0.0407708211F, 0.0415400315F, 0.0423162123F, - 0.0430993552F, 0.0438894515F, 0.0446864926F, 0.0454904698F, - 0.0463013742F, 0.0471191969F, 0.0479439288F, 0.0487755607F, - 0.0496140836F, 0.0504594879F, 0.0513117642F, 0.0521709031F, - 0.0530368949F, 0.0539097297F, 0.0547893979F, 0.0556758894F, - 0.0565691941F, 0.0574693019F, 0.0583762026F, 0.0592898858F, - 0.0602103410F, 0.0611375576F, 0.0620715250F, 0.0630122324F, - 0.0639596688F, 0.0649138234F, 0.0658746848F, 0.0668422421F, - 0.0678164838F, 0.0687973985F, 0.0697849746F, 0.0707792005F, - 0.0717800645F, 0.0727875547F, 0.0738016591F, 0.0748223656F, - 0.0758496620F, 0.0768835359F, 0.0779239751F, 0.0789709668F, - 0.0800244985F, 0.0810845574F, 0.0821511306F, 0.0832242052F, - 0.0843037679F, 0.0853898056F, 0.0864823050F, 0.0875812525F, - 0.0886866347F, 0.0897984378F, 0.0909166480F, 0.0920412513F, - 0.0931722338F, 0.0943095813F, 0.0954532795F, 0.0966033140F, - 0.0977596702F, 0.0989223336F, 0.1000912894F, 0.1012665227F, - 0.1024480185F, 0.1036357616F, 0.1048297369F, 0.1060299290F, - 0.1072363224F, 0.1084489014F, 0.1096676504F, 0.1108925534F, - 0.1121235946F, 0.1133607577F, 0.1146040267F, 0.1158533850F, - 0.1171088163F, 0.1183703040F, 0.1196378312F, 0.1209113812F, - 0.1221909370F, 0.1234764815F, 0.1247679974F, 0.1260654674F, - 0.1273688740F, 0.1286781995F, 0.1299934263F, 0.1313145365F, - 0.1326415121F, 0.1339743349F, 0.1353129866F, 0.1366574490F, - 0.1380077035F, 0.1393637315F, 0.1407255141F, 0.1420930325F, - 0.1434662677F, 0.1448452004F, 0.1462298115F, 0.1476200814F, - 0.1490159906F, 0.1504175195F, 0.1518246482F, 0.1532373569F, - 0.1546556253F, 0.1560794333F, 0.1575087606F, 0.1589435866F, - 0.1603838909F, 0.1618296526F, 0.1632808509F, 0.1647374648F, - 0.1661994731F, 0.1676668546F, 0.1691395880F, 0.1706176516F, - 0.1721010238F, 0.1735896829F, 0.1750836068F, 0.1765827736F, - 0.1780871610F, 0.1795967468F, 0.1811115084F, 0.1826314234F, - 0.1841564689F, 0.1856866221F, 0.1872218600F, 0.1887621595F, - 0.1903074974F, 0.1918578503F, 0.1934131947F, 0.1949735068F, - 0.1965387630F, 0.1981089393F, 0.1996840117F, 0.2012639560F, - 0.2028487479F, 0.2044383630F, 0.2060327766F, 0.2076319642F, - 0.2092359007F, 0.2108445614F, 0.2124579211F, 0.2140759545F, - 0.2156986364F, 0.2173259411F, 0.2189578432F, 0.2205943168F, - 0.2222353361F, 0.2238808751F, 0.2255309076F, 0.2271854073F, - 0.2288443480F, 0.2305077030F, 0.2321754457F, 0.2338475493F, - 0.2355239869F, 0.2372047315F, 0.2388897560F, 0.2405790329F, - 0.2422725350F, 0.2439702347F, 0.2456721043F, 0.2473781159F, - 0.2490882418F, 0.2508024539F, 0.2525207240F, 0.2542430237F, - 0.2559693248F, 0.2576995986F, 0.2594338166F, 0.2611719498F, - 0.2629139695F, 0.2646598466F, 0.2664095520F, 0.2681630564F, - 0.2699203304F, 0.2716813445F, 0.2734460691F, 0.2752144744F, - 0.2769865307F, 0.2787622079F, 0.2805414760F, 0.2823243047F, - 0.2841106637F, 0.2859005227F, 0.2876938509F, 0.2894906179F, - 0.2912907928F, 0.2930943447F, 0.2949012426F, 0.2967114554F, - 0.2985249520F, 0.3003417009F, 0.3021616708F, 0.3039848301F, - 0.3058111471F, 0.3076405901F, 0.3094731273F, 0.3113087266F, - 0.3131473560F, 0.3149889833F, 0.3168335762F, 0.3186811024F, - 0.3205315294F, 0.3223848245F, 0.3242409552F, 0.3260998886F, - 0.3279615918F, 0.3298260319F, 0.3316931758F, 0.3335629903F, - 0.3354354423F, 0.3373104982F, 0.3391881247F, 0.3410682882F, - 0.3429509551F, 0.3448360917F, 0.3467236642F, 0.3486136387F, - 0.3505059811F, 0.3524006575F, 0.3542976336F, 0.3561968753F, - 0.3580983482F, 0.3600020179F, 0.3619078499F, 0.3638158096F, - 0.3657258625F, 0.3676379737F, 0.3695521086F, 0.3714682321F, - 0.3733863094F, 0.3753063055F, 0.3772281852F, 0.3791519134F, - 0.3810774548F, 0.3830047742F, 0.3849338362F, 0.3868646053F, - 0.3887970459F, 0.3907311227F, 0.3926667998F, 0.3946040417F, - 0.3965428125F, 0.3984830765F, 0.4004247978F, 0.4023679403F, - 0.4043124683F, 0.4062583455F, 0.4082055359F, 0.4101540034F, - 0.4121037117F, 0.4140546246F, 0.4160067058F, 0.4179599190F, - 0.4199142277F, 0.4218695956F, 0.4238259861F, 0.4257833627F, - 0.4277416888F, 0.4297009279F, 0.4316610433F, 0.4336219983F, - 0.4355837562F, 0.4375462803F, 0.4395095337F, 0.4414734797F, - 0.4434380815F, 0.4454033021F, 0.4473691046F, 0.4493354521F, - 0.4513023078F, 0.4532696345F, 0.4552373954F, 0.4572055533F, - 0.4591740713F, 0.4611429123F, 0.4631120393F, 0.4650814151F, - 0.4670510028F, 0.4690207650F, 0.4709906649F, 0.4729606651F, - 0.4749307287F, 0.4769008185F, 0.4788708972F, 0.4808409279F, - 0.4828108732F, 0.4847806962F, 0.4867503597F, 0.4887198264F, - 0.4906890593F, 0.4926580213F, 0.4946266753F, 0.4965949840F, - 0.4985629105F, 0.5005304176F, 0.5024974683F, 0.5044640255F, - 0.5064300522F, 0.5083955114F, 0.5103603659F, 0.5123245790F, - 0.5142881136F, 0.5162509328F, 0.5182129997F, 0.5201742774F, - 0.5221347290F, 0.5240943178F, 0.5260530070F, 0.5280107598F, - 0.5299675395F, 0.5319233095F, 0.5338780330F, 0.5358316736F, - 0.5377841946F, 0.5397355596F, 0.5416857320F, 0.5436346755F, - 0.5455823538F, 0.5475287304F, 0.5494737691F, 0.5514174337F, - 0.5533596881F, 0.5553004962F, 0.5572398218F, 0.5591776291F, - 0.5611138821F, 0.5630485449F, 0.5649815818F, 0.5669129570F, - 0.5688426349F, 0.5707705799F, 0.5726967564F, 0.5746211290F, - 0.5765436624F, 0.5784643212F, 0.5803830702F, 0.5822998743F, - 0.5842146984F, 0.5861275076F, 0.5880382669F, 0.5899469416F, - 0.5918534968F, 0.5937578981F, 0.5956601107F, 0.5975601004F, - 0.5994578326F, 0.6013532732F, 0.6032463880F, 0.6051371429F, - 0.6070255039F, 0.6089114372F, 0.6107949090F, 0.6126758856F, - 0.6145543334F, 0.6164302191F, 0.6183035092F, 0.6201741706F, - 0.6220421700F, 0.6239074745F, 0.6257700513F, 0.6276298674F, - 0.6294868903F, 0.6313410873F, 0.6331924262F, 0.6350408745F, - 0.6368864001F, 0.6387289710F, 0.6405685552F, 0.6424051209F, - 0.6442386364F, 0.6460690702F, 0.6478963910F, 0.6497205673F, - 0.6515415682F, 0.6533593625F, 0.6551739194F, 0.6569852082F, - 0.6587931984F, 0.6605978593F, 0.6623991609F, 0.6641970728F, - 0.6659915652F, 0.6677826081F, 0.6695701718F, 0.6713542268F, - 0.6731347437F, 0.6749116932F, 0.6766850461F, 0.6784547736F, - 0.6802208469F, 0.6819832374F, 0.6837419164F, 0.6854968559F, - 0.6872480275F, 0.6889954034F, 0.6907389556F, 0.6924786566F, - 0.6942144788F, 0.6959463950F, 0.6976743780F, 0.6993984008F, - 0.7011184365F, 0.7028344587F, 0.7045464407F, 0.7062543564F, - 0.7079581796F, 0.7096578844F, 0.7113534450F, 0.7130448359F, - 0.7147320316F, 0.7164150070F, 0.7180937371F, 0.7197681970F, - 0.7214383620F, 0.7231042077F, 0.7247657098F, 0.7264228443F, - 0.7280755871F, 0.7297239147F, 0.7313678035F, 0.7330072301F, - 0.7346421715F, 0.7362726046F, 0.7378985069F, 0.7395198556F, - 0.7411366285F, 0.7427488034F, 0.7443563584F, 0.7459592717F, - 0.7475575218F, 0.7491510873F, 0.7507399471F, 0.7523240803F, - 0.7539034661F, 0.7554780839F, 0.7570479136F, 0.7586129349F, - 0.7601731279F, 0.7617284730F, 0.7632789506F, 0.7648245416F, - 0.7663652267F, 0.7679009872F, 0.7694318044F, 0.7709576599F, - 0.7724785354F, 0.7739944130F, 0.7755052749F, 0.7770111035F, - 0.7785118815F, 0.7800075916F, 0.7814982170F, 0.7829837410F, - 0.7844641472F, 0.7859394191F, 0.7874095408F, 0.7888744965F, - 0.7903342706F, 0.7917888476F, 0.7932382124F, 0.7946823501F, - 0.7961212460F, 0.7975548855F, 0.7989832544F, 0.8004063386F, - 0.8018241244F, 0.8032365981F, 0.8046437463F, 0.8060455560F, - 0.8074420141F, 0.8088331080F, 0.8102188253F, 0.8115991536F, - 0.8129740810F, 0.8143435957F, 0.8157076861F, 0.8170663409F, - 0.8184195489F, 0.8197672994F, 0.8211095817F, 0.8224463853F, - 0.8237777001F, 0.8251035161F, 0.8264238235F, 0.8277386129F, - 0.8290478750F, 0.8303516008F, 0.8316497814F, 0.8329424083F, - 0.8342294731F, 0.8355109677F, 0.8367868841F, 0.8380572148F, - 0.8393219523F, 0.8405810893F, 0.8418346190F, 0.8430825345F, - 0.8443248294F, 0.8455614974F, 0.8467925323F, 0.8480179285F, - 0.8492376802F, 0.8504517822F, 0.8516602292F, 0.8528630164F, - 0.8540601391F, 0.8552515928F, 0.8564373733F, 0.8576174766F, - 0.8587918990F, 0.8599606368F, 0.8611236868F, 0.8622810460F, - 0.8634327113F, 0.8645786802F, 0.8657189504F, 0.8668535195F, - 0.8679823857F, 0.8691055472F, 0.8702230025F, 0.8713347503F, - 0.8724407896F, 0.8735411194F, 0.8746357394F, 0.8757246489F, - 0.8768078479F, 0.8778853364F, 0.8789571146F, 0.8800231832F, - 0.8810835427F, 0.8821381942F, 0.8831871387F, 0.8842303777F, - 0.8852679127F, 0.8862997456F, 0.8873258784F, 0.8883463132F, - 0.8893610527F, 0.8903700994F, 0.8913734562F, 0.8923711263F, - 0.8933631129F, 0.8943494196F, 0.8953300500F, 0.8963050083F, - 0.8972742985F, 0.8982379249F, 0.8991958922F, 0.9001482052F, - 0.9010948688F, 0.9020358883F, 0.9029712690F, 0.9039010165F, - 0.9048251367F, 0.9057436357F, 0.9066565195F, 0.9075637946F, - 0.9084654678F, 0.9093615456F, 0.9102520353F, 0.9111369440F, - 0.9120162792F, 0.9128900484F, 0.9137582595F, 0.9146209204F, - 0.9154780394F, 0.9163296248F, 0.9171756853F, 0.9180162296F, - 0.9188512667F, 0.9196808057F, 0.9205048559F, 0.9213234270F, - 0.9221365285F, 0.9229441704F, 0.9237463629F, 0.9245431160F, - 0.9253344404F, 0.9261203465F, 0.9269008453F, 0.9276759477F, - 0.9284456648F, 0.9292100080F, 0.9299689889F, 0.9307226190F, - 0.9314709103F, 0.9322138747F, 0.9329515245F, 0.9336838721F, - 0.9344109300F, 0.9351327108F, 0.9358492275F, 0.9365604931F, - 0.9372665208F, 0.9379673239F, 0.9386629160F, 0.9393533107F, - 0.9400385220F, 0.9407185637F, 0.9413934501F, 0.9420631954F, - 0.9427278141F, 0.9433873208F, 0.9440417304F, 0.9446910576F, - 0.9453353176F, 0.9459745255F, 0.9466086968F, 0.9472378469F, - 0.9478619915F, 0.9484811463F, 0.9490953274F, 0.9497045506F, - 0.9503088323F, 0.9509081888F, 0.9515026365F, 0.9520921921F, - 0.9526768723F, 0.9532566940F, 0.9538316742F, 0.9544018300F, - 0.9549671786F, 0.9555277375F, 0.9560835241F, 0.9566345562F, - 0.9571808513F, 0.9577224275F, 0.9582593027F, 0.9587914949F, - 0.9593190225F, 0.9598419038F, 0.9603601571F, 0.9608738012F, - 0.9613828546F, 0.9618873361F, 0.9623872646F, 0.9628826591F, - 0.9633735388F, 0.9638599227F, 0.9643418303F, 0.9648192808F, - 0.9652922939F, 0.9657608890F, 0.9662250860F, 0.9666849046F, - 0.9671403646F, 0.9675914861F, 0.9680382891F, 0.9684807937F, - 0.9689190202F, 0.9693529890F, 0.9697827203F, 0.9702082347F, - 0.9706295529F, 0.9710466953F, 0.9714596828F, 0.9718685362F, - 0.9722732762F, 0.9726739240F, 0.9730705005F, 0.9734630267F, - 0.9738515239F, 0.9742360134F, 0.9746165163F, 0.9749930540F, - 0.9753656481F, 0.9757343198F, 0.9760990909F, 0.9764599829F, - 0.9768170175F, 0.9771702164F, 0.9775196013F, 0.9778651941F, - 0.9782070167F, 0.9785450909F, 0.9788794388F, 0.9792100824F, - 0.9795370437F, 0.9798603449F, 0.9801800080F, 0.9804960554F, - 0.9808085092F, 0.9811173916F, 0.9814227251F, 0.9817245318F, - 0.9820228343F, 0.9823176549F, 0.9826090160F, 0.9828969402F, - 0.9831814498F, 0.9834625674F, 0.9837403156F, 0.9840147169F, - 0.9842857939F, 0.9845535692F, 0.9848180654F, 0.9850793052F, - 0.9853373113F, 0.9855921062F, 0.9858437127F, 0.9860921535F, - 0.9863374512F, 0.9865796287F, 0.9868187085F, 0.9870547136F, - 0.9872876664F, 0.9875175899F, 0.9877445067F, 0.9879684396F, - 0.9881894112F, 0.9884074444F, 0.9886225619F, 0.9888347863F, - 0.9890441404F, 0.9892506468F, 0.9894543284F, 0.9896552077F, - 0.9898533074F, 0.9900486502F, 0.9902412587F, 0.9904311555F, - 0.9906183633F, 0.9908029045F, 0.9909848019F, 0.9911640779F, - 0.9913407550F, 0.9915148557F, 0.9916864025F, 0.9918554179F, - 0.9920219241F, 0.9921859437F, 0.9923474989F, 0.9925066120F, - 0.9926633054F, 0.9928176012F, 0.9929695218F, 0.9931190891F, - 0.9932663254F, 0.9934112527F, 0.9935538932F, 0.9936942686F, - 0.9938324012F, 0.9939683126F, 0.9941020248F, 0.9942335597F, - 0.9943629388F, 0.9944901841F, 0.9946153170F, 0.9947383593F, - 0.9948593325F, 0.9949782579F, 0.9950951572F, 0.9952100516F, - 0.9953229625F, 0.9954339111F, 0.9955429186F, 0.9956500062F, - 0.9957551948F, 0.9958585056F, 0.9959599593F, 0.9960595769F, - 0.9961573792F, 0.9962533869F, 0.9963476206F, 0.9964401009F, - 0.9965308483F, 0.9966198833F, 0.9967072261F, 0.9967928971F, - 0.9968769164F, 0.9969593041F, 0.9970400804F, 0.9971192651F, - 0.9971968781F, 0.9972729391F, 0.9973474680F, 0.9974204842F, - 0.9974920074F, 0.9975620569F, 0.9976306521F, 0.9976978122F, - 0.9977635565F, 0.9978279039F, 0.9978908736F, 0.9979524842F, - 0.9980127547F, 0.9980717037F, 0.9981293499F, 0.9981857116F, - 0.9982408073F, 0.9982946554F, 0.9983472739F, 0.9983986810F, - 0.9984488947F, 0.9984979328F, 0.9985458132F, 0.9985925534F, - 0.9986381711F, 0.9986826838F, 0.9987261086F, 0.9987684630F, - 0.9988097640F, 0.9988500286F, 0.9988892738F, 0.9989275163F, - 0.9989647727F, 0.9990010597F, 0.9990363938F, 0.9990707911F, - 0.9991042679F, 0.9991368404F, 0.9991685244F, 0.9991993358F, - 0.9992292905F, 0.9992584038F, 0.9992866914F, 0.9993141686F, - 0.9993408506F, 0.9993667526F, 0.9993918895F, 0.9994162761F, - 0.9994399273F, 0.9994628576F, 0.9994850815F, 0.9995066133F, - 0.9995274672F, 0.9995476574F, 0.9995671978F, 0.9995861021F, - 0.9996043841F, 0.9996220573F, 0.9996391352F, 0.9996556310F, - 0.9996715579F, 0.9996869288F, 0.9997017568F, 0.9997160543F, - 0.9997298342F, 0.9997431088F, 0.9997558905F, 0.9997681914F, - 0.9997800236F, 0.9997913990F, 0.9998023292F, 0.9998128261F, - 0.9998229009F, 0.9998325650F, 0.9998418296F, 0.9998507058F, - 0.9998592044F, 0.9998673362F, 0.9998751117F, 0.9998825415F, - 0.9998896358F, 0.9998964047F, 0.9999028584F, 0.9999090066F, - 0.9999148590F, 0.9999204253F, 0.9999257148F, 0.9999307368F, - 0.9999355003F, 0.9999400144F, 0.9999442878F, 0.9999483293F, - 0.9999521472F, 0.9999557499F, 0.9999591457F, 0.9999623426F, - 0.9999653483F, 0.9999681708F, 0.9999708175F, 0.9999732959F, - 0.9999756132F, 0.9999777765F, 0.9999797928F, 0.9999816688F, - 0.9999834113F, 0.9999850266F, 0.9999865211F, 0.9999879009F, - 0.9999891721F, 0.9999903405F, 0.9999914118F, 0.9999923914F, - 0.9999932849F, 0.9999940972F, 0.9999948336F, 0.9999954989F, - 0.9999960978F, 0.9999966349F, 0.9999971146F, 0.9999975411F, - 0.9999979185F, 0.9999982507F, 0.9999985414F, 0.9999987944F, - 0.9999990129F, 0.9999992003F, 0.9999993596F, 0.9999994939F, - 0.9999996059F, 0.9999996981F, 0.9999997732F, 0.9999998333F, - 0.9999998805F, 0.9999999170F, 0.9999999444F, 0.9999999643F, - 0.9999999784F, 0.9999999878F, 0.9999999937F, 0.9999999972F, - 0.9999999990F, 0.9999999997F, 1.0000000000F, 1.0000000000F, -}; - -DECLARE_ALIGNED(16, static const float, vwin4096)[2048] = { - 0.0000002310F, 0.0000020791F, 0.0000057754F, 0.0000113197F, - 0.0000187121F, 0.0000279526F, 0.0000390412F, 0.0000519777F, - 0.0000667623F, 0.0000833949F, 0.0001018753F, 0.0001222036F, - 0.0001443798F, 0.0001684037F, 0.0001942754F, 0.0002219947F, - 0.0002515616F, 0.0002829761F, 0.0003162380F, 0.0003513472F, - 0.0003883038F, 0.0004271076F, 0.0004677584F, 0.0005102563F, - 0.0005546011F, 0.0006007928F, 0.0006488311F, 0.0006987160F, - 0.0007504474F, 0.0008040251F, 0.0008594490F, 0.0009167191F, - 0.0009758351F, 0.0010367969F, 0.0010996044F, 0.0011642574F, - 0.0012307558F, 0.0012990994F, 0.0013692880F, 0.0014413216F, - 0.0015151998F, 0.0015909226F, 0.0016684898F, 0.0017479011F, - 0.0018291565F, 0.0019122556F, 0.0019971983F, 0.0020839845F, - 0.0021726138F, 0.0022630861F, 0.0023554012F, 0.0024495588F, - 0.0025455588F, 0.0026434008F, 0.0027430847F, 0.0028446103F, - 0.0029479772F, 0.0030531853F, 0.0031602342F, 0.0032691238F, - 0.0033798538F, 0.0034924239F, 0.0036068338F, 0.0037230833F, - 0.0038411721F, 0.0039610999F, 0.0040828664F, 0.0042064714F, - 0.0043319145F, 0.0044591954F, 0.0045883139F, 0.0047192696F, - 0.0048520622F, 0.0049866914F, 0.0051231569F, 0.0052614583F, - 0.0054015953F, 0.0055435676F, 0.0056873748F, 0.0058330166F, - 0.0059804926F, 0.0061298026F, 0.0062809460F, 0.0064339226F, - 0.0065887320F, 0.0067453738F, 0.0069038476F, 0.0070641531F, - 0.0072262899F, 0.0073902575F, 0.0075560556F, 0.0077236838F, - 0.0078931417F, 0.0080644288F, 0.0082375447F, 0.0084124891F, - 0.0085892615F, 0.0087678614F, 0.0089482885F, 0.0091305422F, - 0.0093146223F, 0.0095005281F, 0.0096882592F, 0.0098778153F, - 0.0100691958F, 0.0102624002F, 0.0104574281F, 0.0106542791F, - 0.0108529525F, 0.0110534480F, 0.0112557651F, 0.0114599032F, - 0.0116658618F, 0.0118736405F, 0.0120832387F, 0.0122946560F, - 0.0125078917F, 0.0127229454F, 0.0129398166F, 0.0131585046F, - 0.0133790090F, 0.0136013292F, 0.0138254647F, 0.0140514149F, - 0.0142791792F, 0.0145087572F, 0.0147401481F, 0.0149733515F, - 0.0152083667F, 0.0154451932F, 0.0156838304F, 0.0159242777F, - 0.0161665345F, 0.0164106001F, 0.0166564741F, 0.0169041557F, - 0.0171536443F, 0.0174049393F, 0.0176580401F, 0.0179129461F, - 0.0181696565F, 0.0184281708F, 0.0186884883F, 0.0189506084F, - 0.0192145303F, 0.0194802535F, 0.0197477772F, 0.0200171008F, - 0.0202882236F, 0.0205611449F, 0.0208358639F, 0.0211123801F, - 0.0213906927F, 0.0216708011F, 0.0219527043F, 0.0222364019F, - 0.0225218930F, 0.0228091769F, 0.0230982529F, 0.0233891203F, - 0.0236817782F, 0.0239762259F, 0.0242724628F, 0.0245704880F, - 0.0248703007F, 0.0251719002F, 0.0254752858F, 0.0257804565F, - 0.0260874117F, 0.0263961506F, 0.0267066722F, 0.0270189760F, - 0.0273330609F, 0.0276489263F, 0.0279665712F, 0.0282859949F, - 0.0286071966F, 0.0289301753F, 0.0292549303F, 0.0295814607F, - 0.0299097656F, 0.0302398442F, 0.0305716957F, 0.0309053191F, - 0.0312407135F, 0.0315778782F, 0.0319168122F, 0.0322575145F, - 0.0325999844F, 0.0329442209F, 0.0332902231F, 0.0336379900F, - 0.0339875208F, 0.0343388146F, 0.0346918703F, 0.0350466871F, - 0.0354032640F, 0.0357616000F, 0.0361216943F, 0.0364835458F, - 0.0368471535F, 0.0372125166F, 0.0375796339F, 0.0379485046F, - 0.0383191276F, 0.0386915020F, 0.0390656267F, 0.0394415008F, - 0.0398191231F, 0.0401984927F, 0.0405796086F, 0.0409624698F, - 0.0413470751F, 0.0417334235F, 0.0421215141F, 0.0425113457F, - 0.0429029172F, 0.0432962277F, 0.0436912760F, 0.0440880610F, - 0.0444865817F, 0.0448868370F, 0.0452888257F, 0.0456925468F, - 0.0460979992F, 0.0465051816F, 0.0469140931F, 0.0473247325F, - 0.0477370986F, 0.0481511902F, 0.0485670064F, 0.0489845458F, - 0.0494038074F, 0.0498247899F, 0.0502474922F, 0.0506719131F, - 0.0510980514F, 0.0515259060F, 0.0519554756F, 0.0523867590F, - 0.0528197550F, 0.0532544624F, 0.0536908800F, 0.0541290066F, - 0.0545688408F, 0.0550103815F, 0.0554536274F, 0.0558985772F, - 0.0563452297F, 0.0567935837F, 0.0572436377F, 0.0576953907F, - 0.0581488412F, 0.0586039880F, 0.0590608297F, 0.0595193651F, - 0.0599795929F, 0.0604415117F, 0.0609051202F, 0.0613704170F, - 0.0618374009F, 0.0623060704F, 0.0627764243F, 0.0632484611F, - 0.0637221795F, 0.0641975781F, 0.0646746555F, 0.0651534104F, - 0.0656338413F, 0.0661159469F, 0.0665997257F, 0.0670851763F, - 0.0675722973F, 0.0680610873F, 0.0685515448F, 0.0690436684F, - 0.0695374567F, 0.0700329081F, 0.0705300213F, 0.0710287947F, - 0.0715292269F, 0.0720313163F, 0.0725350616F, 0.0730404612F, - 0.0735475136F, 0.0740562172F, 0.0745665707F, 0.0750785723F, - 0.0755922207F, 0.0761075143F, 0.0766244515F, 0.0771430307F, - 0.0776632505F, 0.0781851092F, 0.0787086052F, 0.0792337371F, - 0.0797605032F, 0.0802889018F, 0.0808189315F, 0.0813505905F, - 0.0818838773F, 0.0824187903F, 0.0829553277F, 0.0834934881F, - 0.0840332697F, 0.0845746708F, 0.0851176899F, 0.0856623252F, - 0.0862085751F, 0.0867564379F, 0.0873059119F, 0.0878569954F, - 0.0884096867F, 0.0889639840F, 0.0895198858F, 0.0900773902F, - 0.0906364955F, 0.0911972000F, 0.0917595019F, 0.0923233995F, - 0.0928888909F, 0.0934559745F, 0.0940246485F, 0.0945949110F, - 0.0951667604F, 0.0957401946F, 0.0963152121F, 0.0968918109F, - 0.0974699893F, 0.0980497454F, 0.0986310773F, 0.0992139832F, - 0.0997984614F, 0.1003845098F, 0.1009721267F, 0.1015613101F, - 0.1021520582F, 0.1027443692F, 0.1033382410F, 0.1039336718F, - 0.1045306597F, 0.1051292027F, 0.1057292990F, 0.1063309466F, - 0.1069341435F, 0.1075388878F, 0.1081451776F, 0.1087530108F, - 0.1093623856F, 0.1099732998F, 0.1105857516F, 0.1111997389F, - 0.1118152597F, 0.1124323121F, 0.1130508939F, 0.1136710032F, - 0.1142926379F, 0.1149157960F, 0.1155404755F, 0.1161666742F, - 0.1167943901F, 0.1174236211F, 0.1180543652F, 0.1186866202F, - 0.1193203841F, 0.1199556548F, 0.1205924300F, 0.1212307078F, - 0.1218704860F, 0.1225117624F, 0.1231545349F, 0.1237988013F, - 0.1244445596F, 0.1250918074F, 0.1257405427F, 0.1263907632F, - 0.1270424667F, 0.1276956512F, 0.1283503142F, 0.1290064537F, - 0.1296640674F, 0.1303231530F, 0.1309837084F, 0.1316457312F, - 0.1323092193F, 0.1329741703F, 0.1336405820F, 0.1343084520F, - 0.1349777782F, 0.1356485582F, 0.1363207897F, 0.1369944704F, - 0.1376695979F, 0.1383461700F, 0.1390241842F, 0.1397036384F, - 0.1403845300F, 0.1410668567F, 0.1417506162F, 0.1424358061F, - 0.1431224240F, 0.1438104674F, 0.1444999341F, 0.1451908216F, - 0.1458831274F, 0.1465768492F, 0.1472719844F, 0.1479685308F, - 0.1486664857F, 0.1493658468F, 0.1500666115F, 0.1507687775F, - 0.1514723422F, 0.1521773031F, 0.1528836577F, 0.1535914035F, - 0.1543005380F, 0.1550110587F, 0.1557229631F, 0.1564362485F, - 0.1571509124F, 0.1578669524F, 0.1585843657F, 0.1593031499F, - 0.1600233024F, 0.1607448205F, 0.1614677017F, 0.1621919433F, - 0.1629175428F, 0.1636444975F, 0.1643728047F, 0.1651024619F, - 0.1658334665F, 0.1665658156F, 0.1672995067F, 0.1680345371F, - 0.1687709041F, 0.1695086050F, 0.1702476372F, 0.1709879978F, - 0.1717296843F, 0.1724726938F, 0.1732170237F, 0.1739626711F, - 0.1747096335F, 0.1754579079F, 0.1762074916F, 0.1769583819F, - 0.1777105760F, 0.1784640710F, 0.1792188642F, 0.1799749529F, - 0.1807323340F, 0.1814910049F, 0.1822509628F, 0.1830122046F, - 0.1837747277F, 0.1845385292F, 0.1853036062F, 0.1860699558F, - 0.1868375751F, 0.1876064613F, 0.1883766114F, 0.1891480226F, - 0.1899206919F, 0.1906946164F, 0.1914697932F, 0.1922462194F, - 0.1930238919F, 0.1938028079F, 0.1945829643F, 0.1953643583F, - 0.1961469868F, 0.1969308468F, 0.1977159353F, 0.1985022494F, - 0.1992897859F, 0.2000785420F, 0.2008685145F, 0.2016597005F, - 0.2024520968F, 0.2032457005F, 0.2040405084F, 0.2048365175F, - 0.2056337247F, 0.2064321269F, 0.2072317211F, 0.2080325041F, - 0.2088344727F, 0.2096376240F, 0.2104419547F, 0.2112474618F, - 0.2120541420F, 0.2128619923F, 0.2136710094F, 0.2144811902F, - 0.2152925315F, 0.2161050301F, 0.2169186829F, 0.2177334866F, - 0.2185494381F, 0.2193665340F, 0.2201847712F, 0.2210041465F, - 0.2218246565F, 0.2226462981F, 0.2234690680F, 0.2242929629F, - 0.2251179796F, 0.2259441147F, 0.2267713650F, 0.2275997272F, - 0.2284291979F, 0.2292597739F, 0.2300914518F, 0.2309242283F, - 0.2317581001F, 0.2325930638F, 0.2334291160F, 0.2342662534F, - 0.2351044727F, 0.2359437703F, 0.2367841431F, 0.2376255875F, - 0.2384681001F, 0.2393116776F, 0.2401563165F, 0.2410020134F, - 0.2418487649F, 0.2426965675F, 0.2435454178F, 0.2443953122F, - 0.2452462474F, 0.2460982199F, 0.2469512262F, 0.2478052628F, - 0.2486603262F, 0.2495164129F, 0.2503735194F, 0.2512316421F, - 0.2520907776F, 0.2529509222F, 0.2538120726F, 0.2546742250F, - 0.2555373760F, 0.2564015219F, 0.2572666593F, 0.2581327845F, - 0.2589998939F, 0.2598679840F, 0.2607370510F, 0.2616070916F, - 0.2624781019F, 0.2633500783F, 0.2642230173F, 0.2650969152F, - 0.2659717684F, 0.2668475731F, 0.2677243257F, 0.2686020226F, - 0.2694806601F, 0.2703602344F, 0.2712407419F, 0.2721221789F, - 0.2730045417F, 0.2738878265F, 0.2747720297F, 0.2756571474F, - 0.2765431760F, 0.2774301117F, 0.2783179508F, 0.2792066895F, - 0.2800963240F, 0.2809868505F, 0.2818782654F, 0.2827705647F, - 0.2836637447F, 0.2845578016F, 0.2854527315F, 0.2863485307F, - 0.2872451953F, 0.2881427215F, 0.2890411055F, 0.2899403433F, - 0.2908404312F, 0.2917413654F, 0.2926431418F, 0.2935457567F, - 0.2944492061F, 0.2953534863F, 0.2962585932F, 0.2971645230F, - 0.2980712717F, 0.2989788356F, 0.2998872105F, 0.3007963927F, - 0.3017063781F, 0.3026171629F, 0.3035287430F, 0.3044411145F, - 0.3053542736F, 0.3062682161F, 0.3071829381F, 0.3080984356F, - 0.3090147047F, 0.3099317413F, 0.3108495414F, 0.3117681011F, - 0.3126874163F, 0.3136074830F, 0.3145282972F, 0.3154498548F, - 0.3163721517F, 0.3172951841F, 0.3182189477F, 0.3191434385F, - 0.3200686525F, 0.3209945856F, 0.3219212336F, 0.3228485927F, - 0.3237766585F, 0.3247054271F, 0.3256348943F, 0.3265650560F, - 0.3274959081F, 0.3284274465F, 0.3293596671F, 0.3302925657F, - 0.3312261382F, 0.3321603804F, 0.3330952882F, 0.3340308574F, - 0.3349670838F, 0.3359039634F, 0.3368414919F, 0.3377796651F, - 0.3387184789F, 0.3396579290F, 0.3405980113F, 0.3415387216F, - 0.3424800556F, 0.3434220091F, 0.3443645779F, 0.3453077578F, - 0.3462515446F, 0.3471959340F, 0.3481409217F, 0.3490865036F, - 0.3500326754F, 0.3509794328F, 0.3519267715F, 0.3528746873F, - 0.3538231759F, 0.3547722330F, 0.3557218544F, 0.3566720357F, - 0.3576227727F, 0.3585740610F, 0.3595258964F, 0.3604782745F, - 0.3614311910F, 0.3623846417F, 0.3633386221F, 0.3642931280F, - 0.3652481549F, 0.3662036987F, 0.3671597548F, 0.3681163191F, - 0.3690733870F, 0.3700309544F, 0.3709890167F, 0.3719475696F, - 0.3729066089F, 0.3738661299F, 0.3748261285F, 0.3757866002F, - 0.3767475406F, 0.3777089453F, 0.3786708100F, 0.3796331302F, - 0.3805959014F, 0.3815591194F, 0.3825227796F, 0.3834868777F, - 0.3844514093F, 0.3854163698F, 0.3863817549F, 0.3873475601F, - 0.3883137810F, 0.3892804131F, 0.3902474521F, 0.3912148933F, - 0.3921827325F, 0.3931509650F, 0.3941195865F, 0.3950885925F, - 0.3960579785F, 0.3970277400F, 0.3979978725F, 0.3989683716F, - 0.3999392328F, 0.4009104516F, 0.4018820234F, 0.4028539438F, - 0.4038262084F, 0.4047988125F, 0.4057717516F, 0.4067450214F, - 0.4077186172F, 0.4086925345F, 0.4096667688F, 0.4106413155F, - 0.4116161703F, 0.4125913284F, 0.4135667854F, 0.4145425368F, - 0.4155185780F, 0.4164949044F, 0.4174715116F, 0.4184483949F, - 0.4194255498F, 0.4204029718F, 0.4213806563F, 0.4223585987F, - 0.4233367946F, 0.4243152392F, 0.4252939281F, 0.4262728566F, - 0.4272520202F, 0.4282314144F, 0.4292110345F, 0.4301908760F, - 0.4311709343F, 0.4321512047F, 0.4331316828F, 0.4341123639F, - 0.4350932435F, 0.4360743168F, 0.4370555794F, 0.4380370267F, - 0.4390186540F, 0.4400004567F, 0.4409824303F, 0.4419645701F, - 0.4429468716F, 0.4439293300F, 0.4449119409F, 0.4458946996F, - 0.4468776014F, 0.4478606418F, 0.4488438162F, 0.4498271199F, - 0.4508105483F, 0.4517940967F, 0.4527777607F, 0.4537615355F, - 0.4547454165F, 0.4557293991F, 0.4567134786F, 0.4576976505F, - 0.4586819101F, 0.4596662527F, 0.4606506738F, 0.4616351687F, - 0.4626197328F, 0.4636043614F, 0.4645890499F, 0.4655737936F, - 0.4665585880F, 0.4675434284F, 0.4685283101F, 0.4695132286F, - 0.4704981791F, 0.4714831570F, 0.4724681577F, 0.4734531766F, - 0.4744382089F, 0.4754232501F, 0.4764082956F, 0.4773933406F, - 0.4783783806F, 0.4793634108F, 0.4803484267F, 0.4813334237F, - 0.4823183969F, 0.4833033419F, 0.4842882540F, 0.4852731285F, - 0.4862579608F, 0.4872427462F, 0.4882274802F, 0.4892121580F, - 0.4901967751F, 0.4911813267F, 0.4921658083F, 0.4931502151F, - 0.4941345427F, 0.4951187863F, 0.4961029412F, 0.4970870029F, - 0.4980709667F, 0.4990548280F, 0.5000385822F, 0.5010222245F, - 0.5020057505F, 0.5029891553F, 0.5039724345F, 0.5049555834F, - 0.5059385973F, 0.5069214716F, 0.5079042018F, 0.5088867831F, - 0.5098692110F, 0.5108514808F, 0.5118335879F, 0.5128155277F, - 0.5137972956F, 0.5147788869F, 0.5157602971F, 0.5167415215F, - 0.5177225555F, 0.5187033945F, 0.5196840339F, 0.5206644692F, - 0.5216446956F, 0.5226247086F, 0.5236045035F, 0.5245840759F, - 0.5255634211F, 0.5265425344F, 0.5275214114F, 0.5285000474F, - 0.5294784378F, 0.5304565781F, 0.5314344637F, 0.5324120899F, - 0.5333894522F, 0.5343665461F, 0.5353433670F, 0.5363199102F, - 0.5372961713F, 0.5382721457F, 0.5392478287F, 0.5402232159F, - 0.5411983027F, 0.5421730845F, 0.5431475569F, 0.5441217151F, - 0.5450955548F, 0.5460690714F, 0.5470422602F, 0.5480151169F, - 0.5489876368F, 0.5499598155F, 0.5509316484F, 0.5519031310F, - 0.5528742587F, 0.5538450271F, 0.5548154317F, 0.5557854680F, - 0.5567551314F, 0.5577244174F, 0.5586933216F, 0.5596618395F, - 0.5606299665F, 0.5615976983F, 0.5625650302F, 0.5635319580F, - 0.5644984770F, 0.5654645828F, 0.5664302709F, 0.5673955370F, - 0.5683603765F, 0.5693247850F, 0.5702887580F, 0.5712522912F, - 0.5722153800F, 0.5731780200F, 0.5741402069F, 0.5751019362F, - 0.5760632034F, 0.5770240042F, 0.5779843341F, 0.5789441889F, - 0.5799035639F, 0.5808624549F, 0.5818208575F, 0.5827787673F, - 0.5837361800F, 0.5846930910F, 0.5856494961F, 0.5866053910F, - 0.5875607712F, 0.5885156324F, 0.5894699703F, 0.5904237804F, - 0.5913770586F, 0.5923298004F, 0.5932820016F, 0.5942336578F, - 0.5951847646F, 0.5961353179F, 0.5970853132F, 0.5980347464F, - 0.5989836131F, 0.5999319090F, 0.6008796298F, 0.6018267713F, - 0.6027733292F, 0.6037192993F, 0.6046646773F, 0.6056094589F, - 0.6065536400F, 0.6074972162F, 0.6084401833F, 0.6093825372F, - 0.6103242736F, 0.6112653884F, 0.6122058772F, 0.6131457359F, - 0.6140849604F, 0.6150235464F, 0.6159614897F, 0.6168987862F, - 0.6178354318F, 0.6187714223F, 0.6197067535F, 0.6206414213F, - 0.6215754215F, 0.6225087501F, 0.6234414028F, 0.6243733757F, - 0.6253046646F, 0.6262352654F, 0.6271651739F, 0.6280943862F, - 0.6290228982F, 0.6299507057F, 0.6308778048F, 0.6318041913F, - 0.6327298612F, 0.6336548105F, 0.6345790352F, 0.6355025312F, - 0.6364252945F, 0.6373473211F, 0.6382686070F, 0.6391891483F, - 0.6401089409F, 0.6410279808F, 0.6419462642F, 0.6428637869F, - 0.6437805452F, 0.6446965350F, 0.6456117524F, 0.6465261935F, - 0.6474398544F, 0.6483527311F, 0.6492648197F, 0.6501761165F, - 0.6510866174F, 0.6519963186F, 0.6529052162F, 0.6538133064F, - 0.6547205854F, 0.6556270492F, 0.6565326941F, 0.6574375162F, - 0.6583415117F, 0.6592446769F, 0.6601470079F, 0.6610485009F, - 0.6619491521F, 0.6628489578F, 0.6637479143F, 0.6646460177F, - 0.6655432643F, 0.6664396505F, 0.6673351724F, 0.6682298264F, - 0.6691236087F, 0.6700165157F, 0.6709085436F, 0.6717996889F, - 0.6726899478F, 0.6735793167F, 0.6744677918F, 0.6753553697F, - 0.6762420466F, 0.6771278190F, 0.6780126832F, 0.6788966357F, - 0.6797796728F, 0.6806617909F, 0.6815429866F, 0.6824232562F, - 0.6833025961F, 0.6841810030F, 0.6850584731F, 0.6859350031F, - 0.6868105894F, 0.6876852284F, 0.6885589168F, 0.6894316510F, - 0.6903034275F, 0.6911742430F, 0.6920440939F, 0.6929129769F, - 0.6937808884F, 0.6946478251F, 0.6955137837F, 0.6963787606F, - 0.6972427525F, 0.6981057560F, 0.6989677678F, 0.6998287845F, - 0.7006888028F, 0.7015478194F, 0.7024058309F, 0.7032628340F, - 0.7041188254F, 0.7049738019F, 0.7058277601F, 0.7066806969F, - 0.7075326089F, 0.7083834929F, 0.7092333457F, 0.7100821640F, - 0.7109299447F, 0.7117766846F, 0.7126223804F, 0.7134670291F, - 0.7143106273F, 0.7151531721F, 0.7159946602F, 0.7168350885F, - 0.7176744539F, 0.7185127534F, 0.7193499837F, 0.7201861418F, - 0.7210212247F, 0.7218552293F, 0.7226881526F, 0.7235199914F, - 0.7243507428F, 0.7251804039F, 0.7260089715F, 0.7268364426F, - 0.7276628144F, 0.7284880839F, 0.7293122481F, 0.7301353040F, - 0.7309572487F, 0.7317780794F, 0.7325977930F, 0.7334163868F, - 0.7342338579F, 0.7350502033F, 0.7358654202F, 0.7366795059F, - 0.7374924573F, 0.7383042718F, 0.7391149465F, 0.7399244787F, - 0.7407328655F, 0.7415401041F, 0.7423461920F, 0.7431511261F, - 0.7439549040F, 0.7447575227F, 0.7455589797F, 0.7463592723F, - 0.7471583976F, 0.7479563532F, 0.7487531363F, 0.7495487443F, - 0.7503431745F, 0.7511364244F, 0.7519284913F, 0.7527193726F, - 0.7535090658F, 0.7542975683F, 0.7550848776F, 0.7558709910F, - 0.7566559062F, 0.7574396205F, 0.7582221314F, 0.7590034366F, - 0.7597835334F, 0.7605624194F, 0.7613400923F, 0.7621165495F, - 0.7628917886F, 0.7636658072F, 0.7644386030F, 0.7652101735F, - 0.7659805164F, 0.7667496292F, 0.7675175098F, 0.7682841556F, - 0.7690495645F, 0.7698137341F, 0.7705766622F, 0.7713383463F, - 0.7720987844F, 0.7728579741F, 0.7736159132F, 0.7743725994F, - 0.7751280306F, 0.7758822046F, 0.7766351192F, 0.7773867722F, - 0.7781371614F, 0.7788862848F, 0.7796341401F, 0.7803807253F, - 0.7811260383F, 0.7818700769F, 0.7826128392F, 0.7833543230F, - 0.7840945263F, 0.7848334471F, 0.7855710833F, 0.7863074330F, - 0.7870424941F, 0.7877762647F, 0.7885087428F, 0.7892399264F, - 0.7899698137F, 0.7906984026F, 0.7914256914F, 0.7921516780F, - 0.7928763607F, 0.7935997375F, 0.7943218065F, 0.7950425661F, - 0.7957620142F, 0.7964801492F, 0.7971969692F, 0.7979124724F, - 0.7986266570F, 0.7993395214F, 0.8000510638F, 0.8007612823F, - 0.8014701754F, 0.8021777413F, 0.8028839784F, 0.8035888849F, - 0.8042924592F, 0.8049946997F, 0.8056956048F, 0.8063951727F, - 0.8070934020F, 0.8077902910F, 0.8084858381F, 0.8091800419F, - 0.8098729007F, 0.8105644130F, 0.8112545774F, 0.8119433922F, - 0.8126308561F, 0.8133169676F, 0.8140017251F, 0.8146851272F, - 0.8153671726F, 0.8160478598F, 0.8167271874F, 0.8174051539F, - 0.8180817582F, 0.8187569986F, 0.8194308741F, 0.8201033831F, - 0.8207745244F, 0.8214442966F, 0.8221126986F, 0.8227797290F, - 0.8234453865F, 0.8241096700F, 0.8247725781F, 0.8254341097F, - 0.8260942636F, 0.8267530385F, 0.8274104334F, 0.8280664470F, - 0.8287210782F, 0.8293743259F, 0.8300261889F, 0.8306766662F, - 0.8313257566F, 0.8319734591F, 0.8326197727F, 0.8332646963F, - 0.8339082288F, 0.8345503692F, 0.8351911167F, 0.8358304700F, - 0.8364684284F, 0.8371049907F, 0.8377401562F, 0.8383739238F, - 0.8390062927F, 0.8396372618F, 0.8402668305F, 0.8408949977F, - 0.8415217626F, 0.8421471245F, 0.8427710823F, 0.8433936354F, - 0.8440147830F, 0.8446345242F, 0.8452528582F, 0.8458697844F, - 0.8464853020F, 0.8470994102F, 0.8477121084F, 0.8483233958F, - 0.8489332718F, 0.8495417356F, 0.8501487866F, 0.8507544243F, - 0.8513586479F, 0.8519614568F, 0.8525628505F, 0.8531628283F, - 0.8537613897F, 0.8543585341F, 0.8549542611F, 0.8555485699F, - 0.8561414603F, 0.8567329315F, 0.8573229832F, 0.8579116149F, - 0.8584988262F, 0.8590846165F, 0.8596689855F, 0.8602519327F, - 0.8608334577F, 0.8614135603F, 0.8619922399F, 0.8625694962F, - 0.8631453289F, 0.8637197377F, 0.8642927222F, 0.8648642821F, - 0.8654344172F, 0.8660031272F, 0.8665704118F, 0.8671362708F, - 0.8677007039F, 0.8682637109F, 0.8688252917F, 0.8693854460F, - 0.8699441737F, 0.8705014745F, 0.8710573485F, 0.8716117953F, - 0.8721648150F, 0.8727164073F, 0.8732665723F, 0.8738153098F, - 0.8743626197F, 0.8749085021F, 0.8754529569F, 0.8759959840F, - 0.8765375835F, 0.8770777553F, 0.8776164996F, 0.8781538162F, - 0.8786897054F, 0.8792241670F, 0.8797572013F, 0.8802888082F, - 0.8808189880F, 0.8813477407F, 0.8818750664F, 0.8824009653F, - 0.8829254375F, 0.8834484833F, 0.8839701028F, 0.8844902961F, - 0.8850090636F, 0.8855264054F, 0.8860423218F, 0.8865568131F, - 0.8870698794F, 0.8875815212F, 0.8880917386F, 0.8886005319F, - 0.8891079016F, 0.8896138479F, 0.8901183712F, 0.8906214719F, - 0.8911231503F, 0.8916234067F, 0.8921222417F, 0.8926196556F, - 0.8931156489F, 0.8936102219F, 0.8941033752F, 0.8945951092F, - 0.8950854244F, 0.8955743212F, 0.8960618003F, 0.8965478621F, - 0.8970325071F, 0.8975157359F, 0.8979975490F, 0.8984779471F, - 0.8989569307F, 0.8994345004F, 0.8999106568F, 0.9003854005F, - 0.9008587323F, 0.9013306526F, 0.9018011623F, 0.9022702619F, - 0.9027379521F, 0.9032042337F, 0.9036691074F, 0.9041325739F, - 0.9045946339F, 0.9050552882F, 0.9055145376F, 0.9059723828F, - 0.9064288246F, 0.9068838638F, 0.9073375013F, 0.9077897379F, - 0.9082405743F, 0.9086900115F, 0.9091380503F, 0.9095846917F, - 0.9100299364F, 0.9104737854F, 0.9109162397F, 0.9113573001F, - 0.9117969675F, 0.9122352430F, 0.9126721275F, 0.9131076219F, - 0.9135417273F, 0.9139744447F, 0.9144057750F, 0.9148357194F, - 0.9152642787F, 0.9156914542F, 0.9161172468F, 0.9165416576F, - 0.9169646877F, 0.9173863382F, 0.9178066102F, 0.9182255048F, - 0.9186430232F, 0.9190591665F, 0.9194739359F, 0.9198873324F, - 0.9202993574F, 0.9207100120F, 0.9211192973F, 0.9215272147F, - 0.9219337653F, 0.9223389504F, 0.9227427713F, 0.9231452290F, - 0.9235463251F, 0.9239460607F, 0.9243444371F, 0.9247414557F, - 0.9251371177F, 0.9255314245F, 0.9259243774F, 0.9263159778F, - 0.9267062270F, 0.9270951264F, 0.9274826774F, 0.9278688814F, - 0.9282537398F, 0.9286372540F, 0.9290194254F, 0.9294002555F, - 0.9297797458F, 0.9301578976F, 0.9305347125F, 0.9309101919F, - 0.9312843373F, 0.9316571503F, 0.9320286323F, 0.9323987849F, - 0.9327676097F, 0.9331351080F, 0.9335012816F, 0.9338661320F, - 0.9342296607F, 0.9345918694F, 0.9349527596F, 0.9353123330F, - 0.9356705911F, 0.9360275357F, 0.9363831683F, 0.9367374905F, - 0.9370905042F, 0.9374422108F, 0.9377926122F, 0.9381417099F, - 0.9384895057F, 0.9388360014F, 0.9391811985F, 0.9395250989F, - 0.9398677043F, 0.9402090165F, 0.9405490371F, 0.9408877680F, - 0.9412252110F, 0.9415613678F, 0.9418962402F, 0.9422298301F, - 0.9425621392F, 0.9428931695F, 0.9432229226F, 0.9435514005F, - 0.9438786050F, 0.9442045381F, 0.9445292014F, 0.9448525971F, - 0.9451747268F, 0.9454955926F, 0.9458151963F, 0.9461335399F, - 0.9464506253F, 0.9467664545F, 0.9470810293F, 0.9473943517F, - 0.9477064238F, 0.9480172474F, 0.9483268246F, 0.9486351573F, - 0.9489422475F, 0.9492480973F, 0.9495527087F, 0.9498560837F, - 0.9501582243F, 0.9504591325F, 0.9507588105F, 0.9510572603F, - 0.9513544839F, 0.9516504834F, 0.9519452609F, 0.9522388186F, - 0.9525311584F, 0.9528222826F, 0.9531121932F, 0.9534008923F, - 0.9536883821F, 0.9539746647F, 0.9542597424F, 0.9545436171F, - 0.9548262912F, 0.9551077667F, 0.9553880459F, 0.9556671309F, - 0.9559450239F, 0.9562217272F, 0.9564972429F, 0.9567715733F, - 0.9570447206F, 0.9573166871F, 0.9575874749F, 0.9578570863F, - 0.9581255236F, 0.9583927890F, 0.9586588849F, 0.9589238134F, - 0.9591875769F, 0.9594501777F, 0.9597116180F, 0.9599719003F, - 0.9602310267F, 0.9604889995F, 0.9607458213F, 0.9610014942F, - 0.9612560206F, 0.9615094028F, 0.9617616433F, 0.9620127443F, - 0.9622627083F, 0.9625115376F, 0.9627592345F, 0.9630058016F, - 0.9632512411F, 0.9634955555F, 0.9637387471F, 0.9639808185F, - 0.9642217720F, 0.9644616100F, 0.9647003349F, 0.9649379493F, - 0.9651744556F, 0.9654098561F, 0.9656441534F, 0.9658773499F, - 0.9661094480F, 0.9663404504F, 0.9665703593F, 0.9667991774F, - 0.9670269071F, 0.9672535509F, 0.9674791114F, 0.9677035909F, - 0.9679269921F, 0.9681493174F, 0.9683705694F, 0.9685907506F, - 0.9688098636F, 0.9690279108F, 0.9692448948F, 0.9694608182F, - 0.9696756836F, 0.9698894934F, 0.9701022503F, 0.9703139569F, - 0.9705246156F, 0.9707342291F, 0.9709428000F, 0.9711503309F, - 0.9713568243F, 0.9715622829F, 0.9717667093F, 0.9719701060F, - 0.9721724757F, 0.9723738210F, 0.9725741446F, 0.9727734490F, - 0.9729717369F, 0.9731690109F, 0.9733652737F, 0.9735605279F, - 0.9737547762F, 0.9739480212F, 0.9741402656F, 0.9743315120F, - 0.9745217631F, 0.9747110216F, 0.9748992901F, 0.9750865714F, - 0.9752728681F, 0.9754581829F, 0.9756425184F, 0.9758258775F, - 0.9760082627F, 0.9761896768F, 0.9763701224F, 0.9765496024F, - 0.9767281193F, 0.9769056760F, 0.9770822751F, 0.9772579193F, - 0.9774326114F, 0.9776063542F, 0.9777791502F, 0.9779510023F, - 0.9781219133F, 0.9782918858F, 0.9784609226F, 0.9786290264F, - 0.9787962000F, 0.9789624461F, 0.9791277676F, 0.9792921671F, - 0.9794556474F, 0.9796182113F, 0.9797798615F, 0.9799406009F, - 0.9801004321F, 0.9802593580F, 0.9804173813F, 0.9805745049F, - 0.9807307314F, 0.9808860637F, 0.9810405046F, 0.9811940568F, - 0.9813467232F, 0.9814985065F, 0.9816494095F, 0.9817994351F, - 0.9819485860F, 0.9820968650F, 0.9822442750F, 0.9823908186F, - 0.9825364988F, 0.9826813184F, 0.9828252801F, 0.9829683868F, - 0.9831106413F, 0.9832520463F, 0.9833926048F, 0.9835323195F, - 0.9836711932F, 0.9838092288F, 0.9839464291F, 0.9840827969F, - 0.9842183351F, 0.9843530464F, 0.9844869337F, 0.9846199998F, - 0.9847522475F, 0.9848836798F, 0.9850142993F, 0.9851441090F, - 0.9852731117F, 0.9854013101F, 0.9855287073F, 0.9856553058F, - 0.9857811087F, 0.9859061188F, 0.9860303388F, 0.9861537717F, - 0.9862764202F, 0.9863982872F, 0.9865193756F, 0.9866396882F, - 0.9867592277F, 0.9868779972F, 0.9869959993F, 0.9871132370F, - 0.9872297131F, 0.9873454304F, 0.9874603918F, 0.9875746001F, - 0.9876880581F, 0.9878007688F, 0.9879127348F, 0.9880239592F, - 0.9881344447F, 0.9882441941F, 0.9883532104F, 0.9884614962F, - 0.9885690546F, 0.9886758883F, 0.9887820001F, 0.9888873930F, - 0.9889920697F, 0.9890960331F, 0.9891992859F, 0.9893018312F, - 0.9894036716F, 0.9895048100F, 0.9896052493F, 0.9897049923F, - 0.9898040418F, 0.9899024006F, 0.9900000717F, 0.9900970577F, - 0.9901933616F, 0.9902889862F, 0.9903839343F, 0.9904782087F, - 0.9905718122F, 0.9906647477F, 0.9907570180F, 0.9908486259F, - 0.9909395742F, 0.9910298658F, 0.9911195034F, 0.9912084899F, - 0.9912968281F, 0.9913845208F, 0.9914715708F, 0.9915579810F, - 0.9916437540F, 0.9917288928F, 0.9918134001F, 0.9918972788F, - 0.9919805316F, 0.9920631613F, 0.9921451707F, 0.9922265626F, - 0.9923073399F, 0.9923875052F, 0.9924670615F, 0.9925460114F, - 0.9926243577F, 0.9927021033F, 0.9927792508F, 0.9928558032F, - 0.9929317631F, 0.9930071333F, 0.9930819167F, 0.9931561158F, - 0.9932297337F, 0.9933027728F, 0.9933752362F, 0.9934471264F, - 0.9935184462F, 0.9935891985F, 0.9936593859F, 0.9937290112F, - 0.9937980771F, 0.9938665864F, 0.9939345418F, 0.9940019460F, - 0.9940688018F, 0.9941351118F, 0.9942008789F, 0.9942661057F, - 0.9943307950F, 0.9943949494F, 0.9944585717F, 0.9945216645F, - 0.9945842307F, 0.9946462728F, 0.9947077936F, 0.9947687957F, - 0.9948292820F, 0.9948892550F, 0.9949487174F, 0.9950076719F, - 0.9950661212F, 0.9951240679F, 0.9951815148F, 0.9952384645F, - 0.9952949196F, 0.9953508828F, 0.9954063568F, 0.9954613442F, - 0.9955158476F, 0.9955698697F, 0.9956234132F, 0.9956764806F, - 0.9957290746F, 0.9957811978F, 0.9958328528F, 0.9958840423F, - 0.9959347688F, 0.9959850351F, 0.9960348435F, 0.9960841969F, - 0.9961330977F, 0.9961815486F, 0.9962295521F, 0.9962771108F, - 0.9963242274F, 0.9963709043F, 0.9964171441F, 0.9964629494F, - 0.9965083228F, 0.9965532668F, 0.9965977840F, 0.9966418768F, - 0.9966855479F, 0.9967287998F, 0.9967716350F, 0.9968140559F, - 0.9968560653F, 0.9968976655F, 0.9969388591F, 0.9969796485F, - 0.9970200363F, 0.9970600250F, 0.9970996170F, 0.9971388149F, - 0.9971776211F, 0.9972160380F, 0.9972540683F, 0.9972917142F, - 0.9973289783F, 0.9973658631F, 0.9974023709F, 0.9974385042F, - 0.9974742655F, 0.9975096571F, 0.9975446816F, 0.9975793413F, - 0.9976136386F, 0.9976475759F, 0.9976811557F, 0.9977143803F, - 0.9977472521F, 0.9977797736F, 0.9978119470F, 0.9978437748F, - 0.9978752593F, 0.9979064029F, 0.9979372079F, 0.9979676768F, - 0.9979978117F, 0.9980276151F, 0.9980570893F, 0.9980862367F, - 0.9981150595F, 0.9981435600F, 0.9981717406F, 0.9981996035F, - 0.9982271511F, 0.9982543856F, 0.9982813093F, 0.9983079246F, - 0.9983342336F, 0.9983602386F, 0.9983859418F, 0.9984113456F, - 0.9984364522F, 0.9984612638F, 0.9984857825F, 0.9985100108F, - 0.9985339507F, 0.9985576044F, 0.9985809743F, 0.9986040624F, - 0.9986268710F, 0.9986494022F, 0.9986716583F, 0.9986936413F, - 0.9987153535F, 0.9987367969F, 0.9987579738F, 0.9987788864F, - 0.9987995366F, 0.9988199267F, 0.9988400587F, 0.9988599348F, - 0.9988795572F, 0.9988989278F, 0.9989180487F, 0.9989369222F, - 0.9989555501F, 0.9989739347F, 0.9989920780F, 0.9990099820F, - 0.9990276487F, 0.9990450803F, 0.9990622787F, 0.9990792460F, - 0.9990959841F, 0.9991124952F, 0.9991287812F, 0.9991448440F, - 0.9991606858F, 0.9991763084F, 0.9991917139F, 0.9992069042F, - 0.9992218813F, 0.9992366471F, 0.9992512035F, 0.9992655525F, - 0.9992796961F, 0.9992936361F, 0.9993073744F, 0.9993209131F, - 0.9993342538F, 0.9993473987F, 0.9993603494F, 0.9993731080F, - 0.9993856762F, 0.9993980559F, 0.9994102490F, 0.9994222573F, - 0.9994340827F, 0.9994457269F, 0.9994571918F, 0.9994684793F, - 0.9994795910F, 0.9994905288F, 0.9995012945F, 0.9995118898F, - 0.9995223165F, 0.9995325765F, 0.9995426713F, 0.9995526029F, - 0.9995623728F, 0.9995719829F, 0.9995814349F, 0.9995907304F, - 0.9995998712F, 0.9996088590F, 0.9996176954F, 0.9996263821F, - 0.9996349208F, 0.9996433132F, 0.9996515609F, 0.9996596656F, - 0.9996676288F, 0.9996754522F, 0.9996831375F, 0.9996906862F, - 0.9996981000F, 0.9997053804F, 0.9997125290F, 0.9997195474F, - 0.9997264371F, 0.9997331998F, 0.9997398369F, 0.9997463500F, - 0.9997527406F, 0.9997590103F, 0.9997651606F, 0.9997711930F, - 0.9997771089F, 0.9997829098F, 0.9997885973F, 0.9997941728F, - 0.9997996378F, 0.9998049936F, 0.9998102419F, 0.9998153839F, - 0.9998204211F, 0.9998253550F, 0.9998301868F, 0.9998349182F, - 0.9998395503F, 0.9998440847F, 0.9998485226F, 0.9998528654F, - 0.9998571146F, 0.9998612713F, 0.9998653370F, 0.9998693130F, - 0.9998732007F, 0.9998770012F, 0.9998807159F, 0.9998843461F, - 0.9998878931F, 0.9998913581F, 0.9998947424F, 0.9998980473F, - 0.9999012740F, 0.9999044237F, 0.9999074976F, 0.9999104971F, - 0.9999134231F, 0.9999162771F, 0.9999190601F, 0.9999217733F, - 0.9999244179F, 0.9999269950F, 0.9999295058F, 0.9999319515F, - 0.9999343332F, 0.9999366519F, 0.9999389088F, 0.9999411050F, - 0.9999432416F, 0.9999453196F, 0.9999473402F, 0.9999493044F, - 0.9999512132F, 0.9999530677F, 0.9999548690F, 0.9999566180F, - 0.9999583157F, 0.9999599633F, 0.9999615616F, 0.9999631116F, - 0.9999646144F, 0.9999660709F, 0.9999674820F, 0.9999688487F, - 0.9999701719F, 0.9999714526F, 0.9999726917F, 0.9999738900F, - 0.9999750486F, 0.9999761682F, 0.9999772497F, 0.9999782941F, - 0.9999793021F, 0.9999802747F, 0.9999812126F, 0.9999821167F, - 0.9999829878F, 0.9999838268F, 0.9999846343F, 0.9999854113F, - 0.9999861584F, 0.9999868765F, 0.9999875664F, 0.9999882287F, - 0.9999888642F, 0.9999894736F, 0.9999900577F, 0.9999906172F, - 0.9999911528F, 0.9999916651F, 0.9999921548F, 0.9999926227F, - 0.9999930693F, 0.9999934954F, 0.9999939015F, 0.9999942883F, - 0.9999946564F, 0.9999950064F, 0.9999953390F, 0.9999956547F, - 0.9999959541F, 0.9999962377F, 0.9999965062F, 0.9999967601F, - 0.9999969998F, 0.9999972260F, 0.9999974392F, 0.9999976399F, - 0.9999978285F, 0.9999980056F, 0.9999981716F, 0.9999983271F, - 0.9999984724F, 0.9999986081F, 0.9999987345F, 0.9999988521F, - 0.9999989613F, 0.9999990625F, 0.9999991562F, 0.9999992426F, - 0.9999993223F, 0.9999993954F, 0.9999994625F, 0.9999995239F, - 0.9999995798F, 0.9999996307F, 0.9999996768F, 0.9999997184F, - 0.9999997559F, 0.9999997895F, 0.9999998195F, 0.9999998462F, - 0.9999998698F, 0.9999998906F, 0.9999999088F, 0.9999999246F, - 0.9999999383F, 0.9999999500F, 0.9999999600F, 0.9999999684F, - 0.9999999754F, 0.9999999811F, 0.9999999858F, 0.9999999896F, - 0.9999999925F, 0.9999999948F, 0.9999999965F, 0.9999999978F, - 0.9999999986F, 0.9999999992F, 0.9999999996F, 0.9999999998F, - 0.9999999999F, 1.0000000000F, 1.0000000000F, 1.0000000000F, -}; - -DECLARE_ALIGNED(16, static const float, vwin8192)[4096] = { - 0.0000000578F, 0.0000005198F, 0.0000014438F, 0.0000028299F, - 0.0000046780F, 0.0000069882F, 0.0000097604F, 0.0000129945F, - 0.0000166908F, 0.0000208490F, 0.0000254692F, 0.0000305515F, - 0.0000360958F, 0.0000421021F, 0.0000485704F, 0.0000555006F, - 0.0000628929F, 0.0000707472F, 0.0000790635F, 0.0000878417F, - 0.0000970820F, 0.0001067842F, 0.0001169483F, 0.0001275744F, - 0.0001386625F, 0.0001502126F, 0.0001622245F, 0.0001746984F, - 0.0001876343F, 0.0002010320F, 0.0002148917F, 0.0002292132F, - 0.0002439967F, 0.0002592421F, 0.0002749493F, 0.0002911184F, - 0.0003077493F, 0.0003248421F, 0.0003423967F, 0.0003604132F, - 0.0003788915F, 0.0003978316F, 0.0004172335F, 0.0004370971F, - 0.0004574226F, 0.0004782098F, 0.0004994587F, 0.0005211694F, - 0.0005433418F, 0.0005659759F, 0.0005890717F, 0.0006126292F, - 0.0006366484F, 0.0006611292F, 0.0006860716F, 0.0007114757F, - 0.0007373414F, 0.0007636687F, 0.0007904576F, 0.0008177080F, - 0.0008454200F, 0.0008735935F, 0.0009022285F, 0.0009313250F, - 0.0009608830F, 0.0009909025F, 0.0010213834F, 0.0010523257F, - 0.0010837295F, 0.0011155946F, 0.0011479211F, 0.0011807090F, - 0.0012139582F, 0.0012476687F, 0.0012818405F, 0.0013164736F, - 0.0013515679F, 0.0013871235F, 0.0014231402F, 0.0014596182F, - 0.0014965573F, 0.0015339576F, 0.0015718190F, 0.0016101415F, - 0.0016489251F, 0.0016881698F, 0.0017278754F, 0.0017680421F, - 0.0018086698F, 0.0018497584F, 0.0018913080F, 0.0019333185F, - 0.0019757898F, 0.0020187221F, 0.0020621151F, 0.0021059690F, - 0.0021502837F, 0.0021950591F, 0.0022402953F, 0.0022859921F, - 0.0023321497F, 0.0023787679F, 0.0024258467F, 0.0024733861F, - 0.0025213861F, 0.0025698466F, 0.0026187676F, 0.0026681491F, - 0.0027179911F, 0.0027682935F, 0.0028190562F, 0.0028702794F, - 0.0029219628F, 0.0029741066F, 0.0030267107F, 0.0030797749F, - 0.0031332994F, 0.0031872841F, 0.0032417289F, 0.0032966338F, - 0.0033519988F, 0.0034078238F, 0.0034641089F, 0.0035208539F, - 0.0035780589F, 0.0036357237F, 0.0036938485F, 0.0037524331F, - 0.0038114775F, 0.0038709817F, 0.0039309456F, 0.0039913692F, - 0.0040522524F, 0.0041135953F, 0.0041753978F, 0.0042376599F, - 0.0043003814F, 0.0043635624F, 0.0044272029F, 0.0044913028F, - 0.0045558620F, 0.0046208806F, 0.0046863585F, 0.0047522955F, - 0.0048186919F, 0.0048855473F, 0.0049528619F, 0.0050206356F, - 0.0050888684F, 0.0051575601F, 0.0052267108F, 0.0052963204F, - 0.0053663890F, 0.0054369163F, 0.0055079025F, 0.0055793474F, - 0.0056512510F, 0.0057236133F, 0.0057964342F, 0.0058697137F, - 0.0059434517F, 0.0060176482F, 0.0060923032F, 0.0061674166F, - 0.0062429883F, 0.0063190183F, 0.0063955066F, 0.0064724532F, - 0.0065498579F, 0.0066277207F, 0.0067060416F, 0.0067848205F, - 0.0068640575F, 0.0069437523F, 0.0070239051F, 0.0071045157F, - 0.0071855840F, 0.0072671102F, 0.0073490940F, 0.0074315355F, - 0.0075144345F, 0.0075977911F, 0.0076816052F, 0.0077658768F, - 0.0078506057F, 0.0079357920F, 0.0080214355F, 0.0081075363F, - 0.0081940943F, 0.0082811094F, 0.0083685816F, 0.0084565108F, - 0.0085448970F, 0.0086337401F, 0.0087230401F, 0.0088127969F, - 0.0089030104F, 0.0089936807F, 0.0090848076F, 0.0091763911F, - 0.0092684311F, 0.0093609276F, 0.0094538805F, 0.0095472898F, - 0.0096411554F, 0.0097354772F, 0.0098302552F, 0.0099254894F, - 0.0100211796F, 0.0101173259F, 0.0102139281F, 0.0103109863F, - 0.0104085002F, 0.0105064700F, 0.0106048955F, 0.0107037766F, - 0.0108031133F, 0.0109029056F, 0.0110031534F, 0.0111038565F, - 0.0112050151F, 0.0113066289F, 0.0114086980F, 0.0115112222F, - 0.0116142015F, 0.0117176359F, 0.0118215252F, 0.0119258695F, - 0.0120306686F, 0.0121359225F, 0.0122416312F, 0.0123477944F, - 0.0124544123F, 0.0125614847F, 0.0126690116F, 0.0127769928F, - 0.0128854284F, 0.0129943182F, 0.0131036623F, 0.0132134604F, - 0.0133237126F, 0.0134344188F, 0.0135455790F, 0.0136571929F, - 0.0137692607F, 0.0138817821F, 0.0139947572F, 0.0141081859F, - 0.0142220681F, 0.0143364037F, 0.0144511927F, 0.0145664350F, - 0.0146821304F, 0.0147982791F, 0.0149148808F, 0.0150319355F, - 0.0151494431F, 0.0152674036F, 0.0153858168F, 0.0155046828F, - 0.0156240014F, 0.0157437726F, 0.0158639962F, 0.0159846723F, - 0.0161058007F, 0.0162273814F, 0.0163494142F, 0.0164718991F, - 0.0165948361F, 0.0167182250F, 0.0168420658F, 0.0169663584F, - 0.0170911027F, 0.0172162987F, 0.0173419462F, 0.0174680452F, - 0.0175945956F, 0.0177215974F, 0.0178490504F, 0.0179769545F, - 0.0181053098F, 0.0182341160F, 0.0183633732F, 0.0184930812F, - 0.0186232399F, 0.0187538494F, 0.0188849094F, 0.0190164200F, - 0.0191483809F, 0.0192807923F, 0.0194136539F, 0.0195469656F, - 0.0196807275F, 0.0198149394F, 0.0199496012F, 0.0200847128F, - 0.0202202742F, 0.0203562853F, 0.0204927460F, 0.0206296561F, - 0.0207670157F, 0.0209048245F, 0.0210430826F, 0.0211817899F, - 0.0213209462F, 0.0214605515F, 0.0216006057F, 0.0217411086F, - 0.0218820603F, 0.0220234605F, 0.0221653093F, 0.0223076066F, - 0.0224503521F, 0.0225935459F, 0.0227371879F, 0.0228812779F, - 0.0230258160F, 0.0231708018F, 0.0233162355F, 0.0234621169F, - 0.0236084459F, 0.0237552224F, 0.0239024462F, 0.0240501175F, - 0.0241982359F, 0.0243468015F, 0.0244958141F, 0.0246452736F, - 0.0247951800F, 0.0249455331F, 0.0250963329F, 0.0252475792F, - 0.0253992720F, 0.0255514111F, 0.0257039965F, 0.0258570281F, - 0.0260105057F, 0.0261644293F, 0.0263187987F, 0.0264736139F, - 0.0266288747F, 0.0267845811F, 0.0269407330F, 0.0270973302F, - 0.0272543727F, 0.0274118604F, 0.0275697930F, 0.0277281707F, - 0.0278869932F, 0.0280462604F, 0.0282059723F, 0.0283661287F, - 0.0285267295F, 0.0286877747F, 0.0288492641F, 0.0290111976F, - 0.0291735751F, 0.0293363965F, 0.0294996617F, 0.0296633706F, - 0.0298275231F, 0.0299921190F, 0.0301571583F, 0.0303226409F, - 0.0304885667F, 0.0306549354F, 0.0308217472F, 0.0309890017F, - 0.0311566989F, 0.0313248388F, 0.0314934211F, 0.0316624459F, - 0.0318319128F, 0.0320018220F, 0.0321721732F, 0.0323429663F, - 0.0325142013F, 0.0326858779F, 0.0328579962F, 0.0330305559F, - 0.0332035570F, 0.0333769994F, 0.0335508829F, 0.0337252074F, - 0.0338999728F, 0.0340751790F, 0.0342508259F, 0.0344269134F, - 0.0346034412F, 0.0347804094F, 0.0349578178F, 0.0351356663F, - 0.0353139548F, 0.0354926831F, 0.0356718511F, 0.0358514588F, - 0.0360315059F, 0.0362119924F, 0.0363929182F, 0.0365742831F, - 0.0367560870F, 0.0369383297F, 0.0371210113F, 0.0373041315F, - 0.0374876902F, 0.0376716873F, 0.0378561226F, 0.0380409961F, - 0.0382263077F, 0.0384120571F, 0.0385982443F, 0.0387848691F, - 0.0389719315F, 0.0391594313F, 0.0393473683F, 0.0395357425F, - 0.0397245537F, 0.0399138017F, 0.0401034866F, 0.0402936080F, - 0.0404841660F, 0.0406751603F, 0.0408665909F, 0.0410584576F, - 0.0412507603F, 0.0414434988F, 0.0416366731F, 0.0418302829F, - 0.0420243282F, 0.0422188088F, 0.0424137246F, 0.0426090755F, - 0.0428048613F, 0.0430010819F, 0.0431977371F, 0.0433948269F, - 0.0435923511F, 0.0437903095F, 0.0439887020F, 0.0441875285F, - 0.0443867889F, 0.0445864830F, 0.0447866106F, 0.0449871717F, - 0.0451881661F, 0.0453895936F, 0.0455914542F, 0.0457937477F, - 0.0459964738F, 0.0461996326F, 0.0464032239F, 0.0466072475F, - 0.0468117032F, 0.0470165910F, 0.0472219107F, 0.0474276622F, - 0.0476338452F, 0.0478404597F, 0.0480475056F, 0.0482549827F, - 0.0484628907F, 0.0486712297F, 0.0488799994F, 0.0490891998F, - 0.0492988306F, 0.0495088917F, 0.0497193830F, 0.0499303043F, - 0.0501416554F, 0.0503534363F, 0.0505656468F, 0.0507782867F, - 0.0509913559F, 0.0512048542F, 0.0514187815F, 0.0516331376F, - 0.0518479225F, 0.0520631358F, 0.0522787775F, 0.0524948475F, - 0.0527113455F, 0.0529282715F, 0.0531456252F, 0.0533634066F, - 0.0535816154F, 0.0538002515F, 0.0540193148F, 0.0542388051F, - 0.0544587222F, 0.0546790660F, 0.0548998364F, 0.0551210331F, - 0.0553426561F, 0.0555647051F, 0.0557871801F, 0.0560100807F, - 0.0562334070F, 0.0564571587F, 0.0566813357F, 0.0569059378F, - 0.0571309649F, 0.0573564168F, 0.0575822933F, 0.0578085942F, - 0.0580353195F, 0.0582624689F, 0.0584900423F, 0.0587180396F, - 0.0589464605F, 0.0591753049F, 0.0594045726F, 0.0596342635F, - 0.0598643774F, 0.0600949141F, 0.0603258735F, 0.0605572555F, - 0.0607890597F, 0.0610212862F, 0.0612539346F, 0.0614870049F, - 0.0617204968F, 0.0619544103F, 0.0621887451F, 0.0624235010F, - 0.0626586780F, 0.0628942758F, 0.0631302942F, 0.0633667331F, - 0.0636035923F, 0.0638408717F, 0.0640785710F, 0.0643166901F, - 0.0645552288F, 0.0647941870F, 0.0650335645F, 0.0652733610F, - 0.0655135765F, 0.0657542108F, 0.0659952636F, 0.0662367348F, - 0.0664786242F, 0.0667209316F, 0.0669636570F, 0.0672068000F, - 0.0674503605F, 0.0676943384F, 0.0679387334F, 0.0681835454F, - 0.0684287742F, 0.0686744196F, 0.0689204814F, 0.0691669595F, - 0.0694138536F, 0.0696611637F, 0.0699088894F, 0.0701570307F, - 0.0704055873F, 0.0706545590F, 0.0709039458F, 0.0711537473F, - 0.0714039634F, 0.0716545939F, 0.0719056387F, 0.0721570975F, - 0.0724089702F, 0.0726612565F, 0.0729139563F, 0.0731670694F, - 0.0734205956F, 0.0736745347F, 0.0739288866F, 0.0741836510F, - 0.0744388277F, 0.0746944166F, 0.0749504175F, 0.0752068301F, - 0.0754636543F, 0.0757208899F, 0.0759785367F, 0.0762365946F, - 0.0764950632F, 0.0767539424F, 0.0770132320F, 0.0772729319F, - 0.0775330418F, 0.0777935616F, 0.0780544909F, 0.0783158298F, - 0.0785775778F, 0.0788397349F, 0.0791023009F, 0.0793652755F, - 0.0796286585F, 0.0798924498F, 0.0801566492F, 0.0804212564F, - 0.0806862712F, 0.0809516935F, 0.0812175231F, 0.0814837597F, - 0.0817504031F, 0.0820174532F, 0.0822849097F, 0.0825527724F, - 0.0828210412F, 0.0830897158F, 0.0833587960F, 0.0836282816F, - 0.0838981724F, 0.0841684682F, 0.0844391688F, 0.0847102740F, - 0.0849817835F, 0.0852536973F, 0.0855260150F, 0.0857987364F, - 0.0860718614F, 0.0863453897F, 0.0866193211F, 0.0868936554F, - 0.0871683924F, 0.0874435319F, 0.0877190737F, 0.0879950175F, - 0.0882713632F, 0.0885481105F, 0.0888252592F, 0.0891028091F, - 0.0893807600F, 0.0896591117F, 0.0899378639F, 0.0902170165F, - 0.0904965692F, 0.0907765218F, 0.0910568740F, 0.0913376258F, - 0.0916187767F, 0.0919003268F, 0.0921822756F, 0.0924646230F, - 0.0927473687F, 0.0930305126F, 0.0933140545F, 0.0935979940F, - 0.0938823310F, 0.0941670653F, 0.0944521966F, 0.0947377247F, - 0.0950236494F, 0.0953099704F, 0.0955966876F, 0.0958838007F, - 0.0961713094F, 0.0964592136F, 0.0967475131F, 0.0970362075F, - 0.0973252967F, 0.0976147805F, 0.0979046585F, 0.0981949307F, - 0.0984855967F, 0.0987766563F, 0.0990681093F, 0.0993599555F, - 0.0996521945F, 0.0999448263F, 0.1002378506F, 0.1005312671F, - 0.1008250755F, 0.1011192757F, 0.1014138675F, 0.1017088505F, - 0.1020042246F, 0.1022999895F, 0.1025961450F, 0.1028926909F, - 0.1031896268F, 0.1034869526F, 0.1037846680F, 0.1040827729F, - 0.1043812668F, 0.1046801497F, 0.1049794213F, 0.1052790813F, - 0.1055791294F, 0.1058795656F, 0.1061803894F, 0.1064816006F, - 0.1067831991F, 0.1070851846F, 0.1073875568F, 0.1076903155F, - 0.1079934604F, 0.1082969913F, 0.1086009079F, 0.1089052101F, - 0.1092098975F, 0.1095149699F, 0.1098204270F, 0.1101262687F, - 0.1104324946F, 0.1107391045F, 0.1110460982F, 0.1113534754F, - 0.1116612359F, 0.1119693793F, 0.1122779055F, 0.1125868142F, - 0.1128961052F, 0.1132057781F, 0.1135158328F, 0.1138262690F, - 0.1141370863F, 0.1144482847F, 0.1147598638F, 0.1150718233F, - 0.1153841631F, 0.1156968828F, 0.1160099822F, 0.1163234610F, - 0.1166373190F, 0.1169515559F, 0.1172661714F, 0.1175811654F, - 0.1178965374F, 0.1182122874F, 0.1185284149F, 0.1188449198F, - 0.1191618018F, 0.1194790606F, 0.1197966960F, 0.1201147076F, - 0.1204330953F, 0.1207518587F, 0.1210709976F, 0.1213905118F, - 0.1217104009F, 0.1220306647F, 0.1223513029F, 0.1226723153F, - 0.1229937016F, 0.1233154615F, 0.1236375948F, 0.1239601011F, - 0.1242829803F, 0.1246062319F, 0.1249298559F, 0.1252538518F, - 0.1255782195F, 0.1259029586F, 0.1262280689F, 0.1265535501F, - 0.1268794019F, 0.1272056241F, 0.1275322163F, 0.1278591784F, - 0.1281865099F, 0.1285142108F, 0.1288422805F, 0.1291707190F, - 0.1294995259F, 0.1298287009F, 0.1301582437F, 0.1304881542F, - 0.1308184319F, 0.1311490766F, 0.1314800881F, 0.1318114660F, - 0.1321432100F, 0.1324753200F, 0.1328077955F, 0.1331406364F, - 0.1334738422F, 0.1338074129F, 0.1341413479F, 0.1344756472F, - 0.1348103103F, 0.1351453370F, 0.1354807270F, 0.1358164801F, - 0.1361525959F, 0.1364890741F, 0.1368259145F, 0.1371631167F, - 0.1375006805F, 0.1378386056F, 0.1381768917F, 0.1385155384F, - 0.1388545456F, 0.1391939129F, 0.1395336400F, 0.1398737266F, - 0.1402141724F, 0.1405549772F, 0.1408961406F, 0.1412376623F, - 0.1415795421F, 0.1419217797F, 0.1422643746F, 0.1426073268F, - 0.1429506358F, 0.1432943013F, 0.1436383231F, 0.1439827008F, - 0.1443274342F, 0.1446725229F, 0.1450179667F, 0.1453637652F, - 0.1457099181F, 0.1460564252F, 0.1464032861F, 0.1467505006F, - 0.1470980682F, 0.1474459888F, 0.1477942620F, 0.1481428875F, - 0.1484918651F, 0.1488411942F, 0.1491908748F, 0.1495409065F, - 0.1498912889F, 0.1502420218F, 0.1505931048F, 0.1509445376F, - 0.1512963200F, 0.1516484516F, 0.1520009321F, 0.1523537612F, - 0.1527069385F, 0.1530604638F, 0.1534143368F, 0.1537685571F, - 0.1541231244F, 0.1544780384F, 0.1548332987F, 0.1551889052F, - 0.1555448574F, 0.1559011550F, 0.1562577978F, 0.1566147853F, - 0.1569721173F, 0.1573297935F, 0.1576878135F, 0.1580461771F, - 0.1584048838F, 0.1587639334F, 0.1591233255F, 0.1594830599F, - 0.1598431361F, 0.1602035540F, 0.1605643131F, 0.1609254131F, - 0.1612868537F, 0.1616486346F, 0.1620107555F, 0.1623732160F, - 0.1627360158F, 0.1630991545F, 0.1634626319F, 0.1638264476F, - 0.1641906013F, 0.1645550926F, 0.1649199212F, 0.1652850869F, - 0.1656505892F, 0.1660164278F, 0.1663826024F, 0.1667491127F, - 0.1671159583F, 0.1674831388F, 0.1678506541F, 0.1682185036F, - 0.1685866872F, 0.1689552044F, 0.1693240549F, 0.1696932384F, - 0.1700627545F, 0.1704326029F, 0.1708027833F, 0.1711732952F, - 0.1715441385F, 0.1719153127F, 0.1722868175F, 0.1726586526F, - 0.1730308176F, 0.1734033121F, 0.1737761359F, 0.1741492886F, - 0.1745227698F, 0.1748965792F, 0.1752707164F, 0.1756451812F, - 0.1760199731F, 0.1763950918F, 0.1767705370F, 0.1771463083F, - 0.1775224054F, 0.1778988279F, 0.1782755754F, 0.1786526477F, - 0.1790300444F, 0.1794077651F, 0.1797858094F, 0.1801641771F, - 0.1805428677F, 0.1809218810F, 0.1813012165F, 0.1816808739F, - 0.1820608528F, 0.1824411530F, 0.1828217739F, 0.1832027154F, - 0.1835839770F, 0.1839655584F, 0.1843474592F, 0.1847296790F, - 0.1851122175F, 0.1854950744F, 0.1858782492F, 0.1862617417F, - 0.1866455514F, 0.1870296780F, 0.1874141211F, 0.1877988804F, - 0.1881839555F, 0.1885693461F, 0.1889550517F, 0.1893410721F, - 0.1897274068F, 0.1901140555F, 0.1905010178F, 0.1908882933F, - 0.1912758818F, 0.1916637828F, 0.1920519959F, 0.1924405208F, - 0.1928293571F, 0.1932185044F, 0.1936079625F, 0.1939977308F, - 0.1943878091F, 0.1947781969F, 0.1951688939F, 0.1955598998F, - 0.1959512141F, 0.1963428364F, 0.1967347665F, 0.1971270038F, - 0.1975195482F, 0.1979123990F, 0.1983055561F, 0.1986990190F, - 0.1990927873F, 0.1994868607F, 0.1998812388F, 0.2002759212F, - 0.2006709075F, 0.2010661974F, 0.2014617904F, 0.2018576862F, - 0.2022538844F, 0.2026503847F, 0.2030471865F, 0.2034442897F, - 0.2038416937F, 0.2042393982F, 0.2046374028F, 0.2050357071F, - 0.2054343107F, 0.2058332133F, 0.2062324145F, 0.2066319138F, - 0.2070317110F, 0.2074318055F, 0.2078321970F, 0.2082328852F, - 0.2086338696F, 0.2090351498F, 0.2094367255F, 0.2098385962F, - 0.2102407617F, 0.2106432213F, 0.2110459749F, 0.2114490220F, - 0.2118523621F, 0.2122559950F, 0.2126599202F, 0.2130641373F, - 0.2134686459F, 0.2138734456F, 0.2142785361F, 0.2146839168F, - 0.2150895875F, 0.2154955478F, 0.2159017972F, 0.2163083353F, - 0.2167151617F, 0.2171222761F, 0.2175296780F, 0.2179373670F, - 0.2183453428F, 0.2187536049F, 0.2191621529F, 0.2195709864F, - 0.2199801051F, 0.2203895085F, 0.2207991961F, 0.2212091677F, - 0.2216194228F, 0.2220299610F, 0.2224407818F, 0.2228518850F, - 0.2232632699F, 0.2236749364F, 0.2240868839F, 0.2244991121F, - 0.2249116204F, 0.2253244086F, 0.2257374763F, 0.2261508229F, - 0.2265644481F, 0.2269783514F, 0.2273925326F, 0.2278069911F, - 0.2282217265F, 0.2286367384F, 0.2290520265F, 0.2294675902F, - 0.2298834292F, 0.2302995431F, 0.2307159314F, 0.2311325937F, - 0.2315495297F, 0.2319667388F, 0.2323842207F, 0.2328019749F, - 0.2332200011F, 0.2336382988F, 0.2340568675F, 0.2344757070F, - 0.2348948166F, 0.2353141961F, 0.2357338450F, 0.2361537629F, - 0.2365739493F, 0.2369944038F, 0.2374151261F, 0.2378361156F, - 0.2382573720F, 0.2386788948F, 0.2391006836F, 0.2395227380F, - 0.2399450575F, 0.2403676417F, 0.2407904902F, 0.2412136026F, - 0.2416369783F, 0.2420606171F, 0.2424845185F, 0.2429086820F, - 0.2433331072F, 0.2437577936F, 0.2441827409F, 0.2446079486F, - 0.2450334163F, 0.2454591435F, 0.2458851298F, 0.2463113747F, - 0.2467378779F, 0.2471646389F, 0.2475916573F, 0.2480189325F, - 0.2484464643F, 0.2488742521F, 0.2493022955F, 0.2497305940F, - 0.2501591473F, 0.2505879549F, 0.2510170163F, 0.2514463311F, - 0.2518758989F, 0.2523057193F, 0.2527357916F, 0.2531661157F, - 0.2535966909F, 0.2540275169F, 0.2544585931F, 0.2548899193F, - 0.2553214948F, 0.2557533193F, 0.2561853924F, 0.2566177135F, - 0.2570502822F, 0.2574830981F, 0.2579161608F, 0.2583494697F, - 0.2587830245F, 0.2592168246F, 0.2596508697F, 0.2600851593F, - 0.2605196929F, 0.2609544701F, 0.2613894904F, 0.2618247534F, - 0.2622602586F, 0.2626960055F, 0.2631319938F, 0.2635682230F, - 0.2640046925F, 0.2644414021F, 0.2648783511F, 0.2653155391F, - 0.2657529657F, 0.2661906305F, 0.2666285329F, 0.2670666725F, - 0.2675050489F, 0.2679436616F, 0.2683825101F, 0.2688215940F, - 0.2692609127F, 0.2697004660F, 0.2701402532F, 0.2705802739F, - 0.2710205278F, 0.2714610142F, 0.2719017327F, 0.2723426830F, - 0.2727838644F, 0.2732252766F, 0.2736669191F, 0.2741087914F, - 0.2745508930F, 0.2749932235F, 0.2754357824F, 0.2758785693F, - 0.2763215837F, 0.2767648251F, 0.2772082930F, 0.2776519870F, - 0.2780959066F, 0.2785400513F, 0.2789844207F, 0.2794290143F, - 0.2798738316F, 0.2803188722F, 0.2807641355F, 0.2812096211F, - 0.2816553286F, 0.2821012574F, 0.2825474071F, 0.2829937773F, - 0.2834403673F, 0.2838871768F, 0.2843342053F, 0.2847814523F, - 0.2852289174F, 0.2856765999F, 0.2861244996F, 0.2865726159F, - 0.2870209482F, 0.2874694962F, 0.2879182594F, 0.2883672372F, - 0.2888164293F, 0.2892658350F, 0.2897154540F, 0.2901652858F, - 0.2906153298F, 0.2910655856F, 0.2915160527F, 0.2919667306F, - 0.2924176189F, 0.2928687171F, 0.2933200246F, 0.2937715409F, - 0.2942232657F, 0.2946751984F, 0.2951273386F, 0.2955796856F, - 0.2960322391F, 0.2964849986F, 0.2969379636F, 0.2973911335F, - 0.2978445080F, 0.2982980864F, 0.2987518684F, 0.2992058534F, - 0.2996600409F, 0.3001144305F, 0.3005690217F, 0.3010238139F, - 0.3014788067F, 0.3019339995F, 0.3023893920F, 0.3028449835F, - 0.3033007736F, 0.3037567618F, 0.3042129477F, 0.3046693306F, - 0.3051259102F, 0.3055826859F, 0.3060396572F, 0.3064968236F, - 0.3069541847F, 0.3074117399F, 0.3078694887F, 0.3083274307F, - 0.3087855653F, 0.3092438920F, 0.3097024104F, 0.3101611199F, - 0.3106200200F, 0.3110791103F, 0.3115383902F, 0.3119978592F, - 0.3124575169F, 0.3129173627F, 0.3133773961F, 0.3138376166F, - 0.3142980238F, 0.3147586170F, 0.3152193959F, 0.3156803598F, - 0.3161415084F, 0.3166028410F, 0.3170643573F, 0.3175260566F, - 0.3179879384F, 0.3184500023F, 0.3189122478F, 0.3193746743F, - 0.3198372814F, 0.3203000685F, 0.3207630351F, 0.3212261807F, - 0.3216895048F, 0.3221530069F, 0.3226166865F, 0.3230805430F, - 0.3235445760F, 0.3240087849F, 0.3244731693F, 0.3249377285F, - 0.3254024622F, 0.3258673698F, 0.3263324507F, 0.3267977045F, - 0.3272631306F, 0.3277287286F, 0.3281944978F, 0.3286604379F, - 0.3291265482F, 0.3295928284F, 0.3300592777F, 0.3305258958F, - 0.3309926821F, 0.3314596361F, 0.3319267573F, 0.3323940451F, - 0.3328614990F, 0.3333291186F, 0.3337969033F, 0.3342648525F, - 0.3347329658F, 0.3352012427F, 0.3356696825F, 0.3361382849F, - 0.3366070492F, 0.3370759749F, 0.3375450616F, 0.3380143087F, - 0.3384837156F, 0.3389532819F, 0.3394230071F, 0.3398928905F, - 0.3403629317F, 0.3408331302F, 0.3413034854F, 0.3417739967F, - 0.3422446638F, 0.3427154860F, 0.3431864628F, 0.3436575938F, - 0.3441288782F, 0.3446003158F, 0.3450719058F, 0.3455436478F, - 0.3460155412F, 0.3464875856F, 0.3469597804F, 0.3474321250F, - 0.3479046189F, 0.3483772617F, 0.3488500527F, 0.3493229914F, - 0.3497960774F, 0.3502693100F, 0.3507426887F, 0.3512162131F, - 0.3516898825F, 0.3521636965F, 0.3526376545F, 0.3531117559F, - 0.3535860003F, 0.3540603870F, 0.3545349157F, 0.3550095856F, - 0.3554843964F, 0.3559593474F, 0.3564344381F, 0.3569096680F, - 0.3573850366F, 0.3578605432F, 0.3583361875F, 0.3588119687F, - 0.3592878865F, 0.3597639402F, 0.3602401293F, 0.3607164533F, - 0.3611929117F, 0.3616695038F, 0.3621462292F, 0.3626230873F, - 0.3631000776F, 0.3635771995F, 0.3640544525F, 0.3645318360F, - 0.3650093496F, 0.3654869926F, 0.3659647645F, 0.3664426648F, - 0.3669206930F, 0.3673988484F, 0.3678771306F, 0.3683555390F, - 0.3688340731F, 0.3693127322F, 0.3697915160F, 0.3702704237F, - 0.3707494549F, 0.3712286091F, 0.3717078857F, 0.3721872840F, - 0.3726668037F, 0.3731464441F, 0.3736262047F, 0.3741060850F, - 0.3745860843F, 0.3750662023F, 0.3755464382F, 0.3760267915F, - 0.3765072618F, 0.3769878484F, 0.3774685509F, 0.3779493686F, - 0.3784303010F, 0.3789113475F, 0.3793925076F, 0.3798737809F, - 0.3803551666F, 0.3808366642F, 0.3813182733F, 0.3817999932F, - 0.3822818234F, 0.3827637633F, 0.3832458124F, 0.3837279702F, - 0.3842102360F, 0.3846926093F, 0.3851750897F, 0.3856576764F, - 0.3861403690F, 0.3866231670F, 0.3871060696F, 0.3875890765F, - 0.3880721870F, 0.3885554007F, 0.3890387168F, 0.3895221349F, - 0.3900056544F, 0.3904892748F, 0.3909729955F, 0.3914568160F, - 0.3919407356F, 0.3924247539F, 0.3929088702F, 0.3933930841F, - 0.3938773949F, 0.3943618021F, 0.3948463052F, 0.3953309035F, - 0.3958155966F, 0.3963003838F, 0.3967852646F, 0.3972702385F, - 0.3977553048F, 0.3982404631F, 0.3987257127F, 0.3992110531F, - 0.3996964838F, 0.4001820041F, 0.4006676136F, 0.4011533116F, - 0.4016390976F, 0.4021249710F, 0.4026109313F, 0.4030969779F, - 0.4035831102F, 0.4040693277F, 0.4045556299F, 0.4050420160F, - 0.4055284857F, 0.4060150383F, 0.4065016732F, 0.4069883899F, - 0.4074751879F, 0.4079620665F, 0.4084490252F, 0.4089360635F, - 0.4094231807F, 0.4099103763F, 0.4103976498F, 0.4108850005F, - 0.4113724280F, 0.4118599315F, 0.4123475107F, 0.4128351648F, - 0.4133228934F, 0.4138106959F, 0.4142985716F, 0.4147865201F, - 0.4152745408F, 0.4157626330F, 0.4162507963F, 0.4167390301F, - 0.4172273337F, 0.4177157067F, 0.4182041484F, 0.4186926583F, - 0.4191812359F, 0.4196698805F, 0.4201585915F, 0.4206473685F, - 0.4211362108F, 0.4216251179F, 0.4221140892F, 0.4226031241F, - 0.4230922221F, 0.4235813826F, 0.4240706050F, 0.4245598887F, - 0.4250492332F, 0.4255386379F, 0.4260281022F, 0.4265176256F, - 0.4270072075F, 0.4274968473F, 0.4279865445F, 0.4284762984F, - 0.4289661086F, 0.4294559743F, 0.4299458951F, 0.4304358704F, - 0.4309258996F, 0.4314159822F, 0.4319061175F, 0.4323963050F, - 0.4328865441F, 0.4333768342F, 0.4338671749F, 0.4343575654F, - 0.4348480052F, 0.4353384938F, 0.4358290306F, 0.4363196149F, - 0.4368102463F, 0.4373009241F, 0.4377916478F, 0.4382824168F, - 0.4387732305F, 0.4392640884F, 0.4397549899F, 0.4402459343F, - 0.4407369212F, 0.4412279499F, 0.4417190198F, 0.4422101305F, - 0.4427012813F, 0.4431924717F, 0.4436837010F, 0.4441749686F, - 0.4446662742F, 0.4451576169F, 0.4456489963F, 0.4461404118F, - 0.4466318628F, 0.4471233487F, 0.4476148690F, 0.4481064230F, - 0.4485980103F, 0.4490896302F, 0.4495812821F, 0.4500729654F, - 0.4505646797F, 0.4510564243F, 0.4515481986F, 0.4520400021F, - 0.4525318341F, 0.4530236942F, 0.4535155816F, 0.4540074959F, - 0.4544994365F, 0.4549914028F, 0.4554833941F, 0.4559754100F, - 0.4564674499F, 0.4569595131F, 0.4574515991F, 0.4579437074F, - 0.4584358372F, 0.4589279881F, 0.4594201595F, 0.4599123508F, - 0.4604045615F, 0.4608967908F, 0.4613890383F, 0.4618813034F, - 0.4623735855F, 0.4628658841F, 0.4633581984F, 0.4638505281F, - 0.4643428724F, 0.4648352308F, 0.4653276028F, 0.4658199877F, - 0.4663123849F, 0.4668047940F, 0.4672972143F, 0.4677896451F, - 0.4682820861F, 0.4687745365F, 0.4692669958F, 0.4697594634F, - 0.4702519387F, 0.4707444211F, 0.4712369102F, 0.4717294052F, - 0.4722219056F, 0.4727144109F, 0.4732069204F, 0.4736994336F, - 0.4741919498F, 0.4746844686F, 0.4751769893F, 0.4756695113F, - 0.4761620341F, 0.4766545571F, 0.4771470797F, 0.4776396013F, - 0.4781321213F, 0.4786246392F, 0.4791171544F, 0.4796096663F, - 0.4801021744F, 0.4805946779F, 0.4810871765F, 0.4815796694F, - 0.4820721561F, 0.4825646360F, 0.4830571086F, 0.4835495732F, - 0.4840420293F, 0.4845344763F, 0.4850269136F, 0.4855193407F, - 0.4860117569F, 0.4865041617F, 0.4869965545F, 0.4874889347F, - 0.4879813018F, 0.4884736551F, 0.4889659941F, 0.4894583182F, - 0.4899506268F, 0.4904429193F, 0.4909351952F, 0.4914274538F, - 0.4919196947F, 0.4924119172F, 0.4929041207F, 0.4933963046F, - 0.4938884685F, 0.4943806116F, 0.4948727335F, 0.4953648335F, - 0.4958569110F, 0.4963489656F, 0.4968409965F, 0.4973330032F, - 0.4978249852F, 0.4983169419F, 0.4988088726F, 0.4993007768F, - 0.4997926539F, 0.5002845034F, 0.5007763247F, 0.5012681171F, - 0.5017598801F, 0.5022516132F, 0.5027433157F, 0.5032349871F, - 0.5037266268F, 0.5042182341F, 0.5047098086F, 0.5052013497F, - 0.5056928567F, 0.5061843292F, 0.5066757664F, 0.5071671679F, - 0.5076585330F, 0.5081498613F, 0.5086411520F, 0.5091324047F, - 0.5096236187F, 0.5101147934F, 0.5106059284F, 0.5110970230F, - 0.5115880766F, 0.5120790887F, 0.5125700587F, 0.5130609860F, - 0.5135518700F, 0.5140427102F, 0.5145335059F, 0.5150242566F, - 0.5155149618F, 0.5160056208F, 0.5164962331F, 0.5169867980F, - 0.5174773151F, 0.5179677837F, 0.5184582033F, 0.5189485733F, - 0.5194388931F, 0.5199291621F, 0.5204193798F, 0.5209095455F, - 0.5213996588F, 0.5218897190F, 0.5223797256F, 0.5228696779F, - 0.5233595755F, 0.5238494177F, 0.5243392039F, 0.5248289337F, - 0.5253186063F, 0.5258082213F, 0.5262977781F, 0.5267872760F, - 0.5272767146F, 0.5277660932F, 0.5282554112F, 0.5287446682F, - 0.5292338635F, 0.5297229965F, 0.5302120667F, 0.5307010736F, - 0.5311900164F, 0.5316788947F, 0.5321677079F, 0.5326564554F, - 0.5331451366F, 0.5336337511F, 0.5341222981F, 0.5346107771F, - 0.5350991876F, 0.5355875290F, 0.5360758007F, 0.5365640021F, - 0.5370521327F, 0.5375401920F, 0.5380281792F, 0.5385160939F, - 0.5390039355F, 0.5394917034F, 0.5399793971F, 0.5404670159F, - 0.5409545594F, 0.5414420269F, 0.5419294179F, 0.5424167318F, - 0.5429039680F, 0.5433911261F, 0.5438782053F, 0.5443652051F, - 0.5448521250F, 0.5453389644F, 0.5458257228F, 0.5463123995F, - 0.5467989940F, 0.5472855057F, 0.5477719341F, 0.5482582786F, - 0.5487445387F, 0.5492307137F, 0.5497168031F, 0.5502028063F, - 0.5506887228F, 0.5511745520F, 0.5516602934F, 0.5521459463F, - 0.5526315103F, 0.5531169847F, 0.5536023690F, 0.5540876626F, - 0.5545728649F, 0.5550579755F, 0.5555429937F, 0.5560279189F, - 0.5565127507F, 0.5569974884F, 0.5574821315F, 0.5579666794F, - 0.5584511316F, 0.5589354875F, 0.5594197465F, 0.5599039080F, - 0.5603879716F, 0.5608719367F, 0.5613558026F, 0.5618395689F, - 0.5623232350F, 0.5628068002F, 0.5632902642F, 0.5637736262F, - 0.5642568858F, 0.5647400423F, 0.5652230953F, 0.5657060442F, - 0.5661888883F, 0.5666716272F, 0.5671542603F, 0.5676367870F, - 0.5681192069F, 0.5686015192F, 0.5690837235F, 0.5695658192F, - 0.5700478058F, 0.5705296827F, 0.5710114494F, 0.5714931052F, - 0.5719746497F, 0.5724560822F, 0.5729374023F, 0.5734186094F, - 0.5738997029F, 0.5743806823F, 0.5748615470F, 0.5753422965F, - 0.5758229301F, 0.5763034475F, 0.5767838480F, 0.5772641310F, - 0.5777442960F, 0.5782243426F, 0.5787042700F, 0.5791840778F, - 0.5796637654F, 0.5801433322F, 0.5806227778F, 0.5811021016F, - 0.5815813029F, 0.5820603814F, 0.5825393363F, 0.5830181673F, - 0.5834968737F, 0.5839754549F, 0.5844539105F, 0.5849322399F, - 0.5854104425F, 0.5858885179F, 0.5863664653F, 0.5868442844F, - 0.5873219746F, 0.5877995353F, 0.5882769660F, 0.5887542661F, - 0.5892314351F, 0.5897084724F, 0.5901853776F, 0.5906621500F, - 0.5911387892F, 0.5916152945F, 0.5920916655F, 0.5925679016F, - 0.5930440022F, 0.5935199669F, 0.5939957950F, 0.5944714861F, - 0.5949470396F, 0.5954224550F, 0.5958977317F, 0.5963728692F, - 0.5968478669F, 0.5973227244F, 0.5977974411F, 0.5982720163F, - 0.5987464497F, 0.5992207407F, 0.5996948887F, 0.6001688932F, - 0.6006427537F, 0.6011164696F, 0.6015900405F, 0.6020634657F, - 0.6025367447F, 0.6030098770F, 0.6034828621F, 0.6039556995F, - 0.6044283885F, 0.6049009288F, 0.6053733196F, 0.6058455606F, - 0.6063176512F, 0.6067895909F, 0.6072613790F, 0.6077330152F, - 0.6082044989F, 0.6086758295F, 0.6091470065F, 0.6096180294F, - 0.6100888977F, 0.6105596108F, 0.6110301682F, 0.6115005694F, - 0.6119708139F, 0.6124409011F, 0.6129108305F, 0.6133806017F, - 0.6138502139F, 0.6143196669F, 0.6147889599F, 0.6152580926F, - 0.6157270643F, 0.6161958746F, 0.6166645230F, 0.6171330088F, - 0.6176013317F, 0.6180694910F, 0.6185374863F, 0.6190053171F, - 0.6194729827F, 0.6199404828F, 0.6204078167F, 0.6208749841F, - 0.6213419842F, 0.6218088168F, 0.6222754811F, 0.6227419768F, - 0.6232083032F, 0.6236744600F, 0.6241404465F, 0.6246062622F, - 0.6250719067F, 0.6255373795F, 0.6260026799F, 0.6264678076F, - 0.6269327619F, 0.6273975425F, 0.6278621487F, 0.6283265800F, - 0.6287908361F, 0.6292549163F, 0.6297188201F, 0.6301825471F, - 0.6306460966F, 0.6311094683F, 0.6315726617F, 0.6320356761F, - 0.6324985111F, 0.6329611662F, 0.6334236410F, 0.6338859348F, - 0.6343480472F, 0.6348099777F, 0.6352717257F, 0.6357332909F, - 0.6361946726F, 0.6366558704F, 0.6371168837F, 0.6375777122F, - 0.6380383552F, 0.6384988123F, 0.6389590830F, 0.6394191668F, - 0.6398790631F, 0.6403387716F, 0.6407982916F, 0.6412576228F, - 0.6417167645F, 0.6421757163F, 0.6426344778F, 0.6430930483F, - 0.6435514275F, 0.6440096149F, 0.6444676098F, 0.6449254119F, - 0.6453830207F, 0.6458404356F, 0.6462976562F, 0.6467546820F, - 0.6472115125F, 0.6476681472F, 0.6481245856F, 0.6485808273F, - 0.6490368717F, 0.6494927183F, 0.6499483667F, 0.6504038164F, - 0.6508590670F, 0.6513141178F, 0.6517689684F, 0.6522236185F, - 0.6526780673F, 0.6531323146F, 0.6535863598F, 0.6540402024F, - 0.6544938419F, 0.6549472779F, 0.6554005099F, 0.6558535373F, - 0.6563063598F, 0.6567589769F, 0.6572113880F, 0.6576635927F, - 0.6581155906F, 0.6585673810F, 0.6590189637F, 0.6594703380F, - 0.6599215035F, 0.6603724598F, 0.6608232064F, 0.6612737427F, - 0.6617240684F, 0.6621741829F, 0.6626240859F, 0.6630737767F, - 0.6635232550F, 0.6639725202F, 0.6644215720F, 0.6648704098F, - 0.6653190332F, 0.6657674417F, 0.6662156348F, 0.6666636121F, - 0.6671113731F, 0.6675589174F, 0.6680062445F, 0.6684533538F, - 0.6689002450F, 0.6693469177F, 0.6697933712F, 0.6702396052F, - 0.6706856193F, 0.6711314129F, 0.6715769855F, 0.6720223369F, - 0.6724674664F, 0.6729123736F, 0.6733570581F, 0.6738015194F, - 0.6742457570F, 0.6746897706F, 0.6751335596F, 0.6755771236F, - 0.6760204621F, 0.6764635747F, 0.6769064609F, 0.6773491204F, - 0.6777915525F, 0.6782337570F, 0.6786757332F, 0.6791174809F, - 0.6795589995F, 0.6800002886F, 0.6804413477F, 0.6808821765F, - 0.6813227743F, 0.6817631409F, 0.6822032758F, 0.6826431785F, - 0.6830828485F, 0.6835222855F, 0.6839614890F, 0.6844004585F, - 0.6848391936F, 0.6852776939F, 0.6857159589F, 0.6861539883F, - 0.6865917815F, 0.6870293381F, 0.6874666576F, 0.6879037398F, - 0.6883405840F, 0.6887771899F, 0.6892135571F, 0.6896496850F, - 0.6900855733F, 0.6905212216F, 0.6909566294F, 0.6913917963F, - 0.6918267218F, 0.6922614055F, 0.6926958471F, 0.6931300459F, - 0.6935640018F, 0.6939977141F, 0.6944311825F, 0.6948644066F, - 0.6952973859F, 0.6957301200F, 0.6961626085F, 0.6965948510F, - 0.6970268470F, 0.6974585961F, 0.6978900980F, 0.6983213521F, - 0.6987523580F, 0.6991831154F, 0.6996136238F, 0.7000438828F, - 0.7004738921F, 0.7009036510F, 0.7013331594F, 0.7017624166F, - 0.7021914224F, 0.7026201763F, 0.7030486779F, 0.7034769268F, - 0.7039049226F, 0.7043326648F, 0.7047601531F, 0.7051873870F, - 0.7056143662F, 0.7060410902F, 0.7064675586F, 0.7068937711F, - 0.7073197271F, 0.7077454264F, 0.7081708684F, 0.7085960529F, - 0.7090209793F, 0.7094456474F, 0.7098700566F, 0.7102942066F, - 0.7107180970F, 0.7111417274F, 0.7115650974F, 0.7119882066F, - 0.7124110545F, 0.7128336409F, 0.7132559653F, 0.7136780272F, - 0.7140998264F, 0.7145213624F, 0.7149426348F, 0.7153636433F, - 0.7157843874F, 0.7162048668F, 0.7166250810F, 0.7170450296F, - 0.7174647124F, 0.7178841289F, 0.7183032786F, 0.7187221613F, - 0.7191407765F, 0.7195591239F, 0.7199772030F, 0.7203950135F, - 0.7208125550F, 0.7212298271F, 0.7216468294F, 0.7220635616F, - 0.7224800233F, 0.7228962140F, 0.7233121335F, 0.7237277813F, - 0.7241431571F, 0.7245582604F, 0.7249730910F, 0.7253876484F, - 0.7258019322F, 0.7262159422F, 0.7266296778F, 0.7270431388F, - 0.7274563247F, 0.7278692353F, 0.7282818700F, 0.7286942287F, - 0.7291063108F, 0.7295181160F, 0.7299296440F, 0.7303408944F, - 0.7307518669F, 0.7311625609F, 0.7315729763F, 0.7319831126F, - 0.7323929695F, 0.7328025466F, 0.7332118435F, 0.7336208600F, - 0.7340295955F, 0.7344380499F, 0.7348462226F, 0.7352541134F, - 0.7356617220F, 0.7360690478F, 0.7364760907F, 0.7368828502F, - 0.7372893259F, 0.7376955176F, 0.7381014249F, 0.7385070475F, - 0.7389123849F, 0.7393174368F, 0.7397222029F, 0.7401266829F, - 0.7405308763F, 0.7409347829F, 0.7413384023F, 0.7417417341F, - 0.7421447780F, 0.7425475338F, 0.7429500009F, 0.7433521791F, - 0.7437540681F, 0.7441556674F, 0.7445569769F, 0.7449579960F, - 0.7453587245F, 0.7457591621F, 0.7461593084F, 0.7465591631F, - 0.7469587259F, 0.7473579963F, 0.7477569741F, 0.7481556590F, - 0.7485540506F, 0.7489521486F, 0.7493499526F, 0.7497474623F, - 0.7501446775F, 0.7505415977F, 0.7509382227F, 0.7513345521F, - 0.7517305856F, 0.7521263229F, 0.7525217636F, 0.7529169074F, - 0.7533117541F, 0.7537063032F, 0.7541005545F, 0.7544945076F, - 0.7548881623F, 0.7552815182F, 0.7556745749F, 0.7560673323F, - 0.7564597899F, 0.7568519474F, 0.7572438046F, 0.7576353611F, - 0.7580266166F, 0.7584175708F, 0.7588082235F, 0.7591985741F, - 0.7595886226F, 0.7599783685F, 0.7603678116F, 0.7607569515F, - 0.7611457879F, 0.7615343206F, 0.7619225493F, 0.7623104735F, - 0.7626980931F, 0.7630854078F, 0.7634724171F, 0.7638591209F, - 0.7642455188F, 0.7646316106F, 0.7650173959F, 0.7654028744F, - 0.7657880459F, 0.7661729100F, 0.7665574664F, 0.7669417150F, - 0.7673256553F, 0.7677092871F, 0.7680926100F, 0.7684756239F, - 0.7688583284F, 0.7692407232F, 0.7696228080F, 0.7700045826F, - 0.7703860467F, 0.7707671999F, 0.7711480420F, 0.7715285728F, - 0.7719087918F, 0.7722886989F, 0.7726682938F, 0.7730475762F, - 0.7734265458F, 0.7738052023F, 0.7741835454F, 0.7745615750F, - 0.7749392906F, 0.7753166921F, 0.7756937791F, 0.7760705514F, - 0.7764470087F, 0.7768231508F, 0.7771989773F, 0.7775744880F, - 0.7779496827F, 0.7783245610F, 0.7786991227F, 0.7790733676F, - 0.7794472953F, 0.7798209056F, 0.7801941982F, 0.7805671729F, - 0.7809398294F, 0.7813121675F, 0.7816841869F, 0.7820558873F, - 0.7824272684F, 0.7827983301F, 0.7831690720F, 0.7835394940F, - 0.7839095957F, 0.7842793768F, 0.7846488373F, 0.7850179767F, - 0.7853867948F, 0.7857552914F, 0.7861234663F, 0.7864913191F, - 0.7868588497F, 0.7872260578F, 0.7875929431F, 0.7879595055F, - 0.7883257445F, 0.7886916601F, 0.7890572520F, 0.7894225198F, - 0.7897874635F, 0.7901520827F, 0.7905163772F, 0.7908803468F, - 0.7912439912F, 0.7916073102F, 0.7919703035F, 0.7923329710F, - 0.7926953124F, 0.7930573274F, 0.7934190158F, 0.7937803774F, - 0.7941414120F, 0.7945021193F, 0.7948624991F, 0.7952225511F, - 0.7955822752F, 0.7959416711F, 0.7963007387F, 0.7966594775F, - 0.7970178875F, 0.7973759685F, 0.7977337201F, 0.7980911422F, - 0.7984482346F, 0.7988049970F, 0.7991614292F, 0.7995175310F, - 0.7998733022F, 0.8002287426F, 0.8005838519F, 0.8009386299F, - 0.8012930765F, 0.8016471914F, 0.8020009744F, 0.8023544253F, - 0.8027075438F, 0.8030603298F, 0.8034127831F, 0.8037649035F, - 0.8041166906F, 0.8044681445F, 0.8048192647F, 0.8051700512F, - 0.8055205038F, 0.8058706222F, 0.8062204062F, 0.8065698556F, - 0.8069189702F, 0.8072677499F, 0.8076161944F, 0.8079643036F, - 0.8083120772F, 0.8086595151F, 0.8090066170F, 0.8093533827F, - 0.8096998122F, 0.8100459051F, 0.8103916613F, 0.8107370806F, - 0.8110821628F, 0.8114269077F, 0.8117713151F, 0.8121153849F, - 0.8124591169F, 0.8128025108F, 0.8131455666F, 0.8134882839F, - 0.8138306627F, 0.8141727027F, 0.8145144038F, 0.8148557658F, - 0.8151967886F, 0.8155374718F, 0.8158778154F, 0.8162178192F, - 0.8165574830F, 0.8168968067F, 0.8172357900F, 0.8175744328F, - 0.8179127349F, 0.8182506962F, 0.8185883164F, 0.8189255955F, - 0.8192625332F, 0.8195991295F, 0.8199353840F, 0.8202712967F, - 0.8206068673F, 0.8209420958F, 0.8212769820F, 0.8216115256F, - 0.8219457266F, 0.8222795848F, 0.8226131000F, 0.8229462721F, - 0.8232791009F, 0.8236115863F, 0.8239437280F, 0.8242755260F, - 0.8246069801F, 0.8249380901F, 0.8252688559F, 0.8255992774F, - 0.8259293544F, 0.8262590867F, 0.8265884741F, 0.8269175167F, - 0.8272462141F, 0.8275745663F, 0.8279025732F, 0.8282302344F, - 0.8285575501F, 0.8288845199F, 0.8292111437F, 0.8295374215F, - 0.8298633530F, 0.8301889382F, 0.8305141768F, 0.8308390688F, - 0.8311636141F, 0.8314878124F, 0.8318116637F, 0.8321351678F, - 0.8324583246F, 0.8327811340F, 0.8331035957F, 0.8334257098F, - 0.8337474761F, 0.8340688944F, 0.8343899647F, 0.8347106867F, - 0.8350310605F, 0.8353510857F, 0.8356707624F, 0.8359900904F, - 0.8363090696F, 0.8366276999F, 0.8369459811F, 0.8372639131F, - 0.8375814958F, 0.8378987292F, 0.8382156130F, 0.8385321472F, - 0.8388483316F, 0.8391641662F, 0.8394796508F, 0.8397947853F, - 0.8401095697F, 0.8404240037F, 0.8407380873F, 0.8410518204F, - 0.8413652029F, 0.8416782347F, 0.8419909156F, 0.8423032456F, - 0.8426152245F, 0.8429268523F, 0.8432381289F, 0.8435490541F, - 0.8438596279F, 0.8441698502F, 0.8444797208F, 0.8447892396F, - 0.8450984067F, 0.8454072218F, 0.8457156849F, 0.8460237959F, - 0.8463315547F, 0.8466389612F, 0.8469460154F, 0.8472527170F, - 0.8475590661F, 0.8478650625F, 0.8481707063F, 0.8484759971F, - 0.8487809351F, 0.8490855201F, 0.8493897521F, 0.8496936308F, - 0.8499971564F, 0.8503003286F, 0.8506031474F, 0.8509056128F, - 0.8512077246F, 0.8515094828F, 0.8518108872F, 0.8521119379F, - 0.8524126348F, 0.8527129777F, 0.8530129666F, 0.8533126015F, - 0.8536118822F, 0.8539108087F, 0.8542093809F, 0.8545075988F, - 0.8548054623F, 0.8551029712F, 0.8554001257F, 0.8556969255F, - 0.8559933707F, 0.8562894611F, 0.8565851968F, 0.8568805775F, - 0.8571756034F, 0.8574702743F, 0.8577645902F, 0.8580585509F, - 0.8583521566F, 0.8586454070F, 0.8589383021F, 0.8592308420F, - 0.8595230265F, 0.8598148556F, 0.8601063292F, 0.8603974473F, - 0.8606882098F, 0.8609786167F, 0.8612686680F, 0.8615583636F, - 0.8618477034F, 0.8621366874F, 0.8624253156F, 0.8627135878F, - 0.8630015042F, 0.8632890646F, 0.8635762690F, 0.8638631173F, - 0.8641496096F, 0.8644357457F, 0.8647215257F, 0.8650069495F, - 0.8652920171F, 0.8655767283F, 0.8658610833F, 0.8661450820F, - 0.8664287243F, 0.8667120102F, 0.8669949397F, 0.8672775127F, - 0.8675597293F, 0.8678415894F, 0.8681230929F, 0.8684042398F, - 0.8686850302F, 0.8689654640F, 0.8692455412F, 0.8695252617F, - 0.8698046255F, 0.8700836327F, 0.8703622831F, 0.8706405768F, - 0.8709185138F, 0.8711960940F, 0.8714733174F, 0.8717501840F, - 0.8720266939F, 0.8723028469F, 0.8725786430F, 0.8728540824F, - 0.8731291648F, 0.8734038905F, 0.8736782592F, 0.8739522711F, - 0.8742259261F, 0.8744992242F, 0.8747721653F, 0.8750447496F, - 0.8753169770F, 0.8755888475F, 0.8758603611F, 0.8761315177F, - 0.8764023175F, 0.8766727603F, 0.8769428462F, 0.8772125752F, - 0.8774819474F, 0.8777509626F, 0.8780196209F, 0.8782879224F, - 0.8785558669F, 0.8788234546F, 0.8790906854F, 0.8793575594F, - 0.8796240765F, 0.8798902368F, 0.8801560403F, 0.8804214870F, - 0.8806865768F, 0.8809513099F, 0.8812156863F, 0.8814797059F, - 0.8817433687F, 0.8820066749F, 0.8822696243F, 0.8825322171F, - 0.8827944532F, 0.8830563327F, 0.8833178556F, 0.8835790219F, - 0.8838398316F, 0.8841002848F, 0.8843603815F, 0.8846201217F, - 0.8848795054F, 0.8851385327F, 0.8853972036F, 0.8856555182F, - 0.8859134764F, 0.8861710783F, 0.8864283239F, 0.8866852133F, - 0.8869417464F, 0.8871979234F, 0.8874537443F, 0.8877092090F, - 0.8879643177F, 0.8882190704F, 0.8884734671F, 0.8887275078F, - 0.8889811927F, 0.8892345216F, 0.8894874948F, 0.8897401122F, - 0.8899923738F, 0.8902442798F, 0.8904958301F, 0.8907470248F, - 0.8909978640F, 0.8912483477F, 0.8914984759F, 0.8917482487F, - 0.8919976662F, 0.8922467284F, 0.8924954353F, 0.8927437871F, - 0.8929917837F, 0.8932394252F, 0.8934867118F, 0.8937336433F, - 0.8939802199F, 0.8942264417F, 0.8944723087F, 0.8947178210F, - 0.8949629785F, 0.8952077815F, 0.8954522299F, 0.8956963239F, - 0.8959400634F, 0.8961834486F, 0.8964264795F, 0.8966691561F, - 0.8969114786F, 0.8971534470F, 0.8973950614F, 0.8976363219F, - 0.8978772284F, 0.8981177812F, 0.8983579802F, 0.8985978256F, - 0.8988373174F, 0.8990764556F, 0.8993152405F, 0.8995536720F, - 0.8997917502F, 0.9000294751F, 0.9002668470F, 0.9005038658F, - 0.9007405317F, 0.9009768446F, 0.9012128048F, 0.9014484123F, - 0.9016836671F, 0.9019185693F, 0.9021531191F, 0.9023873165F, - 0.9026211616F, 0.9028546546F, 0.9030877954F, 0.9033205841F, - 0.9035530210F, 0.9037851059F, 0.9040168392F, 0.9042482207F, - 0.9044792507F, 0.9047099293F, 0.9049402564F, 0.9051702323F, - 0.9053998569F, 0.9056291305F, 0.9058580531F, 0.9060866248F, - 0.9063148457F, 0.9065427159F, 0.9067702355F, 0.9069974046F, - 0.9072242233F, 0.9074506917F, 0.9076768100F, 0.9079025782F, - 0.9081279964F, 0.9083530647F, 0.9085777833F, 0.9088021523F, - 0.9090261717F, 0.9092498417F, 0.9094731623F, 0.9096961338F, - 0.9099187561F, 0.9101410295F, 0.9103629540F, 0.9105845297F, - 0.9108057568F, 0.9110266354F, 0.9112471656F, 0.9114673475F, - 0.9116871812F, 0.9119066668F, 0.9121258046F, 0.9123445945F, - 0.9125630367F, 0.9127811314F, 0.9129988786F, 0.9132162785F, - 0.9134333312F, 0.9136500368F, 0.9138663954F, 0.9140824073F, - 0.9142980724F, 0.9145133910F, 0.9147283632F, 0.9149429890F, - 0.9151572687F, 0.9153712023F, 0.9155847900F, 0.9157980319F, - 0.9160109282F, 0.9162234790F, 0.9164356844F, 0.9166475445F, - 0.9168590595F, 0.9170702296F, 0.9172810548F, 0.9174915354F, - 0.9177016714F, 0.9179114629F, 0.9181209102F, 0.9183300134F, - 0.9185387726F, 0.9187471879F, 0.9189552595F, 0.9191629876F, - 0.9193703723F, 0.9195774136F, 0.9197841119F, 0.9199904672F, - 0.9201964797F, 0.9204021495F, 0.9206074767F, 0.9208124616F, - 0.9210171043F, 0.9212214049F, 0.9214253636F, 0.9216289805F, - 0.9218322558F, 0.9220351896F, 0.9222377821F, 0.9224400335F, - 0.9226419439F, 0.9228435134F, 0.9230447423F, 0.9232456307F, - 0.9234461787F, 0.9236463865F, 0.9238462543F, 0.9240457822F, - 0.9242449704F, 0.9244438190F, 0.9246423282F, 0.9248404983F, - 0.9250383293F, 0.9252358214F, 0.9254329747F, 0.9256297896F, - 0.9258262660F, 0.9260224042F, 0.9262182044F, 0.9264136667F, - 0.9266087913F, 0.9268035783F, 0.9269980280F, 0.9271921405F, - 0.9273859160F, 0.9275793546F, 0.9277724566F, 0.9279652221F, - 0.9281576513F, 0.9283497443F, 0.9285415014F, 0.9287329227F, - 0.9289240084F, 0.9291147586F, 0.9293051737F, 0.9294952536F, - 0.9296849987F, 0.9298744091F, 0.9300634850F, 0.9302522266F, - 0.9304406340F, 0.9306287074F, 0.9308164471F, 0.9310038532F, - 0.9311909259F, 0.9313776654F, 0.9315640719F, 0.9317501455F, - 0.9319358865F, 0.9321212951F, 0.9323063713F, 0.9324911155F, - 0.9326755279F, 0.9328596085F, 0.9330433577F, 0.9332267756F, - 0.9334098623F, 0.9335926182F, 0.9337750434F, 0.9339571380F, - 0.9341389023F, 0.9343203366F, 0.9345014409F, 0.9346822155F, - 0.9348626606F, 0.9350427763F, 0.9352225630F, 0.9354020207F, - 0.9355811498F, 0.9357599503F, 0.9359384226F, 0.9361165667F, - 0.9362943830F, 0.9364718716F, 0.9366490327F, 0.9368258666F, - 0.9370023733F, 0.9371785533F, 0.9373544066F, 0.9375299335F, - 0.9377051341F, 0.9378800087F, 0.9380545576F, 0.9382287809F, - 0.9384026787F, 0.9385762515F, 0.9387494993F, 0.9389224223F, - 0.9390950209F, 0.9392672951F, 0.9394392453F, 0.9396108716F, - 0.9397821743F, 0.9399531536F, 0.9401238096F, 0.9402941427F, - 0.9404641530F, 0.9406338407F, 0.9408032061F, 0.9409722495F, - 0.9411409709F, 0.9413093707F, 0.9414774491F, 0.9416452062F, - 0.9418126424F, 0.9419797579F, 0.9421465528F, 0.9423130274F, - 0.9424791819F, 0.9426450166F, 0.9428105317F, 0.9429757274F, - 0.9431406039F, 0.9433051616F, 0.9434694005F, 0.9436333209F, - 0.9437969232F, 0.9439602074F, 0.9441231739F, 0.9442858229F, - 0.9444481545F, 0.9446101691F, 0.9447718669F, 0.9449332481F, - 0.9450943129F, 0.9452550617F, 0.9454154945F, 0.9455756118F, - 0.9457354136F, 0.9458949003F, 0.9460540721F, 0.9462129292F, - 0.9463714719F, 0.9465297003F, 0.9466876149F, 0.9468452157F, - 0.9470025031F, 0.9471594772F, 0.9473161384F, 0.9474724869F, - 0.9476285229F, 0.9477842466F, 0.9479396584F, 0.9480947585F, - 0.9482495470F, 0.9484040243F, 0.9485581906F, 0.9487120462F, - 0.9488655913F, 0.9490188262F, 0.9491717511F, 0.9493243662F, - 0.9494766718F, 0.9496286683F, 0.9497803557F, 0.9499317345F, - 0.9500828047F, 0.9502335668F, 0.9503840209F, 0.9505341673F, - 0.9506840062F, 0.9508335380F, 0.9509827629F, 0.9511316810F, - 0.9512802928F, 0.9514285984F, 0.9515765982F, 0.9517242923F, - 0.9518716810F, 0.9520187646F, 0.9521655434F, 0.9523120176F, - 0.9524581875F, 0.9526040534F, 0.9527496154F, 0.9528948739F, - 0.9530398292F, 0.9531844814F, 0.9533288310F, 0.9534728780F, - 0.9536166229F, 0.9537600659F, 0.9539032071F, 0.9540460470F, - 0.9541885858F, 0.9543308237F, 0.9544727611F, 0.9546143981F, - 0.9547557351F, 0.9548967723F, 0.9550375100F, 0.9551779485F, - 0.9553180881F, 0.9554579290F, 0.9555974714F, 0.9557367158F, - 0.9558756623F, 0.9560143112F, 0.9561526628F, 0.9562907174F, - 0.9564284752F, 0.9565659366F, 0.9567031017F, 0.9568399710F, - 0.9569765446F, 0.9571128229F, 0.9572488061F, 0.9573844944F, - 0.9575198883F, 0.9576549879F, 0.9577897936F, 0.9579243056F, - 0.9580585242F, 0.9581924497F, 0.9583260824F, 0.9584594226F, - 0.9585924705F, 0.9587252264F, 0.9588576906F, 0.9589898634F, - 0.9591217452F, 0.9592533360F, 0.9593846364F, 0.9595156465F, - 0.9596463666F, 0.9597767971F, 0.9599069382F, 0.9600367901F, - 0.9601663533F, 0.9602956279F, 0.9604246143F, 0.9605533128F, - 0.9606817236F, 0.9608098471F, 0.9609376835F, 0.9610652332F, - 0.9611924963F, 0.9613194733F, 0.9614461644F, 0.9615725699F, - 0.9616986901F, 0.9618245253F, 0.9619500757F, 0.9620753418F, - 0.9622003238F, 0.9623250219F, 0.9624494365F, 0.9625735679F, - 0.9626974163F, 0.9628209821F, 0.9629442656F, 0.9630672671F, - 0.9631899868F, 0.9633124251F, 0.9634345822F, 0.9635564585F, - 0.9636780543F, 0.9637993699F, 0.9639204056F, 0.9640411616F, - 0.9641616383F, 0.9642818359F, 0.9644017549F, 0.9645213955F, - 0.9646407579F, 0.9647598426F, 0.9648786497F, 0.9649971797F, - 0.9651154328F, 0.9652334092F, 0.9653511095F, 0.9654685337F, - 0.9655856823F, 0.9657025556F, 0.9658191538F, 0.9659354773F, - 0.9660515263F, 0.9661673013F, 0.9662828024F, 0.9663980300F, - 0.9665129845F, 0.9666276660F, 0.9667420750F, 0.9668562118F, - 0.9669700766F, 0.9670836698F, 0.9671969917F, 0.9673100425F, - 0.9674228227F, 0.9675353325F, 0.9676475722F, 0.9677595422F, - 0.9678712428F, 0.9679826742F, 0.9680938368F, 0.9682047309F, - 0.9683153569F, 0.9684257150F, 0.9685358056F, 0.9686456289F, - 0.9687551853F, 0.9688644752F, 0.9689734987F, 0.9690822564F, - 0.9691907483F, 0.9692989750F, 0.9694069367F, 0.9695146337F, - 0.9696220663F, 0.9697292349F, 0.9698361398F, 0.9699427813F, - 0.9700491597F, 0.9701552754F, 0.9702611286F, 0.9703667197F, - 0.9704720490F, 0.9705771169F, 0.9706819236F, 0.9707864695F, - 0.9708907549F, 0.9709947802F, 0.9710985456F, 0.9712020514F, - 0.9713052981F, 0.9714082859F, 0.9715110151F, 0.9716134862F, - 0.9717156993F, 0.9718176549F, 0.9719193532F, 0.9720207946F, - 0.9721219794F, 0.9722229080F, 0.9723235806F, 0.9724239976F, - 0.9725241593F, 0.9726240661F, 0.9727237183F, 0.9728231161F, - 0.9729222601F, 0.9730211503F, 0.9731197873F, 0.9732181713F, - 0.9733163027F, 0.9734141817F, 0.9735118088F, 0.9736091842F, - 0.9737063083F, 0.9738031814F, 0.9738998039F, 0.9739961760F, - 0.9740922981F, 0.9741881706F, 0.9742837938F, 0.9743791680F, - 0.9744742935F, 0.9745691707F, 0.9746637999F, 0.9747581814F, - 0.9748523157F, 0.9749462029F, 0.9750398435F, 0.9751332378F, - 0.9752263861F, 0.9753192887F, 0.9754119461F, 0.9755043585F, - 0.9755965262F, 0.9756884496F, 0.9757801291F, 0.9758715650F, - 0.9759627575F, 0.9760537071F, 0.9761444141F, 0.9762348789F, - 0.9763251016F, 0.9764150828F, 0.9765048228F, 0.9765943218F, - 0.9766835802F, 0.9767725984F, 0.9768613767F, 0.9769499154F, - 0.9770382149F, 0.9771262755F, 0.9772140976F, 0.9773016815F, - 0.9773890275F, 0.9774761360F, 0.9775630073F, 0.9776496418F, - 0.9777360398F, 0.9778222016F, 0.9779081277F, 0.9779938182F, - 0.9780792736F, 0.9781644943F, 0.9782494805F, 0.9783342326F, - 0.9784187509F, 0.9785030359F, 0.9785870877F, 0.9786709069F, - 0.9787544936F, 0.9788378484F, 0.9789209714F, 0.9790038631F, - 0.9790865238F, 0.9791689538F, 0.9792511535F, 0.9793331232F, - 0.9794148633F, 0.9794963742F, 0.9795776561F, 0.9796587094F, - 0.9797395345F, 0.9798201316F, 0.9799005013F, 0.9799806437F, - 0.9800605593F, 0.9801402483F, 0.9802197112F, 0.9802989483F, - 0.9803779600F, 0.9804567465F, 0.9805353082F, 0.9806136455F, - 0.9806917587F, 0.9807696482F, 0.9808473143F, 0.9809247574F, - 0.9810019778F, 0.9810789759F, 0.9811557519F, 0.9812323064F, - 0.9813086395F, 0.9813847517F, 0.9814606433F, 0.9815363147F, - 0.9816117662F, 0.9816869981F, 0.9817620108F, 0.9818368047F, - 0.9819113801F, 0.9819857374F, 0.9820598769F, 0.9821337989F, - 0.9822075038F, 0.9822809920F, 0.9823542638F, 0.9824273195F, - 0.9825001596F, 0.9825727843F, 0.9826451940F, 0.9827173891F, - 0.9827893700F, 0.9828611368F, 0.9829326901F, 0.9830040302F, - 0.9830751574F, 0.9831460720F, 0.9832167745F, 0.9832872652F, - 0.9833575444F, 0.9834276124F, 0.9834974697F, 0.9835671166F, - 0.9836365535F, 0.9837057806F, 0.9837747983F, 0.9838436071F, - 0.9839122072F, 0.9839805990F, 0.9840487829F, 0.9841167591F, - 0.9841845282F, 0.9842520903F, 0.9843194459F, 0.9843865953F, - 0.9844535389F, 0.9845202771F, 0.9845868101F, 0.9846531383F, - 0.9847192622F, 0.9847851820F, 0.9848508980F, 0.9849164108F, - 0.9849817205F, 0.9850468276F, 0.9851117324F, 0.9851764352F, - 0.9852409365F, 0.9853052366F, 0.9853693358F, 0.9854332344F, - 0.9854969330F, 0.9855604317F, 0.9856237309F, 0.9856868310F, - 0.9857497325F, 0.9858124355F, 0.9858749404F, 0.9859372477F, - 0.9859993577F, 0.9860612707F, 0.9861229871F, 0.9861845072F, - 0.9862458315F, 0.9863069601F, 0.9863678936F, 0.9864286322F, - 0.9864891764F, 0.9865495264F, 0.9866096826F, 0.9866696454F, - 0.9867294152F, 0.9867889922F, 0.9868483769F, 0.9869075695F, - 0.9869665706F, 0.9870253803F, 0.9870839991F, 0.9871424273F, - 0.9872006653F, 0.9872587135F, 0.9873165721F, 0.9873742415F, - 0.9874317222F, 0.9874890144F, 0.9875461185F, 0.9876030348F, - 0.9876597638F, 0.9877163057F, 0.9877726610F, 0.9878288300F, - 0.9878848130F, 0.9879406104F, 0.9879962225F, 0.9880516497F, - 0.9881068924F, 0.9881619509F, 0.9882168256F, 0.9882715168F, - 0.9883260249F, 0.9883803502F, 0.9884344931F, 0.9884884539F, - 0.9885422331F, 0.9885958309F, 0.9886492477F, 0.9887024838F, - 0.9887555397F, 0.9888084157F, 0.9888611120F, 0.9889136292F, - 0.9889659675F, 0.9890181273F, 0.9890701089F, 0.9891219128F, - 0.9891735392F, 0.9892249885F, 0.9892762610F, 0.9893273572F, - 0.9893782774F, 0.9894290219F, 0.9894795911F, 0.9895299853F, - 0.9895802049F, 0.9896302502F, 0.9896801217F, 0.9897298196F, - 0.9897793443F, 0.9898286961F, 0.9898778755F, 0.9899268828F, - 0.9899757183F, 0.9900243823F, 0.9900728753F, 0.9901211976F, - 0.9901693495F, 0.9902173314F, 0.9902651436F, 0.9903127865F, - 0.9903602605F, 0.9904075659F, 0.9904547031F, 0.9905016723F, - 0.9905484740F, 0.9905951086F, 0.9906415763F, 0.9906878775F, - 0.9907340126F, 0.9907799819F, 0.9908257858F, 0.9908714247F, - 0.9909168988F, 0.9909622086F, 0.9910073543F, 0.9910523364F, - 0.9910971552F, 0.9911418110F, 0.9911863042F, 0.9912306351F, - 0.9912748042F, 0.9913188117F, 0.9913626580F, 0.9914063435F, - 0.9914498684F, 0.9914932333F, 0.9915364383F, 0.9915794839F, - 0.9916223703F, 0.9916650981F, 0.9917076674F, 0.9917500787F, - 0.9917923323F, 0.9918344286F, 0.9918763679F, 0.9919181505F, - 0.9919597769F, 0.9920012473F, 0.9920425621F, 0.9920837217F, - 0.9921247263F, 0.9921655765F, 0.9922062724F, 0.9922468145F, - 0.9922872030F, 0.9923274385F, 0.9923675211F, 0.9924074513F, - 0.9924472294F, 0.9924868557F, 0.9925263306F, 0.9925656544F, - 0.9926048275F, 0.9926438503F, 0.9926827230F, 0.9927214461F, - 0.9927600199F, 0.9927984446F, 0.9928367208F, 0.9928748486F, - 0.9929128285F, 0.9929506608F, 0.9929883459F, 0.9930258841F, - 0.9930632757F, 0.9931005211F, 0.9931376207F, 0.9931745747F, - 0.9932113836F, 0.9932480476F, 0.9932845671F, 0.9933209425F, - 0.9933571742F, 0.9933932623F, 0.9934292074F, 0.9934650097F, - 0.9935006696F, 0.9935361874F, 0.9935715635F, 0.9936067982F, - 0.9936418919F, 0.9936768448F, 0.9937116574F, 0.9937463300F, - 0.9937808629F, 0.9938152565F, 0.9938495111F, 0.9938836271F, - 0.9939176047F, 0.9939514444F, 0.9939851465F, 0.9940187112F, - 0.9940521391F, 0.9940854303F, 0.9941185853F, 0.9941516044F, - 0.9941844879F, 0.9942172361F, 0.9942498495F, 0.9942823283F, - 0.9943146729F, 0.9943468836F, 0.9943789608F, 0.9944109047F, - 0.9944427158F, 0.9944743944F, 0.9945059408F, 0.9945373553F, - 0.9945686384F, 0.9945997902F, 0.9946308112F, 0.9946617017F, - 0.9946924621F, 0.9947230926F, 0.9947535937F, 0.9947839656F, - 0.9948142086F, 0.9948443232F, 0.9948743097F, 0.9949041683F, - 0.9949338995F, 0.9949635035F, 0.9949929807F, 0.9950223315F, - 0.9950515561F, 0.9950806549F, 0.9951096282F, 0.9951384764F, - 0.9951671998F, 0.9951957987F, 0.9952242735F, 0.9952526245F, - 0.9952808520F, 0.9953089564F, 0.9953369380F, 0.9953647971F, - 0.9953925340F, 0.9954201491F, 0.9954476428F, 0.9954750153F, - 0.9955022670F, 0.9955293981F, 0.9955564092F, 0.9955833003F, - 0.9956100720F, 0.9956367245F, 0.9956632582F, 0.9956896733F, - 0.9957159703F, 0.9957421494F, 0.9957682110F, 0.9957941553F, - 0.9958199828F, 0.9958456937F, 0.9958712884F, 0.9958967672F, - 0.9959221305F, 0.9959473784F, 0.9959725115F, 0.9959975300F, - 0.9960224342F, 0.9960472244F, 0.9960719011F, 0.9960964644F, - 0.9961209148F, 0.9961452525F, 0.9961694779F, 0.9961935913F, - 0.9962175930F, 0.9962414834F, 0.9962652627F, 0.9962889313F, - 0.9963124895F, 0.9963359377F, 0.9963592761F, 0.9963825051F, - 0.9964056250F, 0.9964286361F, 0.9964515387F, 0.9964743332F, - 0.9964970198F, 0.9965195990F, 0.9965420709F, 0.9965644360F, - 0.9965866946F, 0.9966088469F, 0.9966308932F, 0.9966528340F, - 0.9966746695F, 0.9966964001F, 0.9967180260F, 0.9967395475F, - 0.9967609651F, 0.9967822789F, 0.9968034894F, 0.9968245968F, - 0.9968456014F, 0.9968665036F, 0.9968873037F, 0.9969080019F, - 0.9969285987F, 0.9969490942F, 0.9969694889F, 0.9969897830F, - 0.9970099769F, 0.9970300708F, 0.9970500651F, 0.9970699601F, - 0.9970897561F, 0.9971094533F, 0.9971290522F, 0.9971485531F, - 0.9971679561F, 0.9971872617F, 0.9972064702F, 0.9972255818F, - 0.9972445968F, 0.9972635157F, 0.9972823386F, 0.9973010659F, - 0.9973196980F, 0.9973382350F, 0.9973566773F, 0.9973750253F, - 0.9973932791F, 0.9974114392F, 0.9974295059F, 0.9974474793F, - 0.9974653599F, 0.9974831480F, 0.9975008438F, 0.9975184476F, - 0.9975359598F, 0.9975533806F, 0.9975707104F, 0.9975879495F, - 0.9976050981F, 0.9976221566F, 0.9976391252F, 0.9976560043F, - 0.9976727941F, 0.9976894950F, 0.9977061073F, 0.9977226312F, - 0.9977390671F, 0.9977554152F, 0.9977716759F, 0.9977878495F, - 0.9978039361F, 0.9978199363F, 0.9978358501F, 0.9978516780F, - 0.9978674202F, 0.9978830771F, 0.9978986488F, 0.9979141358F, - 0.9979295383F, 0.9979448566F, 0.9979600909F, 0.9979752417F, - 0.9979903091F, 0.9980052936F, 0.9980201952F, 0.9980350145F, - 0.9980497515F, 0.9980644067F, 0.9980789804F, 0.9980934727F, - 0.9981078841F, 0.9981222147F, 0.9981364649F, 0.9981506350F, - 0.9981647253F, 0.9981787360F, 0.9981926674F, 0.9982065199F, - 0.9982202936F, 0.9982339890F, 0.9982476062F, 0.9982611456F, - 0.9982746074F, 0.9982879920F, 0.9983012996F, 0.9983145304F, - 0.9983276849F, 0.9983407632F, 0.9983537657F, 0.9983666926F, - 0.9983795442F, 0.9983923208F, 0.9984050226F, 0.9984176501F, - 0.9984302033F, 0.9984426827F, 0.9984550884F, 0.9984674208F, - 0.9984796802F, 0.9984918667F, 0.9985039808F, 0.9985160227F, - 0.9985279926F, 0.9985398909F, 0.9985517177F, 0.9985634734F, - 0.9985751583F, 0.9985867727F, 0.9985983167F, 0.9986097907F, - 0.9986211949F, 0.9986325297F, 0.9986437953F, 0.9986549919F, - 0.9986661199F, 0.9986771795F, 0.9986881710F, 0.9986990946F, - 0.9987099507F, 0.9987207394F, 0.9987314611F, 0.9987421161F, - 0.9987527045F, 0.9987632267F, 0.9987736829F, 0.9987840734F, - 0.9987943985F, 0.9988046584F, 0.9988148534F, 0.9988249838F, - 0.9988350498F, 0.9988450516F, 0.9988549897F, 0.9988648641F, - 0.9988746753F, 0.9988844233F, 0.9988941086F, 0.9989037313F, - 0.9989132918F, 0.9989227902F, 0.9989322269F, 0.9989416021F, - 0.9989509160F, 0.9989601690F, 0.9989693613F, 0.9989784931F, - 0.9989875647F, 0.9989965763F, 0.9990055283F, 0.9990144208F, - 0.9990232541F, 0.9990320286F, 0.9990407443F, 0.9990494016F, - 0.9990580008F, 0.9990665421F, 0.9990750257F, 0.9990834519F, - 0.9990918209F, 0.9991001331F, 0.9991083886F, 0.9991165877F, - 0.9991247307F, 0.9991328177F, 0.9991408491F, 0.9991488251F, - 0.9991567460F, 0.9991646119F, 0.9991724232F, 0.9991801801F, - 0.9991878828F, 0.9991955316F, 0.9992031267F, 0.9992106684F, - 0.9992181569F, 0.9992255925F, 0.9992329753F, 0.9992403057F, - 0.9992475839F, 0.9992548101F, 0.9992619846F, 0.9992691076F, - 0.9992761793F, 0.9992832001F, 0.9992901701F, 0.9992970895F, - 0.9993039587F, 0.9993107777F, 0.9993175470F, 0.9993242667F, - 0.9993309371F, 0.9993375583F, 0.9993441307F, 0.9993506545F, - 0.9993571298F, 0.9993635570F, 0.9993699362F, 0.9993762678F, - 0.9993825519F, 0.9993887887F, 0.9993949785F, 0.9994011216F, - 0.9994072181F, 0.9994132683F, 0.9994192725F, 0.9994252307F, - 0.9994311434F, 0.9994370107F, 0.9994428327F, 0.9994486099F, - 0.9994543423F, 0.9994600303F, 0.9994656739F, 0.9994712736F, - 0.9994768294F, 0.9994823417F, 0.9994878105F, 0.9994932363F, - 0.9994986191F, 0.9995039592F, 0.9995092568F, 0.9995145122F, - 0.9995197256F, 0.9995248971F, 0.9995300270F, 0.9995351156F, - 0.9995401630F, 0.9995451695F, 0.9995501352F, 0.9995550604F, - 0.9995599454F, 0.9995647903F, 0.9995695953F, 0.9995743607F, - 0.9995790866F, 0.9995837734F, 0.9995884211F, 0.9995930300F, - 0.9995976004F, 0.9996021324F, 0.9996066263F, 0.9996110822F, - 0.9996155004F, 0.9996198810F, 0.9996242244F, 0.9996285306F, - 0.9996327999F, 0.9996370326F, 0.9996412287F, 0.9996453886F, - 0.9996495125F, 0.9996536004F, 0.9996576527F, 0.9996616696F, - 0.9996656512F, 0.9996695977F, 0.9996735094F, 0.9996773865F, - 0.9996812291F, 0.9996850374F, 0.9996888118F, 0.9996925523F, - 0.9996962591F, 0.9996999325F, 0.9997035727F, 0.9997071798F, - 0.9997107541F, 0.9997142957F, 0.9997178049F, 0.9997212818F, - 0.9997247266F, 0.9997281396F, 0.9997315209F, 0.9997348708F, - 0.9997381893F, 0.9997414767F, 0.9997447333F, 0.9997479591F, - 0.9997511544F, 0.9997543194F, 0.9997574542F, 0.9997605591F, - 0.9997636342F, 0.9997666797F, 0.9997696958F, 0.9997726828F, - 0.9997756407F, 0.9997785698F, 0.9997814703F, 0.9997843423F, - 0.9997871860F, 0.9997900016F, 0.9997927894F, 0.9997955494F, - 0.9997982818F, 0.9998009869F, 0.9998036648F, 0.9998063157F, - 0.9998089398F, 0.9998115373F, 0.9998141082F, 0.9998166529F, - 0.9998191715F, 0.9998216642F, 0.9998241311F, 0.9998265724F, - 0.9998289884F, 0.9998313790F, 0.9998337447F, 0.9998360854F, - 0.9998384015F, 0.9998406930F, 0.9998429602F, 0.9998452031F, - 0.9998474221F, 0.9998496171F, 0.9998517885F, 0.9998539364F, - 0.9998560610F, 0.9998581624F, 0.9998602407F, 0.9998622962F, - 0.9998643291F, 0.9998663394F, 0.9998683274F, 0.9998702932F, - 0.9998722370F, 0.9998741589F, 0.9998760591F, 0.9998779378F, - 0.9998797952F, 0.9998816313F, 0.9998834464F, 0.9998852406F, - 0.9998870141F, 0.9998887670F, 0.9998904995F, 0.9998922117F, - 0.9998939039F, 0.9998955761F, 0.9998972285F, 0.9998988613F, - 0.9999004746F, 0.9999020686F, 0.9999036434F, 0.9999051992F, - 0.9999067362F, 0.9999082544F, 0.9999097541F, 0.9999112354F, - 0.9999126984F, 0.9999141433F, 0.9999155703F, 0.9999169794F, - 0.9999183709F, 0.9999197449F, 0.9999211014F, 0.9999224408F, - 0.9999237631F, 0.9999250684F, 0.9999263570F, 0.9999276289F, - 0.9999288843F, 0.9999301233F, 0.9999313461F, 0.9999325529F, - 0.9999337437F, 0.9999349187F, 0.9999360780F, 0.9999372218F, - 0.9999383503F, 0.9999394635F, 0.9999405616F, 0.9999416447F, - 0.9999427129F, 0.9999437665F, 0.9999448055F, 0.9999458301F, - 0.9999468404F, 0.9999478365F, 0.9999488185F, 0.9999497867F, - 0.9999507411F, 0.9999516819F, 0.9999526091F, 0.9999535230F, - 0.9999544236F, 0.9999553111F, 0.9999561856F, 0.9999570472F, - 0.9999578960F, 0.9999587323F, 0.9999595560F, 0.9999603674F, - 0.9999611666F, 0.9999619536F, 0.9999627286F, 0.9999634917F, - 0.9999642431F, 0.9999649828F, 0.9999657110F, 0.9999664278F, - 0.9999671334F, 0.9999678278F, 0.9999685111F, 0.9999691835F, - 0.9999698451F, 0.9999704960F, 0.9999711364F, 0.9999717662F, - 0.9999723858F, 0.9999729950F, 0.9999735942F, 0.9999741834F, - 0.9999747626F, 0.9999753321F, 0.9999758919F, 0.9999764421F, - 0.9999769828F, 0.9999775143F, 0.9999780364F, 0.9999785495F, - 0.9999790535F, 0.9999795485F, 0.9999800348F, 0.9999805124F, - 0.9999809813F, 0.9999814417F, 0.9999818938F, 0.9999823375F, - 0.9999827731F, 0.9999832005F, 0.9999836200F, 0.9999840316F, - 0.9999844353F, 0.9999848314F, 0.9999852199F, 0.9999856008F, - 0.9999859744F, 0.9999863407F, 0.9999866997F, 0.9999870516F, - 0.9999873965F, 0.9999877345F, 0.9999880656F, 0.9999883900F, - 0.9999887078F, 0.9999890190F, 0.9999893237F, 0.9999896220F, - 0.9999899140F, 0.9999901999F, 0.9999904796F, 0.9999907533F, - 0.9999910211F, 0.9999912830F, 0.9999915391F, 0.9999917896F, - 0.9999920345F, 0.9999922738F, 0.9999925077F, 0.9999927363F, - 0.9999929596F, 0.9999931777F, 0.9999933907F, 0.9999935987F, - 0.9999938018F, 0.9999940000F, 0.9999941934F, 0.9999943820F, - 0.9999945661F, 0.9999947456F, 0.9999949206F, 0.9999950912F, - 0.9999952575F, 0.9999954195F, 0.9999955773F, 0.9999957311F, - 0.9999958807F, 0.9999960265F, 0.9999961683F, 0.9999963063F, - 0.9999964405F, 0.9999965710F, 0.9999966979F, 0.9999968213F, - 0.9999969412F, 0.9999970576F, 0.9999971707F, 0.9999972805F, - 0.9999973871F, 0.9999974905F, 0.9999975909F, 0.9999976881F, - 0.9999977824F, 0.9999978738F, 0.9999979624F, 0.9999980481F, - 0.9999981311F, 0.9999982115F, 0.9999982892F, 0.9999983644F, - 0.9999984370F, 0.9999985072F, 0.9999985750F, 0.9999986405F, - 0.9999987037F, 0.9999987647F, 0.9999988235F, 0.9999988802F, - 0.9999989348F, 0.9999989873F, 0.9999990379F, 0.9999990866F, - 0.9999991334F, 0.9999991784F, 0.9999992217F, 0.9999992632F, - 0.9999993030F, 0.9999993411F, 0.9999993777F, 0.9999994128F, - 0.9999994463F, 0.9999994784F, 0.9999995091F, 0.9999995384F, - 0.9999995663F, 0.9999995930F, 0.9999996184F, 0.9999996426F, - 0.9999996657F, 0.9999996876F, 0.9999997084F, 0.9999997282F, - 0.9999997469F, 0.9999997647F, 0.9999997815F, 0.9999997973F, - 0.9999998123F, 0.9999998265F, 0.9999998398F, 0.9999998524F, - 0.9999998642F, 0.9999998753F, 0.9999998857F, 0.9999998954F, - 0.9999999045F, 0.9999999130F, 0.9999999209F, 0.9999999282F, - 0.9999999351F, 0.9999999414F, 0.9999999472F, 0.9999999526F, - 0.9999999576F, 0.9999999622F, 0.9999999664F, 0.9999999702F, - 0.9999999737F, 0.9999999769F, 0.9999999798F, 0.9999999824F, - 0.9999999847F, 0.9999999868F, 0.9999999887F, 0.9999999904F, - 0.9999999919F, 0.9999999932F, 0.9999999943F, 0.9999999953F, - 0.9999999961F, 0.9999999969F, 0.9999999975F, 0.9999999980F, - 0.9999999985F, 0.9999999988F, 0.9999999991F, 0.9999999993F, - 0.9999999995F, 0.9999999997F, 0.9999999998F, 0.9999999999F, - 0.9999999999F, 1.0000000000F, 1.0000000000F, 1.0000000000F, - 1.0000000000F, 1.0000000000F, 1.0000000000F, 1.0000000000F, -}; - -const float ff_vorbis_floor1_inverse_db_table[256]={ - 1.0649863e-07F, 1.1341951e-07F, 1.2079015e-07F, 1.2863978e-07F, - 1.3699951e-07F, 1.4590251e-07F, 1.5538408e-07F, 1.6548181e-07F, - 1.7623575e-07F, 1.8768855e-07F, 1.9988561e-07F, 2.128753e-07F, - 2.2670913e-07F, 2.4144197e-07F, 2.5713223e-07F, 2.7384213e-07F, - 2.9163793e-07F, 3.1059021e-07F, 3.3077411e-07F, 3.5226968e-07F, - 3.7516214e-07F, 3.9954229e-07F, 4.2550680e-07F, 4.5315863e-07F, - 4.8260743e-07F, 5.1396998e-07F, 5.4737065e-07F, 5.8294187e-07F, - 6.2082472e-07F, 6.6116941e-07F, 7.0413592e-07F, 7.4989464e-07F, - 7.9862701e-07F, 8.5052630e-07F, 9.0579828e-07F, 9.6466216e-07F, - 1.0273513e-06F, 1.0941144e-06F, 1.1652161e-06F, 1.2409384e-06F, - 1.3215816e-06F, 1.4074654e-06F, 1.4989305e-06F, 1.5963394e-06F, - 1.7000785e-06F, 1.8105592e-06F, 1.9282195e-06F, 2.0535261e-06F, - 2.1869758e-06F, 2.3290978e-06F, 2.4804557e-06F, 2.6416497e-06F, - 2.8133190e-06F, 2.9961443e-06F, 3.1908506e-06F, 3.3982101e-06F, - 3.6190449e-06F, 3.8542308e-06F, 4.1047004e-06F, 4.3714470e-06F, - 4.6555282e-06F, 4.9580707e-06F, 5.2802740e-06F, 5.6234160e-06F, - 5.9888572e-06F, 6.3780469e-06F, 6.7925283e-06F, 7.2339451e-06F, - 7.7040476e-06F, 8.2047000e-06F, 8.7378876e-06F, 9.3057248e-06F, - 9.9104632e-06F, 1.0554501e-05F, 1.1240392e-05F, 1.1970856e-05F, - 1.2748789e-05F, 1.3577278e-05F, 1.4459606e-05F, 1.5399272e-05F, - 1.6400004e-05F, 1.7465768e-05F, 1.8600792e-05F, 1.9809576e-05F, - 2.1096914e-05F, 2.2467911e-05F, 2.3928002e-05F, 2.5482978e-05F, - 2.7139006e-05F, 2.8902651e-05F, 3.0780908e-05F, 3.2781225e-05F, - 3.4911534e-05F, 3.7180282e-05F, 3.9596466e-05F, 4.2169667e-05F, - 4.4910090e-05F, 4.7828601e-05F, 5.0936773e-05F, 5.4246931e-05F, - 5.7772202e-05F, 6.1526565e-05F, 6.5524908e-05F, 6.9783085e-05F, - 7.4317983e-05F, 7.9147585e-05F, 8.4291040e-05F, 8.9768747e-05F, - 9.5602426e-05F, 0.00010181521F, 0.00010843174F, 0.00011547824F, - 0.00012298267F, 0.00013097477F, 0.00013948625F, 0.00014855085F, - 0.00015820453F, 0.00016848555F, 0.00017943469F, 0.00019109536F, - 0.00020351382F, 0.00021673929F, 0.00023082423F, 0.00024582449F, - 0.00026179955F, 0.00027881276F, 0.00029693158F, 0.00031622787F, - 0.00033677814F, 0.00035866388F, 0.00038197188F, 0.00040679456F, - 0.00043323036F, 0.00046138411F, 0.00049136745F, 0.00052329927F, - 0.00055730621F, 0.00059352311F, 0.00063209358F, 0.00067317058F, - 0.00071691700F, 0.00076350630F, 0.00081312324F, 0.00086596457F, - 0.00092223983F, 0.00098217216F, 0.0010459992F, 0.0011139742F, - 0.0011863665F, 0.0012634633F, 0.0013455702F, 0.0014330129F, - 0.0015261382F, 0.0016253153F, 0.0017309374F, 0.0018434235F, - 0.0019632195F, 0.0020908006F, 0.0022266726F, 0.0023713743F, - 0.0025254795F, 0.0026895994F, 0.0028643847F, 0.0030505286F, - 0.0032487691F, 0.0034598925F, 0.0036847358F, 0.0039241906F, - 0.0041792066F, 0.0044507950F, 0.0047400328F, 0.0050480668F, - 0.0053761186F, 0.0057254891F, 0.0060975636F, 0.0064938176F, - 0.0069158225F, 0.0073652516F, 0.0078438871F, 0.0083536271F, - 0.0088964928F, 0.009474637F, 0.010090352F, 0.010746080F, - 0.011444421F, 0.012188144F, 0.012980198F, 0.013823725F, - 0.014722068F, 0.015678791F, 0.016697687F, 0.017782797F, - 0.018938423F, 0.020169149F, 0.021479854F, 0.022875735F, - 0.024362330F, 0.025945531F, 0.027631618F, 0.029427276F, - 0.031339626F, 0.033376252F, 0.035545228F, 0.037855157F, - 0.040315199F, 0.042935108F, 0.045725273F, 0.048696758F, - 0.051861348F, 0.055231591F, 0.058820850F, 0.062643361F, - 0.066714279F, 0.071049749F, 0.075666962F, 0.080584227F, - 0.085821044F, 0.091398179F, 0.097337747F, 0.10366330F, - 0.11039993F, 0.11757434F, 0.12521498F, 0.13335215F, - 0.14201813F, 0.15124727F, 0.16107617F, 0.17154380F, - 0.18269168F, 0.19456402F, 0.20720788F, 0.22067342F, - 0.23501402F, 0.25028656F, 0.26655159F, 0.28387361F, - 0.30232132F, 0.32196786F, 0.34289114F, 0.36517414F, - 0.38890521F, 0.41417847F, 0.44109412F, 0.46975890F, - 0.50028648F, 0.53279791F, 0.56742212F, 0.60429640F, - 0.64356699F, 0.68538959F, 0.72993007F, 0.77736504F, - 0.82788260F, 0.88168307F, 0.9389798F, 1.F, -}; - -const float * const ff_vorbis_vwin[8] = { - vwin64, vwin128, vwin256, vwin512, - vwin1024, vwin2048, vwin4096, vwin8192 -}; diff --git a/media/ffvpx/libavcodec/vorbis_data.h b/media/ffvpx/libavcodec/vorbis_data.h deleted file mode 100644 index 0fe19e509f3c..000000000000 --- a/media/ffvpx/libavcodec/vorbis_data.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVCODEC_VORBIS_DATA_H -#define AVCODEC_VORBIS_DATA_H - -#include - -#include "libavutil/channel_layout.h" - -extern const float ff_vorbis_floor1_inverse_db_table[256]; -extern const float * const ff_vorbis_vwin[8]; -extern const uint8_t ff_vorbis_channel_layout_offsets[8][8]; -#if FF_API_OLD_CHANNEL_LAYOUT -extern const uint64_t ff_vorbis_channel_layouts[9]; -#endif -extern const AVChannelLayout ff_vorbis_ch_layouts[9]; - -#endif /* AVCODEC_VORBIS_DATA_H */ diff --git a/media/ffvpx/libavutil/avutil.symbols b/media/ffvpx/libavutil/avutil.symbols index 376bc3fdeb5b..aefd9b731098 100644 --- a/media/ffvpx/libavutil/avutil.symbols +++ b/media/ffvpx/libavutil/avutil.symbols @@ -31,12 +31,10 @@ av_buffer_ref av_buffer_unref av_calloc av_channel_layout_check -av_channel_layout_compare av_channel_layout_copy -av_channel_layout_default -av_channel_layout_describe +av_channel_layout_compare av_channel_layout_extract_channel -av_channel_layout_from_mask +av_channel_layout_describe av_channel_layout_from_mask av_channel_layout_uninit av_chroma_location_name @@ -69,8 +67,6 @@ av_dict_set av_dict_set_int av_dirname av_div_q -av_dynamic_hdr_plus_from_t35 -av_dynamic_hdr_plus_create_side_data av_dynarray2_add av_dynarray_add av_dynarray_add_nofree @@ -151,6 +147,7 @@ av_get_pix_fmt_name av_get_pix_fmt_string av_get_planar_sample_fmt av_get_sample_fmt +av_get_sample_fmt_name av_get_sample_fmt_string av_get_standard_channel_layout av_get_time_base_q @@ -327,4 +324,3 @@ av_hwdevice_ctx_init av_hwframe_transfer_get_formats av_hwdevice_ctx_create_derived av_malloc_array -av_get_sample_fmt_name diff --git a/media/ffvpx/libavutil/frame.c b/media/ffvpx/libavutil/frame.c index 5c9afb0d036e..9545477acc95 100644 --- a/media/ffvpx/libavutil/frame.c +++ b/media/ffvpx/libavutil/frame.c @@ -48,12 +48,8 @@ FF_DISABLE_DEPRECATION_WARNINGS frame->pkt_duration = 0; FF_ENABLE_DEPRECATION_WARNINGS #endif -#if FF_API_FRAME_PKT -FF_DISABLE_DEPRECATION_WARNINGS frame->pkt_pos = -1; frame->pkt_size = -1; -FF_ENABLE_DEPRECATION_WARNINGS -#endif frame->time_base = (AVRational){ 0, 1 }; frame->key_frame = 1; frame->sample_aspect_ratio = (AVRational){ 0, 1 }; @@ -283,12 +279,8 @@ static int frame_copy_props(AVFrame *dst, const AVFrame *src, int force_copy) dst->sample_rate = src->sample_rate; dst->opaque = src->opaque; dst->pkt_dts = src->pkt_dts; -#if FF_API_FRAME_PKT -FF_DISABLE_DEPRECATION_WARNINGS dst->pkt_pos = src->pkt_pos; dst->pkt_size = src->pkt_size; -FF_ENABLE_DEPRECATION_WARNINGS -#endif #if FF_API_PKT_DURATION FF_DISABLE_DEPRECATION_WARNINGS dst->pkt_duration = src->pkt_duration; diff --git a/media/ffvpx/libavutil/frame.h b/media/ffvpx/libavutil/frame.h index 5b58c14ac32d..25802695493a 100644 --- a/media/ffvpx/libavutil/frame.h +++ b/media/ffvpx/libavutil/frame.h @@ -470,18 +470,7 @@ typedef struct AVFrame { int quality; /** - * Frame owner's private data. - * - * This field may be set by the code that allocates/owns the frame data. - * It is then not touched by any library functions, except: - * - it is copied to other references by av_frame_copy_props() (and hence by - * av_frame_ref()); - * - it is set to NULL when the frame is cleared by av_frame_unref() - * - on the caller's explicit request. E.g. libavcodec encoders/decoders - * will copy this field to/from @ref AVPacket "AVPackets" if the caller sets - * @ref AV_CODEC_FLAG_COPY_OPAQUE. - * - * @see opaque_ref the reference-counted analogue + * for some private data of the user */ void *opaque; @@ -622,17 +611,12 @@ typedef struct AVFrame { */ int64_t best_effort_timestamp; -#if FF_API_FRAME_PKT /** * reordered pos from the last AVPacket that has been input into the decoder * - encoding: unused * - decoding: Read by user. - * @deprecated use AV_CODEC_FLAG_COPY_OPAQUE to pass through arbitrary user - * data from packets to frames */ - attribute_deprecated int64_t pkt_pos; -#endif #if FF_API_PKT_DURATION /** @@ -678,19 +662,14 @@ typedef struct AVFrame { int channels; #endif -#if FF_API_FRAME_PKT /** * size of the corresponding packet containing the compressed * frame. * It is set to a negative value if unknown. * - encoding: unused * - decoding: set by libavcodec, read by user. - * @deprecated use AV_CODEC_FLAG_COPY_OPAQUE to pass through arbitrary user - * data from packets to frames */ - attribute_deprecated int pkt_size; -#endif /** * For hwaccel-format frames, this should be a reference to the @@ -699,18 +678,13 @@ typedef struct AVFrame { AVBufferRef *hw_frames_ctx; /** - * Frame owner's private data. + * AVBufferRef for free use by the API user. FFmpeg will never check the + * contents of the buffer ref. FFmpeg calls av_buffer_unref() on it when + * the frame is unreferenced. av_frame_copy_props() calls create a new + * reference with av_buffer_ref() for the target frame's opaque_ref field. * - * This field may be set by the code that allocates/owns the frame data. - * It is then not touched by any library functions, except: - * - a new reference to the underlying buffer is propagated by - * av_frame_copy_props() (and hence by av_frame_ref()); - * - it is unreferenced in av_frame_unref(); - * - on the caller's explicit request. E.g. libavcodec encoders/decoders - * will propagate a new reference to/from @ref AVPacket "AVPackets" if the - * caller sets @ref AV_CODEC_FLAG_COPY_OPAQUE. - * - * @see opaque the plain pointer analogue + * This is unrelated to the opaque field, although it serves a similar + * purpose. */ AVBufferRef *opaque_ref; diff --git a/media/ffvpx/libavutil/hdr_dynamic_metadata.c b/media/ffvpx/libavutil/hdr_dynamic_metadata.c deleted file mode 100644 index d458788c32ca..000000000000 --- a/media/ffvpx/libavutil/hdr_dynamic_metadata.c +++ /dev/null @@ -1,385 +0,0 @@ -/** - * Copyright (c) 2018 Mohammad Izadi - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "hdr_dynamic_metadata.h" -#include "mem.h" -#include "libavcodec/defs.h" -#include "libavcodec/get_bits.h" -#include "libavcodec/put_bits.h" - -#define T35_PAYLOAD_MAX_SIZE 907 - -static const int64_t luminance_den = 1; -static const int32_t peak_luminance_den = 15; -static const int64_t rgb_den = 100000; -static const int32_t fraction_pixel_den = 1000; -static const int32_t knee_point_den = 4095; -static const int32_t bezier_anchor_den = 1023; -static const int32_t saturation_weight_den = 8; - -AVDynamicHDRPlus *av_dynamic_hdr_plus_alloc(size_t *size) -{ - AVDynamicHDRPlus *hdr_plus = av_mallocz(sizeof(AVDynamicHDRPlus)); - if (!hdr_plus) - return NULL; - - if (size) - *size = sizeof(*hdr_plus); - - return hdr_plus; -} - -AVDynamicHDRPlus *av_dynamic_hdr_plus_create_side_data(AVFrame *frame) -{ - AVFrameSideData *side_data = av_frame_new_side_data(frame, - AV_FRAME_DATA_DYNAMIC_HDR_PLUS, - sizeof(AVDynamicHDRPlus)); - if (!side_data) - return NULL; - - memset(side_data->data, 0, sizeof(AVDynamicHDRPlus)); - - return (AVDynamicHDRPlus *)side_data->data; -} - -int av_dynamic_hdr_plus_from_t35(AVDynamicHDRPlus *s, const uint8_t *data, - size_t size) -{ - uint8_t padded_buf[T35_PAYLOAD_MAX_SIZE + AV_INPUT_BUFFER_PADDING_SIZE]; - GetBitContext gbc, *gb = &gbc; - int ret; - - if (!s) - return AVERROR(ENOMEM); - - if (size > T35_PAYLOAD_MAX_SIZE) - return AVERROR(EINVAL); - - memcpy(padded_buf, data, size); - // Zero-initialize the buffer padding to avoid overreads into uninitialized data. - memset(padded_buf + size, 0, AV_INPUT_BUFFER_PADDING_SIZE); - - ret = init_get_bits8(gb, padded_buf, size); - if (ret < 0) - return ret; - - if (get_bits_left(gb) < 10) - return AVERROR_INVALIDDATA; - - s->application_version = get_bits(gb, 8); - s->num_windows = get_bits(gb, 2); - - if (s->num_windows < 1 || s->num_windows > 3) { - return AVERROR_INVALIDDATA; - } - - if (get_bits_left(gb) < ((19 * 8 + 1) * (s->num_windows - 1))) - return AVERROR_INVALIDDATA; - - for (int w = 1; w < s->num_windows; w++) { - // The corners are set to absolute coordinates here. They should be - // converted to the relative coordinates (in [0, 1]) in the decoder. - AVHDRPlusColorTransformParams *params = &s->params[w]; - params->window_upper_left_corner_x = - (AVRational){get_bits(gb, 16), 1}; - params->window_upper_left_corner_y = - (AVRational){get_bits(gb, 16), 1}; - params->window_lower_right_corner_x = - (AVRational){get_bits(gb, 16), 1}; - params->window_lower_right_corner_y = - (AVRational){get_bits(gb, 16), 1}; - - params->center_of_ellipse_x = get_bits(gb, 16); - params->center_of_ellipse_y = get_bits(gb, 16); - params->rotation_angle = get_bits(gb, 8); - params->semimajor_axis_internal_ellipse = get_bits(gb, 16); - params->semimajor_axis_external_ellipse = get_bits(gb, 16); - params->semiminor_axis_external_ellipse = get_bits(gb, 16); - params->overlap_process_option = get_bits1(gb); - } - - if (get_bits_left(gb) < 28) - return AVERROR_INVALIDDATA; - - s->targeted_system_display_maximum_luminance = - (AVRational){get_bits_long(gb, 27), luminance_den}; - s->targeted_system_display_actual_peak_luminance_flag = get_bits1(gb); - - if (s->targeted_system_display_actual_peak_luminance_flag) { - int rows, cols; - if (get_bits_left(gb) < 10) - return AVERROR_INVALIDDATA; - rows = get_bits(gb, 5); - cols = get_bits(gb, 5); - if (((rows < 2) || (rows > 25)) || ((cols < 2) || (cols > 25))) { - return AVERROR_INVALIDDATA; - } - s->num_rows_targeted_system_display_actual_peak_luminance = rows; - s->num_cols_targeted_system_display_actual_peak_luminance = cols; - - if (get_bits_left(gb) < (rows * cols * 4)) - return AVERROR_INVALIDDATA; - - for (int i = 0; i < rows; i++) { - for (int j = 0; j < cols; j++) { - s->targeted_system_display_actual_peak_luminance[i][j] = - (AVRational){get_bits(gb, 4), peak_luminance_den}; - } - } - } - for (int w = 0; w < s->num_windows; w++) { - AVHDRPlusColorTransformParams *params = &s->params[w]; - if (get_bits_left(gb) < (3 * 17 + 17 + 4)) - return AVERROR_INVALIDDATA; - - for (int i = 0; i < 3; i++) { - params->maxscl[i] = - (AVRational){get_bits(gb, 17), rgb_den}; - } - params->average_maxrgb = - (AVRational){get_bits(gb, 17), rgb_den}; - params->num_distribution_maxrgb_percentiles = get_bits(gb, 4); - - if (get_bits_left(gb) < - (params->num_distribution_maxrgb_percentiles * 24)) - return AVERROR_INVALIDDATA; - - for (int i = 0; i < params->num_distribution_maxrgb_percentiles; i++) { - params->distribution_maxrgb[i].percentage = get_bits(gb, 7); - params->distribution_maxrgb[i].percentile = - (AVRational){get_bits(gb, 17), rgb_den}; - } - - if (get_bits_left(gb) < 10) - return AVERROR_INVALIDDATA; - - params->fraction_bright_pixels = (AVRational){get_bits(gb, 10), fraction_pixel_den}; - } - if (get_bits_left(gb) < 1) - return AVERROR_INVALIDDATA; - s->mastering_display_actual_peak_luminance_flag = get_bits1(gb); - if (s->mastering_display_actual_peak_luminance_flag) { - int rows, cols; - if (get_bits_left(gb) < 10) - return AVERROR_INVALIDDATA; - rows = get_bits(gb, 5); - cols = get_bits(gb, 5); - if (((rows < 2) || (rows > 25)) || ((cols < 2) || (cols > 25))) { - return AVERROR_INVALIDDATA; - } - s->num_rows_mastering_display_actual_peak_luminance = rows; - s->num_cols_mastering_display_actual_peak_luminance = cols; - - if (get_bits_left(gb) < (rows * cols * 4)) - return AVERROR_INVALIDDATA; - - for (int i = 0; i < rows; i++) { - for (int j = 0; j < cols; j++) { - s->mastering_display_actual_peak_luminance[i][j] = - (AVRational){get_bits(gb, 4), peak_luminance_den}; - } - } - } - - for (int w = 0; w < s->num_windows; w++) { - AVHDRPlusColorTransformParams *params = &s->params[w]; - if (get_bits_left(gb) < 1) - return AVERROR_INVALIDDATA; - - params->tone_mapping_flag = get_bits1(gb); - if (params->tone_mapping_flag) { - if (get_bits_left(gb) < 28) - return AVERROR_INVALIDDATA; - - params->knee_point_x = - (AVRational){get_bits(gb, 12), knee_point_den}; - params->knee_point_y = - (AVRational){get_bits(gb, 12), knee_point_den}; - params->num_bezier_curve_anchors = get_bits(gb, 4); - - if (get_bits_left(gb) < (params->num_bezier_curve_anchors * 10)) - return AVERROR_INVALIDDATA; - - for (int i = 0; i < params->num_bezier_curve_anchors; i++) { - params->bezier_curve_anchors[i] = - (AVRational){get_bits(gb, 10), bezier_anchor_den}; - } - } - - if (get_bits_left(gb) < 1) - return AVERROR_INVALIDDATA; - params->color_saturation_mapping_flag = get_bits1(gb); - if (params->color_saturation_mapping_flag) { - if (get_bits_left(gb) < 6) - return AVERROR_INVALIDDATA; - params->color_saturation_weight = - (AVRational){get_bits(gb, 6), saturation_weight_den}; - } - } - - return 0; -} - -int av_dynamic_hdr_plus_to_t35(const AVDynamicHDRPlus *s, uint8_t **data, size_t *size) -{ - uint8_t *buf; - size_t size_bits, size_bytes; - PutBitContext pbc, *pb = &pbc; - - if (!s || !data) - return AVERROR(EINVAL); - - /** - * Buffer size per CTA-861-H p.253-254: - * 48 header bits (excluded from the serialized payload) - * 8 bits for application_mode - * 2 bits for num_windows - * 153 bits for window geometry, for each window above 1 - * 27 bits for targeted_system_display_maximum_luminance - * 1-2511 bits for targeted system display peak luminance information - * 82-442 bits per window for pixel distribution information - * 1-2511 bits for mastering display peak luminance information - * 1-179 bits per window for tonemapping information - * 1-7 bits per window for color saturation mapping information - * Total: 123-7249 bits, excluding trimmed header bits - */ - size_bits = 8; - - size_bits += 2; - - for (int w = 1; w < s->num_windows; w++) - size_bits += 153; - - size_bits += 27; - - size_bits += 1; - if (s->targeted_system_display_actual_peak_luminance_flag) - size_bits += 10 + - s->num_rows_targeted_system_display_actual_peak_luminance * - s->num_cols_targeted_system_display_actual_peak_luminance * 4; - - for (int w = 0; w < s->num_windows; w++) - size_bits += 72 + s->params[w].num_distribution_maxrgb_percentiles * 24 + 10; - - size_bits += 1; - if (s->mastering_display_actual_peak_luminance_flag) - size_bits += 10 + - s->num_rows_mastering_display_actual_peak_luminance * - s->num_cols_mastering_display_actual_peak_luminance * 4; - - for (int w = 0; w < s->num_windows; w++) { - size_bits += 1; - if (s->params[w].tone_mapping_flag) - size_bits += 28 + s->params[w].num_bezier_curve_anchors * 10; - - size_bits += 1; - if (s->params[w].color_saturation_mapping_flag) - size_bits += 6; - } - - size_bytes = (size_bits + 7) / 8; - - buf = av_mallocz(size_bytes); - if (!buf) - return AVERROR(ENOMEM); - - init_put_bits(pb, buf, size_bytes); - - // application_mode is set to Application Version 1 - put_bits(pb, 8, 1); - - // Payload as per CTA-861-H p.253-254 - put_bits(pb, 2, s->num_windows); - - for (int w = 1; w < s->num_windows; w++) { - put_bits(pb, 16, s->params[w].window_upper_left_corner_x.num / s->params[w].window_upper_left_corner_x.den); - put_bits(pb, 16, s->params[w].window_upper_left_corner_y.num / s->params[w].window_upper_left_corner_y.den); - put_bits(pb, 16, s->params[w].window_lower_right_corner_x.num / s->params[w].window_lower_right_corner_x.den); - put_bits(pb, 16, s->params[w].window_lower_right_corner_y.num / s->params[w].window_lower_right_corner_y.den); - put_bits(pb, 16, s->params[w].center_of_ellipse_x); - put_bits(pb, 16, s->params[w].center_of_ellipse_y); - put_bits(pb, 8, s->params[w].rotation_angle); - put_bits(pb, 16, s->params[w].semimajor_axis_internal_ellipse); - put_bits(pb, 16, s->params[w].semimajor_axis_external_ellipse); - put_bits(pb, 16, s->params[w].semiminor_axis_external_ellipse); - put_bits(pb, 1, s->params[w].overlap_process_option); - } - - put_bits(pb, 27, s->targeted_system_display_maximum_luminance.num * luminance_den / - s->targeted_system_display_maximum_luminance.den); - put_bits(pb, 1, s->targeted_system_display_actual_peak_luminance_flag); - if (s->targeted_system_display_actual_peak_luminance_flag) { - put_bits(pb, 5, s->num_rows_targeted_system_display_actual_peak_luminance); - put_bits(pb, 5, s->num_cols_targeted_system_display_actual_peak_luminance); - for (int i = 0; i < s->num_rows_targeted_system_display_actual_peak_luminance; i++) { - for (int j = 0; j < s->num_cols_targeted_system_display_actual_peak_luminance; j++) - put_bits(pb, 4, s->targeted_system_display_actual_peak_luminance[i][j].num * peak_luminance_den / - s->targeted_system_display_actual_peak_luminance[i][j].den); - } - } - - for (int w = 0; w < s->num_windows; w++) { - for (int i = 0; i < 3; i++) - put_bits(pb, 17, s->params[w].maxscl[i].num * rgb_den / s->params[w].maxscl[i].den); - put_bits(pb, 17, s->params[w].average_maxrgb.num * rgb_den / s->params[w].average_maxrgb.den); - put_bits(pb, 4, s->params[w].num_distribution_maxrgb_percentiles); - for (int i = 0; i < s->params[w].num_distribution_maxrgb_percentiles; i++) { - put_bits(pb, 7, s->params[w].distribution_maxrgb[i].percentage); - put_bits(pb, 17, s->params[w].distribution_maxrgb[i].percentile.num * rgb_den / - s->params[w].distribution_maxrgb[i].percentile.den); - } - put_bits(pb, 10, s->params[w].fraction_bright_pixels.num * fraction_pixel_den / - s->params[w].fraction_bright_pixels.den); - } - - put_bits(pb, 1, s->mastering_display_actual_peak_luminance_flag); - if (s->mastering_display_actual_peak_luminance_flag) { - put_bits(pb, 5, s->num_rows_mastering_display_actual_peak_luminance); - put_bits(pb, 5, s->num_cols_mastering_display_actual_peak_luminance); - for (int i = 0; i < s->num_rows_mastering_display_actual_peak_luminance; i++) { - for (int j = 0; j < s->num_cols_mastering_display_actual_peak_luminance; j++) - put_bits(pb, 4, s->mastering_display_actual_peak_luminance[i][j].num * peak_luminance_den / - s->mastering_display_actual_peak_luminance[i][j].den); - } - } - - for (int w = 0; w < s->num_windows; w++) { - put_bits(pb, 1, s->params[w].tone_mapping_flag); - if (s->params[w].tone_mapping_flag) { - put_bits(pb, 12, s->params[w].knee_point_x.num * knee_point_den / s->params[w].knee_point_x.den); - put_bits(pb, 12, s->params[w].knee_point_y.num * knee_point_den / s->params[w].knee_point_y.den); - put_bits(pb, 4, s->params[w].num_bezier_curve_anchors); - for (int i = 0; i < s->params[w].num_bezier_curve_anchors; i++) - put_bits(pb, 10, s->params[w].bezier_curve_anchors[i].num * bezier_anchor_den / - s->params[w].bezier_curve_anchors[i].den); - put_bits(pb, 1, s->params[w].color_saturation_mapping_flag); - if (s->params[w].color_saturation_mapping_flag) - put_bits(pb, 6, s->params[w].color_saturation_weight.num * saturation_weight_den / - s->params[w].color_saturation_weight.den); - } - } - - flush_put_bits(pb); - - *data = buf; - if (size) - *size = size_bytes; - return 0; -} diff --git a/media/ffvpx/libavutil/hdr_dynamic_metadata.h b/media/ffvpx/libavutil/hdr_dynamic_metadata.h deleted file mode 100644 index 771bb8f468db..000000000000 --- a/media/ffvpx/libavutil/hdr_dynamic_metadata.h +++ /dev/null @@ -1,368 +0,0 @@ -/* - * Copyright (c) 2018 Mohammad Izadi - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVUTIL_HDR_DYNAMIC_METADATA_H -#define AVUTIL_HDR_DYNAMIC_METADATA_H - -#include "frame.h" -#include "rational.h" - -/** - * Option for overlapping elliptical pixel selectors in an image. - */ -enum AVHDRPlusOverlapProcessOption { - AV_HDR_PLUS_OVERLAP_PROCESS_WEIGHTED_AVERAGING = 0, - AV_HDR_PLUS_OVERLAP_PROCESS_LAYERING = 1, -}; - -/** - * Represents the percentile at a specific percentage in - * a distribution. - */ -typedef struct AVHDRPlusPercentile { - /** - * The percentage value corresponding to a specific percentile linearized - * RGB value in the processing window in the scene. The value shall be in - * the range of 0 to100, inclusive. - */ - uint8_t percentage; - - /** - * The linearized maxRGB value at a specific percentile in the processing - * window in the scene. The value shall be in the range of 0 to 1, inclusive - * and in multiples of 0.00001. - */ - AVRational percentile; -} AVHDRPlusPercentile; - -/** - * Color transform parameters at a processing window in a dynamic metadata for - * SMPTE 2094-40. - */ -typedef struct AVHDRPlusColorTransformParams { - /** - * The relative x coordinate of the top left pixel of the processing - * window. The value shall be in the range of 0 and 1, inclusive and - * in multiples of 1/(width of Picture - 1). The value 1 corresponds - * to the absolute coordinate of width of Picture - 1. The value for - * first processing window shall be 0. - */ - AVRational window_upper_left_corner_x; - - /** - * The relative y coordinate of the top left pixel of the processing - * window. The value shall be in the range of 0 and 1, inclusive and - * in multiples of 1/(height of Picture - 1). The value 1 corresponds - * to the absolute coordinate of height of Picture - 1. The value for - * first processing window shall be 0. - */ - AVRational window_upper_left_corner_y; - - /** - * The relative x coordinate of the bottom right pixel of the processing - * window. The value shall be in the range of 0 and 1, inclusive and - * in multiples of 1/(width of Picture - 1). The value 1 corresponds - * to the absolute coordinate of width of Picture - 1. The value for - * first processing window shall be 1. - */ - AVRational window_lower_right_corner_x; - - /** - * The relative y coordinate of the bottom right pixel of the processing - * window. The value shall be in the range of 0 and 1, inclusive and - * in multiples of 1/(height of Picture - 1). The value 1 corresponds - * to the absolute coordinate of height of Picture - 1. The value for - * first processing window shall be 1. - */ - AVRational window_lower_right_corner_y; - - /** - * The x coordinate of the center position of the concentric internal and - * external ellipses of the elliptical pixel selector in the processing - * window. The value shall be in the range of 0 to (width of Picture - 1), - * inclusive and in multiples of 1 pixel. - */ - uint16_t center_of_ellipse_x; - - /** - * The y coordinate of the center position of the concentric internal and - * external ellipses of the elliptical pixel selector in the processing - * window. The value shall be in the range of 0 to (height of Picture - 1), - * inclusive and in multiples of 1 pixel. - */ - uint16_t center_of_ellipse_y; - - /** - * The clockwise rotation angle in degree of arc with respect to the - * positive direction of the x-axis of the concentric internal and external - * ellipses of the elliptical pixel selector in the processing window. The - * value shall be in the range of 0 to 180, inclusive and in multiples of 1. - */ - uint8_t rotation_angle; - - /** - * The semi-major axis value of the internal ellipse of the elliptical pixel - * selector in amount of pixels in the processing window. The value shall be - * in the range of 1 to 65535, inclusive and in multiples of 1 pixel. - */ - uint16_t semimajor_axis_internal_ellipse; - - /** - * The semi-major axis value of the external ellipse of the elliptical pixel - * selector in amount of pixels in the processing window. The value - * shall not be less than semimajor_axis_internal_ellipse of the current - * processing window. The value shall be in the range of 1 to 65535, - * inclusive and in multiples of 1 pixel. - */ - uint16_t semimajor_axis_external_ellipse; - - /** - * The semi-minor axis value of the external ellipse of the elliptical pixel - * selector in amount of pixels in the processing window. The value shall be - * in the range of 1 to 65535, inclusive and in multiples of 1 pixel. - */ - uint16_t semiminor_axis_external_ellipse; - - /** - * Overlap process option indicates one of the two methods of combining - * rendered pixels in the processing window in an image with at least one - * elliptical pixel selector. For overlapping elliptical pixel selectors - * in an image, overlap_process_option shall have the same value. - */ - enum AVHDRPlusOverlapProcessOption overlap_process_option; - - /** - * The maximum of the color components of linearized RGB values in the - * processing window in the scene. The values should be in the range of 0 to - * 1, inclusive and in multiples of 0.00001. maxscl[ 0 ], maxscl[ 1 ], and - * maxscl[ 2 ] are corresponding to R, G, B color components respectively. - */ - AVRational maxscl[3]; - - /** - * The average of linearized maxRGB values in the processing window in the - * scene. The value should be in the range of 0 to 1, inclusive and in - * multiples of 0.00001. - */ - AVRational average_maxrgb; - - /** - * The number of linearized maxRGB values at given percentiles in the - * processing window in the scene. The maximum value shall be 15. - */ - uint8_t num_distribution_maxrgb_percentiles; - - /** - * The linearized maxRGB values at given percentiles in the - * processing window in the scene. - */ - AVHDRPlusPercentile distribution_maxrgb[15]; - - /** - * The fraction of selected pixels in the image that contains the brightest - * pixel in the scene. The value shall be in the range of 0 to 1, inclusive - * and in multiples of 0.001. - */ - AVRational fraction_bright_pixels; - - /** - * This flag indicates that the metadata for the tone mapping function in - * the processing window is present (for value of 1). - */ - uint8_t tone_mapping_flag; - - /** - * The x coordinate of the separation point between the linear part and the - * curved part of the tone mapping function. The value shall be in the range - * of 0 to 1, excluding 0 and in multiples of 1/4095. - */ - AVRational knee_point_x; - - /** - * The y coordinate of the separation point between the linear part and the - * curved part of the tone mapping function. The value shall be in the range - * of 0 to 1, excluding 0 and in multiples of 1/4095. - */ - AVRational knee_point_y; - - /** - * The number of the intermediate anchor parameters of the tone mapping - * function in the processing window. The maximum value shall be 15. - */ - uint8_t num_bezier_curve_anchors; - - /** - * The intermediate anchor parameters of the tone mapping function in the - * processing window in the scene. The values should be in the range of 0 - * to 1, inclusive and in multiples of 1/1023. - */ - AVRational bezier_curve_anchors[15]; - - /** - * This flag shall be equal to 0 in bitstreams conforming to this version of - * this Specification. Other values are reserved for future use. - */ - uint8_t color_saturation_mapping_flag; - - /** - * The color saturation gain in the processing window in the scene. The - * value shall be in the range of 0 to 63/8, inclusive and in multiples of - * 1/8. The default value shall be 1. - */ - AVRational color_saturation_weight; -} AVHDRPlusColorTransformParams; - -/** - * This struct represents dynamic metadata for color volume transform - - * application 4 of SMPTE 2094-40:2016 standard. - * - * To be used as payload of a AVFrameSideData or AVPacketSideData with the - * appropriate type. - * - * @note The struct should be allocated with - * av_dynamic_hdr_plus_alloc() and its size is not a part of - * the public ABI. - */ -typedef struct AVDynamicHDRPlus { - /** - * Country code by Rec. ITU-T T.35 Annex A. The value shall be 0xB5. - */ - uint8_t itu_t_t35_country_code; - - /** - * Application version in the application defining document in ST-2094 - * suite. The value shall be set to 0. - */ - uint8_t application_version; - - /** - * The number of processing windows. The value shall be in the range - * of 1 to 3, inclusive. - */ - uint8_t num_windows; - - /** - * The color transform parameters for every processing window. - */ - AVHDRPlusColorTransformParams params[3]; - - /** - * The nominal maximum display luminance of the targeted system display, - * in units of 0.0001 candelas per square metre. The value shall be in - * the range of 0 to 10000, inclusive. - */ - AVRational targeted_system_display_maximum_luminance; - - /** - * This flag shall be equal to 0 in bit streams conforming to this version - * of this Specification. The value 1 is reserved for future use. - */ - uint8_t targeted_system_display_actual_peak_luminance_flag; - - /** - * The number of rows in the targeted system_display_actual_peak_luminance - * array. The value shall be in the range of 2 to 25, inclusive. - */ - uint8_t num_rows_targeted_system_display_actual_peak_luminance; - - /** - * The number of columns in the - * targeted_system_display_actual_peak_luminance array. The value shall be - * in the range of 2 to 25, inclusive. - */ - uint8_t num_cols_targeted_system_display_actual_peak_luminance; - - /** - * The normalized actual peak luminance of the targeted system display. The - * values should be in the range of 0 to 1, inclusive and in multiples of - * 1/15. - */ - AVRational targeted_system_display_actual_peak_luminance[25][25]; - - /** - * This flag shall be equal to 0 in bitstreams conforming to this version of - * this Specification. The value 1 is reserved for future use. - */ - uint8_t mastering_display_actual_peak_luminance_flag; - - /** - * The number of rows in the mastering_display_actual_peak_luminance array. - * The value shall be in the range of 2 to 25, inclusive. - */ - uint8_t num_rows_mastering_display_actual_peak_luminance; - - /** - * The number of columns in the mastering_display_actual_peak_luminance - * array. The value shall be in the range of 2 to 25, inclusive. - */ - uint8_t num_cols_mastering_display_actual_peak_luminance; - - /** - * The normalized actual peak luminance of the mastering display used for - * mastering the image essence. The values should be in the range of 0 to 1, - * inclusive and in multiples of 1/15. - */ - AVRational mastering_display_actual_peak_luminance[25][25]; -} AVDynamicHDRPlus; - -/** - * Allocate an AVDynamicHDRPlus structure and set its fields to - * default values. The resulting struct can be freed using av_freep(). - * - * @return An AVDynamicHDRPlus filled with default values or NULL - * on failure. - */ -AVDynamicHDRPlus *av_dynamic_hdr_plus_alloc(size_t *size); - -/** - * Allocate a complete AVDynamicHDRPlus and add it to the frame. - * @param frame The frame which side data is added to. - * - * @return The AVDynamicHDRPlus structure to be filled by caller or NULL - * on failure. - */ -AVDynamicHDRPlus *av_dynamic_hdr_plus_create_side_data(AVFrame *frame); - -/** - * Parse the user data registered ITU-T T.35 to AVbuffer (AVDynamicHDRPlus). - * The T.35 buffer must begin with the application mode, skipping the - * country code, terminal provider codes, and application identifier. - * @param s A pointer containing the decoded AVDynamicHDRPlus structure. - * @param data The byte array containing the raw ITU-T T.35 data. - * @param size Size of the data array in bytes. - * - * @return >= 0 on success. Otherwise, returns the appropriate AVERROR. - */ -int av_dynamic_hdr_plus_from_t35(AVDynamicHDRPlus *s, const uint8_t *data, - size_t size); - -/** - * Serialize dynamic HDR10+ metadata to a user data registered ITU-T T.35 buffer, - * excluding the first 48 bytes of the header, and beginning with the application mode. - * @param s A pointer containing the decoded AVDynamicHDRPlus structure. - * @param data A pointer to a byte buffer to be allocated and filled - * with the serialized metadata. - * @param size A pointer to a size to be set to the returned buffer's size (optional). - * - * @return >= 0 on success. Otherwise, returns the appropriate AVERROR. - */ -int av_dynamic_hdr_plus_to_t35(const AVDynamicHDRPlus *s, uint8_t **data, size_t *size); - -#endif /* AVUTIL_HDR_DYNAMIC_METADATA_H */ diff --git a/media/ffvpx/libavutil/hwcontext_vaapi.c b/media/ffvpx/libavutil/hwcontext_vaapi.c index 90c2c191d908..de30a919ab73 100644 --- a/media/ffvpx/libavutil/hwcontext_vaapi.c +++ b/media/ffvpx/libavutil/hwcontext_vaapi.c @@ -44,7 +44,9 @@ #include "buffer.h" #include "common.h" #include "hwcontext.h" +#if CONFIG_LIBDRM #include "hwcontext_drm.h" +#endif #include "hwcontext_internal.h" #include "hwcontext_vaapi.h" #include "mem.h" diff --git a/media/ffvpx/libavutil/moz.build b/media/ffvpx/libavutil/moz.build index 355871a2ec32..c89020ab0a3c 100644 --- a/media/ffvpx/libavutil/moz.build +++ b/media/ffvpx/libavutil/moz.build @@ -54,7 +54,6 @@ if not CONFIG['MOZ_FFVPX_AUDIOONLY']: 'base64.c', 'color_utils.c', 'film_grain_params.c', - 'hdr_dynamic_metadata.c', 'integer.c', 'intmath.c', 'lls.c', diff --git a/media/ffvpx/libavutil/version.h b/media/ffvpx/libavutil/version.h index a232381ba56b..900b7989718a 100644 --- a/media/ffvpx/libavutil/version.h +++ b/media/ffvpx/libavutil/version.h @@ -79,7 +79,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 58 -#define LIBAVUTIL_VERSION_MINOR 5 +#define LIBAVUTIL_VERSION_MINOR 3 #define LIBAVUTIL_VERSION_MICRO 100 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ @@ -113,8 +113,6 @@ #define FF_API_PKT_DURATION (LIBAVUTIL_VERSION_MAJOR < 59) #define FF_API_REORDERED_OPAQUE (LIBAVUTIL_VERSION_MAJOR < 59) #define FF_API_FRAME_PICTURE_NUMBER (LIBAVUTIL_VERSION_MAJOR < 59) -#define FF_API_HDR_VIVID_THREE_SPLINE (LIBAVUTIL_VERSION_MAJOR < 59) -#define FF_API_FRAME_PKT (LIBAVUTIL_VERSION_MAJOR < 59) /** * @} diff --git a/media/libogg/moz.build b/media/libogg/moz.build index f980b820cbc3..81504bc01055 100644 --- a/media/libogg/moz.build +++ b/media/libogg/moz.build @@ -18,8 +18,7 @@ EXPORTS.ogg += [ UNIFIED_SOURCES += ogg_sources -FINAL_LIBRARY = 'gkcodecs' -NoVisibilityFlags() +FINAL_LIBRARY = 'gkmedias' # Add libFuzzer configuration directives include('/tools/fuzzing/libfuzzer-config.mozbuild') diff --git a/media/libopus/moz.build b/media/libopus/moz.build index 7740bf532816..f139053c0964 100644 --- a/media/libopus/moz.build +++ b/media/libopus/moz.build @@ -17,8 +17,7 @@ EXPORTS.opus += [ # We allow warnings for third-party code that can be updated from upstream. AllowCompilerWarnings() -FINAL_LIBRARY = "gkcodecs" -NoVisibilityFlags() +FINAL_LIBRARY = "gkmedias" DEFINES["OPUS_BUILD"] = True DEFINES["OPUS_VERSION"] = "5023249b5c935545fb02dbfe845cae996ecfc8bb" @@ -60,11 +59,6 @@ if not CONFIG["MOZ_SAMPLE_TYPE_FLOAT32"]: DEFINES["FIXED_POINT"] = 1 DEFINES["DISABLE_FLOAT_API"] = True -if CONFIG["OS_ARCH"] == "Linux": - OS_LIBS += [ - "m", - ] - LOCAL_INCLUDES += [ "celt", "include", diff --git a/media/libspeex_resampler/src/moz.build b/media/libspeex_resampler/src/moz.build index 9121f896fc5c..b99b8d92ce10 100644 --- a/media/libspeex_resampler/src/moz.build +++ b/media/libspeex_resampler/src/moz.build @@ -24,10 +24,14 @@ FINAL_LIBRARY = 'gkmedias' DEFINES['OUTSIDE_SPEEX'] = True DEFINES['EXPORT'] = '' -DEFINES['FLOATING_POINT'] = True + +if CONFIG['MOZ_SAMPLE_TYPE_S16']: + DEFINES['FIXED_POINT'] = True +else: + DEFINES['FLOATING_POINT'] = True # Only use SSE code when using floating point samples, and on x86 -if CONFIG['INTEL_ARCHITECTURE']: +if CONFIG['INTEL_ARCHITECTURE'] and not CONFIG['MOZ_SAMPLE_TYPE_S16']: DEFINES['_USE_SSE'] = True DEFINES['_USE_SSE2'] = True SOURCES += [ diff --git a/media/libtheora/moz.build b/media/libtheora/moz.build index 5e44d36ec8cd..7e76448db9ca 100644 --- a/media/libtheora/moz.build +++ b/media/libtheora/moz.build @@ -15,8 +15,7 @@ EXPORTS.theora += [ # We allow warnings for third-party code that can be updated from upstream. AllowCompilerWarnings() -FINAL_LIBRARY = 'gkcodecs' -NoVisibilityFlags() +FINAL_LIBRARY = 'gkmedias' # The encoder is currently not included. DEFINES['THEORA_DISABLE_ENCODE'] = True diff --git a/media/libtremor/COPYING b/media/libtremor/COPYING new file mode 100644 index 000000000000..6111c6c5a6b9 --- /dev/null +++ b/media/libtremor/COPYING @@ -0,0 +1,28 @@ +Copyright (c) 2002, Xiph.org Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +- Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +- Neither the name of the Xiph.org Foundation nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/media/libtremor/README b/media/libtremor/README new file mode 100644 index 000000000000..132117532292 --- /dev/null +++ b/media/libtremor/README @@ -0,0 +1,46 @@ +This README covers the Ogg Vorbis 'Tremor' integer playback codec +source as of date 2002 09 02, version 1.0.0. + + ****** + +The C source in this package will build on any ANSI C compiler and +function completely and properly on any platform. The included build +system assumes GNU build system and make tools (m4, automake, +autoconf, libtool and gmake). GCC is not required, although GCC is +the most tested compiler. To build using GNU tools, type in the +source directory: + +./autogen.sh +make + +Currently, the source implements playback in pure C on all platforms +except ARM, where a [currently] small amount of assembly (see +asm_arm.h) is used to implement 64 bit math operations and fast LSP +computation. If building on ARM without the benefit of GNU build +system tools, be sure that '_ARM_ASSEM_' is #defined by the build +system if this assembly is desired, else the resulting library will +use whatever 64 bit math builtins the compiler implements. + +No math library is required by this source. No floating point +operations are used at any point in either setup or decode. This +decoder library will properly decode any past, current or future +Vorbis I file or stream. + + ******** + +The build system produces a static and [when supported by the OS] +dynamic library named 'libvorbisidec'. This library exposes an API +nearly identical to the BSD reference library's 'libvorbisfile', +including all the features familiar to users of vorbisfile. This API +is similar enough that the proper header file to include is named +'ivorbisfile.h' [included in the source build directory]. Lower level +libvorbis-style headers and structures are in 'ivorbiscodec.h' +[included in the source build directory]. A simple example program, +ivorbisfile_example.c, can be built with 'make example'. + + ******** + +Detailed Tremor API Documentation begins at doc/index.html + +Monty +xiph.org diff --git a/media/libtremor/README_MOZILLA b/media/libtremor/README_MOZILLA new file mode 100644 index 000000000000..ee67b53a05c5 --- /dev/null +++ b/media/libtremor/README_MOZILLA @@ -0,0 +1,7 @@ +The source from this directory was copied from the libtremor +subversion repository using the update.sh script. The only changes +made were those applied by update.sh and the addition/upate of +Makefile.in files for the Mozilla build system. + +The upstream release used was http://svn.xiph.org/trunk/Tremor/ +The subversion revision used was r17547. diff --git a/media/libtremor/bug1117571-r19420.patch b/media/libtremor/bug1117571-r19420.patch new file mode 100644 index 000000000000..02de5e68ffdd --- /dev/null +++ b/media/libtremor/bug1117571-r19420.patch @@ -0,0 +1,18 @@ +diff -r 55f3224d7513 media/libtremor/lib/tremor_synthesis.c +--- a/media/libtremor/lib/tremor_synthesis.c Sat Jan 03 20:02:33 2015 -0800 ++++ b/media/libtremor/lib/tremor_synthesis.c Sun Jan 04 11:17:29 2015 -0800 +@@ -119,13 +119,13 @@ long vorbis_packet_blocksize(vorbis_info + while(v>1){ + modebits++; + v>>=1; + } + + /* read our mode and pre/post windowsize */ + mode=oggpack_read(&opb,modebits); + } +- if(mode==-1)return(OV_EBADPACKET); ++ if(mode==-1 || !ci->mode_param[mode])return(OV_EBADPACKET); + return(ci->blocksizes[ci->mode_param[mode]->blockflag]); + } + + diff --git a/media/libtremor/bug719612.patch b/media/libtremor/bug719612.patch new file mode 100644 index 000000000000..36ac84f66cc0 --- /dev/null +++ b/media/libtremor/bug719612.patch @@ -0,0 +1,21 @@ +diff --git a/media/libtremor/lib/tremor_floor1.c b/media/libtremor/lib/tremor_floor1.c +--- a/media/libtremor/lib/tremor_floor1.c ++++ b/media/libtremor/lib/tremor_floor1.c +@@ -103,16 +103,17 @@ static vorbis_info_floor *floor1_unpack + + /* read the post list */ + info->mult=oggpack_read(opb,2)+1; /* only 1,2,3,4 legal now */ + rangebits=oggpack_read(opb,4); + if(rangebits<0)goto err_out; + + for(j=0,k=0;jpartitions;j++){ + count+=info->class_dim[info->partitionclass[j]]; ++ if(count>VIF_POSIT)goto err_out; + for(;kpostlist[k+2]=oggpack_read(opb,rangebits); + if(t<0 || t>=(1<postlist[0]=0; + info->postlist[1]=1< + +typedef struct vorbis_info{ + int version; + int channels; + long rate; + + /* The below bitrate declarations are *hints*. + Combinations of the three values carry the following implications: + + all three set to the same value: + implies a fixed rate bitstream + only nominal set: + implies a VBR stream that averages the nominal bitrate. No hard + upper/lower limit + upper and or lower set: + implies a VBR bitstream that obeys the bitrate limits. nominal + may also be set to give a nominal rate. + none set: + the coder does not care to speculate. + */ + + long bitrate_upper; + long bitrate_nominal; + long bitrate_lower; + long bitrate_window; + + void *codec_setup; +} vorbis_info; + +/* vorbis_dsp_state buffers the current vorbis audio + analysis/synthesis state. The DSP state belongs to a specific + logical bitstream ****************************************************/ +typedef struct vorbis_dsp_state{ + int analysisp; + vorbis_info *vi; + + ogg_int32_t **pcm; + ogg_int32_t **pcmret; + int pcm_storage; + int pcm_current; + int pcm_returned; + + int preextrapolate; + int eofflag; + + long lW; + long W; + long nW; + long centerW; + + ogg_int64_t granulepos; + ogg_int64_t sequence; + + void *backend_state; +} vorbis_dsp_state; + +typedef struct vorbis_block{ + /* necessary stream state for linking to the framing abstraction */ + ogg_int32_t **pcm; /* this is a pointer into local storage */ + oggpack_buffer opb; + + long lW; + long W; + long nW; + int pcmend; + int mode; + + int eofflag; + ogg_int64_t granulepos; + ogg_int64_t sequence; + vorbis_dsp_state *vd; /* For read-only access of configuration */ + + /* local storage to avoid remallocing; it's up to the mapping to + structure it */ + void *localstore; + long localtop; + long localalloc; + long totaluse; + struct alloc_chain *reap; + +} vorbis_block; + +/* vorbis_block is a single block of data to be processed as part of +the analysis/synthesis stream; it belongs to a specific logical +bitstream, but is independant from other vorbis_blocks belonging to +that logical bitstream. *************************************************/ + +struct alloc_chain{ + void *ptr; + struct alloc_chain *next; +}; + +/* vorbis_info contains all the setup information specific to the + specific compression/decompression mode in progress (eg, + psychoacoustic settings, channel setup, options, codebook + etc). vorbis_info and substructures are in backends.h. +*********************************************************************/ + +/* the comments are not part of vorbis_info so that vorbis_info can be + static storage */ +typedef struct vorbis_comment{ + /* unlimited user comment fields. libvorbis writes 'libvorbis' + whatever vendor is set to in encode */ + char **user_comments; + int *comment_lengths; + int comments; + char *vendor; + +} vorbis_comment; + + +/* libvorbis encodes in two abstraction layers; first we perform DSP + and produce a packet (see docs/analysis.txt). The packet is then + coded into a framed OggSquish bitstream by the second layer (see + docs/framing.txt). Decode is the reverse process; we sync/frame + the bitstream and extract individual packets, then decode the + packet back into PCM audio. + + The extra framing/packetizing is used in streaming formats, such as + files. Over the net (such as with UDP), the framing and + packetization aren't necessary as they're provided by the transport + and the streaming layer is not used */ + +/* Vorbis PRIMITIVES: general ***************************************/ + +extern void vorbis_info_init(vorbis_info *vi); +extern void vorbis_info_clear(vorbis_info *vi); +extern int vorbis_info_blocksize(vorbis_info *vi,int zo); +extern void vorbis_comment_init(vorbis_comment *vc); +extern void vorbis_comment_add(vorbis_comment *vc, char *comment); +extern void vorbis_comment_add_tag(vorbis_comment *vc, + char *tag, char *contents); +extern char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count); +extern int vorbis_comment_query_count(vorbis_comment *vc, char *tag); +extern void vorbis_comment_clear(vorbis_comment *vc); + +extern int vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb); +extern int vorbis_block_clear(vorbis_block *vb); +extern void vorbis_dsp_clear(vorbis_dsp_state *v); + +/* Vorbis PRIMITIVES: synthesis layer *******************************/ +extern int vorbis_synthesis_idheader(ogg_packet *op); +extern int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc, + ogg_packet *op); + +extern int vorbis_synthesis_init(vorbis_dsp_state *v,vorbis_info *vi); +extern int vorbis_synthesis_restart(vorbis_dsp_state *v); +extern int vorbis_synthesis(vorbis_block *vb,ogg_packet *op); +extern int vorbis_synthesis_trackonly(vorbis_block *vb,ogg_packet *op); +extern int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb); +extern int vorbis_synthesis_pcmout(vorbis_dsp_state *v,ogg_int32_t ***pcm); +extern int vorbis_synthesis_read(vorbis_dsp_state *v,int samples); +extern long vorbis_packet_blocksize(vorbis_info *vi,ogg_packet *op); + +/* Vorbis ERRORS and return codes ***********************************/ + +#define OV_FALSE -1 +#define OV_EOF -2 +#define OV_HOLE -3 + +#define OV_EREAD -128 +#define OV_EFAULT -129 +#define OV_EIMPL -130 +#define OV_EINVAL -131 +#define OV_ENOTVORBIS -132 +#define OV_EBADHEADER -133 +#define OV_EVERSION -134 +#define OV_ENOTAUDIO -135 +#define OV_EBADPACKET -136 +#define OV_EBADLINK -137 +#define OV_ENOSEEK -138 + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif + diff --git a/media/libtremor/include/tremor/moz.build b/media/libtremor/include/tremor/moz.build new file mode 100644 index 000000000000..73e4a38c8be5 --- /dev/null +++ b/media/libtremor/include/tremor/moz.build @@ -0,0 +1,10 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# 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/. + +EXPORTS.tremor += [ + 'ivorbiscodec.h', +] + diff --git a/media/libtremor/lib/asm_arm.h b/media/libtremor/lib/asm_arm.h new file mode 100644 index 000000000000..c3bda005cd59 --- /dev/null +++ b/media/libtremor/lib/asm_arm.h @@ -0,0 +1,245 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * + * * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * + * * + ******************************************************************** + + function: arm7 and later wide math functions + + ********************************************************************/ + +#ifdef _ARM_ASSEM_ + +#if !defined(_V_WIDE_MATH) && !defined(_LOW_ACCURACY_) +#define _V_WIDE_MATH + +static inline ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) { + int lo,hi; + asm volatile("smull\t%0, %1, %2, %3" + : "=&r"(lo),"=&r"(hi) + : "%r"(x),"r"(y) + : "cc"); + return(hi); +} + +static inline ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) { + return MULT32(x,y)<<1; +} + +static inline ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) { + int lo,hi; + asm volatile("smull %0, %1, %2, %3\n\t" + "movs %0, %0, lsr #15\n\t" + "adc %1, %0, %1, lsl #17\n\t" + : "=&r"(lo),"=&r"(hi) + : "%r"(x),"r"(y) + : "cc"); + return(hi); +} + +#define MB() asm volatile ("" : : : "memory") + +static inline void XPROD32(ogg_int32_t a, ogg_int32_t b, + ogg_int32_t t, ogg_int32_t v, + ogg_int32_t *x, ogg_int32_t *y) +{ + int x1, y1, l; + asm( "smull %0, %1, %4, %6\n\t" + "smlal %0, %1, %5, %7\n\t" + "rsb %3, %4, #0\n\t" + "smull %0, %2, %5, %6\n\t" + "smlal %0, %2, %3, %7" + : "=&r" (l), "=&r" (x1), "=&r" (y1), "=r" (a) + : "3" (a), "r" (b), "r" (t), "r" (v) + : "cc" ); + *x = x1; + MB(); + *y = y1; +} + +static inline void XPROD31(ogg_int32_t a, ogg_int32_t b, + ogg_int32_t t, ogg_int32_t v, + ogg_int32_t *x, ogg_int32_t *y) +{ + int x1, y1, l; + asm( "smull %0, %1, %4, %6\n\t" + "smlal %0, %1, %5, %7\n\t" + "rsb %3, %4, #0\n\t" + "smull %0, %2, %5, %6\n\t" + "smlal %0, %2, %3, %7" + : "=&r" (l), "=&r" (x1), "=&r" (y1), "=r" (a) + : "3" (a), "r" (b), "r" (t), "r" (v) + : "cc" ); + *x = x1 << 1; + MB(); + *y = y1 << 1; +} + +static inline void XNPROD31(ogg_int32_t a, ogg_int32_t b, + ogg_int32_t t, ogg_int32_t v, + ogg_int32_t *x, ogg_int32_t *y) +{ + int x1, y1, l; + asm( "rsb %2, %4, #0\n\t" + "smull %0, %1, %3, %5\n\t" + "smlal %0, %1, %2, %6\n\t" + "smull %0, %2, %4, %5\n\t" + "smlal %0, %2, %3, %6" + : "=&r" (l), "=&r" (x1), "=&r" (y1) + : "r" (a), "r" (b), "r" (t), "r" (v) + : "cc" ); + *x = x1 << 1; + MB(); + *y = y1 << 1; +} + +#endif + +#ifndef _V_CLIP_MATH +#define _V_CLIP_MATH + +static inline ogg_int32_t CLIP_TO_15(ogg_int32_t x) { + int tmp; + asm volatile("subs %1, %0, #32768\n\t" + "movpl %0, #0x7f00\n\t" + "orrpl %0, %0, #0xff\n" + "adds %1, %0, #32768\n\t" + "movmi %0, #0x8000" + : "+r"(x),"=r"(tmp) + : + : "cc"); + return(x); +} + +#endif + +#ifndef _V_LSP_MATH_ASM +#define _V_LSP_MATH_ASM + +static inline void lsp_loop_asm(ogg_uint32_t *qip,ogg_uint32_t *pip, + ogg_int32_t *qexpp, + ogg_int32_t *ilsp,ogg_int32_t wi, + ogg_int32_t m){ + + ogg_uint32_t qi=*qip,pi=*pip; + ogg_int32_t qexp=*qexpp; + + asm("mov r0,%3;" + "movs r1,%5,asr#1;" + "add r0,r0,r1,lsl#3;" + "beq 2f;\n" + "1:" + + "ldmdb r0!,{r1,r3};" + "subs r1,r1,%4;" //ilsp[j]-wi + "rsbmi r1,r1,#0;" //labs(ilsp[j]-wi) + "umull %0,r2,r1,%0;" //qi*=labs(ilsp[j]-wi) + + "subs r1,r3,%4;" //ilsp[j+1]-wi + "rsbmi r1,r1,#0;" //labs(ilsp[j+1]-wi) + "umull %1,r3,r1,%1;" //pi*=labs(ilsp[j+1]-wi) + + "cmn r2,r3;" // shift down 16? + "beq 0f;" + "add %2,%2,#16;" + "mov %0,%0,lsr #16;" + "orr %0,%0,r2,lsl #16;" + "mov %1,%1,lsr #16;" + "orr %1,%1,r3,lsl #16;" + "0:" + "cmp r0,%3;\n" + "bhi 1b;\n" + + "2:" + // odd filter assymetry + "ands r0,%5,#1;\n" + "beq 3f;\n" + "add r0,%3,%5,lsl#2;\n" + + "ldr r1,[r0,#-4];\n" + "mov r0,#0x4000;\n" + + "subs r1,r1,%4;\n" //ilsp[j]-wi + "rsbmi r1,r1,#0;\n" //labs(ilsp[j]-wi) + "umull %0,r2,r1,%0;\n" //qi*=labs(ilsp[j]-wi) + "umull %1,r3,r0,%1;\n" //pi*=labs(ilsp[j+1]-wi) + + "cmn r2,r3;\n" // shift down 16? + "beq 3f;\n" + "add %2,%2,#16;\n" + "mov %0,%0,lsr #16;\n" + "orr %0,%0,r2,lsl #16;\n" + "mov %1,%1,lsr #16;\n" + "orr %1,%1,r3,lsl #16;\n" + + //qi=(pi>>shift)*labs(ilsp[j]-wi); + //pi=(qi>>shift)*labs(ilsp[j+1]-wi); + //qexp+=shift; + + //} + + /* normalize to max 16 sig figs */ + "3:" + "mov r2,#0;" + "orr r1,%0,%1;" + "tst r1,#0xff000000;" + "addne r2,r2,#8;" + "movne r1,r1,lsr #8;" + "tst r1,#0x00f00000;" + "addne r2,r2,#4;" + "movne r1,r1,lsr #4;" + "tst r1,#0x000c0000;" + "addne r2,r2,#2;" + "movne r1,r1,lsr #2;" + "tst r1,#0x00020000;" + "addne r2,r2,#1;" + "movne r1,r1,lsr #1;" + "tst r1,#0x00010000;" + "addne r2,r2,#1;" + "mov %0,%0,lsr r2;" + "mov %1,%1,lsr r2;" + "add %2,%2,r2;" + + : "+r"(qi),"+r"(pi),"+r"(qexp) + : "r"(ilsp),"r"(wi),"r"(m) + : "r0","r1","r2","r3","cc"); + + *qip=qi; + *pip=pi; + *qexpp=qexp; +} + +static inline void lsp_norm_asm(ogg_uint32_t *qip,ogg_int32_t *qexpp){ + + ogg_uint32_t qi=*qip; + ogg_int32_t qexp=*qexpp; + + asm("tst %0,#0x0000ff00;" + "moveq %0,%0,lsl #8;" + "subeq %1,%1,#8;" + "tst %0,#0x0000f000;" + "moveq %0,%0,lsl #4;" + "subeq %1,%1,#4;" + "tst %0,#0x0000c000;" + "moveq %0,%0,lsl #2;" + "subeq %1,%1,#2;" + "tst %0,#0x00008000;" + "moveq %0,%0,lsl #1;" + "subeq %1,%1,#1;" + : "+r"(qi),"+r"(qexp) + : + : "cc"); + *qip=qi; + *qexpp=qexp; +} + +#endif +#endif + diff --git a/media/libtremor/lib/backends.h b/media/libtremor/lib/backends.h new file mode 100644 index 000000000000..52024219b144 --- /dev/null +++ b/media/libtremor/lib/backends.h @@ -0,0 +1,131 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * + * * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * + * * + ******************************************************************** + + function: backend and mapping structures + + ********************************************************************/ + +/* this is exposed up here because we need it for static modes. + Lookups for each backend aren't exposed because there's no reason + to do so */ + +#ifndef _vorbis_backend_h_ +#define _vorbis_backend_h_ + +#include "codec_internal.h" + +/* this would all be simpler/shorter with templates, but.... */ +/* Transform backend generic *************************************/ + +/* only mdct right now. Flesh it out more if we ever transcend mdct + in the transform domain */ + +/* Floor backend generic *****************************************/ +typedef struct{ + vorbis_info_floor *(*unpack)(vorbis_info *,oggpack_buffer *); + vorbis_look_floor *(*look) (vorbis_dsp_state *,vorbis_info_mode *, + vorbis_info_floor *); + void (*free_info) (vorbis_info_floor *); + void (*free_look) (vorbis_look_floor *); + void *(*inverse1) (struct vorbis_block *,vorbis_look_floor *); + int (*inverse2) (struct vorbis_block *,vorbis_look_floor *, + void *buffer,ogg_int32_t *); +} vorbis_func_floor; + +typedef struct{ + int order; + long rate; + long barkmap; + + int ampbits; + int ampdB; + + int numbooks; /* <= 16 */ + int books[16]; + +} vorbis_info_floor0; + +#define VIF_POSIT 63 +#define VIF_CLASS 16 +#define VIF_PARTS 31 +typedef struct{ + int partitions; /* 0 to 31 */ + int partitionclass[VIF_PARTS]; /* 0 to 15 */ + + int class_dim[VIF_CLASS]; /* 1 to 8 */ + int class_subs[VIF_CLASS]; /* 0,1,2,3 (bits: 1< + +/* This structure encapsulates huffman and VQ style encoding books; it + doesn't do anything specific to either. + + valuelist/quantlist are nonNULL (and q_* significant) only if + there's entry->value mapping to be done. + + If encode-side mapping must be done (and thus the entry needs to be + hunted), the auxiliary encode pointer will point to a decision + tree. This is true of both VQ and huffman, but is mostly useful + with VQ. + +*/ + +typedef struct static_codebook{ + long dim; /* codebook dimensions (elements per vector) */ + long entries; /* codebook entries */ + long *lengthlist; /* codeword lengths in bits */ + + /* mapping ***************************************************************/ + int maptype; /* 0=none + 1=implicitly populated values from map column + 2=listed arbitrary values */ + + /* The below does a linear, single monotonic sequence mapping. */ + long q_min; /* packed 32 bit float; quant value 0 maps to minval */ + long q_delta; /* packed 32 bit float; val 1 - val 0 == delta */ + int q_quant; /* bits: 0 < quant <= 16 */ + int q_sequencep; /* bitflag */ + + long *quantlist; /* map == 1: (int)(entries^(1/dim)) element column map + map == 2: list of dim*entries quantized entry vals + */ +} static_codebook; + +typedef struct codebook{ + long dim; /* codebook dimensions (elements per vector) */ + long entries; /* codebook entries */ + long used_entries; /* populated codebook entries */ + + /* the below are ordered by bitreversed codeword and only used + entries are populated */ + int binarypoint; + ogg_int32_t *valuelist; /* list of dim*entries actual entry values */ + ogg_uint32_t *codelist; /* list of bitstream codewords for each entry */ + + int *dec_index; + char *dec_codelengths; + ogg_uint32_t *dec_firsttable; + int dec_firsttablen; + int dec_maxlength; + + long q_min; /* packed 32 bit float; quant value 0 maps to minval */ + long q_delta; /* packed 32 bit float; val 1 - val 0 == delta */ + +} codebook; + +extern void vorbis_staticbook_destroy(static_codebook *b); +extern int vorbis_book_init_decode(codebook *dest,const static_codebook *source); + +extern void vorbis_book_clear(codebook *b); +extern long _book_maptype1_quantvals(const static_codebook *b); + +extern static_codebook *vorbis_staticbook_unpack(oggpack_buffer *b); + +extern long vorbis_book_decode(codebook *book, oggpack_buffer *b); +extern long vorbis_book_decodevs_add(codebook *book, ogg_int32_t *a, + oggpack_buffer *b,int n,int point); +extern long vorbis_book_decodev_set(codebook *book, ogg_int32_t *a, + oggpack_buffer *b,int n,int point); +extern long vorbis_book_decodev_add(codebook *book, ogg_int32_t *a, + oggpack_buffer *b,int n,int point); +extern long vorbis_book_decodevv_add(codebook *book, ogg_int32_t **a, + long off,int ch, + oggpack_buffer *b,int n,int point); + +extern int _ilog(unsigned int v); + + +#endif diff --git a/media/libtremor/lib/codec_internal.h b/media/libtremor/lib/codec_internal.h new file mode 100644 index 000000000000..3ca7f5472444 --- /dev/null +++ b/media/libtremor/lib/codec_internal.h @@ -0,0 +1,92 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * + * * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * + * * + ******************************************************************** + + function: libvorbis codec headers + + ********************************************************************/ + +#ifndef _V_CODECI_H_ +#define _V_CODECI_H_ + +#include "codebook.h" + +typedef void vorbis_look_mapping; +typedef void vorbis_look_floor; +typedef void vorbis_look_residue; +typedef void vorbis_look_transform; + +/* mode ************************************************************/ +typedef struct { + int blockflag; + int windowtype; + int transformtype; + int mapping; +} vorbis_info_mode; + +typedef void vorbis_info_floor; +typedef void vorbis_info_residue; +typedef void vorbis_info_mapping; + +typedef struct private_state { + /* local lookup storage */ + const void *window[2]; + + /* backend lookups are tied to the mode, not the backend or naked mapping */ + int modebits; + vorbis_look_mapping **mode; + + ogg_int64_t sample_count; + +} private_state; + +/* codec_setup_info contains all the setup information specific to the + specific compression/decompression mode in progress (eg, + psychoacoustic settings, channel setup, options, codebook + etc). +*********************************************************************/ + +typedef struct codec_setup_info { + + /* Vorbis supports only short and long blocks, but allows the + encoder to choose the sizes */ + + long blocksizes[2]; + + /* modes are the primary means of supporting on-the-fly different + blocksizes, different channel mappings (LR or M/A), + different residue backends, etc. Each mode consists of a + blocksize flag and a mapping (along with the mapping setup */ + + int modes; + int maps; + int times; + int floors; + int residues; + int books; + + vorbis_info_mode *mode_param[64]; + int map_type[64]; + vorbis_info_mapping *map_param[64]; + int time_type[64]; + int floor_type[64]; + vorbis_info_floor *floor_param[64]; + int residue_type[64]; + vorbis_info_residue *residue_param[64]; + static_codebook *book_param[256]; + codebook *fullbooks; + + int passlimit[32]; /* iteration limit per couple/quant pass */ + int coupling_passes; +} codec_setup_info; + +#endif diff --git a/media/libtremor/lib/lsp_lookup.h b/media/libtremor/lib/lsp_lookup.h new file mode 100644 index 000000000000..7162392b8b4f --- /dev/null +++ b/media/libtremor/lib/lsp_lookup.h @@ -0,0 +1,136 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * + * * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * + * * + ******************************************************************** + + function: lookup data + + ********************************************************************/ + +#ifndef _V_LOOKUP_DATA_H_ +#define _V_LOOKUP_DATA_H_ + +#include + +#define FROMdB_LOOKUP_SZ 35 +#define FROMdB2_LOOKUP_SZ 32 +#define FROMdB_SHIFT 5 +#define FROMdB2_SHIFT 3 +#define FROMdB2_MASK 31 + +static const ogg_int32_t FROMdB_LOOKUP[FROMdB_LOOKUP_SZ]={ + 0x003fffff, 0x0028619b, 0x00197a96, 0x0010137a, + 0x000a24b0, 0x00066666, 0x000409c3, 0x00028c42, + 0x00019b8c, 0x000103ab, 0x0000a3d7, 0x00006760, + 0x0000413a, 0x00002928, 0x000019f8, 0x00001062, + 0x00000a56, 0x00000686, 0x0000041e, 0x00000299, + 0x000001a3, 0x00000109, 0x000000a7, 0x00000069, + 0x00000042, 0x0000002a, 0x0000001a, 0x00000011, + 0x0000000b, 0x00000007, 0x00000004, 0x00000003, + 0x00000002, 0x00000001, 0x00000001}; + +static const ogg_int32_t FROMdB2_LOOKUP[FROMdB2_LOOKUP_SZ]={ + 0x000001fc, 0x000001f5, 0x000001ee, 0x000001e7, + 0x000001e0, 0x000001d9, 0x000001d2, 0x000001cc, + 0x000001c5, 0x000001bf, 0x000001b8, 0x000001b2, + 0x000001ac, 0x000001a6, 0x000001a0, 0x0000019a, + 0x00000194, 0x0000018e, 0x00000188, 0x00000183, + 0x0000017d, 0x00000178, 0x00000172, 0x0000016d, + 0x00000168, 0x00000163, 0x0000015e, 0x00000159, + 0x00000154, 0x0000014f, 0x0000014a, 0x00000145, +}; + +#define INVSQ_LOOKUP_I_SHIFT 10 +#define INVSQ_LOOKUP_I_MASK 1023 +static const long INVSQ_LOOKUP_I[64+1]={ + 92682, 91966, 91267, 90583, + 89915, 89261, 88621, 87995, + 87381, 86781, 86192, 85616, + 85051, 84497, 83953, 83420, + 82897, 82384, 81880, 81385, + 80899, 80422, 79953, 79492, + 79039, 78594, 78156, 77726, + 77302, 76885, 76475, 76072, + 75674, 75283, 74898, 74519, + 74146, 73778, 73415, 73058, + 72706, 72359, 72016, 71679, + 71347, 71019, 70695, 70376, + 70061, 69750, 69444, 69141, + 68842, 68548, 68256, 67969, + 67685, 67405, 67128, 66855, + 66585, 66318, 66054, 65794, + 65536, +}; + +static const long INVSQ_LOOKUP_IDel[64]={ + 716, 699, 684, 668, + 654, 640, 626, 614, + 600, 589, 576, 565, + 554, 544, 533, 523, + 513, 504, 495, 486, + 477, 469, 461, 453, + 445, 438, 430, 424, + 417, 410, 403, 398, + 391, 385, 379, 373, + 368, 363, 357, 352, + 347, 343, 337, 332, + 328, 324, 319, 315, + 311, 306, 303, 299, + 294, 292, 287, 284, + 280, 277, 273, 270, + 267, 264, 260, 258, +}; + +#define COS_LOOKUP_I_SHIFT 9 +#define COS_LOOKUP_I_MASK 511 +#define COS_LOOKUP_I_SZ 128 +static const ogg_int32_t COS_LOOKUP_I[COS_LOOKUP_I_SZ+1]={ + 16384, 16379, 16364, 16340, + 16305, 16261, 16207, 16143, + 16069, 15986, 15893, 15791, + 15679, 15557, 15426, 15286, + 15137, 14978, 14811, 14635, + 14449, 14256, 14053, 13842, + 13623, 13395, 13160, 12916, + 12665, 12406, 12140, 11866, + 11585, 11297, 11003, 10702, + 10394, 10080, 9760, 9434, + 9102, 8765, 8423, 8076, + 7723, 7366, 7005, 6639, + 6270, 5897, 5520, 5139, + 4756, 4370, 3981, 3590, + 3196, 2801, 2404, 2006, + 1606, 1205, 804, 402, + 0, -401, -803, -1204, + -1605, -2005, -2403, -2800, + -3195, -3589, -3980, -4369, + -4755, -5138, -5519, -5896, + -6269, -6638, -7004, -7365, + -7722, -8075, -8422, -8764, + -9101, -9433, -9759, -10079, + -10393, -10701, -11002, -11296, + -11584, -11865, -12139, -12405, + -12664, -12915, -13159, -13394, + -13622, -13841, -14052, -14255, + -14448, -14634, -14810, -14977, + -15136, -15285, -15425, -15556, + -15678, -15790, -15892, -15985, + -16068, -16142, -16206, -16260, + -16304, -16339, -16363, -16378, + -16383, +}; + +#endif + + + + + diff --git a/media/libtremor/lib/mdct.h b/media/libtremor/lib/mdct.h new file mode 100644 index 000000000000..6d8890720cde --- /dev/null +++ b/media/libtremor/lib/mdct.h @@ -0,0 +1,52 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * + * * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * + * * + ******************************************************************** + + function: modified discrete cosine transform prototypes + + ********************************************************************/ + +#ifndef _OGG_mdct_H_ +#define _OGG_mdct_H_ + +#include "ivorbiscodec.h" +#include "misc.h" + +#define DATA_TYPE ogg_int32_t +#define REG_TYPE register ogg_int32_t + +#ifdef _LOW_ACCURACY_ +#define cPI3_8 (0x0062) +#define cPI2_8 (0x00b5) +#define cPI1_8 (0x00ed) +#else +#define cPI3_8 (0x30fbc54d) +#define cPI2_8 (0x5a82799a) +#define cPI1_8 (0x7641af3d) +#endif + +extern void mdct_forward(int n, DATA_TYPE *in, DATA_TYPE *out); +extern void mdct_backward(int n, DATA_TYPE *in, DATA_TYPE *out); + +#endif + + + + + + + + + + + + diff --git a/media/libtremor/lib/mdct_lookup.h b/media/libtremor/lib/mdct_lookup.h new file mode 100644 index 000000000000..ee4f101c27ef --- /dev/null +++ b/media/libtremor/lib/mdct_lookup.h @@ -0,0 +1,540 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * + * * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * + * * + ******************************************************************** + + function: sin,cos lookup tables + + ********************************************************************/ + +#include "misc.h" + +/* {sin(2*i*PI/4096), cos(2*i*PI/4096)}, with i = 0 to 512 */ +static const LOOKUP_T sincos_lookup0[1026] = { + X(0x00000000), X(0x7fffffff), X(0x003243f5), X(0x7ffff621), + X(0x006487e3), X(0x7fffd886), X(0x0096cbc1), X(0x7fffa72c), + X(0x00c90f88), X(0x7fff6216), X(0x00fb5330), X(0x7fff0943), + X(0x012d96b1), X(0x7ffe9cb2), X(0x015fda03), X(0x7ffe1c65), + X(0x01921d20), X(0x7ffd885a), X(0x01c45ffe), X(0x7ffce093), + X(0x01f6a297), X(0x7ffc250f), X(0x0228e4e2), X(0x7ffb55ce), + X(0x025b26d7), X(0x7ffa72d1), X(0x028d6870), X(0x7ff97c18), + X(0x02bfa9a4), X(0x7ff871a2), X(0x02f1ea6c), X(0x7ff75370), + X(0x03242abf), X(0x7ff62182), X(0x03566a96), X(0x7ff4dbd9), + X(0x0388a9ea), X(0x7ff38274), X(0x03bae8b2), X(0x7ff21553), + X(0x03ed26e6), X(0x7ff09478), X(0x041f6480), X(0x7feeffe1), + X(0x0451a177), X(0x7fed5791), X(0x0483ddc3), X(0x7feb9b85), + X(0x04b6195d), X(0x7fe9cbc0), X(0x04e8543e), X(0x7fe7e841), + X(0x051a8e5c), X(0x7fe5f108), X(0x054cc7b1), X(0x7fe3e616), + X(0x057f0035), X(0x7fe1c76b), X(0x05b137df), X(0x7fdf9508), + X(0x05e36ea9), X(0x7fdd4eec), X(0x0615a48b), X(0x7fdaf519), + X(0x0647d97c), X(0x7fd8878e), X(0x067a0d76), X(0x7fd6064c), + X(0x06ac406f), X(0x7fd37153), X(0x06de7262), X(0x7fd0c8a3), + X(0x0710a345), X(0x7fce0c3e), X(0x0742d311), X(0x7fcb3c23), + X(0x077501be), X(0x7fc85854), X(0x07a72f45), X(0x7fc560cf), + X(0x07d95b9e), X(0x7fc25596), X(0x080b86c2), X(0x7fbf36aa), + X(0x083db0a7), X(0x7fbc040a), X(0x086fd947), X(0x7fb8bdb8), + X(0x08a2009a), X(0x7fb563b3), X(0x08d42699), X(0x7fb1f5fc), + X(0x09064b3a), X(0x7fae7495), X(0x09386e78), X(0x7faadf7c), + X(0x096a9049), X(0x7fa736b4), X(0x099cb0a7), X(0x7fa37a3c), + X(0x09cecf89), X(0x7f9faa15), X(0x0a00ece8), X(0x7f9bc640), + X(0x0a3308bd), X(0x7f97cebd), X(0x0a6522fe), X(0x7f93c38c), + X(0x0a973ba5), X(0x7f8fa4b0), X(0x0ac952aa), X(0x7f8b7227), + X(0x0afb6805), X(0x7f872bf3), X(0x0b2d7baf), X(0x7f82d214), + X(0x0b5f8d9f), X(0x7f7e648c), X(0x0b919dcf), X(0x7f79e35a), + X(0x0bc3ac35), X(0x7f754e80), X(0x0bf5b8cb), X(0x7f70a5fe), + X(0x0c27c389), X(0x7f6be9d4), X(0x0c59cc68), X(0x7f671a05), + X(0x0c8bd35e), X(0x7f62368f), X(0x0cbdd865), X(0x7f5d3f75), + X(0x0cefdb76), X(0x7f5834b7), X(0x0d21dc87), X(0x7f531655), + X(0x0d53db92), X(0x7f4de451), X(0x0d85d88f), X(0x7f489eaa), + X(0x0db7d376), X(0x7f434563), X(0x0de9cc40), X(0x7f3dd87c), + X(0x0e1bc2e4), X(0x7f3857f6), X(0x0e4db75b), X(0x7f32c3d1), + X(0x0e7fa99e), X(0x7f2d1c0e), X(0x0eb199a4), X(0x7f2760af), + X(0x0ee38766), X(0x7f2191b4), X(0x0f1572dc), X(0x7f1baf1e), + X(0x0f475bff), X(0x7f15b8ee), X(0x0f7942c7), X(0x7f0faf25), + X(0x0fab272b), X(0x7f0991c4), X(0x0fdd0926), X(0x7f0360cb), + X(0x100ee8ad), X(0x7efd1c3c), X(0x1040c5bb), X(0x7ef6c418), + X(0x1072a048), X(0x7ef05860), X(0x10a4784b), X(0x7ee9d914), + X(0x10d64dbd), X(0x7ee34636), X(0x11082096), X(0x7edc9fc6), + X(0x1139f0cf), X(0x7ed5e5c6), X(0x116bbe60), X(0x7ecf1837), + X(0x119d8941), X(0x7ec8371a), X(0x11cf516a), X(0x7ec14270), + X(0x120116d5), X(0x7eba3a39), X(0x1232d979), X(0x7eb31e78), + X(0x1264994e), X(0x7eabef2c), X(0x1296564d), X(0x7ea4ac58), + X(0x12c8106f), X(0x7e9d55fc), X(0x12f9c7aa), X(0x7e95ec1a), + X(0x132b7bf9), X(0x7e8e6eb2), X(0x135d2d53), X(0x7e86ddc6), + X(0x138edbb1), X(0x7e7f3957), X(0x13c0870a), X(0x7e778166), + X(0x13f22f58), X(0x7e6fb5f4), X(0x1423d492), X(0x7e67d703), + X(0x145576b1), X(0x7e5fe493), X(0x148715ae), X(0x7e57dea7), + X(0x14b8b17f), X(0x7e4fc53e), X(0x14ea4a1f), X(0x7e47985b), + X(0x151bdf86), X(0x7e3f57ff), X(0x154d71aa), X(0x7e37042a), + X(0x157f0086), X(0x7e2e9cdf), X(0x15b08c12), X(0x7e26221f), + X(0x15e21445), X(0x7e1d93ea), X(0x16139918), X(0x7e14f242), + X(0x16451a83), X(0x7e0c3d29), X(0x1676987f), X(0x7e0374a0), + X(0x16a81305), X(0x7dfa98a8), X(0x16d98a0c), X(0x7df1a942), + X(0x170afd8d), X(0x7de8a670), X(0x173c6d80), X(0x7ddf9034), + X(0x176dd9de), X(0x7dd6668f), X(0x179f429f), X(0x7dcd2981), + X(0x17d0a7bc), X(0x7dc3d90d), X(0x1802092c), X(0x7dba7534), + X(0x183366e9), X(0x7db0fdf8), X(0x1864c0ea), X(0x7da77359), + X(0x18961728), X(0x7d9dd55a), X(0x18c7699b), X(0x7d9423fc), + X(0x18f8b83c), X(0x7d8a5f40), X(0x192a0304), X(0x7d808728), + X(0x195b49ea), X(0x7d769bb5), X(0x198c8ce7), X(0x7d6c9ce9), + X(0x19bdcbf3), X(0x7d628ac6), X(0x19ef0707), X(0x7d58654d), + X(0x1a203e1b), X(0x7d4e2c7f), X(0x1a517128), X(0x7d43e05e), + X(0x1a82a026), X(0x7d3980ec), X(0x1ab3cb0d), X(0x7d2f0e2b), + X(0x1ae4f1d6), X(0x7d24881b), X(0x1b161479), X(0x7d19eebf), + X(0x1b4732ef), X(0x7d0f4218), X(0x1b784d30), X(0x7d048228), + X(0x1ba96335), X(0x7cf9aef0), X(0x1bda74f6), X(0x7ceec873), + X(0x1c0b826a), X(0x7ce3ceb2), X(0x1c3c8b8c), X(0x7cd8c1ae), + X(0x1c6d9053), X(0x7ccda169), X(0x1c9e90b8), X(0x7cc26de5), + X(0x1ccf8cb3), X(0x7cb72724), X(0x1d00843d), X(0x7cabcd28), + X(0x1d31774d), X(0x7ca05ff1), X(0x1d6265dd), X(0x7c94df83), + X(0x1d934fe5), X(0x7c894bde), X(0x1dc4355e), X(0x7c7da505), + X(0x1df5163f), X(0x7c71eaf9), X(0x1e25f282), X(0x7c661dbc), + X(0x1e56ca1e), X(0x7c5a3d50), X(0x1e879d0d), X(0x7c4e49b7), + X(0x1eb86b46), X(0x7c4242f2), X(0x1ee934c3), X(0x7c362904), + X(0x1f19f97b), X(0x7c29fbee), X(0x1f4ab968), X(0x7c1dbbb3), + X(0x1f7b7481), X(0x7c116853), X(0x1fac2abf), X(0x7c0501d2), + X(0x1fdcdc1b), X(0x7bf88830), X(0x200d888d), X(0x7bebfb70), + X(0x203e300d), X(0x7bdf5b94), X(0x206ed295), X(0x7bd2a89e), + X(0x209f701c), X(0x7bc5e290), X(0x20d0089c), X(0x7bb9096b), + X(0x21009c0c), X(0x7bac1d31), X(0x21312a65), X(0x7b9f1de6), + X(0x2161b3a0), X(0x7b920b89), X(0x219237b5), X(0x7b84e61f), + X(0x21c2b69c), X(0x7b77ada8), X(0x21f3304f), X(0x7b6a6227), + X(0x2223a4c5), X(0x7b5d039e), X(0x225413f8), X(0x7b4f920e), + X(0x22847de0), X(0x7b420d7a), X(0x22b4e274), X(0x7b3475e5), + X(0x22e541af), X(0x7b26cb4f), X(0x23159b88), X(0x7b190dbc), + X(0x2345eff8), X(0x7b0b3d2c), X(0x23763ef7), X(0x7afd59a4), + X(0x23a6887f), X(0x7aef6323), X(0x23d6cc87), X(0x7ae159ae), + X(0x24070b08), X(0x7ad33d45), X(0x243743fa), X(0x7ac50dec), + X(0x24677758), X(0x7ab6cba4), X(0x2497a517), X(0x7aa8766f), + X(0x24c7cd33), X(0x7a9a0e50), X(0x24f7efa2), X(0x7a8b9348), + X(0x25280c5e), X(0x7a7d055b), X(0x2558235f), X(0x7a6e648a), + X(0x2588349d), X(0x7a5fb0d8), X(0x25b84012), X(0x7a50ea47), + X(0x25e845b6), X(0x7a4210d8), X(0x26184581), X(0x7a332490), + X(0x26483f6c), X(0x7a24256f), X(0x26783370), X(0x7a151378), + X(0x26a82186), X(0x7a05eead), X(0x26d809a5), X(0x79f6b711), + X(0x2707ebc7), X(0x79e76ca7), X(0x2737c7e3), X(0x79d80f6f), + X(0x27679df4), X(0x79c89f6e), X(0x27976df1), X(0x79b91ca4), + X(0x27c737d3), X(0x79a98715), X(0x27f6fb92), X(0x7999dec4), + X(0x2826b928), X(0x798a23b1), X(0x2856708d), X(0x797a55e0), + X(0x288621b9), X(0x796a7554), X(0x28b5cca5), X(0x795a820e), + X(0x28e5714b), X(0x794a7c12), X(0x29150fa1), X(0x793a6361), + X(0x2944a7a2), X(0x792a37fe), X(0x29743946), X(0x7919f9ec), + X(0x29a3c485), X(0x7909a92d), X(0x29d34958), X(0x78f945c3), + X(0x2a02c7b8), X(0x78e8cfb2), X(0x2a323f9e), X(0x78d846fb), + X(0x2a61b101), X(0x78c7aba2), X(0x2a911bdc), X(0x78b6fda8), + X(0x2ac08026), X(0x78a63d11), X(0x2aefddd8), X(0x789569df), + X(0x2b1f34eb), X(0x78848414), X(0x2b4e8558), X(0x78738bb3), + X(0x2b7dcf17), X(0x786280bf), X(0x2bad1221), X(0x7851633b), + X(0x2bdc4e6f), X(0x78403329), X(0x2c0b83fa), X(0x782ef08b), + X(0x2c3ab2b9), X(0x781d9b65), X(0x2c69daa6), X(0x780c33b8), + X(0x2c98fbba), X(0x77fab989), X(0x2cc815ee), X(0x77e92cd9), + X(0x2cf72939), X(0x77d78daa), X(0x2d263596), X(0x77c5dc01), + X(0x2d553afc), X(0x77b417df), X(0x2d843964), X(0x77a24148), + X(0x2db330c7), X(0x7790583e), X(0x2de2211e), X(0x777e5cc3), + X(0x2e110a62), X(0x776c4edb), X(0x2e3fec8b), X(0x775a2e89), + X(0x2e6ec792), X(0x7747fbce), X(0x2e9d9b70), X(0x7735b6af), + X(0x2ecc681e), X(0x77235f2d), X(0x2efb2d95), X(0x7710f54c), + X(0x2f29ebcc), X(0x76fe790e), X(0x2f58a2be), X(0x76ebea77), + X(0x2f875262), X(0x76d94989), X(0x2fb5fab2), X(0x76c69647), + X(0x2fe49ba7), X(0x76b3d0b4), X(0x30133539), X(0x76a0f8d2), + X(0x3041c761), X(0x768e0ea6), X(0x30705217), X(0x767b1231), + X(0x309ed556), X(0x76680376), X(0x30cd5115), X(0x7654e279), + X(0x30fbc54d), X(0x7641af3d), X(0x312a31f8), X(0x762e69c4), + X(0x3158970e), X(0x761b1211), X(0x3186f487), X(0x7607a828), + X(0x31b54a5e), X(0x75f42c0b), X(0x31e39889), X(0x75e09dbd), + X(0x3211df04), X(0x75ccfd42), X(0x32401dc6), X(0x75b94a9c), + X(0x326e54c7), X(0x75a585cf), X(0x329c8402), X(0x7591aedd), + X(0x32caab6f), X(0x757dc5ca), X(0x32f8cb07), X(0x7569ca99), + X(0x3326e2c3), X(0x7555bd4c), X(0x3354f29b), X(0x75419de7), + X(0x3382fa88), X(0x752d6c6c), X(0x33b0fa84), X(0x751928e0), + X(0x33def287), X(0x7504d345), X(0x340ce28b), X(0x74f06b9e), + X(0x343aca87), X(0x74dbf1ef), X(0x3468aa76), X(0x74c7663a), + X(0x34968250), X(0x74b2c884), X(0x34c4520d), X(0x749e18cd), + X(0x34f219a8), X(0x7489571c), X(0x351fd918), X(0x74748371), + X(0x354d9057), X(0x745f9dd1), X(0x357b3f5d), X(0x744aa63f), + X(0x35a8e625), X(0x74359cbd), X(0x35d684a6), X(0x74208150), + X(0x36041ad9), X(0x740b53fb), X(0x3631a8b8), X(0x73f614c0), + X(0x365f2e3b), X(0x73e0c3a3), X(0x368cab5c), X(0x73cb60a8), + X(0x36ba2014), X(0x73b5ebd1), X(0x36e78c5b), X(0x73a06522), + X(0x3714f02a), X(0x738acc9e), X(0x37424b7b), X(0x73752249), + X(0x376f9e46), X(0x735f6626), X(0x379ce885), X(0x73499838), + X(0x37ca2a30), X(0x7333b883), X(0x37f76341), X(0x731dc70a), + X(0x382493b0), X(0x7307c3d0), X(0x3851bb77), X(0x72f1aed9), + X(0x387eda8e), X(0x72db8828), X(0x38abf0ef), X(0x72c54fc1), + X(0x38d8fe93), X(0x72af05a7), X(0x39060373), X(0x7298a9dd), + X(0x3932ff87), X(0x72823c67), X(0x395ff2c9), X(0x726bbd48), + X(0x398cdd32), X(0x72552c85), X(0x39b9bebc), X(0x723e8a20), + X(0x39e6975e), X(0x7227d61c), X(0x3a136712), X(0x7211107e), + X(0x3a402dd2), X(0x71fa3949), X(0x3a6ceb96), X(0x71e35080), + X(0x3a99a057), X(0x71cc5626), X(0x3ac64c0f), X(0x71b54a41), + X(0x3af2eeb7), X(0x719e2cd2), X(0x3b1f8848), X(0x7186fdde), + X(0x3b4c18ba), X(0x716fbd68), X(0x3b78a007), X(0x71586b74), + X(0x3ba51e29), X(0x71410805), X(0x3bd19318), X(0x7129931f), + X(0x3bfdfecd), X(0x71120cc5), X(0x3c2a6142), X(0x70fa74fc), + X(0x3c56ba70), X(0x70e2cbc6), X(0x3c830a50), X(0x70cb1128), + X(0x3caf50da), X(0x70b34525), X(0x3cdb8e09), X(0x709b67c0), + X(0x3d07c1d6), X(0x708378ff), X(0x3d33ec39), X(0x706b78e3), + X(0x3d600d2c), X(0x70536771), X(0x3d8c24a8), X(0x703b44ad), + X(0x3db832a6), X(0x7023109a), X(0x3de4371f), X(0x700acb3c), + X(0x3e10320d), X(0x6ff27497), X(0x3e3c2369), X(0x6fda0cae), + X(0x3e680b2c), X(0x6fc19385), X(0x3e93e950), X(0x6fa90921), + X(0x3ebfbdcd), X(0x6f906d84), X(0x3eeb889c), X(0x6f77c0b3), + X(0x3f1749b8), X(0x6f5f02b2), X(0x3f430119), X(0x6f463383), + X(0x3f6eaeb8), X(0x6f2d532c), X(0x3f9a5290), X(0x6f1461b0), + X(0x3fc5ec98), X(0x6efb5f12), X(0x3ff17cca), X(0x6ee24b57), + X(0x401d0321), X(0x6ec92683), X(0x40487f94), X(0x6eaff099), + X(0x4073f21d), X(0x6e96a99d), X(0x409f5ab6), X(0x6e7d5193), + X(0x40cab958), X(0x6e63e87f), X(0x40f60dfb), X(0x6e4a6e66), + X(0x4121589b), X(0x6e30e34a), X(0x414c992f), X(0x6e174730), + X(0x4177cfb1), X(0x6dfd9a1c), X(0x41a2fc1a), X(0x6de3dc11), + X(0x41ce1e65), X(0x6dca0d14), X(0x41f93689), X(0x6db02d29), + X(0x42244481), X(0x6d963c54), X(0x424f4845), X(0x6d7c3a98), + X(0x427a41d0), X(0x6d6227fa), X(0x42a5311b), X(0x6d48047e), + X(0x42d0161e), X(0x6d2dd027), X(0x42faf0d4), X(0x6d138afb), + X(0x4325c135), X(0x6cf934fc), X(0x4350873c), X(0x6cdece2f), + X(0x437b42e1), X(0x6cc45698), X(0x43a5f41e), X(0x6ca9ce3b), + X(0x43d09aed), X(0x6c8f351c), X(0x43fb3746), X(0x6c748b3f), + X(0x4425c923), X(0x6c59d0a9), X(0x4450507e), X(0x6c3f055d), + X(0x447acd50), X(0x6c242960), X(0x44a53f93), X(0x6c093cb6), + X(0x44cfa740), X(0x6bee3f62), X(0x44fa0450), X(0x6bd3316a), + X(0x452456bd), X(0x6bb812d1), X(0x454e9e80), X(0x6b9ce39b), + X(0x4578db93), X(0x6b81a3cd), X(0x45a30df0), X(0x6b66536b), + X(0x45cd358f), X(0x6b4af279), X(0x45f7526b), X(0x6b2f80fb), + X(0x4621647d), X(0x6b13fef5), X(0x464b6bbe), X(0x6af86c6c), + X(0x46756828), X(0x6adcc964), X(0x469f59b4), X(0x6ac115e2), + X(0x46c9405c), X(0x6aa551e9), X(0x46f31c1a), X(0x6a897d7d), + X(0x471cece7), X(0x6a6d98a4), X(0x4746b2bc), X(0x6a51a361), + X(0x47706d93), X(0x6a359db9), X(0x479a1d67), X(0x6a1987b0), + X(0x47c3c22f), X(0x69fd614a), X(0x47ed5be6), X(0x69e12a8c), + X(0x4816ea86), X(0x69c4e37a), X(0x48406e08), X(0x69a88c19), + X(0x4869e665), X(0x698c246c), X(0x48935397), X(0x696fac78), + X(0x48bcb599), X(0x69532442), X(0x48e60c62), X(0x69368bce), + X(0x490f57ee), X(0x6919e320), X(0x49389836), X(0x68fd2a3d), + X(0x4961cd33), X(0x68e06129), X(0x498af6df), X(0x68c387e9), + X(0x49b41533), X(0x68a69e81), X(0x49dd282a), X(0x6889a4f6), + X(0x4a062fbd), X(0x686c9b4b), X(0x4a2f2be6), X(0x684f8186), + X(0x4a581c9e), X(0x683257ab), X(0x4a8101de), X(0x68151dbe), + X(0x4aa9dba2), X(0x67f7d3c5), X(0x4ad2a9e2), X(0x67da79c3), + X(0x4afb6c98), X(0x67bd0fbd), X(0x4b2423be), X(0x679f95b7), + X(0x4b4ccf4d), X(0x67820bb7), X(0x4b756f40), X(0x676471c0), + X(0x4b9e0390), X(0x6746c7d8), X(0x4bc68c36), X(0x67290e02), + X(0x4bef092d), X(0x670b4444), X(0x4c177a6e), X(0x66ed6aa1), + X(0x4c3fdff4), X(0x66cf8120), X(0x4c6839b7), X(0x66b187c3), + X(0x4c9087b1), X(0x66937e91), X(0x4cb8c9dd), X(0x6675658c), + X(0x4ce10034), X(0x66573cbb), X(0x4d092ab0), X(0x66390422), + X(0x4d31494b), X(0x661abbc5), X(0x4d595bfe), X(0x65fc63a9), + X(0x4d8162c4), X(0x65ddfbd3), X(0x4da95d96), X(0x65bf8447), + X(0x4dd14c6e), X(0x65a0fd0b), X(0x4df92f46), X(0x65826622), + X(0x4e210617), X(0x6563bf92), X(0x4e48d0dd), X(0x6545095f), + X(0x4e708f8f), X(0x6526438f), X(0x4e984229), X(0x65076e25), + X(0x4ebfe8a5), X(0x64e88926), X(0x4ee782fb), X(0x64c99498), + X(0x4f0f1126), X(0x64aa907f), X(0x4f369320), X(0x648b7ce0), + X(0x4f5e08e3), X(0x646c59bf), X(0x4f857269), X(0x644d2722), + X(0x4faccfab), X(0x642de50d), X(0x4fd420a4), X(0x640e9386), + X(0x4ffb654d), X(0x63ef3290), X(0x50229da1), X(0x63cfc231), + X(0x5049c999), X(0x63b0426d), X(0x5070e92f), X(0x6390b34a), + X(0x5097fc5e), X(0x637114cc), X(0x50bf031f), X(0x635166f9), + X(0x50e5fd6d), X(0x6331a9d4), X(0x510ceb40), X(0x6311dd64), + X(0x5133cc94), X(0x62f201ac), X(0x515aa162), X(0x62d216b3), + X(0x518169a5), X(0x62b21c7b), X(0x51a82555), X(0x6292130c), + X(0x51ced46e), X(0x6271fa69), X(0x51f576ea), X(0x6251d298), + X(0x521c0cc2), X(0x62319b9d), X(0x524295f0), X(0x6211557e), + X(0x5269126e), X(0x61f1003f), X(0x528f8238), X(0x61d09be5), + X(0x52b5e546), X(0x61b02876), X(0x52dc3b92), X(0x618fa5f7), + X(0x53028518), X(0x616f146c), X(0x5328c1d0), X(0x614e73da), + X(0x534ef1b5), X(0x612dc447), X(0x537514c2), X(0x610d05b7), + X(0x539b2af0), X(0x60ec3830), X(0x53c13439), X(0x60cb5bb7), + X(0x53e73097), X(0x60aa7050), X(0x540d2005), X(0x60897601), + X(0x5433027d), X(0x60686ccf), X(0x5458d7f9), X(0x604754bf), + X(0x547ea073), X(0x60262dd6), X(0x54a45be6), X(0x6004f819), + X(0x54ca0a4b), X(0x5fe3b38d), X(0x54efab9c), X(0x5fc26038), + X(0x55153fd4), X(0x5fa0fe1f), X(0x553ac6ee), X(0x5f7f8d46), + X(0x556040e2), X(0x5f5e0db3), X(0x5585adad), X(0x5f3c7f6b), + X(0x55ab0d46), X(0x5f1ae274), X(0x55d05faa), X(0x5ef936d1), + X(0x55f5a4d2), X(0x5ed77c8a), X(0x561adcb9), X(0x5eb5b3a2), + X(0x56400758), X(0x5e93dc1f), X(0x566524aa), X(0x5e71f606), + X(0x568a34a9), X(0x5e50015d), X(0x56af3750), X(0x5e2dfe29), + X(0x56d42c99), X(0x5e0bec6e), X(0x56f9147e), X(0x5de9cc33), + X(0x571deefa), X(0x5dc79d7c), X(0x5742bc06), X(0x5da5604f), + X(0x57677b9d), X(0x5d8314b1), X(0x578c2dba), X(0x5d60baa7), + X(0x57b0d256), X(0x5d3e5237), X(0x57d5696d), X(0x5d1bdb65), + X(0x57f9f2f8), X(0x5cf95638), X(0x581e6ef1), X(0x5cd6c2b5), + X(0x5842dd54), X(0x5cb420e0), X(0x58673e1b), X(0x5c9170bf), + X(0x588b9140), X(0x5c6eb258), X(0x58afd6bd), X(0x5c4be5b0), + X(0x58d40e8c), X(0x5c290acc), X(0x58f838a9), X(0x5c0621b2), + X(0x591c550e), X(0x5be32a67), X(0x594063b5), X(0x5bc024f0), + X(0x59646498), X(0x5b9d1154), X(0x598857b2), X(0x5b79ef96), + X(0x59ac3cfd), X(0x5b56bfbd), X(0x59d01475), X(0x5b3381ce), + X(0x59f3de12), X(0x5b1035cf), X(0x5a1799d1), X(0x5aecdbc5), + X(0x5a3b47ab), X(0x5ac973b5), X(0x5a5ee79a), X(0x5aa5fda5), + X(0x5a82799a), X(0x5a82799a) + }; + + /* {sin((2*i+1)*PI/4096), cos((2*i+1)*PI/4096)}, with i = 0 to 511 */ +static const LOOKUP_T sincos_lookup1[1024] = { + X(0x001921fb), X(0x7ffffd88), X(0x004b65ee), X(0x7fffe9cb), + X(0x007da9d4), X(0x7fffc251), X(0x00afeda8), X(0x7fff8719), + X(0x00e23160), X(0x7fff3824), X(0x011474f6), X(0x7ffed572), + X(0x0146b860), X(0x7ffe5f03), X(0x0178fb99), X(0x7ffdd4d7), + X(0x01ab3e97), X(0x7ffd36ee), X(0x01dd8154), X(0x7ffc8549), + X(0x020fc3c6), X(0x7ffbbfe6), X(0x024205e8), X(0x7ffae6c7), + X(0x027447b0), X(0x7ff9f9ec), X(0x02a68917), X(0x7ff8f954), + X(0x02d8ca16), X(0x7ff7e500), X(0x030b0aa4), X(0x7ff6bcf0), + X(0x033d4abb), X(0x7ff58125), X(0x036f8a51), X(0x7ff4319d), + X(0x03a1c960), X(0x7ff2ce5b), X(0x03d407df), X(0x7ff1575d), + X(0x040645c7), X(0x7fefcca4), X(0x04388310), X(0x7fee2e30), + X(0x046abfb3), X(0x7fec7c02), X(0x049cfba7), X(0x7feab61a), + X(0x04cf36e5), X(0x7fe8dc78), X(0x05017165), X(0x7fe6ef1c), + X(0x0533ab20), X(0x7fe4ee06), X(0x0565e40d), X(0x7fe2d938), + X(0x05981c26), X(0x7fe0b0b1), X(0x05ca5361), X(0x7fde7471), + X(0x05fc89b8), X(0x7fdc247a), X(0x062ebf22), X(0x7fd9c0ca), + X(0x0660f398), X(0x7fd74964), X(0x06932713), X(0x7fd4be46), + X(0x06c5598a), X(0x7fd21f72), X(0x06f78af6), X(0x7fcf6ce8), + X(0x0729bb4e), X(0x7fcca6a7), X(0x075bea8c), X(0x7fc9ccb2), + X(0x078e18a7), X(0x7fc6df08), X(0x07c04598), X(0x7fc3dda9), + X(0x07f27157), X(0x7fc0c896), X(0x08249bdd), X(0x7fbd9fd0), + X(0x0856c520), X(0x7fba6357), X(0x0888ed1b), X(0x7fb7132b), + X(0x08bb13c5), X(0x7fb3af4e), X(0x08ed3916), X(0x7fb037bf), + X(0x091f5d06), X(0x7facac7f), X(0x09517f8f), X(0x7fa90d8e), + X(0x0983a0a7), X(0x7fa55aee), X(0x09b5c048), X(0x7fa1949e), + X(0x09e7de6a), X(0x7f9dbaa0), X(0x0a19fb04), X(0x7f99ccf4), + X(0x0a4c1610), X(0x7f95cb9a), X(0x0a7e2f85), X(0x7f91b694), + X(0x0ab0475c), X(0x7f8d8de1), X(0x0ae25d8d), X(0x7f895182), + X(0x0b147211), X(0x7f850179), X(0x0b4684df), X(0x7f809dc5), + X(0x0b7895f0), X(0x7f7c2668), X(0x0baaa53b), X(0x7f779b62), + X(0x0bdcb2bb), X(0x7f72fcb4), X(0x0c0ebe66), X(0x7f6e4a5e), + X(0x0c40c835), X(0x7f698461), X(0x0c72d020), X(0x7f64aabf), + X(0x0ca4d620), X(0x7f5fbd77), X(0x0cd6da2d), X(0x7f5abc8a), + X(0x0d08dc3f), X(0x7f55a7fa), X(0x0d3adc4e), X(0x7f507fc7), + X(0x0d6cda53), X(0x7f4b43f2), X(0x0d9ed646), X(0x7f45f47b), + X(0x0dd0d01f), X(0x7f409164), X(0x0e02c7d7), X(0x7f3b1aad), + X(0x0e34bd66), X(0x7f359057), X(0x0e66b0c3), X(0x7f2ff263), + X(0x0e98a1e9), X(0x7f2a40d2), X(0x0eca90ce), X(0x7f247ba5), + X(0x0efc7d6b), X(0x7f1ea2dc), X(0x0f2e67b8), X(0x7f18b679), + X(0x0f604faf), X(0x7f12b67c), X(0x0f923546), X(0x7f0ca2e7), + X(0x0fc41876), X(0x7f067bba), X(0x0ff5f938), X(0x7f0040f6), + X(0x1027d784), X(0x7ef9f29d), X(0x1059b352), X(0x7ef390ae), + X(0x108b8c9b), X(0x7eed1b2c), X(0x10bd6356), X(0x7ee69217), + X(0x10ef377d), X(0x7edff570), X(0x11210907), X(0x7ed94538), + X(0x1152d7ed), X(0x7ed28171), X(0x1184a427), X(0x7ecbaa1a), + X(0x11b66dad), X(0x7ec4bf36), X(0x11e83478), X(0x7ebdc0c6), + X(0x1219f880), X(0x7eb6aeca), X(0x124bb9be), X(0x7eaf8943), + X(0x127d7829), X(0x7ea85033), X(0x12af33ba), X(0x7ea1039b), + X(0x12e0ec6a), X(0x7e99a37c), X(0x1312a230), X(0x7e922fd6), + X(0x13445505), X(0x7e8aa8ac), X(0x137604e2), X(0x7e830dff), + X(0x13a7b1bf), X(0x7e7b5fce), X(0x13d95b93), X(0x7e739e1d), + X(0x140b0258), X(0x7e6bc8eb), X(0x143ca605), X(0x7e63e03b), + X(0x146e4694), X(0x7e5be40c), X(0x149fe3fc), X(0x7e53d462), + X(0x14d17e36), X(0x7e4bb13c), X(0x1503153a), X(0x7e437a9c), + X(0x1534a901), X(0x7e3b3083), X(0x15663982), X(0x7e32d2f4), + X(0x1597c6b7), X(0x7e2a61ed), X(0x15c95097), X(0x7e21dd73), + X(0x15fad71b), X(0x7e194584), X(0x162c5a3b), X(0x7e109a24), + X(0x165dd9f0), X(0x7e07db52), X(0x168f5632), X(0x7dff0911), + X(0x16c0cef9), X(0x7df62362), X(0x16f2443e), X(0x7ded2a47), + X(0x1723b5f9), X(0x7de41dc0), X(0x17552422), X(0x7ddafdce), + X(0x17868eb3), X(0x7dd1ca75), X(0x17b7f5a3), X(0x7dc883b4), + X(0x17e958ea), X(0x7dbf298d), X(0x181ab881), X(0x7db5bc02), + X(0x184c1461), X(0x7dac3b15), X(0x187d6c82), X(0x7da2a6c6), + X(0x18aec0db), X(0x7d98ff17), X(0x18e01167), X(0x7d8f4409), + X(0x19115e1c), X(0x7d85759f), X(0x1942a6f3), X(0x7d7b93da), + X(0x1973ebe6), X(0x7d719eba), X(0x19a52ceb), X(0x7d679642), + X(0x19d669fc), X(0x7d5d7a74), X(0x1a07a311), X(0x7d534b50), + X(0x1a38d823), X(0x7d4908d9), X(0x1a6a0929), X(0x7d3eb30f), + X(0x1a9b361d), X(0x7d3449f5), X(0x1acc5ef6), X(0x7d29cd8c), + X(0x1afd83ad), X(0x7d1f3dd6), X(0x1b2ea43a), X(0x7d149ad5), + X(0x1b5fc097), X(0x7d09e489), X(0x1b90d8bb), X(0x7cff1af5), + X(0x1bc1ec9e), X(0x7cf43e1a), X(0x1bf2fc3a), X(0x7ce94dfb), + X(0x1c240786), X(0x7cde4a98), X(0x1c550e7c), X(0x7cd333f3), + X(0x1c861113), X(0x7cc80a0f), X(0x1cb70f43), X(0x7cbcccec), + X(0x1ce80906), X(0x7cb17c8d), X(0x1d18fe54), X(0x7ca618f3), + X(0x1d49ef26), X(0x7c9aa221), X(0x1d7adb73), X(0x7c8f1817), + X(0x1dabc334), X(0x7c837ad8), X(0x1ddca662), X(0x7c77ca65), + X(0x1e0d84f5), X(0x7c6c06c0), X(0x1e3e5ee5), X(0x7c602fec), + X(0x1e6f342c), X(0x7c5445e9), X(0x1ea004c1), X(0x7c4848ba), + X(0x1ed0d09d), X(0x7c3c3860), X(0x1f0197b8), X(0x7c3014de), + X(0x1f325a0b), X(0x7c23de35), X(0x1f63178f), X(0x7c179467), + X(0x1f93d03c), X(0x7c0b3777), X(0x1fc4840a), X(0x7bfec765), + X(0x1ff532f2), X(0x7bf24434), X(0x2025dcec), X(0x7be5ade6), + X(0x205681f1), X(0x7bd9047c), X(0x208721f9), X(0x7bcc47fa), + X(0x20b7bcfe), X(0x7bbf7860), X(0x20e852f6), X(0x7bb295b0), + X(0x2118e3dc), X(0x7ba59fee), X(0x21496fa7), X(0x7b989719), + X(0x2179f64f), X(0x7b8b7b36), X(0x21aa77cf), X(0x7b7e4c45), + X(0x21daf41d), X(0x7b710a49), X(0x220b6b32), X(0x7b63b543), + X(0x223bdd08), X(0x7b564d36), X(0x226c4996), X(0x7b48d225), + X(0x229cb0d5), X(0x7b3b4410), X(0x22cd12bd), X(0x7b2da2fa), + X(0x22fd6f48), X(0x7b1feee5), X(0x232dc66d), X(0x7b1227d3), + X(0x235e1826), X(0x7b044dc7), X(0x238e646a), X(0x7af660c2), + X(0x23beab33), X(0x7ae860c7), X(0x23eeec78), X(0x7ada4dd8), + X(0x241f2833), X(0x7acc27f7), X(0x244f5e5c), X(0x7abdef25), + X(0x247f8eec), X(0x7aafa367), X(0x24afb9da), X(0x7aa144bc), + X(0x24dfdf20), X(0x7a92d329), X(0x250ffeb7), X(0x7a844eae), + X(0x25401896), X(0x7a75b74f), X(0x25702cb7), X(0x7a670d0d), + X(0x25a03b11), X(0x7a584feb), X(0x25d0439f), X(0x7a497feb), + X(0x26004657), X(0x7a3a9d0f), X(0x26304333), X(0x7a2ba75a), + X(0x26603a2c), X(0x7a1c9ece), X(0x26902b39), X(0x7a0d836d), + X(0x26c01655), X(0x79fe5539), X(0x26effb76), X(0x79ef1436), + X(0x271fda96), X(0x79dfc064), X(0x274fb3ae), X(0x79d059c8), + X(0x277f86b5), X(0x79c0e062), X(0x27af53a6), X(0x79b15435), + X(0x27df1a77), X(0x79a1b545), X(0x280edb23), X(0x79920392), + X(0x283e95a1), X(0x79823f20), X(0x286e49ea), X(0x797267f2), + X(0x289df7f8), X(0x79627e08), X(0x28cd9fc1), X(0x79528167), + X(0x28fd4140), X(0x79427210), X(0x292cdc6d), X(0x79325006), + X(0x295c7140), X(0x79221b4b), X(0x298bffb2), X(0x7911d3e2), + X(0x29bb87bc), X(0x790179cd), X(0x29eb0957), X(0x78f10d0f), + X(0x2a1a847b), X(0x78e08dab), X(0x2a49f920), X(0x78cffba3), + X(0x2a796740), X(0x78bf56f9), X(0x2aa8ced3), X(0x78ae9fb0), + X(0x2ad82fd2), X(0x789dd5cb), X(0x2b078a36), X(0x788cf94c), + X(0x2b36ddf7), X(0x787c0a36), X(0x2b662b0e), X(0x786b088c), + X(0x2b957173), X(0x7859f44f), X(0x2bc4b120), X(0x7848cd83), + X(0x2bf3ea0d), X(0x7837942b), X(0x2c231c33), X(0x78264849), + X(0x2c52478a), X(0x7814e9df), X(0x2c816c0c), X(0x780378f1), + X(0x2cb089b1), X(0x77f1f581), X(0x2cdfa071), X(0x77e05f91), + X(0x2d0eb046), X(0x77ceb725), X(0x2d3db928), X(0x77bcfc3f), + X(0x2d6cbb10), X(0x77ab2ee2), X(0x2d9bb5f6), X(0x77994f11), + X(0x2dcaa9d5), X(0x77875cce), X(0x2df996a3), X(0x7775581d), + X(0x2e287c5a), X(0x776340ff), X(0x2e575af3), X(0x77511778), + X(0x2e863267), X(0x773edb8b), X(0x2eb502ae), X(0x772c8d3a), + X(0x2ee3cbc1), X(0x771a2c88), X(0x2f128d99), X(0x7707b979), + X(0x2f41482e), X(0x76f5340e), X(0x2f6ffb7a), X(0x76e29c4b), + X(0x2f9ea775), X(0x76cff232), X(0x2fcd4c19), X(0x76bd35c7), + X(0x2ffbe95d), X(0x76aa670d), X(0x302a7f3a), X(0x76978605), + X(0x30590dab), X(0x768492b4), X(0x308794a6), X(0x76718d1c), + X(0x30b61426), X(0x765e7540), X(0x30e48c22), X(0x764b4b23), + X(0x3112fc95), X(0x76380ec8), X(0x31416576), X(0x7624c031), + X(0x316fc6be), X(0x76115f63), X(0x319e2067), X(0x75fdec60), + X(0x31cc7269), X(0x75ea672a), X(0x31fabcbd), X(0x75d6cfc5), + X(0x3228ff5c), X(0x75c32634), X(0x32573a3f), X(0x75af6a7b), + X(0x32856d5e), X(0x759b9c9b), X(0x32b398b3), X(0x7587bc98), + X(0x32e1bc36), X(0x7573ca75), X(0x330fd7e1), X(0x755fc635), + X(0x333debab), X(0x754bafdc), X(0x336bf78f), X(0x7537876c), + X(0x3399fb85), X(0x75234ce8), X(0x33c7f785), X(0x750f0054), + X(0x33f5eb89), X(0x74faa1b3), X(0x3423d78a), X(0x74e63108), + X(0x3451bb81), X(0x74d1ae55), X(0x347f9766), X(0x74bd199f), + X(0x34ad6b32), X(0x74a872e8), X(0x34db36df), X(0x7493ba34), + X(0x3508fa66), X(0x747eef85), X(0x3536b5be), X(0x746a12df), + X(0x356468e2), X(0x74552446), X(0x359213c9), X(0x744023bc), + X(0x35bfb66e), X(0x742b1144), X(0x35ed50c9), X(0x7415ece2), + X(0x361ae2d3), X(0x7400b69a), X(0x36486c86), X(0x73eb6e6e), + X(0x3675edd9), X(0x73d61461), X(0x36a366c6), X(0x73c0a878), + X(0x36d0d746), X(0x73ab2ab4), X(0x36fe3f52), X(0x73959b1b), + X(0x372b9ee3), X(0x737ff9ae), X(0x3758f5f2), X(0x736a4671), + X(0x37864477), X(0x73548168), X(0x37b38a6d), X(0x733eaa96), + X(0x37e0c7cc), X(0x7328c1ff), X(0x380dfc8d), X(0x7312c7a5), + X(0x383b28a9), X(0x72fcbb8c), X(0x38684c19), X(0x72e69db7), + X(0x389566d6), X(0x72d06e2b), X(0x38c278d9), X(0x72ba2cea), + X(0x38ef821c), X(0x72a3d9f7), X(0x391c8297), X(0x728d7557), + X(0x39497a43), X(0x7276ff0d), X(0x39766919), X(0x7260771b), + X(0x39a34f13), X(0x7249dd86), X(0x39d02c2a), X(0x72333251), + X(0x39fd0056), X(0x721c7580), X(0x3a29cb91), X(0x7205a716), + X(0x3a568dd4), X(0x71eec716), X(0x3a834717), X(0x71d7d585), + X(0x3aaff755), X(0x71c0d265), X(0x3adc9e86), X(0x71a9bdba), + X(0x3b093ca3), X(0x71929789), X(0x3b35d1a5), X(0x717b5fd3), + X(0x3b625d86), X(0x7164169d), X(0x3b8ee03e), X(0x714cbbeb), + X(0x3bbb59c7), X(0x71354fc0), X(0x3be7ca1a), X(0x711dd220), + X(0x3c143130), X(0x7106430e), X(0x3c408f03), X(0x70eea28e), + X(0x3c6ce38a), X(0x70d6f0a4), X(0x3c992ec0), X(0x70bf2d53), + X(0x3cc5709e), X(0x70a7589f), X(0x3cf1a91c), X(0x708f728b), + X(0x3d1dd835), X(0x70777b1c), X(0x3d49fde1), X(0x705f7255), + X(0x3d761a19), X(0x70475839), X(0x3da22cd7), X(0x702f2ccd), + X(0x3dce3614), X(0x7016f014), X(0x3dfa35c8), X(0x6ffea212), + X(0x3e262bee), X(0x6fe642ca), X(0x3e52187f), X(0x6fcdd241), + X(0x3e7dfb73), X(0x6fb5507a), X(0x3ea9d4c3), X(0x6f9cbd79), + X(0x3ed5a46b), X(0x6f841942), X(0x3f016a61), X(0x6f6b63d8), + X(0x3f2d26a0), X(0x6f529d40), X(0x3f58d921), X(0x6f39c57d), + X(0x3f8481dd), X(0x6f20dc92), X(0x3fb020ce), X(0x6f07e285), + X(0x3fdbb5ec), X(0x6eeed758), X(0x40074132), X(0x6ed5bb10), + X(0x4032c297), X(0x6ebc8db0), X(0x405e3a16), X(0x6ea34f3d), + X(0x4089a7a8), X(0x6e89ffb9), X(0x40b50b46), X(0x6e709f2a), + X(0x40e064ea), X(0x6e572d93), X(0x410bb48c), X(0x6e3daaf8), + X(0x4136fa27), X(0x6e24175c), X(0x416235b2), X(0x6e0a72c5), + X(0x418d6729), X(0x6df0bd35), X(0x41b88e84), X(0x6dd6f6b1), + X(0x41e3abbc), X(0x6dbd1f3c), X(0x420ebecb), X(0x6da336dc), + X(0x4239c7aa), X(0x6d893d93), X(0x4264c653), X(0x6d6f3365), + X(0x428fbabe), X(0x6d551858), X(0x42baa4e6), X(0x6d3aec6e), + X(0x42e584c3), X(0x6d20afac), X(0x43105a50), X(0x6d066215), + X(0x433b2585), X(0x6cec03af), X(0x4365e65b), X(0x6cd1947c), + X(0x43909ccd), X(0x6cb71482), X(0x43bb48d4), X(0x6c9c83c3), + X(0x43e5ea68), X(0x6c81e245), X(0x44108184), X(0x6c67300b), + X(0x443b0e21), X(0x6c4c6d1a), X(0x44659039), X(0x6c319975), + X(0x449007c4), X(0x6c16b521), X(0x44ba74bd), X(0x6bfbc021), + X(0x44e4d71c), X(0x6be0ba7b), X(0x450f2edb), X(0x6bc5a431), + X(0x45397bf4), X(0x6baa7d49), X(0x4563be60), X(0x6b8f45c7), + X(0x458df619), X(0x6b73fdae), X(0x45b82318), X(0x6b58a503), + X(0x45e24556), X(0x6b3d3bcb), X(0x460c5cce), X(0x6b21c208), + X(0x46366978), X(0x6b0637c1), X(0x46606b4e), X(0x6aea9cf8), + X(0x468a624a), X(0x6acef1b2), X(0x46b44e65), X(0x6ab335f4), + X(0x46de2f99), X(0x6a9769c1), X(0x470805df), X(0x6a7b8d1e), + X(0x4731d131), X(0x6a5fa010), X(0x475b9188), X(0x6a43a29a), + X(0x478546de), X(0x6a2794c1), X(0x47aef12c), X(0x6a0b7689), + X(0x47d8906d), X(0x69ef47f6), X(0x48022499), X(0x69d3090e), + X(0x482badab), X(0x69b6b9d3), X(0x48552b9b), X(0x699a5a4c), + X(0x487e9e64), X(0x697dea7b), X(0x48a805ff), X(0x69616a65), + X(0x48d16265), X(0x6944da10), X(0x48fab391), X(0x6928397e), + X(0x4923f97b), X(0x690b88b5), X(0x494d341e), X(0x68eec7b9), + X(0x49766373), X(0x68d1f68f), X(0x499f8774), X(0x68b5153a), + X(0x49c8a01b), X(0x689823bf), X(0x49f1ad61), X(0x687b2224), + X(0x4a1aaf3f), X(0x685e106c), X(0x4a43a5b0), X(0x6840ee9b), + X(0x4a6c90ad), X(0x6823bcb7), X(0x4a957030), X(0x68067ac3), + X(0x4abe4433), X(0x67e928c5), X(0x4ae70caf), X(0x67cbc6c0), + X(0x4b0fc99d), X(0x67ae54ba), X(0x4b387af9), X(0x6790d2b6), + X(0x4b6120bb), X(0x677340ba), X(0x4b89badd), X(0x67559eca), + X(0x4bb24958), X(0x6737ecea), X(0x4bdacc28), X(0x671a2b20), + X(0x4c034345), X(0x66fc596f), X(0x4c2baea9), X(0x66de77dc), + X(0x4c540e4e), X(0x66c0866d), X(0x4c7c622d), X(0x66a28524), + X(0x4ca4aa41), X(0x66847408), X(0x4ccce684), X(0x6666531d), + X(0x4cf516ee), X(0x66482267), X(0x4d1d3b7a), X(0x6629e1ec), + X(0x4d455422), X(0x660b91af), X(0x4d6d60df), X(0x65ed31b5), + X(0x4d9561ac), X(0x65cec204), X(0x4dbd5682), X(0x65b0429f), + X(0x4de53f5a), X(0x6591b38c), X(0x4e0d1c30), X(0x657314cf), + X(0x4e34ecfc), X(0x6554666d), X(0x4e5cb1b9), X(0x6535a86b), + X(0x4e846a60), X(0x6516dacd), X(0x4eac16eb), X(0x64f7fd98), + X(0x4ed3b755), X(0x64d910d1), X(0x4efb4b96), X(0x64ba147d), + X(0x4f22d3aa), X(0x649b08a0), X(0x4f4a4f89), X(0x647bed3f), + X(0x4f71bf2e), X(0x645cc260), X(0x4f992293), X(0x643d8806), + X(0x4fc079b1), X(0x641e3e38), X(0x4fe7c483), X(0x63fee4f8), + X(0x500f0302), X(0x63df7c4d), X(0x50363529), X(0x63c0043b), + X(0x505d5af1), X(0x63a07cc7), X(0x50847454), X(0x6380e5f6), + X(0x50ab814d), X(0x63613fcd), X(0x50d281d5), X(0x63418a50), + X(0x50f975e6), X(0x6321c585), X(0x51205d7b), X(0x6301f171), + X(0x5147388c), X(0x62e20e17), X(0x516e0715), X(0x62c21b7e), + X(0x5194c910), X(0x62a219aa), X(0x51bb7e75), X(0x628208a1), + X(0x51e22740), X(0x6261e866), X(0x5208c36a), X(0x6241b8ff), + X(0x522f52ee), X(0x62217a72), X(0x5255d5c5), X(0x62012cc2), + X(0x527c4bea), X(0x61e0cff5), X(0x52a2b556), X(0x61c06410), + X(0x52c91204), X(0x619fe918), X(0x52ef61ee), X(0x617f5f12), + X(0x5315a50e), X(0x615ec603), X(0x533bdb5d), X(0x613e1df0), + X(0x536204d7), X(0x611d66de), X(0x53882175), X(0x60fca0d2), + X(0x53ae3131), X(0x60dbcbd1), X(0x53d43406), X(0x60bae7e1), + X(0x53fa29ed), X(0x6099f505), X(0x542012e1), X(0x6078f344), + X(0x5445eedb), X(0x6057e2a2), X(0x546bbdd7), X(0x6036c325), + X(0x54917fce), X(0x601594d1), X(0x54b734ba), X(0x5ff457ad), + X(0x54dcdc96), X(0x5fd30bbc), X(0x5502775c), X(0x5fb1b104), + X(0x55280505), X(0x5f90478a), X(0x554d858d), X(0x5f6ecf53), + X(0x5572f8ed), X(0x5f4d4865), X(0x55985f20), X(0x5f2bb2c5), + X(0x55bdb81f), X(0x5f0a0e77), X(0x55e303e6), X(0x5ee85b82), + X(0x5608426e), X(0x5ec699e9), X(0x562d73b2), X(0x5ea4c9b3), + X(0x565297ab), X(0x5e82eae5), X(0x5677ae54), X(0x5e60fd84), + X(0x569cb7a8), X(0x5e3f0194), X(0x56c1b3a1), X(0x5e1cf71c), + X(0x56e6a239), X(0x5dfade20), X(0x570b8369), X(0x5dd8b6a7), + X(0x5730572e), X(0x5db680b4), X(0x57551d80), X(0x5d943c4e), + X(0x5779d65b), X(0x5d71e979), X(0x579e81b8), X(0x5d4f883b), + X(0x57c31f92), X(0x5d2d189a), X(0x57e7afe4), X(0x5d0a9a9a), + X(0x580c32a7), X(0x5ce80e41), X(0x5830a7d6), X(0x5cc57394), + X(0x58550f6c), X(0x5ca2ca99), X(0x58796962), X(0x5c801354), + X(0x589db5b3), X(0x5c5d4dcc), X(0x58c1f45b), X(0x5c3a7a05), + X(0x58e62552), X(0x5c179806), X(0x590a4893), X(0x5bf4a7d2), + X(0x592e5e19), X(0x5bd1a971), X(0x595265df), X(0x5bae9ce7), + X(0x59765fde), X(0x5b8b8239), X(0x599a4c12), X(0x5b68596d), + X(0x59be2a74), X(0x5b452288), X(0x59e1faff), X(0x5b21dd90), + X(0x5a05bdae), X(0x5afe8a8b), X(0x5a29727b), X(0x5adb297d), + X(0x5a4d1960), X(0x5ab7ba6c), X(0x5a70b258), X(0x5a943d5e), +}; + diff --git a/media/libtremor/lib/misc.h b/media/libtremor/lib/misc.h new file mode 100644 index 000000000000..2fc521a2440f --- /dev/null +++ b/media/libtremor/lib/misc.h @@ -0,0 +1,250 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * + * * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * + * * + ******************************************************************** + + function: miscellaneous math and prototypes + + ********************************************************************/ + +#ifndef _V_RANDOM_H_ +#define _V_RANDOM_H_ +#include "ivorbiscodec.h" +#include "os.h" + +#ifdef _LOW_ACCURACY_ +# define X(n) (((((n)>>22)+1)>>1) - ((((n)>>22)+1)>>9)) +# define LOOKUP_T const unsigned char +#else +# define X(n) (n) +# define LOOKUP_T const ogg_int32_t +#endif + +#include "asm_arm.h" +#include /* for abs() */ + +#ifndef _V_WIDE_MATH +#define _V_WIDE_MATH + +#ifndef _LOW_ACCURACY_ +/* 64 bit multiply */ + +#if !(defined WIN32 && defined WINCE) +#include +#endif + +#if BYTE_ORDER==LITTLE_ENDIAN +union magic { + struct { + ogg_int32_t lo; + ogg_int32_t hi; + } halves; + ogg_int64_t whole; +}; +#elif BYTE_ORDER==BIG_ENDIAN +union magic { + struct { + ogg_int32_t hi; + ogg_int32_t lo; + } halves; + ogg_int64_t whole; +}; +#endif + +STIN ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) { + union magic magic; + magic.whole = (ogg_int64_t)x * y; + return magic.halves.hi; +} + +STIN ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) { + return MULT32(x,y)<<1; +} + +STIN ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) { + union magic magic; + magic.whole = (ogg_int64_t)x * y; + return ((ogg_uint32_t)(magic.halves.lo)>>15) | ((magic.halves.hi)<<17); +} + +#else +/* 32 bit multiply, more portable but less accurate */ + +/* + * Note: Precision is biased towards the first argument therefore ordering + * is important. Shift values were chosen for the best sound quality after + * many listening tests. + */ + +/* + * For MULT32 and MULT31: The second argument is always a lookup table + * value already preshifted from 31 to 8 bits. We therefore take the + * opportunity to save on text space and use unsigned char for those + * tables in this case. + */ + +STIN ogg_int32_t MULT32(ogg_int32_t x, ogg_int32_t y) { + return (x >> 9) * y; /* y preshifted >>23 */ +} + +STIN ogg_int32_t MULT31(ogg_int32_t x, ogg_int32_t y) { + return (x >> 8) * y; /* y preshifted >>23 */ +} + +STIN ogg_int32_t MULT31_SHIFT15(ogg_int32_t x, ogg_int32_t y) { + return (x >> 6) * y; /* y preshifted >>9 */ +} + +#endif + +/* + * This should be used as a memory barrier, forcing all cached values in + * registers to wr writen back to memory. Might or might not be beneficial + * depending on the architecture and compiler. + */ +#define MB() + +/* + * The XPROD functions are meant to optimize the cross products found all + * over the place in mdct.c by forcing memory operation ordering to avoid + * unnecessary register reloads as soon as memory is being written to. + * However this is only beneficial on CPUs with a sane number of general + * purpose registers which exclude the Intel x86. On Intel, better let the + * compiler actually reload registers directly from original memory by using + * macros. + */ + +#ifdef __i386__ + +#define XPROD32(_a, _b, _t, _v, _x, _y) \ + { *(_x)=MULT32(_a,_t)+MULT32(_b,_v); \ + *(_y)=MULT32(_b,_t)-MULT32(_a,_v); } +#define XPROD31(_a, _b, _t, _v, _x, _y) \ + { *(_x)=MULT31(_a,_t)+MULT31(_b,_v); \ + *(_y)=MULT31(_b,_t)-MULT31(_a,_v); } +#define XNPROD31(_a, _b, _t, _v, _x, _y) \ + { *(_x)=MULT31(_a,_t)-MULT31(_b,_v); \ + *(_y)=MULT31(_b,_t)+MULT31(_a,_v); } + +#else + +STIN void XPROD32(ogg_int32_t a, ogg_int32_t b, + ogg_int32_t t, ogg_int32_t v, + ogg_int32_t *x, ogg_int32_t *y) +{ + *x = MULT32(a, t) + MULT32(b, v); + *y = MULT32(b, t) - MULT32(a, v); +} + +STIN void XPROD31(ogg_int32_t a, ogg_int32_t b, + ogg_int32_t t, ogg_int32_t v, + ogg_int32_t *x, ogg_int32_t *y) +{ + *x = MULT31(a, t) + MULT31(b, v); + *y = MULT31(b, t) - MULT31(a, v); +} + +STIN void XNPROD31(ogg_int32_t a, ogg_int32_t b, + ogg_int32_t t, ogg_int32_t v, + ogg_int32_t *x, ogg_int32_t *y) +{ + *x = MULT31(a, t) - MULT31(b, v); + *y = MULT31(b, t) + MULT31(a, v); +} + +#endif + +#endif + +#ifndef _V_CLIP_MATH +#define _V_CLIP_MATH + +STIN ogg_int32_t CLIP_TO_15(ogg_int32_t x) { + int ret=x; + ret-= ((x<=32767)-1)&(x-32767); + ret-= ((x>=-32768)-1)&(x+32768); + return(ret); +} + +#endif + +STIN ogg_int32_t VFLOAT_MULT(ogg_int32_t a,ogg_int32_t ap, + ogg_int32_t b,ogg_int32_t bp, + ogg_int32_t *p){ + if(a && b){ +#ifndef _LOW_ACCURACY_ + *p=ap+bp+32; + return MULT32(a,b); +#else + *p=ap+bp+31; + return (a>>15)*(b>>16); +#endif + }else + return 0; +} + +int _ilog(unsigned int); + +STIN ogg_int32_t VFLOAT_MULTI(ogg_int32_t a,ogg_int32_t ap, + ogg_int32_t i, + ogg_int32_t *p){ + + int ip=_ilog(abs(i))-31; + return VFLOAT_MULT(a,ap,i<<-ip,ip,p); +} + +STIN ogg_int32_t VFLOAT_ADD(ogg_int32_t a,ogg_int32_t ap, + ogg_int32_t b,ogg_int32_t bp, + ogg_int32_t *p){ + + if(!a){ + *p=bp; + return b; + }else if(!b){ + *p=ap; + return a; + } + + /* yes, this can leak a bit. */ + if(ap>bp){ + int shift=ap-bp+1; + *p=ap+1; + a>>=1; + if(shift<32){ + b=(b+(1<<(shift-1)))>>shift; + }else{ + b=0; + } + }else{ + int shift=bp-ap+1; + *p=bp+1; + b>>=1; + if(shift<32){ + a=(a+(1<<(shift-1)))>>shift; + }else{ + a=0; + } + } + + a+=b; + if((a&0xc0000000)==0xc0000000 || + (a&0xc0000000)==0){ + a<<=1; + (*p)--; + } + return(a); +} + +#endif + + + + diff --git a/media/libtremor/lib/moz.build b/media/libtremor/lib/moz.build new file mode 100644 index 000000000000..11d49a744aea --- /dev/null +++ b/media/libtremor/lib/moz.build @@ -0,0 +1,35 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# 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/. + +SOURCES += [ + 'tremor_block.c', + 'tremor_codebook.c', + 'tremor_floor0.c', + 'tremor_floor1.c', + 'tremor_info.c', + 'tremor_mapping0.c', + 'tremor_mdct.c', + 'tremor_registry.c', + 'tremor_res012.c', + 'tremor_sharedbook.c', + 'tremor_synthesis.c', + 'tremor_window.c', +] + +FINAL_LIBRARY = 'gkmedias' + +if CONFIG['OS_ARCH'] == 'AIX': + DEFINES['alloca'] = '__alloca' + +if CONFIG['CPU_ARCH'] == 'arm' and CONFIG['CC_TYPE'] in ('clang', 'gcc') and not CONFIG['MOZ_THUMB2']: + DEFINES['_ARM_ASSEM_'] = True + +LOCAL_INCLUDES += [ + '/media/libtremor/include/tremor', +] + +# We allow warnings for third-party code that can be updated from upstream. +AllowCompilerWarnings() diff --git a/media/libtremor/lib/os.h b/media/libtremor/lib/os.h new file mode 100644 index 000000000000..130d27de3263 --- /dev/null +++ b/media/libtremor/lib/os.h @@ -0,0 +1,64 @@ +#ifndef _OS_H +#define _OS_H +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * + * * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * + * * + ******************************************************************** + + function: #ifdef jail to whip a few platforms into the UNIX ideal. + + ********************************************************************/ + +#include +#include + +#ifndef _V_IFDEFJAIL_H_ +# define _V_IFDEFJAIL_H_ + +# ifdef __GNUC__ +# define STIN static __inline__ +# elif _WIN32 +# define STIN static __inline +# endif +#else +# define STIN static +#endif + +#ifndef M_PI +# define M_PI (3.1415926536f) +#endif + +#ifdef _WIN32 +# include +# define rint(x) (floor((x)+0.5f)) +# define NO_FLOAT_MATH_LIB +# define FAST_HYPOT(a, b) sqrt((a)*(a) + (b)*(b)) +# define LITTLE_ENDIAN 1 +# define BYTE_ORDER LITTLE_ENDIAN +#endif + +#ifdef HAVE_ALLOCA_H +# include +#endif + +#ifdef USE_MEMORY_H +# include +#endif + +#ifndef min +# define min(x,y) ((x)>(y)?(y):(x)) +#endif + +#ifndef max +# define max(x,y) ((x)<(y)?(y):(x)) +#endif + +#endif /* _OS_H */ diff --git a/media/libtremor/lib/registry.h b/media/libtremor/lib/registry.h new file mode 100644 index 000000000000..2bc8068f6946 --- /dev/null +++ b/media/libtremor/lib/registry.h @@ -0,0 +1,40 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * + * * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * + * * + ******************************************************************** + + function: registry for time, floor, res backends and channel mappings + + ********************************************************************/ + +#ifndef _V_REG_H_ +#define _V_REG_H_ + +#define VI_TRANSFORMB 1 +#define VI_WINDOWB 1 +#define VI_TIMEB 1 +#define VI_FLOORB 2 +#define VI_RESB 3 +#define VI_MAPB 1 + +#include "backends.h" + +#if defined(_WIN32) && defined(VORBISDLL_IMPORT) +# define EXTERN __declspec(dllimport) extern +#else +# define EXTERN extern +#endif + +EXTERN vorbis_func_floor *_floor_P[]; +EXTERN vorbis_func_residue *_residue_P[]; +EXTERN vorbis_func_mapping *_mapping_P[]; + +#endif diff --git a/media/libtremor/lib/tremor_block.c b/media/libtremor/lib/tremor_block.c new file mode 100644 index 000000000000..666bc51a6248 --- /dev/null +++ b/media/libtremor/lib/tremor_block.c @@ -0,0 +1,497 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * + * * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * + * * + ******************************************************************** + + function: PCM data vector blocking, windowing and dis/reassembly + + ********************************************************************/ + +#include +#include +#include +#include +#include "ivorbiscodec.h" +#include "codec_internal.h" + +#include "window.h" +#include "registry.h" +#include "misc.h" + +static int ilog(unsigned int v){ + int ret=0; + if(v)--v; + while(v){ + ret++; + v>>=1; + } + return(ret); +} + +/* pcm accumulator examples (not exhaustive): + + <-------------- lW ----------------> + <--------------- W ----------------> +: .....|..... _______________ | +: .''' | '''_--- | |\ | +:.....''' |_____--- '''......| | \_______| +:.................|__________________|_______|__|______| + |<------ Sl ------>| > Sr < |endW + |beginSl |endSl | |endSr + |beginW |endlW |beginSr + + + |< lW >| + <--------------- W ----------------> + | | .. ______________ | + | | ' `/ | ---_ | + |___.'___/`. | ---_____| + |_______|__|_______|_________________| + | >|Sl|< |<------ Sr ----->|endW + | | |endSl |beginSr |endSr + |beginW | |endlW + mult[0] |beginSl mult[n] + + <-------------- lW -----------------> + |<--W-->| +: .............. ___ | | +: .''' |`/ \ | | +:.....''' |/`....\|...| +:.........................|___|___|___| + |Sl |Sr |endW + | | |endSr + | |beginSr + | |endSl + |beginSl + |beginW +*/ + +/* block abstraction setup *********************************************/ + +#ifndef WORD_ALIGN +#define WORD_ALIGN 8 +#endif + +int vorbis_block_init(vorbis_dsp_state *v, vorbis_block *vb){ + memset(vb,0,sizeof(*vb)); + vb->vd=v; + vb->localalloc=0; + vb->localstore=NULL; + + return(0); +} + +void *_vorbis_block_alloc(vorbis_block *vb,long bytes){ + bytes=(bytes+(WORD_ALIGN-1)) & ~(WORD_ALIGN-1); + if(bytes+vb->localtop>vb->localalloc){ + /* can't just _ogg_realloc... there are outstanding pointers */ + if(vb->localstore){ + struct alloc_chain *link=(struct alloc_chain *)_ogg_malloc(sizeof(*link)); + vb->totaluse+=vb->localtop; + link->next=vb->reap; + link->ptr=vb->localstore; + vb->reap=link; + } + /* highly conservative */ + vb->localalloc=bytes; + vb->localstore=_ogg_malloc(vb->localalloc); + vb->localtop=0; + } + { + void *ret=(void *)(((char *)vb->localstore)+vb->localtop); + vb->localtop+=bytes; + return ret; + } +} + +/* reap the chain, pull the ripcord */ +void _vorbis_block_ripcord(vorbis_block *vb){ + /* reap the chain */ + struct alloc_chain *reap=vb->reap; + while(reap){ + struct alloc_chain *next=reap->next; + _ogg_free(reap->ptr); + memset(reap,0,sizeof(*reap)); + _ogg_free(reap); + reap=next; + } + /* consolidate storage */ + if(vb->totaluse){ + vb->localstore=_ogg_realloc(vb->localstore,vb->totaluse+vb->localalloc); + vb->localalloc+=vb->totaluse; + vb->totaluse=0; + } + + /* pull the ripcord */ + vb->localtop=0; + vb->reap=NULL; +} + +int vorbis_block_clear(vorbis_block *vb){ + _vorbis_block_ripcord(vb); + if(vb->localstore)_ogg_free(vb->localstore); + + memset(vb,0,sizeof(*vb)); + return(0); +} + +static int _vds_init(vorbis_dsp_state *v,vorbis_info *vi){ + int i; + codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; + private_state *b=NULL; + + if(ci==NULL) return 1; + + memset(v,0,sizeof(*v)); + b=(private_state *)(v->backend_state=_ogg_calloc(1,sizeof(*b))); + + v->vi=vi; + b->modebits=ilog(ci->modes); + + /* Vorbis I uses only window type 0 */ + b->window[0]=_vorbis_window(0,ci->blocksizes[0]/2); + b->window[1]=_vorbis_window(0,ci->blocksizes[1]/2); + + /* finish the codebooks */ + if(!ci->fullbooks){ + ci->fullbooks=(codebook *)_ogg_calloc(ci->books,sizeof(*ci->fullbooks)); + for(i=0;ibooks;i++){ + if(ci->book_param[i]==NULL) + goto abort_books; + if(vorbis_book_init_decode(ci->fullbooks+i,ci->book_param[i])) + goto abort_books; + /* decode codebooks are now standalone after init */ + vorbis_staticbook_destroy(ci->book_param[i]); + ci->book_param[i]=NULL; + } + } + + v->pcm_storage=ci->blocksizes[1]; + v->pcm=(ogg_int32_t **)_ogg_malloc(vi->channels*sizeof(*v->pcm)); + v->pcmret=(ogg_int32_t **)_ogg_malloc(vi->channels*sizeof(*v->pcmret)); + for(i=0;ichannels;i++) + v->pcm[i]=(ogg_int32_t *)_ogg_calloc(v->pcm_storage,sizeof(*v->pcm[i])); + + /* all 1 (large block) or 0 (small block) */ + /* explicitly set for the sake of clarity */ + v->lW=0; /* previous window size */ + v->W=0; /* current window size */ + + /* initialize all the mapping/backend lookups */ + b->mode=(vorbis_look_mapping **)_ogg_calloc(ci->modes,sizeof(*b->mode)); + for(i=0;imodes;i++){ + int mapnum=ci->mode_param[i]->mapping; + int maptype=ci->map_type[mapnum]; + b->mode[i]=_mapping_P[maptype]->look(v,ci->mode_param[i], + ci->map_param[mapnum]); + } + return 0; +abort_books: + for(i=0;ibooks;i++){ + if(ci->book_param[i]!=NULL){ + vorbis_staticbook_destroy(ci->book_param[i]); + ci->book_param[i]=NULL; + } + } + vorbis_dsp_clear(v); + return -1; +} + +int vorbis_synthesis_restart(vorbis_dsp_state *v){ + vorbis_info *vi=v->vi; + codec_setup_info *ci; + + if(!v->backend_state)return -1; + if(!vi)return -1; + ci=vi->codec_setup; + if(!ci)return -1; + + v->centerW=ci->blocksizes[1]/2; + v->pcm_current=v->centerW; + + v->pcm_returned=-1; + v->granulepos=-1; + v->sequence=-1; + ((private_state *)(v->backend_state))->sample_count=-1; + + return(0); +} + +int vorbis_synthesis_init(vorbis_dsp_state *v,vorbis_info *vi){ + if(_vds_init(v,vi))return 1; + vorbis_synthesis_restart(v); + + return 0; +} + +void vorbis_dsp_clear(vorbis_dsp_state *v){ + int i; + if(v){ + vorbis_info *vi=v->vi; + codec_setup_info *ci=(codec_setup_info *)(vi?vi->codec_setup:NULL); + private_state *b=(private_state *)v->backend_state; + + if(v->pcm){ + for(i=0;ichannels;i++) + if(v->pcm[i])_ogg_free(v->pcm[i]); + _ogg_free(v->pcm); + if(v->pcmret)_ogg_free(v->pcmret); + } + + /* free mode lookups; these are actually vorbis_look_mapping structs */ + if(ci){ + for(i=0;imodes;i++){ + int mapnum=ci->mode_param[i]->mapping; + int maptype=ci->map_type[mapnum]; + if(b && b->mode)_mapping_P[maptype]->free_look(b->mode[i]); + } + } + + if(b){ + if(b->mode)_ogg_free(b->mode); + _ogg_free(b); + } + + memset(v,0,sizeof(*v)); + } +} + +/* Unlike in analysis, the window is only partially applied for each + block. The time domain envelope is not yet handled at the point of + calling (as it relies on the previous block). */ + +int vorbis_synthesis_blockin(vorbis_dsp_state *v,vorbis_block *vb){ + vorbis_info *vi=v->vi; + codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; + private_state *b=v->backend_state; + int i,j; + + if(v->pcm_current>v->pcm_returned && v->pcm_returned!=-1)return(OV_EINVAL); + + v->lW=v->W; + v->W=vb->W; + v->nW=-1; + + if((v->sequence==-1)|| + (v->sequence+1 != vb->sequence)){ + v->granulepos=-1; /* out of sequence; lose count */ + b->sample_count=-1; + } + + v->sequence=vb->sequence; + + if(vb->pcm){ /* no pcm to process if vorbis_synthesis_trackonly + was called on block */ + int n=ci->blocksizes[v->W]/2; + int n0=ci->blocksizes[0]/2; + int n1=ci->blocksizes[1]/2; + + int thisCenter; + int prevCenter; + + if(v->centerW){ + thisCenter=n1; + prevCenter=0; + }else{ + thisCenter=0; + prevCenter=n1; + } + + /* v->pcm is now used like a two-stage double buffer. We don't want + to have to constantly shift *or* adjust memory usage. Don't + accept a new block until the old is shifted out */ + + /* overlap/add PCM */ + + for(j=0;jchannels;j++){ + /* the overlap/add section */ + if(v->lW){ + if(v->W){ + /* large/large */ + ogg_int32_t *pcm=v->pcm[j]+prevCenter; + ogg_int32_t *p=vb->pcm[j]; + for(i=0;ipcm[j]+prevCenter+n1/2-n0/2; + ogg_int32_t *p=vb->pcm[j]; + for(i=0;iW){ + /* small/large */ + ogg_int32_t *pcm=v->pcm[j]+prevCenter; + ogg_int32_t *p=vb->pcm[j]+n1/2-n0/2; + for(i=0;ipcm[j]+prevCenter; + ogg_int32_t *p=vb->pcm[j]; + for(i=0;ipcm[j]+thisCenter; + ogg_int32_t *p=vb->pcm[j]+n; + for(i=0;icenterW) + v->centerW=0; + else + v->centerW=n1; + + /* deal with initial packet state; we do this using the explicit + pcm_returned==-1 flag otherwise we're sensitive to first block + being short or long */ + + if(v->pcm_returned==-1){ + v->pcm_returned=thisCenter; + v->pcm_current=thisCenter; + }else{ + v->pcm_returned=prevCenter; + v->pcm_current=prevCenter+ + ci->blocksizes[v->lW]/4+ + ci->blocksizes[v->W]/4; + } + + } + + /* track the frame number... This is for convenience, but also + making sure our last packet doesn't end with added padding. If + the last packet is partial, the number of samples we'll have to + return will be past the vb->granulepos. + + This is not foolproof! It will be confused if we begin + decoding at the last page after a seek or hole. In that case, + we don't have a starting point to judge where the last frame + is. For this reason, vorbisfile will always try to make sure + it reads the last two marked pages in proper sequence */ + + if(b->sample_count==-1){ + b->sample_count=0; + }else{ + b->sample_count+=ci->blocksizes[v->lW]/4+ci->blocksizes[v->W]/4; + } + + if(v->granulepos==-1){ + if(vb->granulepos!=-1){ /* only set if we have a position to set to */ + + v->granulepos=vb->granulepos; + + /* is this a short page? */ + if(b->sample_count>v->granulepos){ + /* corner case; if this is both the first and last audio page, + then spec says the end is cut, not beginning */ + long extra=b->sample_count-vb->granulepos; + + /* we use ogg_int64_t for granule positions because a + uint64 isn't universally available. Unfortunately, + that means granposes can be 'negative' and result in + extra being negative */ + if(extra<0) + extra=0; + + if(vb->eofflag){ + /* trim the end */ + /* no preceeding granulepos; assume we started at zero (we'd + have to in a short single-page stream) */ + /* granulepos could be -1 due to a seek, but that would result + in a long coun`t, not short count */ + + /* Guard against corrupt/malicious frames that set EOP and + a backdated granpos; don't rewind more samples than we + actually have */ + if(extra > v->pcm_current - v->pcm_returned) + extra = v->pcm_current - v->pcm_returned; + + v->pcm_current-=extra; + }else{ + /* trim the beginning */ + v->pcm_returned+=extra; + if(v->pcm_returned>v->pcm_current) + v->pcm_returned=v->pcm_current; + } + + } + + } + }else{ + v->granulepos+=ci->blocksizes[v->lW]/4+ci->blocksizes[v->W]/4; + if(vb->granulepos!=-1 && v->granulepos!=vb->granulepos){ + + if(v->granulepos>vb->granulepos){ + long extra=v->granulepos-vb->granulepos; + + if(extra) + if(vb->eofflag){ + /* partial last frame. Strip the extra samples off */ + + /* Guard against corrupt/malicious frames that set EOP and + a backdated granpos; don't rewind more samples than we + actually have */ + if(extra > v->pcm_current - v->pcm_returned) + extra = v->pcm_current - v->pcm_returned; + + /* we use ogg_int64_t for granule positions because a + uint64 isn't universally available. Unfortunately, + that means granposes can be 'negative' and result in + extra being negative */ + if(extra<0) + extra=0; + + v->pcm_current-=extra; + + } /* else {Shouldn't happen *unless* the bitstream is out of + spec. Either way, believe the bitstream } */ + } /* else {Shouldn't happen *unless* the bitstream is out of + spec. Either way, believe the bitstream } */ + v->granulepos=vb->granulepos; + } + } + + /* Update, cleanup */ + + if(vb->eofflag)v->eofflag=1; + return(0); +} + +/* pcm==NULL indicates we just want the pending samples, no more */ +int vorbis_synthesis_pcmout(vorbis_dsp_state *v,ogg_int32_t ***pcm){ + vorbis_info *vi=v->vi; + if(v->pcm_returned>-1 && v->pcm_returnedpcm_current){ + if(pcm){ + int i; + for(i=0;ichannels;i++) + v->pcmret[i]=v->pcm[i]+v->pcm_returned; + *pcm=v->pcmret; + } + return(v->pcm_current-v->pcm_returned); + } + return(0); +} + +int vorbis_synthesis_read(vorbis_dsp_state *v,int bytes){ + if(bytes && v->pcm_returned+bytes>v->pcm_current)return(OV_EINVAL); + v->pcm_returned+=bytes; + return(0); +} + diff --git a/media/libtremor/lib/tremor_codebook.c b/media/libtremor/lib/tremor_codebook.c new file mode 100644 index 000000000000..1e1ae8a916b0 --- /dev/null +++ b/media/libtremor/lib/tremor_codebook.c @@ -0,0 +1,391 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * + * * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * + * * + ******************************************************************** + + function: basic codebook pack/unpack/code/decode operations + + ********************************************************************/ + +#include +#include +#include +#include +#include "ivorbiscodec.h" +#include "codebook.h" +#include "misc.h" + +/* unpacks a codebook from the packet buffer into the codebook struct, + readies the codebook auxiliary structures for decode *************/ +static_codebook *vorbis_staticbook_unpack(oggpack_buffer *opb){ + long i,j; + static_codebook *s=_ogg_calloc(1,sizeof(*s)); + + /* make sure alignment is correct */ + if(oggpack_read(opb,24)!=0x564342)goto _eofout; + + /* first the basic parameters */ + s->dim=oggpack_read(opb,16); + s->entries=oggpack_read(opb,24); + if(s->entries==-1)goto _eofout; + + if(_ilog(s->dim)+_ilog(s->entries)>24)goto _eofout; + + /* codeword ordering.... length ordered or unordered? */ + switch((int)oggpack_read(opb,1)){ + case 0:{ + long unused; + /* allocated but unused entries? */ + unused=oggpack_read(opb,1); + if((s->entries*(unused?1:5)+7)>>3>opb->storage-oggpack_bytes(opb)) + goto _eofout; + /* unordered */ + s->lengthlist=(long *)_ogg_malloc(sizeof(*s->lengthlist)*s->entries); + + /* allocated but unused entries? */ + if(unused){ + /* yes, unused entries */ + + for(i=0;ientries;i++){ + if(oggpack_read(opb,1)){ + long num=oggpack_read(opb,5); + if(num==-1)goto _eofout; + s->lengthlist[i]=num+1; + }else + s->lengthlist[i]=0; + } + }else{ + /* all entries used; no tagging */ + for(i=0;ientries;i++){ + long num=oggpack_read(opb,5); + if(num==-1)goto _eofout; + s->lengthlist[i]=num+1; + } + } + + break; + } + case 1: + /* ordered */ + { + long length=oggpack_read(opb,5)+1; + if(length==0)goto _eofout; + s->lengthlist=(long *)_ogg_malloc(sizeof(*s->lengthlist)*s->entries); + + for(i=0;ientries;){ + long num=oggpack_read(opb,_ilog(s->entries-i)); + if(num==-1)goto _eofout; + if(length>32 || num>s->entries-i || + (num>0 && (num-1)>>(length>>1)>>((length+1)>>1))>0){ + goto _errout; + } + for(j=0;jlengthlist[i]=length; + length++; + } + } + break; + default: + /* EOF */ + goto _eofout; + } + + /* Do we have a mapping to unpack? */ + switch((s->maptype=oggpack_read(opb,4))){ + case 0: + /* no mapping */ + break; + case 1: case 2: + /* implicitly populated value mapping */ + /* explicitly populated value mapping */ + + s->q_min=oggpack_read(opb,32); + s->q_delta=oggpack_read(opb,32); + s->q_quant=oggpack_read(opb,4)+1; + s->q_sequencep=oggpack_read(opb,1); + if(s->q_sequencep==-1)goto _eofout; + + { + int quantvals=0; + switch(s->maptype){ + case 1: + quantvals=(s->dim==0?0:_book_maptype1_quantvals(s)); + break; + case 2: + quantvals=s->entries*s->dim; + break; + } + + /* quantized values */ + if((quantvals*s->q_quant+7)>>3>opb->storage-oggpack_bytes(opb)) + goto _eofout; + s->quantlist=(long *)_ogg_malloc(sizeof(*s->quantlist)*quantvals); + for(i=0;iquantlist[i]=oggpack_read(opb,s->q_quant); + + if(quantvals&&s->quantlist[quantvals-1]==-1)goto _eofout; + } + break; + default: + goto _errout; + } + + /* all set */ + return(s); + + _errout: + _eofout: + vorbis_staticbook_destroy(s); + return(NULL); +} + +/* the 'eliminate the decode tree' optimization actually requires the + codewords to be MSb first, not LSb. This is an annoying inelegancy + (and one of the first places where carefully thought out design + turned out to be wrong; Vorbis II and future Ogg codecs should go + to an MSb bitpacker), but not actually the huge hit it appears to + be. The first-stage decode table catches most words so that + bitreverse is not in the main execution path. */ + +static ogg_uint32_t bitreverse(ogg_uint32_t x){ + x= ((x>>16)&0x0000ffff) | ((x<<16)&0xffff0000); + x= ((x>> 8)&0x00ff00ff) | ((x<< 8)&0xff00ff00); + x= ((x>> 4)&0x0f0f0f0f) | ((x<< 4)&0xf0f0f0f0); + x= ((x>> 2)&0x33333333) | ((x<< 2)&0xcccccccc); + return((x>> 1)&0x55555555) | ((x<< 1)&0xaaaaaaaa); +} + +STIN long decode_packed_entry_number(codebook *book, + oggpack_buffer *b){ + int read=book->dec_maxlength; + long lo,hi; + long lok = oggpack_look(b,book->dec_firsttablen); + + if (lok >= 0) { + long entry = book->dec_firsttable[lok]; + if(entry&0x80000000UL){ + lo=(entry>>15)&0x7fff; + hi=book->used_entries-(entry&0x7fff); + }else{ + oggpack_adv(b, book->dec_codelengths[entry-1]); + return(entry-1); + } + }else{ + lo=0; + hi=book->used_entries; + } + + lok = oggpack_look(b, read); + + while(lok<0 && read>1) + lok = oggpack_look(b, --read); + + if(lok<0){ + oggpack_adv(b,1); /* force eop */ + return -1; + } + + /* bisect search for the codeword in the ordered list */ + { + ogg_uint32_t testword=bitreverse((ogg_uint32_t)lok); + + while(hi-lo>1){ + long p=(hi-lo)>>1; + long test=book->codelist[lo+p]>testword; + lo+=p&(test-1); + hi-=p&(-test); + } + + if(book->dec_codelengths[lo]<=read){ + oggpack_adv(b, book->dec_codelengths[lo]); + return(lo); + } + } + + oggpack_adv(b, read+1); + return(-1); +} + +/* Decode side is specced and easier, because we don't need to find + matches using different criteria; we simply read and map. There are + two things we need to do 'depending': + + We may need to support interleave. We don't really, but it's + convenient to do it here rather than rebuild the vector later. + + Cascades may be additive or multiplicitive; this is not inherent in + the codebook, but set in the code using the codebook. Like + interleaving, it's easiest to do it here. + addmul==0 -> declarative (set the value) + addmul==1 -> additive + addmul==2 -> multiplicitive */ + +/* returns the [original, not compacted] entry number or -1 on eof *********/ +long vorbis_book_decode(codebook *book, oggpack_buffer *b){ + if(book->used_entries>0){ + long packed_entry=decode_packed_entry_number(book,b); + if(packed_entry>=0) + return(book->dec_index[packed_entry]); + } + + /* if there's no dec_index, the codebook unpacking isn't collapsed */ + return(-1); +} + +/* returns 0 on OK or -1 on eof *************************************/ +/* decode vector / dim granularity gaurding is done in the upper layer */ +long vorbis_book_decodevs_add(codebook *book,ogg_int32_t *a, + oggpack_buffer *b,int n,int point){ + if(book->used_entries>0){ + int step=n/book->dim; + long *entry = (long *)alloca(sizeof(*entry)*step); + ogg_int32_t **t = (ogg_int32_t **)alloca(sizeof(*t)*step); + int i,j,o; + int shift=point-book->binarypoint; + + if(shift>=0){ + for (i = 0; i < step; i++) { + entry[i]=decode_packed_entry_number(book,b); + if(entry[i]==-1)return(-1); + t[i] = book->valuelist+entry[i]*book->dim; + } + for(i=0,o=0;idim;i++,o+=step) + for (j=0;o+j>shift; + }else{ + for (i = 0; i < step; i++) { + entry[i]=decode_packed_entry_number(book,b); + if(entry[i]==-1)return(-1); + t[i] = book->valuelist+entry[i]*book->dim; + } + for(i=0,o=0;idim;i++,o+=step) + for (j=0;o+jused_entries>0){ + int i,j,entry; + ogg_int32_t *t; + int shift=point-book->binarypoint; + + if(shift>=0){ + for(i=0;ivaluelist+entry*book->dim; + for (j=0;idim;) + a[i++]+=t[j++]>>shift; + } + }else{ + for(i=0;ivaluelist+entry*book->dim; + for (j=0;idim;) + a[i++]+=t[j++]<<-shift; + } + } + } + return(0); +} + +/* unlike the others, we guard against n not being an integer number + of internally rather than in the upper layer (called only by + floor0) */ +long vorbis_book_decodev_set(codebook *book,ogg_int32_t *a, + oggpack_buffer *b,int n,int point){ + if(book->used_entries>0){ + int i,j,entry; + ogg_int32_t *t; + int shift=point-book->binarypoint; + + if(shift>=0){ + + for(i=0;ivaluelist+entry*book->dim; + for (j=0;idim;){ + a[i++]=t[j++]>>shift; + } + } + }else{ + + for(i=0;ivaluelist+entry*book->dim; + for (j=0;idim;){ + a[i++]=t[j++]<<-shift; + } + } + } + }else{ + + int i,j; + for(i=0;iused_entries>0){ + long i,j,entry; + int chptr=0; + int shift=point-book->binarypoint; + int m=offset+n; + if(shift>=0){ + + for(i=offset;ivaluelist+entry*book->dim; + for (j=0;idim;j++){ + a[chptr++][i]+=t[j]>>shift; + if(chptr==ch){ + chptr=0; + i++; + } + } + } + } + }else{ + + for(i=offset;ivaluelist+entry*book->dim; + for (j=0;idim;j++){ + a[chptr++][i]+=t[j]<<-shift; + if(chptr==ch){ + chptr=0; + i++; + } + } + } + } + } + } + return(0); +} diff --git a/media/libtremor/lib/tremor_floor0.c b/media/libtremor/lib/tremor_floor0.c new file mode 100644 index 000000000000..9f3ef560145e --- /dev/null +++ b/media/libtremor/lib/tremor_floor0.c @@ -0,0 +1,438 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * + * * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * + * * + ******************************************************************** + + function: floor backend 0 implementation + + ********************************************************************/ + +#include +#include +#include +#include +#include "ivorbiscodec.h" +#include "codec_internal.h" +#include "registry.h" +#include "codebook.h" +#include "misc.h" +#include "block.h" + +#define LSP_FRACBITS 14 + +typedef struct { + long n; + int ln; + int m; + int *linearmap; + + vorbis_info_floor0 *vi; + ogg_int32_t *lsp_look; + +} vorbis_look_floor0; + +/*************** LSP decode ********************/ + +#include "lsp_lookup.h" + +/* interpolated 1./sqrt(p) where .5 <= a < 1. (.100000... to .111111...) in + 16.16 format + returns in m.8 format */ + +static long ADJUST_SQRT2[2]={8192,5792}; +STIN ogg_int32_t vorbis_invsqlook_i(long a,long e){ + long i=(a&0x7fff)>>(INVSQ_LOOKUP_I_SHIFT-1); + long d=a&INVSQ_LOOKUP_I_MASK; /* 0.10 */ + long val=INVSQ_LOOKUP_I[i]- /* 1.16 */ + ((INVSQ_LOOKUP_IDel[i]*d)>>INVSQ_LOOKUP_I_SHIFT); /* result 1.16 */ + val*=ADJUST_SQRT2[e&1]; + e=(e>>1)+21; + return(val>>e); +} + +/* interpolated lookup based fromdB function, domain -140dB to 0dB only */ +/* a is in n.12 format */ +STIN ogg_int32_t vorbis_fromdBlook_i(long a){ + int i=(-a)>>(12-FROMdB2_SHIFT); + if(i<0) return 0x7fffffff; + if(i>=(FROMdB_LOOKUP_SZ<>FROMdB_SHIFT] * FROMdB2_LOOKUP[i&FROMdB2_MASK]; +} + +/* interpolated lookup based cos function, domain 0 to PI only */ +/* a is in 0.16 format, where 0==0, 2^^16-1==PI, return 0.14 */ +STIN ogg_int32_t vorbis_coslook_i(long a){ + int i=a>>COS_LOOKUP_I_SHIFT; + int d=a&COS_LOOKUP_I_MASK; + return COS_LOOKUP_I[i]- ((d*(COS_LOOKUP_I[i]-COS_LOOKUP_I[i+1]))>> + COS_LOOKUP_I_SHIFT); +} + +/* interpolated lookup based cos function */ +/* a is in 0.16 format, where 0==0, 2^^16==PI, return .LSP_FRACBITS */ +STIN ogg_int32_t vorbis_coslook2_i(long a){ + a=a&0x1ffff; + + if(a>0x10000)a=0x20000-a; + { + int i=a>>COS_LOOKUP_I_SHIFT; + int d=a&COS_LOOKUP_I_MASK; + a=((COS_LOOKUP_I[i]<> + (COS_LOOKUP_I_SHIFT-LSP_FRACBITS+14); + } + + return(a); +} + +static const int barklook[28]={ + 0,100,200,301, 405,516,635,766, + 912,1077,1263,1476, 1720,2003,2333,2721, + 3184,3742,4428,5285, 6376,7791,9662,12181, + 15624,20397,27087,36554 +}; + +/* used in init only; interpolate the long way */ +STIN ogg_int32_t toBARK(int n){ + int i; + for(i=0;i<27;i++) + if(n>=barklook[i] && n>10)*0x517d)>>14; +#endif + + /* safeguard against a malicious stream */ + if(val<0 || (val>>COS_LOOKUP_I_SHIFT)>=COS_LOOKUP_I_SZ){ + memset(curve,0,sizeof(*curve)*n); + return; + } + + ilsp[i]=vorbis_coslook_i(val); + } + + i=0; + while(i>16); + qi=((qi*qi)>>16); + + if(m&1){ + qexp= qexp*2-28*((m+1)>>1)+m; + pi*=(1<<14)-((wi*wi)>>14); + qi+=pi>>14; + }else{ + qexp= qexp*2-13*m; + + pi*=(1<<14)-wi; + qi*=(1<<14)+wi; + + qi=(qi+pi)>>14; + } + + if(qi&0xffff0000){ /* checks for 1.xxxxxxxxxxxxxxxx */ + qi>>=1; qexp++; + }else + lsp_norm_asm(&qi,&qexp); + +#else + + j=1; + if(m>1){ + qi*=labs(ilsp[0]-wi); + pi*=labs(ilsp[1]-wi); + + for(j+=2;j>25])) + if(!(shift=MLOOP_2[(pi|qi)>>19])) + shift=MLOOP_3[(pi|qi)>>16]; + qi=(qi>>shift)*labs(ilsp[j-1]-wi); + pi=(pi>>shift)*labs(ilsp[j]-wi); + qexp+=shift; + } + } + if(!(shift=MLOOP_1[(pi|qi)>>25])) + if(!(shift=MLOOP_2[(pi|qi)>>19])) + shift=MLOOP_3[(pi|qi)>>16]; + + /* pi,qi normalized collectively, both tracked using qexp */ + + if(m&1){ + /* odd order filter; slightly assymetric */ + /* the last coefficient */ + qi=(qi>>shift)*labs(ilsp[j-1]-wi); + pi=(pi>>shift)<<14; + qexp+=shift; + + if(!(shift=MLOOP_1[(pi|qi)>>25])) + if(!(shift=MLOOP_2[(pi|qi)>>19])) + shift=MLOOP_3[(pi|qi)>>16]; + + pi>>=shift; + qi>>=shift; + qexp+=shift-14*((m+1)>>1); + + pi=((pi*pi)>>16); + qi=((qi*qi)>>16); + qexp=qexp*2+m; + + pi*=(1<<14)-((wi*wi)>>14); + qi+=pi>>14; + + }else{ + /* even order filter; still symmetric */ + + /* p*=p(1-w), q*=q(1+w), let normalization drift because it isn't + worth tracking step by step */ + + pi>>=shift; + qi>>=shift; + qexp+=shift-7*m; + + pi=((pi*pi)>>16); + qi=((qi*qi)>>16); + qexp=qexp*2+m; + + pi*=(1<<14)-wi; + qi*=(1<<14)+wi; + qi=(qi+pi)>>14; + + } + + + /* we've let the normalization drift because it wasn't important; + however, for the lookup, things must be normalized again. We + need at most one right shift or a number of left shifts */ + + if(qi&0xffff0000){ /* checks for 1.xxxxxxxxxxxxxxxx */ + qi>>=1; qexp++; + }else + while(qi && !(qi&0x8000)){ /* checks for 0.0xxxxxxxxxxxxxxx or less*/ + qi<<=1; qexp--; + } + +#endif + + amp=vorbis_fromdBlook_i(ampi* /* n.4 */ + vorbis_invsqlook_i(qi,qexp)- + /* m.8, m+n<=8 */ + ampoffseti); /* 8.12[0] */ + +#ifdef _LOW_ACCURACY_ + amp>>=9; +#endif + curve[i]= MULT31_SHIFT15(curve[i],amp); + while(map[++i]==k) curve[i]= MULT31_SHIFT15(curve[i],amp); + } +} + +/*************** vorbis decode glue ************/ + +static void floor0_free_info(vorbis_info_floor *i){ + vorbis_info_floor0 *info=(vorbis_info_floor0 *)i; + if(info){ + memset(info,0,sizeof(*info)); + _ogg_free(info); + } +} + +static void floor0_free_look(vorbis_look_floor *i){ + vorbis_look_floor0 *look=(vorbis_look_floor0 *)i; + if(look){ + + if(look->linearmap)_ogg_free(look->linearmap); + if(look->lsp_look)_ogg_free(look->lsp_look); + memset(look,0,sizeof(*look)); + _ogg_free(look); + } +} + +static vorbis_info_floor *floor0_unpack (vorbis_info *vi,oggpack_buffer *opb){ + codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; + int j; + + vorbis_info_floor0 *info=(vorbis_info_floor0 *)_ogg_malloc(sizeof(*info)); + info->order=oggpack_read(opb,8); + info->rate=oggpack_read(opb,16); + info->barkmap=oggpack_read(opb,16); + info->ampbits=oggpack_read(opb,6); + info->ampdB=oggpack_read(opb,8); + info->numbooks=oggpack_read(opb,4)+1; + + if(info->order<1)goto err_out; + if(info->rate<1)goto err_out; + if(info->barkmap<1)goto err_out; + if(info->numbooks<1)goto err_out; + + for(j=0;jnumbooks;j++){ + info->books[j]=oggpack_read(opb,8); + if(info->books[j]<0 || info->books[j]>=ci->books)goto err_out; + if(ci->book_param[info->books[j]]->maptype==0)goto err_out; + } + return(info); + + err_out: + floor0_free_info(info); + return(NULL); +} + +/* initialize Bark scale and normalization lookups. We could do this + with static tables, but Vorbis allows a number of possible + combinations, so it's best to do it computationally. + + The below is authoritative in terms of defining scale mapping. + Note that the scale depends on the sampling rate as well as the + linear block and mapping sizes */ + +static vorbis_look_floor *floor0_look (vorbis_dsp_state *vd,vorbis_info_mode *mi, + vorbis_info_floor *i){ + int j; + vorbis_info *vi=vd->vi; + codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; + vorbis_info_floor0 *info=(vorbis_info_floor0 *)i; + vorbis_look_floor0 *look=(vorbis_look_floor0 *)_ogg_calloc(1,sizeof(*look)); + look->m=info->order; + look->n=ci->blocksizes[mi->blockflag]/2; + look->ln=info->barkmap; + look->vi=info; + + /* the mapping from a linear scale to a smaller bark scale is + straightforward. We do *not* make sure that the linear mapping + does not skip bark-scale bins; the decoder simply skips them and + the encoder may do what it wishes in filling them. They're + necessary in some mapping combinations to keep the scale spacing + accurate */ + look->linearmap=(int *)_ogg_malloc((look->n+1)*sizeof(*look->linearmap)); + for(j=0;jn;j++){ + + int val=(look->ln* + ((toBARK(info->rate/2*j/look->n)<<11)/toBARK(info->rate/2)))>>11; + + if(val>=look->ln)val=look->ln-1; /* guard against the approximation */ + look->linearmap[j]=val; + } + look->linearmap[j]=-1; + + look->lsp_look=(ogg_int32_t *)_ogg_malloc(look->ln*sizeof(*look->lsp_look)); + for(j=0;jln;j++) + look->lsp_look[j]=vorbis_coslook2_i(0x10000*j/look->ln); + + return look; +} + +static void *floor0_inverse1(vorbis_block *vb,vorbis_look_floor *i){ + vorbis_look_floor0 *look=(vorbis_look_floor0 *)i; + vorbis_info_floor0 *info=look->vi; + int j,k; + + int ampraw=oggpack_read(&vb->opb,info->ampbits); + if(ampraw>0){ /* also handles the -1 out of data case */ + long maxval=(1<ampbits)-1; + int amp=((ampraw*info->ampdB)<<4)/maxval; + int booknum=oggpack_read(&vb->opb,_ilog(info->numbooks)); + + if(booknum!=-1 && booknumnumbooks){ /* be paranoid */ + codec_setup_info *ci=(codec_setup_info *)vb->vd->vi->codec_setup; + codebook *b=ci->fullbooks+info->books[booknum]; + ogg_int32_t last=0; + ogg_int32_t *lsp=(ogg_int32_t *)_vorbis_block_alloc(vb,sizeof(*lsp)*(look->m+1)); + + if(vorbis_book_decodev_set(b,lsp,&vb->opb,look->m,-24)==-1)goto eop; + for(j=0;jm;){ + for(k=0;jm && kdim;k++,j++)lsp[j]+=last; + last=lsp[j-1]; + } + + lsp[look->m]=amp; + return(lsp); + } + } + eop: + return(NULL); +} + +static int floor0_inverse2(vorbis_block *vb,vorbis_look_floor *i, + void *memo,ogg_int32_t *out){ + vorbis_look_floor0 *look=(vorbis_look_floor0 *)i; + vorbis_info_floor0 *info=look->vi; + + if(memo){ + ogg_int32_t *lsp=(ogg_int32_t *)memo; + ogg_int32_t amp=lsp[look->m]; + + /* take the coefficients back to a spectral envelope curve */ + vorbis_lsp_to_curve(out,look->linearmap,look->n,look->ln, + lsp,look->m,amp,info->ampdB,look->lsp_look); + return(1); + } + memset(out,0,sizeof(*out)*look->n); + return(0); +} + +/* export hooks */ +vorbis_func_floor floor0_exportbundle={ + &floor0_unpack,&floor0_look,&floor0_free_info, + &floor0_free_look,&floor0_inverse1,&floor0_inverse2 +}; + + diff --git a/media/libtremor/lib/tremor_floor1.c b/media/libtremor/lib/tremor_floor1.c new file mode 100644 index 000000000000..12a687ec5382 --- /dev/null +++ b/media/libtremor/lib/tremor_floor1.c @@ -0,0 +1,461 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * + * * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * + * * + ******************************************************************** + + function: floor backend 1 implementation + + ********************************************************************/ + +#include +#include +#include +#include +#include "ivorbiscodec.h" +#include "codec_internal.h" +#include "registry.h" +#include "codebook.h" +#include "misc.h" +#include "block.h" + +#define floor1_rangedB 140 /* floor 1 fixed at -140dB to 0dB range */ + +typedef struct { + int forward_index[VIF_POSIT+2]; + + int hineighbor[VIF_POSIT]; + int loneighbor[VIF_POSIT]; + int posts; + + int n; + int quant_q; + vorbis_info_floor1 *vi; + +} vorbis_look_floor1; + +/***********************************************/ + +static void floor1_free_info(vorbis_info_floor *i){ + vorbis_info_floor1 *info=(vorbis_info_floor1 *)i; + if(info){ + memset(info,0,sizeof(*info)); + _ogg_free(info); + } +} + +static void floor1_free_look(vorbis_look_floor *i){ + vorbis_look_floor1 *look=(vorbis_look_floor1 *)i; + if(look){ + memset(look,0,sizeof(*look)); + _ogg_free(look); + } +} + +static int ilog(unsigned int v){ + int ret=0; + while(v){ + ret++; + v>>=1; + } + return(ret); +} + +static int icomp(const void *a,const void *b){ + return(**(int **)a-**(int **)b); +} + +static vorbis_info_floor *floor1_unpack (vorbis_info *vi,oggpack_buffer *opb){ + codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; + int j,k,count=0,maxclass=-1,rangebits; + + vorbis_info_floor1 *info=(vorbis_info_floor1 *)_ogg_calloc(1,sizeof(*info)); + /* read partitions */ + info->partitions=oggpack_read(opb,5); /* only 0 to 31 legal */ + for(j=0;jpartitions;j++){ + info->partitionclass[j]=oggpack_read(opb,4); /* only 0 to 15 legal */ + if(info->partitionclass[j]<0)goto err_out; + if(maxclasspartitionclass[j])maxclass=info->partitionclass[j]; + } + + /* read partition classes */ + for(j=0;jclass_dim[j]=oggpack_read(opb,3)+1; /* 1 to 8 */ + info->class_subs[j]=oggpack_read(opb,2); /* 0,1,2,3 bits */ + if(info->class_subs[j]<0) + goto err_out; + if(info->class_subs[j])info->class_book[j]=oggpack_read(opb,8); + if(info->class_book[j]<0 || info->class_book[j]>=ci->books) + goto err_out; + for(k=0;k<(1<class_subs[j]);k++){ + info->class_subbook[j][k]=oggpack_read(opb,8)-1; + if(info->class_subbook[j][k]<-1 || info->class_subbook[j][k]>=ci->books) + goto err_out; + } + } + + /* read the post list */ + info->mult=oggpack_read(opb,2)+1; /* only 1,2,3,4 legal now */ + rangebits=oggpack_read(opb,4); + if(rangebits<0)goto err_out; + + for(j=0,k=0;jpartitions;j++){ + count+=info->class_dim[info->partitionclass[j]]; + if(count>VIF_POSIT)goto err_out; + for(;kpostlist[k+2]=oggpack_read(opb,rangebits); + if(t<0 || t>=(1<postlist[0]=0; + info->postlist[1]=1<postlist+j; + qsort(sortpointer,count+2,sizeof(*sortpointer),icomp); + + for(j=1;jvi=info; + look->n=info->postlist[1]; + + /* we drop each position value in-between already decoded values, + and use linear interpolation to predict each new value past the + edges. The positions are read in the order of the position + list... we precompute the bounding positions in the lookup. Of + course, the neighbors can change (if a position is declined), but + this is an initial mapping */ + + for(i=0;ipartitions;i++)n+=info->class_dim[info->partitionclass[i]]; + n+=2; + look->posts=n; + + /* also store a sorted position index */ + for(i=0;ipostlist+i; + qsort(sortpointer,n,sizeof(*sortpointer),icomp); + + /* points from sort order back to range number */ + for(i=0;iforward_index[i]=sortpointer[i]-info->postlist; + + /* quantize values to multiplier spec */ + switch(info->mult){ + case 1: /* 1024 -> 256 */ + look->quant_q=256; + break; + case 2: /* 1024 -> 128 */ + look->quant_q=128; + break; + case 3: /* 1024 -> 86 */ + look->quant_q=86; + break; + case 4: /* 1024 -> 64 */ + look->quant_q=64; + break; + } + + /* discover our neighbors for decode where we don't use fit flags + (that would push the neighbors outward) */ + for(i=0;in; + int currentx=info->postlist[i+2]; + for(j=0;jpostlist[j]; + if(x>lx && xcurrentx){ + hi=j; + hx=x; + } + } + look->loneighbor[i]=lo; + look->hineighbor[i]=hi; + } + + return(look); +} + +static int render_point(int x0,int x1,int y0,int y1,int x){ + y0&=0x7fff; /* mask off flag */ + y1&=0x7fff; + + { + int dy=y1-y0; + int adx=x1-x0; + int ady=abs(dy); + int err=ady*(x-x0); + + int off=err/adx; + if(dy<0)return(y0-off); + return(y0+off); + } +} + +#ifdef _LOW_ACCURACY_ +# define XdB(n) ((((n)>>8)+1)>>1) +#else +# define XdB(n) (n) +#endif + +static const ogg_int32_t FLOOR_fromdB_LOOKUP[256]={ + XdB(0x000000e5), XdB(0x000000f4), XdB(0x00000103), XdB(0x00000114), + XdB(0x00000126), XdB(0x00000139), XdB(0x0000014e), XdB(0x00000163), + XdB(0x0000017a), XdB(0x00000193), XdB(0x000001ad), XdB(0x000001c9), + XdB(0x000001e7), XdB(0x00000206), XdB(0x00000228), XdB(0x0000024c), + XdB(0x00000272), XdB(0x0000029b), XdB(0x000002c6), XdB(0x000002f4), + XdB(0x00000326), XdB(0x0000035a), XdB(0x00000392), XdB(0x000003cd), + XdB(0x0000040c), XdB(0x00000450), XdB(0x00000497), XdB(0x000004e4), + XdB(0x00000535), XdB(0x0000058c), XdB(0x000005e8), XdB(0x0000064a), + XdB(0x000006b3), XdB(0x00000722), XdB(0x00000799), XdB(0x00000818), + XdB(0x0000089e), XdB(0x0000092e), XdB(0x000009c6), XdB(0x00000a69), + XdB(0x00000b16), XdB(0x00000bcf), XdB(0x00000c93), XdB(0x00000d64), + XdB(0x00000e43), XdB(0x00000f30), XdB(0x0000102d), XdB(0x0000113a), + XdB(0x00001258), XdB(0x0000138a), XdB(0x000014cf), XdB(0x00001629), + XdB(0x0000179a), XdB(0x00001922), XdB(0x00001ac4), XdB(0x00001c82), + XdB(0x00001e5c), XdB(0x00002055), XdB(0x0000226f), XdB(0x000024ac), + XdB(0x0000270e), XdB(0x00002997), XdB(0x00002c4b), XdB(0x00002f2c), + XdB(0x0000323d), XdB(0x00003581), XdB(0x000038fb), XdB(0x00003caf), + XdB(0x000040a0), XdB(0x000044d3), XdB(0x0000494c), XdB(0x00004e10), + XdB(0x00005323), XdB(0x0000588a), XdB(0x00005e4b), XdB(0x0000646b), + XdB(0x00006af2), XdB(0x000071e5), XdB(0x0000794c), XdB(0x0000812e), + XdB(0x00008993), XdB(0x00009283), XdB(0x00009c09), XdB(0x0000a62d), + XdB(0x0000b0f9), XdB(0x0000bc79), XdB(0x0000c8b9), XdB(0x0000d5c4), + XdB(0x0000e3a9), XdB(0x0000f274), XdB(0x00010235), XdB(0x000112fd), + XdB(0x000124dc), XdB(0x000137e4), XdB(0x00014c29), XdB(0x000161bf), + XdB(0x000178bc), XdB(0x00019137), XdB(0x0001ab4a), XdB(0x0001c70e), + XdB(0x0001e4a1), XdB(0x0002041f), XdB(0x000225aa), XdB(0x00024962), + XdB(0x00026f6d), XdB(0x000297f0), XdB(0x0002c316), XdB(0x0002f109), + XdB(0x000321f9), XdB(0x00035616), XdB(0x00038d97), XdB(0x0003c8b4), + XdB(0x000407a7), XdB(0x00044ab2), XdB(0x00049218), XdB(0x0004de23), + XdB(0x00052f1e), XdB(0x0005855c), XdB(0x0005e135), XdB(0x00064306), + XdB(0x0006ab33), XdB(0x00071a24), XdB(0x0007904b), XdB(0x00080e20), + XdB(0x00089422), XdB(0x000922da), XdB(0x0009bad8), XdB(0x000a5cb6), + XdB(0x000b091a), XdB(0x000bc0b1), XdB(0x000c8436), XdB(0x000d5471), + XdB(0x000e3233), XdB(0x000f1e5f), XdB(0x001019e4), XdB(0x001125c1), + XdB(0x00124306), XdB(0x001372d5), XdB(0x0014b663), XdB(0x00160ef7), + XdB(0x00177df0), XdB(0x001904c1), XdB(0x001aa4f9), XdB(0x001c603d), + XdB(0x001e384f), XdB(0x00202f0f), XdB(0x0022467a), XdB(0x002480b1), + XdB(0x0026dff7), XdB(0x002966b3), XdB(0x002c1776), XdB(0x002ef4fc), + XdB(0x0032022d), XdB(0x00354222), XdB(0x0038b828), XdB(0x003c67c2), + XdB(0x004054ae), XdB(0x004482e8), XdB(0x0048f6af), XdB(0x004db488), + XdB(0x0052c142), XdB(0x005821ff), XdB(0x005ddc33), XdB(0x0063f5b0), + XdB(0x006a74a7), XdB(0x00715faf), XdB(0x0078bdce), XdB(0x0080967f), + XdB(0x0088f1ba), XdB(0x0091d7f9), XdB(0x009b5247), XdB(0x00a56a41), + XdB(0x00b02a27), XdB(0x00bb9ce2), XdB(0x00c7ce12), XdB(0x00d4ca17), + XdB(0x00e29e20), XdB(0x00f15835), XdB(0x0101074b), XdB(0x0111bb4e), + XdB(0x01238531), XdB(0x01367704), XdB(0x014aa402), XdB(0x016020a7), + XdB(0x017702c3), XdB(0x018f6190), XdB(0x01a955cb), XdB(0x01c4f9cf), + XdB(0x01e269a8), XdB(0x0201c33b), XdB(0x0223265a), XdB(0x0246b4ea), + XdB(0x026c9302), XdB(0x0294e716), XdB(0x02bfda13), XdB(0x02ed9793), + XdB(0x031e4e09), XdB(0x03522ee4), XdB(0x03896ed0), XdB(0x03c445e2), + XdB(0x0402efd6), XdB(0x0445ac4b), XdB(0x048cbefc), XdB(0x04d87013), + XdB(0x05290c67), XdB(0x057ee5ca), XdB(0x05da5364), XdB(0x063bb204), + XdB(0x06a36485), XdB(0x0711d42b), XdB(0x0787710e), XdB(0x0804b299), + XdB(0x088a17ef), XdB(0x0918287e), XdB(0x09af747c), XdB(0x0a50957e), + XdB(0x0afc2f19), XdB(0x0bb2ef7f), XdB(0x0c759034), XdB(0x0d44d6ca), + XdB(0x0e2195bc), XdB(0x0f0cad0d), XdB(0x10070b62), XdB(0x1111aeea), + XdB(0x122da66c), XdB(0x135c120f), XdB(0x149e24d9), XdB(0x15f525b1), + XdB(0x176270e3), XdB(0x18e7794b), XdB(0x1a85c9ae), XdB(0x1c3f06d1), + XdB(0x1e14f07d), XdB(0x200963d7), XdB(0x221e5ccd), XdB(0x2455f870), + XdB(0x26b2770b), XdB(0x29363e2b), XdB(0x2be3db5c), XdB(0x2ebe06b6), + XdB(0x31c7a55b), XdB(0x3503ccd4), XdB(0x3875c5aa), XdB(0x3c210f44), + XdB(0x4009632b), XdB(0x4432b8cf), XdB(0x48a149bc), XdB(0x4d59959e), + XdB(0x52606733), XdB(0x57bad899), XdB(0x5d6e593a), XdB(0x6380b298), + XdB(0x69f80e9a), XdB(0x70dafda8), XdB(0x78307d76), XdB(0x7fffffff), +}; + +static void render_line(int n, int x0,int x1,int y0,int y1,ogg_int32_t *d){ + int dy=y1-y0; + int adx=x1-x0; + int ady=abs(dy); + int base=dy/adx; + int sy=(dy<0?base-1:base+1); + int x=x0; + int y=y0; + int err=0; + + if(n>x1)n=x1; + ady-=abs(base*adx); + + if(x=adx){ + err-=adx; + y+=sy; + }else{ + y+=base; + } + d[x]= MULT31_SHIFT15(d[x],FLOOR_fromdB_LOOKUP[y]); + } +} + +static void *floor1_inverse1(vorbis_block *vb,vorbis_look_floor *in){ + vorbis_look_floor1 *look=(vorbis_look_floor1 *)in; + vorbis_info_floor1 *info=look->vi; + codec_setup_info *ci=(codec_setup_info *)vb->vd->vi->codec_setup; + + int i,j,k; + codebook *books=ci->fullbooks; + + /* unpack wrapped/predicted values from stream */ + if(oggpack_read(&vb->opb,1)==1){ + int *fit_value=(int *)_vorbis_block_alloc(vb,(look->posts)*sizeof(*fit_value)); + + fit_value[0]=oggpack_read(&vb->opb,ilog(look->quant_q-1)); + fit_value[1]=oggpack_read(&vb->opb,ilog(look->quant_q-1)); + + /* partition by partition */ + /* partition by partition */ + for(i=0,j=2;ipartitions;i++){ + int classv=info->partitionclass[i]; + int cdim=info->class_dim[classv]; + int csubbits=info->class_subs[classv]; + int csub=1<class_book[classv],&vb->opb); + + if(cval==-1)goto eop; + } + + for(k=0;kclass_subbook[classv][cval&(csub-1)]; + cval>>=csubbits; + if(book>=0){ + if((fit_value[j+k]=vorbis_book_decode(books+book,&vb->opb))==-1) + goto eop; + }else{ + fit_value[j+k]=0; + } + } + j+=cdim; + } + + /* unwrap positive values and reconsitute via linear interpolation */ + for(i=2;iposts;i++){ + int predicted=render_point(info->postlist[look->loneighbor[i-2]], + info->postlist[look->hineighbor[i-2]], + fit_value[look->loneighbor[i-2]], + fit_value[look->hineighbor[i-2]], + info->postlist[i]); + int hiroom=look->quant_q-predicted; + int loroom=predicted; + int room=(hiroom=room){ + if(hiroom>loroom){ + val = val-loroom; + }else{ + val = -1-(val-hiroom); + } + }else{ + if(val&1){ + val= -((val+1)>>1); + }else{ + val>>=1; + } + } + + fit_value[i]=(val+predicted)&0x7fff;; + fit_value[look->loneighbor[i-2]]&=0x7fff; + fit_value[look->hineighbor[i-2]]&=0x7fff; + + }else{ + fit_value[i]=predicted|0x8000; + } + + } + + return(fit_value); + } + eop: + return(NULL); +} + +static int floor1_inverse2(vorbis_block *vb,vorbis_look_floor *in,void *memo, + ogg_int32_t *out){ + vorbis_look_floor1 *look=(vorbis_look_floor1 *)in; + vorbis_info_floor1 *info=look->vi; + + codec_setup_info *ci=(codec_setup_info *)vb->vd->vi->codec_setup; + int n=ci->blocksizes[vb->W]/2; + int j; + + if(memo){ + /* render the lines */ + int *fit_value=(int *)memo; + int hx=0; + int lx=0; + int ly=fit_value[0]*info->mult; + /* guard lookup against out-of-rage values */ + ly=(ly<0?0:ly>255?255:ly); + + for(j=1;jposts;j++){ + int current=look->forward_index[j]; + int hy=fit_value[current]&0x7fff; + if(hy==fit_value[current]){ + + hx=info->postlist[current]; + hy*=info->mult; + /* guard lookup against out-of-rage values */ + hy=(hy<0?0:hy>255?255:hy); + + + render_line(n,lx,hx,ly,hy,out); + + lx=hx; + ly=hy; + } + } + for(j=hx;j header packets + + ********************************************************************/ + +/* general handling of the header and the vorbis_info structure (and + substructures) */ + +#include +#include +#include +#include +#include +#include "ivorbiscodec.h" +#include "codec_internal.h" +#include "codebook.h" +#include "registry.h" +#include "window.h" +#include "misc.h" + +/* helpers */ +static void _v_readstring(oggpack_buffer *o,char *buf,int bytes){ + while(bytes--){ + *buf++=oggpack_read(o,8); + } +} + +void vorbis_comment_init(vorbis_comment *vc){ + memset(vc,0,sizeof(*vc)); +} + +/* This is more or less the same as strncasecmp - but that doesn't exist + * everywhere, and this is a fairly trivial function, so we include it */ +static int tagcompare(const char *s1, const char *s2, int n){ + int c=0; + while(c < n){ + if(toupper(s1[c]) != toupper(s2[c])) + return !0; + c++; + } + return 0; +} + +char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count){ + long i; + int found = 0; + int taglen = strlen(tag)+1; /* +1 for the = we append */ + char *fulltag = (char *)alloca(taglen+ 1); + + strcpy(fulltag, tag); + strcat(fulltag, "="); + + for(i=0;icomments;i++){ + if(!tagcompare(vc->user_comments[i], fulltag, taglen)){ + if(count == found) + /* We return a pointer to the data, not a copy */ + return vc->user_comments[i] + taglen; + else + found++; + } + } + return NULL; /* didn't find anything */ +} + +int vorbis_comment_query_count(vorbis_comment *vc, char *tag){ + int i,count=0; + int taglen = strlen(tag)+1; /* +1 for the = we append */ + char *fulltag = (char *)alloca(taglen+1); + strcpy(fulltag,tag); + strcat(fulltag, "="); + + for(i=0;icomments;i++){ + if(!tagcompare(vc->user_comments[i], fulltag, taglen)) + count++; + } + + return count; +} + +void vorbis_comment_clear(vorbis_comment *vc){ + if(vc){ + long i; + if(vc->user_comments){ + for(i=0;icomments;i++) + if(vc->user_comments[i])_ogg_free(vc->user_comments[i]); + _ogg_free(vc->user_comments); + } + if(vc->comment_lengths)_ogg_free(vc->comment_lengths); + if(vc->vendor)_ogg_free(vc->vendor); + memset(vc,0,sizeof(*vc)); + } +} + +/* blocksize 0 is guaranteed to be short, 1 is guarantted to be long. + They may be equal, but short will never ge greater than long */ +int vorbis_info_blocksize(vorbis_info *vi,int zo){ + codec_setup_info *ci = (codec_setup_info *)vi->codec_setup; + return ci ? ci->blocksizes[zo] : -1; +} + +/* used by synthesis, which has a full, alloced vi */ +void vorbis_info_init(vorbis_info *vi){ + memset(vi,0,sizeof(*vi)); + vi->codec_setup=(codec_setup_info *)_ogg_calloc(1,sizeof(codec_setup_info)); +} + +void vorbis_info_clear(vorbis_info *vi){ + codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; + int i; + + if(ci){ + + for(i=0;imodes;i++) + if(ci->mode_param[i])_ogg_free(ci->mode_param[i]); + + for(i=0;imaps;i++) /* unpack does the range checking */ + if(ci->map_param[i]) + _mapping_P[ci->map_type[i]]->free_info(ci->map_param[i]); + + for(i=0;ifloors;i++) /* unpack does the range checking */ + if(ci->floor_param[i]) + _floor_P[ci->floor_type[i]]->free_info(ci->floor_param[i]); + + for(i=0;iresidues;i++) /* unpack does the range checking */ + if(ci->residue_param[i]) + _residue_P[ci->residue_type[i]]->free_info(ci->residue_param[i]); + + for(i=0;ibooks;i++){ + if(ci->book_param[i]){ + /* knows if the book was not alloced */ + vorbis_staticbook_destroy(ci->book_param[i]); + } + if(ci->fullbooks) + vorbis_book_clear(ci->fullbooks+i); + } + if(ci->fullbooks) + _ogg_free(ci->fullbooks); + + _ogg_free(ci); + } + + memset(vi,0,sizeof(*vi)); +} + +/* Header packing/unpacking ********************************************/ + +static int _vorbis_unpack_info(vorbis_info *vi,oggpack_buffer *opb){ + codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; + if(!ci)return(OV_EFAULT); + + vi->version=oggpack_read(opb,32); + if(vi->version!=0)return(OV_EVERSION); + + vi->channels=oggpack_read(opb,8); + vi->rate=oggpack_read(opb,32); + + vi->bitrate_upper=oggpack_read(opb,32); + vi->bitrate_nominal=oggpack_read(opb,32); + vi->bitrate_lower=oggpack_read(opb,32); + + ci->blocksizes[0]=1<blocksizes[1]=1<rate<1)goto err_out; + if(vi->channels<1)goto err_out; + if(ci->blocksizes[0]<64)goto err_out; + if(ci->blocksizes[1]blocksizes[0])goto err_out; + if(ci->blocksizes[1]>8192)goto err_out; + + if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */ + + return(0); + err_out: + vorbis_info_clear(vi); + return(OV_EBADHEADER); +} + +static int _vorbis_unpack_comment(vorbis_comment *vc,oggpack_buffer *opb){ + int i; + int vendorlen; + vendorlen=oggpack_read(opb,32); + if(vendorlen<0)goto err_out; + if(vendorlen>opb->storage-oggpack_bytes(opb))goto err_out; + vc->vendor=(char *)_ogg_calloc(vendorlen+1,1); + if(vc->vendor==NULL)goto err_out; + _v_readstring(opb,vc->vendor,vendorlen); + i=oggpack_read(opb,32); + if(i<0||i>=INT_MAX||i>(opb->storage-oggpack_bytes(opb))>>2)goto err_out; + vc->user_comments=(char **)_ogg_calloc(i+1,sizeof(*vc->user_comments)); + vc->comment_lengths=(int *)_ogg_calloc(i+1, sizeof(*vc->comment_lengths)); + if(vc->user_comments==NULL||vc->comment_lengths==NULL)goto err_out; + vc->comments=i; + + for(i=0;icomments;i++){ + int len=oggpack_read(opb,32); + if(len<0||len>opb->storage-oggpack_bytes(opb))goto err_out; + vc->comment_lengths[i]=len; + vc->user_comments[i]=(char *)_ogg_calloc(len+1,1); + if(vc->user_comments[i]==NULL){ + vc->comments=i; + goto err_out; + } + _v_readstring(opb,vc->user_comments[i],len); + } + if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */ + + return(0); + err_out: + vorbis_comment_clear(vc); + return(OV_EBADHEADER); +} + +/* all of the real encoding details are here. The modes, books, + everything */ +static int _vorbis_unpack_books(vorbis_info *vi,oggpack_buffer *opb){ + codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; + int i; + if(!ci)return(OV_EFAULT); + + /* codebooks */ + ci->books=oggpack_read(opb,8)+1; + if(ci->books<=0)goto err_out; + for(i=0;ibooks;i++){ + ci->book_param[i]=vorbis_staticbook_unpack(opb); + if(!ci->book_param[i])goto err_out; + } + + /* time backend settings */ + ci->times=oggpack_read(opb,6)+1; + if(ci->times<=0)goto err_out; + for(i=0;itimes;i++){ + ci->time_type[i]=oggpack_read(opb,16); + if(ci->time_type[i]<0 || ci->time_type[i]>=VI_TIMEB)goto err_out; + /* ci->time_param[i]=_time_P[ci->time_type[i]]->unpack(vi,opb); + Vorbis I has no time backend */ + /*if(!ci->time_param[i])goto err_out;*/ + } + + /* floor backend settings */ + ci->floors=oggpack_read(opb,6)+1; + if(ci->floors<=0)goto err_out; + for(i=0;ifloors;i++){ + ci->floor_type[i]=oggpack_read(opb,16); + if(ci->floor_type[i]<0 || ci->floor_type[i]>=VI_FLOORB)goto err_out; + ci->floor_param[i]=_floor_P[ci->floor_type[i]]->unpack(vi,opb); + if(!ci->floor_param[i])goto err_out; + } + + /* residue backend settings */ + ci->residues=oggpack_read(opb,6)+1; + if(ci->residues<=0)goto err_out; + for(i=0;iresidues;i++){ + ci->residue_type[i]=oggpack_read(opb,16); + if(ci->residue_type[i]<0 || ci->residue_type[i]>=VI_RESB)goto err_out; + ci->residue_param[i]=_residue_P[ci->residue_type[i]]->unpack(vi,opb); + if(!ci->residue_param[i])goto err_out; + } + + /* map backend settings */ + ci->maps=oggpack_read(opb,6)+1; + if(ci->maps<=0)goto err_out; + for(i=0;imaps;i++){ + ci->map_type[i]=oggpack_read(opb,16); + if(ci->map_type[i]<0 || ci->map_type[i]>=VI_MAPB)goto err_out; + ci->map_param[i]=_mapping_P[ci->map_type[i]]->unpack(vi,opb); + if(!ci->map_param[i])goto err_out; + } + + /* mode settings */ + ci->modes=oggpack_read(opb,6)+1; + if(ci->modes<=0)goto err_out; + for(i=0;imodes;i++){ + ci->mode_param[i]=(vorbis_info_mode *)_ogg_calloc(1,sizeof(*ci->mode_param[i])); + ci->mode_param[i]->blockflag=oggpack_read(opb,1); + ci->mode_param[i]->windowtype=oggpack_read(opb,16); + ci->mode_param[i]->transformtype=oggpack_read(opb,16); + ci->mode_param[i]->mapping=oggpack_read(opb,8); + + if(ci->mode_param[i]->windowtype>=VI_WINDOWB)goto err_out; + if(ci->mode_param[i]->transformtype>=VI_WINDOWB)goto err_out; + if(ci->mode_param[i]->mapping>=ci->maps)goto err_out; + if(ci->mode_param[i]->mapping<0)goto err_out; + } + + if(oggpack_read(opb,1)!=1)goto err_out; /* top level EOP check */ + + return(0); + err_out: + vorbis_info_clear(vi); + return(OV_EBADHEADER); +} + +/* Is this packet a vorbis ID header? */ +int vorbis_synthesis_idheader(ogg_packet *op){ + oggpack_buffer opb; + char buffer[6]; + + if(op){ + oggpack_readinit(&opb,op->packet,op->bytes); + + if(!op->b_o_s) + return(0); /* Not the initial packet */ + + if(oggpack_read(&opb,8) != 1) + return 0; /* not an ID header */ + + memset(buffer,0,6); + _v_readstring(&opb,buffer,6); + if(memcmp(buffer,"vorbis",6)) + return 0; /* not vorbis */ + + return 1; + } + + return 0; +} + +/* The Vorbis header is in three packets; the initial small packet in + the first page that identifies basic parameters, a second packet + with bitstream comments and a third packet that holds the + codebook. */ + +int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc,ogg_packet *op){ + oggpack_buffer opb; + + if(op){ + oggpack_readinit(&opb,op->packet,op->bytes); + + /* Which of the three types of header is this? */ + /* Also verify header-ness, vorbis */ + { + char buffer[6]; + int packtype=oggpack_read(&opb,8); + memset(buffer,0,6); + _v_readstring(&opb,buffer,6); + if(memcmp(buffer,"vorbis",6)){ + /* not a vorbis header */ + return(OV_ENOTVORBIS); + } + switch(packtype){ + case 0x01: /* least significant *bit* is read first */ + if(!op->b_o_s){ + /* Not the initial packet */ + return(OV_EBADHEADER); + } + if(vi->rate!=0){ + /* previously initialized info header */ + return(OV_EBADHEADER); + } + + return(_vorbis_unpack_info(vi,&opb)); + + case 0x03: /* least significant *bit* is read first */ + if(vi->rate==0){ + /* um... we didn't get the initial header */ + return(OV_EBADHEADER); + } + + return(_vorbis_unpack_comment(vc,&opb)); + + case 0x05: /* least significant *bit* is read first */ + if(vi->rate==0 || vc->vendor==NULL){ + /* um... we didn;t get the initial header or comments yet */ + return(OV_EBADHEADER); + } + + return(_vorbis_unpack_books(vi,&opb)); + + default: + /* Not a valid vorbis header type */ + return(OV_EBADHEADER); + break; + } + } + } + return(OV_EBADHEADER); +} + diff --git a/media/libtremor/lib/tremor_mapping0.c b/media/libtremor/lib/tremor_mapping0.c new file mode 100644 index 000000000000..aa03e8543f21 --- /dev/null +++ b/media/libtremor/lib/tremor_mapping0.c @@ -0,0 +1,328 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * + * * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * + * * + ******************************************************************** + + function: channel mapping 0 implementation + + ********************************************************************/ + +#include +#include +#include +#include +#include +#include "ivorbiscodec.h" +#include "mdct.h" +#include "codec_internal.h" +#include "codebook.h" +#include "window.h" +#include "registry.h" +#include "misc.h" + +/* simplistic, wasteful way of doing this (unique lookup for each + mode/submapping); there should be a central repository for + identical lookups. That will require minor work, so I'm putting it + off as low priority. + + Why a lookup for each backend in a given mode? Because the + blocksize is set by the mode, and low backend lookups may require + parameters from other areas of the mode/mapping */ + +typedef struct { + vorbis_info_mode *mode; + vorbis_info_mapping0 *map; + + vorbis_look_floor **floor_look; + + vorbis_look_residue **residue_look; + + vorbis_func_floor **floor_func; + vorbis_func_residue **residue_func; + + int ch; + long lastframe; /* if a different mode is called, we need to + invalidate decay */ +} vorbis_look_mapping0; + +static void mapping0_free_info(vorbis_info_mapping *i){ + vorbis_info_mapping0 *info=(vorbis_info_mapping0 *)i; + if(info){ + memset(info,0,sizeof(*info)); + _ogg_free(info); + } +} + +static void mapping0_free_look(vorbis_look_mapping *look){ + int i; + vorbis_look_mapping0 *l=(vorbis_look_mapping0 *)look; + if(l){ + + for(i=0;imap->submaps;i++){ + l->floor_func[i]->free_look(l->floor_look[i]); + l->residue_func[i]->free_look(l->residue_look[i]); + } + + _ogg_free(l->floor_func); + _ogg_free(l->residue_func); + _ogg_free(l->floor_look); + _ogg_free(l->residue_look); + memset(l,0,sizeof(*l)); + _ogg_free(l); + } +} + +static vorbis_look_mapping *mapping0_look(vorbis_dsp_state *vd,vorbis_info_mode *vm, + vorbis_info_mapping *m){ + int i; + vorbis_info *vi=vd->vi; + codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; + vorbis_look_mapping0 *look=(vorbis_look_mapping0 *)_ogg_calloc(1,sizeof(*look)); + vorbis_info_mapping0 *info=look->map=(vorbis_info_mapping0 *)m; + look->mode=vm; + + look->floor_look=(vorbis_look_floor **)_ogg_calloc(info->submaps,sizeof(*look->floor_look)); + + look->residue_look=(vorbis_look_residue **)_ogg_calloc(info->submaps,sizeof(*look->residue_look)); + + look->floor_func=(vorbis_func_floor **)_ogg_calloc(info->submaps,sizeof(*look->floor_func)); + look->residue_func=(vorbis_func_residue **)_ogg_calloc(info->submaps,sizeof(*look->residue_func)); + + for(i=0;isubmaps;i++){ + int floornum=info->floorsubmap[i]; + int resnum=info->residuesubmap[i]; + + look->floor_func[i]=_floor_P[ci->floor_type[floornum]]; + look->floor_look[i]=look->floor_func[i]-> + look(vd,vm,ci->floor_param[floornum]); + look->residue_func[i]=_residue_P[ci->residue_type[resnum]]; + look->residue_look[i]=look->residue_func[i]-> + look(vd,vm,ci->residue_param[resnum]); + + } + + look->ch=vi->channels; + + return(look); +} + +static int ilog(unsigned int v){ + int ret=0; + if(v)--v; + while(v){ + ret++; + v>>=1; + } + return(ret); +} + +/* also responsible for range checking */ +static vorbis_info_mapping *mapping0_unpack(vorbis_info *vi,oggpack_buffer *opb){ + int i,b; + vorbis_info_mapping0 *info=(vorbis_info_mapping0 *)_ogg_calloc(1,sizeof(*info)); + codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; + memset(info,0,sizeof(*info)); + + b=oggpack_read(opb,1); + if(b<0)goto err_out; + if(b){ + info->submaps=oggpack_read(opb,4)+1; + if(info->submaps<=0)goto err_out; + }else + info->submaps=1; + + b=oggpack_read(opb,1); + if(b<0)goto err_out; + if(b){ + info->coupling_steps=oggpack_read(opb,8)+1; + if(info->coupling_steps<=0)goto err_out; + for(i=0;icoupling_steps;i++){ + int testM=info->coupling_mag[i]=oggpack_read(opb,ilog(vi->channels)); + int testA=info->coupling_ang[i]=oggpack_read(opb,ilog(vi->channels)); + + if(testM<0 || + testA<0 || + testM==testA || + testM>=vi->channels || + testA>=vi->channels) goto err_out; + } + + } + + if(oggpack_read(opb,2)!=0)goto err_out; /* 2,3:reserved */ + + if(info->submaps>1){ + for(i=0;ichannels;i++){ + info->chmuxlist[i]=oggpack_read(opb,4); + if(info->chmuxlist[i]>=info->submaps || info->chmuxlist[i]<0)goto err_out; + } + } + for(i=0;isubmaps;i++){ + int temp=oggpack_read(opb,8); + if(temp>=ci->times)goto err_out; + info->floorsubmap[i]=oggpack_read(opb,8); + if(info->floorsubmap[i]>=ci->floors || info->floorsubmap[i]<0)goto err_out; + info->residuesubmap[i]=oggpack_read(opb,8); + if(info->residuesubmap[i]>=ci->residues || info->residuesubmap[i]<0) + goto err_out; + } + + return info; + + err_out: + mapping0_free_info(info); + return(NULL); +} + +static int seq=0; +static int mapping0_inverse(vorbis_block *vb,vorbis_look_mapping *l){ + vorbis_dsp_state *vd=vb->vd; + vorbis_info *vi=vd->vi; + codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; + private_state *b=(private_state *)vd->backend_state; + vorbis_look_mapping0 *look=(vorbis_look_mapping0 *)l; + vorbis_info_mapping0 *info=look->map; + + int i,j; + long n=vb->pcmend=ci->blocksizes[vb->W]; + + ogg_int32_t **pcmbundle=(ogg_int32_t **)alloca(sizeof(*pcmbundle)*vi->channels); + int *zerobundle=(int *)alloca(sizeof(*zerobundle)*vi->channels); + + int *nonzero =(int *)alloca(sizeof(*nonzero)*vi->channels); + void **floormemo=(void **)alloca(sizeof(*floormemo)*vi->channels); + + /* time domain information decode (note that applying the + information would have to happen later; we'll probably add a + function entry to the harness for that later */ + /* NOT IMPLEMENTED */ + + /* recover the spectral envelope; store it in the PCM vector for now */ + for(i=0;ichannels;i++){ + int submap=info->chmuxlist[i]; + floormemo[i]=look->floor_func[submap]-> + inverse1(vb,look->floor_look[submap]); + if(floormemo[i]) + nonzero[i]=1; + else + nonzero[i]=0; + memset(vb->pcm[i],0,sizeof(*vb->pcm[i])*n/2); + } + + /* channel coupling can 'dirty' the nonzero listing */ + for(i=0;icoupling_steps;i++){ + if(nonzero[info->coupling_mag[i]] || + nonzero[info->coupling_ang[i]]){ + nonzero[info->coupling_mag[i]]=1; + nonzero[info->coupling_ang[i]]=1; + } + } + + /* recover the residue into our working vectors */ + for(i=0;isubmaps;i++){ + int ch_in_bundle=0; + for(j=0;jchannels;j++){ + if(info->chmuxlist[j]==i){ + if(nonzero[j]) + zerobundle[ch_in_bundle]=1; + else + zerobundle[ch_in_bundle]=0; + pcmbundle[ch_in_bundle++]=vb->pcm[j]; + } + } + + look->residue_func[i]->inverse(vb,look->residue_look[i], + pcmbundle,zerobundle,ch_in_bundle); + } + + //for(j=0;jchannels;j++) + //_analysis_output("coupled",seq+j,vb->pcm[j],-8,n/2,0,0); + + + /* channel coupling */ + for(i=info->coupling_steps-1;i>=0;i--){ + ogg_int32_t *pcmM=vb->pcm[info->coupling_mag[i]]; + ogg_int32_t *pcmA=vb->pcm[info->coupling_ang[i]]; + + for(j=0;j0) + if(ang>0){ + pcmM[j]=mag; + pcmA[j]=mag-ang; + }else{ + pcmA[j]=mag; + pcmM[j]=mag+ang; + } + else + if(ang>0){ + pcmM[j]=mag; + pcmA[j]=mag+ang; + }else{ + pcmA[j]=mag; + pcmM[j]=mag-ang; + } + } + } + + //for(j=0;jchannels;j++) + //_analysis_output("residue",seq+j,vb->pcm[j],-8,n/2,0,0); + + /* compute and apply spectral envelope */ + for(i=0;ichannels;i++){ + ogg_int32_t *pcm=vb->pcm[i]; + int submap=info->chmuxlist[i]; + look->floor_func[submap]-> + inverse2(vb,look->floor_look[submap],floormemo[i],pcm); + } + + //for(j=0;jchannels;j++) + //_analysis_output("mdct",seq+j,vb->pcm[j],-24,n/2,0,1); + + /* transform the PCM data; takes PCM vector, vb; modifies PCM vector */ + /* only MDCT right now.... */ + for(i=0;ichannels;i++){ + ogg_int32_t *pcm=vb->pcm[i]; + mdct_backward(n,pcm,pcm); + } + + //for(j=0;jchannels;j++) + //_analysis_output("imdct",seq+j,vb->pcm[j],-24,n,0,0); + + /* window the data */ + for(i=0;ichannels;i++){ + ogg_int32_t *pcm=vb->pcm[i]; + if(nonzero[i]) + _vorbis_apply_window(pcm,b->window,ci->blocksizes,vb->lW,vb->W,vb->nW); + else + for(j=0;jchannels;j++) + //_analysis_output("window",seq+j,vb->pcm[j],-24,n,0,0); + + seq+=vi->channels; + /* all done! */ + return(0); +} + +/* export hooks */ +vorbis_func_mapping mapping0_exportbundle={ + &mapping0_unpack, + &mapping0_look, + &mapping0_free_info, + &mapping0_free_look, + &mapping0_inverse +}; diff --git a/media/libtremor/lib/tremor_mdct.c b/media/libtremor/lib/tremor_mdct.c new file mode 100644 index 000000000000..4f39e7d531d4 --- /dev/null +++ b/media/libtremor/lib/tremor_mdct.c @@ -0,0 +1,510 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * + * * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * + * * + ******************************************************************** + + function: normalized modified discrete cosine transform + power of two length transform only [64 <= n ] + last mod: $Id: mdct.c,v 1.9 2002/10/16 09:17:39 xiphmont Exp $ + + Original algorithm adapted long ago from _The use of multirate filter + banks for coding of high quality digital audio_, by T. Sporer, + K. Brandenburg and B. Edler, collection of the European Signal + Processing Conference (EUSIPCO), Amsterdam, June 1992, Vol.1, pp + 211-214 + + The below code implements an algorithm that no longer looks much like + that presented in the paper, but the basic structure remains if you + dig deep enough to see it. + + This module DOES NOT INCLUDE code to generate/apply the window + function. Everybody has their own weird favorite including me... I + happen to like the properties of y=sin(.5PI*sin^2(x)), but others may + vehemently disagree. + + ********************************************************************/ + +#include "ivorbiscodec.h" +#include "codebook.h" +#include "misc.h" +#include "mdct.h" +#include "mdct_lookup.h" + + +/* 8 point butterfly (in place) */ +STIN void mdct_butterfly_8(DATA_TYPE *x){ + + REG_TYPE r0 = x[4] + x[0]; + REG_TYPE r1 = x[4] - x[0]; + REG_TYPE r2 = x[5] + x[1]; + REG_TYPE r3 = x[5] - x[1]; + REG_TYPE r4 = x[6] + x[2]; + REG_TYPE r5 = x[6] - x[2]; + REG_TYPE r6 = x[7] + x[3]; + REG_TYPE r7 = x[7] - x[3]; + + x[0] = r5 + r3; + x[1] = r7 - r1; + x[2] = r5 - r3; + x[3] = r7 + r1; + x[4] = r4 - r0; + x[5] = r6 - r2; + x[6] = r4 + r0; + x[7] = r6 + r2; + MB(); +} + +/* 16 point butterfly (in place, 4 register) */ +STIN void mdct_butterfly_16(DATA_TYPE *x){ + + REG_TYPE r0, r1; + + r0 = x[ 0] - x[ 8]; x[ 8] += x[ 0]; + r1 = x[ 1] - x[ 9]; x[ 9] += x[ 1]; + x[ 0] = MULT31((r0 + r1) , cPI2_8); + x[ 1] = MULT31((r1 - r0) , cPI2_8); + MB(); + + r0 = x[10] - x[ 2]; x[10] += x[ 2]; + r1 = x[ 3] - x[11]; x[11] += x[ 3]; + x[ 2] = r1; x[ 3] = r0; + MB(); + + r0 = x[12] - x[ 4]; x[12] += x[ 4]; + r1 = x[13] - x[ 5]; x[13] += x[ 5]; + x[ 4] = MULT31((r0 - r1) , cPI2_8); + x[ 5] = MULT31((r0 + r1) , cPI2_8); + MB(); + + r0 = x[14] - x[ 6]; x[14] += x[ 6]; + r1 = x[15] - x[ 7]; x[15] += x[ 7]; + x[ 6] = r0; x[ 7] = r1; + MB(); + + mdct_butterfly_8(x); + mdct_butterfly_8(x+8); +} + +/* 32 point butterfly (in place, 4 register) */ +STIN void mdct_butterfly_32(DATA_TYPE *x){ + + REG_TYPE r0, r1; + + r0 = x[30] - x[14]; x[30] += x[14]; + r1 = x[31] - x[15]; x[31] += x[15]; + x[14] = r0; x[15] = r1; + MB(); + + r0 = x[28] - x[12]; x[28] += x[12]; + r1 = x[29] - x[13]; x[29] += x[13]; + XNPROD31( r0, r1, cPI1_8, cPI3_8, &x[12], &x[13] ); + MB(); + + r0 = x[26] - x[10]; x[26] += x[10]; + r1 = x[27] - x[11]; x[27] += x[11]; + x[10] = MULT31((r0 - r1) , cPI2_8); + x[11] = MULT31((r0 + r1) , cPI2_8); + MB(); + + r0 = x[24] - x[ 8]; x[24] += x[ 8]; + r1 = x[25] - x[ 9]; x[25] += x[ 9]; + XNPROD31( r0, r1, cPI3_8, cPI1_8, &x[ 8], &x[ 9] ); + MB(); + + r0 = x[22] - x[ 6]; x[22] += x[ 6]; + r1 = x[ 7] - x[23]; x[23] += x[ 7]; + x[ 6] = r1; x[ 7] = r0; + MB(); + + r0 = x[ 4] - x[20]; x[20] += x[ 4]; + r1 = x[ 5] - x[21]; x[21] += x[ 5]; + XPROD31 ( r0, r1, cPI3_8, cPI1_8, &x[ 4], &x[ 5] ); + MB(); + + r0 = x[ 2] - x[18]; x[18] += x[ 2]; + r1 = x[ 3] - x[19]; x[19] += x[ 3]; + x[ 2] = MULT31((r1 + r0) , cPI2_8); + x[ 3] = MULT31((r1 - r0) , cPI2_8); + MB(); + + r0 = x[ 0] - x[16]; x[16] += x[ 0]; + r1 = x[ 1] - x[17]; x[17] += x[ 1]; + XPROD31 ( r0, r1, cPI1_8, cPI3_8, &x[ 0], &x[ 1] ); + MB(); + + mdct_butterfly_16(x); + mdct_butterfly_16(x+16); +} + +/* N/stage point generic N stage butterfly (in place, 2 register) */ +STIN void mdct_butterfly_generic(DATA_TYPE *x,int points,int step){ + + LOOKUP_T *T = sincos_lookup0; + DATA_TYPE *x1 = x + points - 8; + DATA_TYPE *x2 = x + (points>>1) - 8; + REG_TYPE r0; + REG_TYPE r1; + + do{ + r0 = x1[6] - x2[6]; x1[6] += x2[6]; + r1 = x2[7] - x1[7]; x1[7] += x2[7]; + XPROD31( r1, r0, T[0], T[1], &x2[6], &x2[7] ); T+=step; + + r0 = x1[4] - x2[4]; x1[4] += x2[4]; + r1 = x2[5] - x1[5]; x1[5] += x2[5]; + XPROD31( r1, r0, T[0], T[1], &x2[4], &x2[5] ); T+=step; + + r0 = x1[2] - x2[2]; x1[2] += x2[2]; + r1 = x2[3] - x1[3]; x1[3] += x2[3]; + XPROD31( r1, r0, T[0], T[1], &x2[2], &x2[3] ); T+=step; + + r0 = x1[0] - x2[0]; x1[0] += x2[0]; + r1 = x2[1] - x1[1]; x1[1] += x2[1]; + XPROD31( r1, r0, T[0], T[1], &x2[0], &x2[1] ); T+=step; + + x1-=8; x2-=8; + }while(Tsincos_lookup0); + do{ + r0 = x2[6] - x1[6]; x1[6] += x2[6]; + r1 = x2[7] - x1[7]; x1[7] += x2[7]; + XPROD31( r0, r1, T[0], T[1], &x2[6], &x2[7] ); T+=step; + + r0 = x2[4] - x1[4]; x1[4] += x2[4]; + r1 = x2[5] - x1[5]; x1[5] += x2[5]; + XPROD31( r0, r1, T[0], T[1], &x2[4], &x2[5] ); T+=step; + + r0 = x2[2] - x1[2]; x1[2] += x2[2]; + r1 = x2[3] - x1[3]; x1[3] += x2[3]; + XPROD31( r0, r1, T[0], T[1], &x2[2], &x2[3] ); T+=step; + + r0 = x2[0] - x1[0]; x1[0] += x2[0]; + r1 = x2[1] - x1[1]; x1[1] += x2[1]; + XPROD31( r0, r1, T[0], T[1], &x2[0], &x2[1] ); T+=step; + + x1-=8; x2-=8; + }while(Tsincos_lookup0); +} + +STIN void mdct_butterflies(DATA_TYPE *x,int points,int shift){ + + int stages=8-shift; + int i,j; + + for(i=0;--stages>0;i++){ + for(j=0;j<(1<>i)*j,points>>i,4<<(i+shift)); + } + + for(j=0;j>8]|(bitrev[(x&0x0f0)>>4]<<4)|(((int)bitrev[x&0x00f])<<8); +} + +STIN void mdct_bitreverse(DATA_TYPE *x,int n,int step,int shift){ + + int bit = 0; + DATA_TYPE *w0 = x; + DATA_TYPE *w1 = x = w0+(n>>1); + LOOKUP_T *T = (step>=4)?(sincos_lookup0+(step>>1)):sincos_lookup1; + LOOKUP_T *Ttop = T+1024; + DATA_TYPE r2; + + do{ + DATA_TYPE r3 = bitrev12(bit++); + DATA_TYPE *x0 = x + ((r3 ^ 0xfff)>>shift) -1; + DATA_TYPE *x1 = x + (r3>>shift); + + REG_TYPE r0 = x0[0] + x1[0]; + REG_TYPE r1 = x1[1] - x0[1]; + + XPROD32( r0, r1, T[1], T[0], &r2, &r3 ); T+=step; + + w1 -= 4; + + r0 = (x0[1] + x1[1])>>1; + r1 = (x0[0] - x1[0])>>1; + w0[0] = r0 + r2; + w0[1] = r1 + r3; + w1[2] = r0 - r2; + w1[3] = r3 - r1; + + r3 = bitrev12(bit++); + x0 = x + ((r3 ^ 0xfff)>>shift) -1; + x1 = x + (r3>>shift); + + r0 = x0[0] + x1[0]; + r1 = x1[1] - x0[1]; + + XPROD32( r0, r1, T[1], T[0], &r2, &r3 ); T+=step; + + r0 = (x0[1] + x1[1])>>1; + r1 = (x0[0] - x1[0])>>1; + w0[2] = r0 + r2; + w0[3] = r1 + r3; + w1[0] = r0 - r2; + w1[1] = r3 - r1; + + w0 += 4; + }while(T>shift) -1; + DATA_TYPE *x1 = x + (r3>>shift); + + REG_TYPE r0 = x0[0] + x1[0]; + REG_TYPE r1 = x1[1] - x0[1]; + + T-=step; XPROD32( r0, r1, T[0], T[1], &r2, &r3 ); + + w1 -= 4; + + r0 = (x0[1] + x1[1])>>1; + r1 = (x0[0] - x1[0])>>1; + w0[0] = r0 + r2; + w0[1] = r1 + r3; + w1[2] = r0 - r2; + w1[3] = r3 - r1; + + r3 = bitrev12(bit++); + x0 = x + ((r3 ^ 0xfff)>>shift) -1; + x1 = x + (r3>>shift); + + r0 = x0[0] + x1[0]; + r1 = x1[1] - x0[1]; + + T-=step; XPROD32( r0, r1, T[0], T[1], &r2, &r3 ); + + r0 = (x0[1] + x1[1])>>1; + r1 = (x0[0] - x1[0])>>1; + w0[2] = r0 + r2; + w0[3] = r1 + r3; + w1[0] = r0 - r2; + w1[1] = r3 - r1; + + w0 += 4; + }while(w0>1; + int n4=n>>2; + DATA_TYPE *iX; + DATA_TYPE *oX; + LOOKUP_T *T; + LOOKUP_T *V; + int shift; + int step; + + for (shift=6;!(n&(1<=in+n4); + do{ + oX-=4; + XPROD31( iX[4], iX[6], T[1], T[0], &oX[2], &oX[3] ); T-=step; + XPROD31( iX[0], iX[2], T[1], T[0], &oX[0], &oX[1] ); T-=step; + iX-=8; + }while(iX>=in); + + iX = in+n2-8; + oX = out+n2+n4; + T = sincos_lookup0; + + do{ + T+=step; XNPROD31( iX[6], iX[4], T[0], T[1], &oX[0], &oX[1] ); + T+=step; XNPROD31( iX[2], iX[0], T[0], T[1], &oX[2], &oX[3] ); + iX-=8; + oX+=4; + }while(iX>=in+n4); + do{ + T-=step; XNPROD31( iX[6], iX[4], T[1], T[0], &oX[0], &oX[1] ); + T-=step; XNPROD31( iX[2], iX[0], T[1], T[0], &oX[2], &oX[3] ); + iX-=8; + oX+=4; + }while(iX>=in); + + mdct_butterflies(out+n2,n2,shift); + mdct_bitreverse(out,n,step,shift); + + /* rotate + window */ + + step>>=2; + { + DATA_TYPE *oX1=out+n2+n4; + DATA_TYPE *oX2=out+n2+n4; + DATA_TYPE *iX =out; + + switch(step) { + default: { + T=(step>=4)?(sincos_lookup0+(step>>1)):sincos_lookup1; + do{ + oX1-=4; + XPROD31( iX[0], -iX[1], T[0], T[1], &oX1[3], &oX2[0] ); T+=step; + XPROD31( iX[2], -iX[3], T[0], T[1], &oX1[2], &oX2[1] ); T+=step; + XPROD31( iX[4], -iX[5], T[0], T[1], &oX1[1], &oX2[2] ); T+=step; + XPROD31( iX[6], -iX[7], T[0], T[1], &oX1[0], &oX2[3] ); T+=step; + oX2+=4; + iX+=8; + }while(iX>1; + t1 = (*T++)>>1; + do{ + oX1-=4; + + t0 += (v0 = (*V++)>>1); + t1 += (v1 = (*V++)>>1); + XPROD31( iX[0], -iX[1], t0, t1, &oX1[3], &oX2[0] ); + v0 += (t0 = (*T++)>>1); + v1 += (t1 = (*T++)>>1); + XPROD31( iX[2], -iX[3], v0, v1, &oX1[2], &oX2[1] ); + t0 += (v0 = (*V++)>>1); + t1 += (v1 = (*V++)>>1); + XPROD31( iX[4], -iX[5], t0, t1, &oX1[1], &oX2[2] ); + v0 += (t0 = (*T++)>>1); + v1 += (t1 = (*T++)>>1); + XPROD31( iX[6], -iX[7], v0, v1, &oX1[0], &oX2[3] ); + + oX2+=4; + iX+=8; + }while(iX>2); + t1 += (q1 = (v1-t1)>>2); + XPROD31( iX[0], -iX[1], t0, t1, &oX1[3], &oX2[0] ); + t0 = v0-q0; + t1 = v1-q1; + XPROD31( iX[2], -iX[3], t0, t1, &oX1[2], &oX2[1] ); + + t0 = *T++; + t1 = *T++; + v0 += (q0 = (t0-v0)>>2); + v1 += (q1 = (t1-v1)>>2); + XPROD31( iX[4], -iX[5], v0, v1, &oX1[1], &oX2[2] ); + v0 = t0-q0; + v1 = t1-q1; + XPROD31( iX[6], -iX[7], v0, v1, &oX1[0], &oX2[3] ); + + oX2+=4; + iX+=8; + }while(iXoX2); + } +} + diff --git a/media/libtremor/lib/tremor_registry.c b/media/libtremor/lib/tremor_registry.c new file mode 100644 index 000000000000..c0b5fec0cc32 --- /dev/null +++ b/media/libtremor/lib/tremor_registry.c @@ -0,0 +1,50 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * + * * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * + * * + ******************************************************************** + + function: registry for floor, res backends and channel mappings + + ********************************************************************/ + +#include "ivorbiscodec.h" +#include "codec_internal.h" +#include "registry.h" +#include "misc.h" + + +/* seems like major overkill now; the backend numbers will grow into + the infrastructure soon enough */ + +extern vorbis_func_floor floor0_exportbundle; +extern vorbis_func_floor floor1_exportbundle; +extern vorbis_func_residue residue0_exportbundle; +extern vorbis_func_residue residue1_exportbundle; +extern vorbis_func_residue residue2_exportbundle; +extern vorbis_func_mapping mapping0_exportbundle; + +vorbis_func_floor *_floor_P[]={ + &floor0_exportbundle, + &floor1_exportbundle, +}; + +vorbis_func_residue *_residue_P[]={ + &residue0_exportbundle, + &residue1_exportbundle, + &residue2_exportbundle, +}; + +vorbis_func_mapping *_mapping_P[]={ + &mapping0_exportbundle, +}; + + + diff --git a/media/libtremor/lib/tremor_res012.c b/media/libtremor/lib/tremor_res012.c new file mode 100644 index 000000000000..f036caaa48f6 --- /dev/null +++ b/media/libtremor/lib/tremor_res012.c @@ -0,0 +1,374 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * + * * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * + * * + ******************************************************************** + + function: residue backend 0, 1 and 2 implementation + + ********************************************************************/ + +#include +#include +#include +#include +#include "ivorbiscodec.h" +#include "codec_internal.h" +#include "registry.h" +#include "codebook.h" +#include "misc.h" +#include "os.h" +#include "block.h" + +typedef struct { + vorbis_info_residue0 *info; + int map; + + int parts; + int stages; + codebook *fullbooks; + codebook *phrasebook; + codebook ***partbooks; + + int partvals; + int **decodemap; + +} vorbis_look_residue0; + +void res0_free_info(vorbis_info_residue *i){ + vorbis_info_residue0 *info=(vorbis_info_residue0 *)i; + if(info){ + memset(info,0,sizeof(*info)); + _ogg_free(info); + } +} + +void res0_free_look(vorbis_look_residue *i){ + int j; + if(i){ + + vorbis_look_residue0 *look=(vorbis_look_residue0 *)i; + + for(j=0;jparts;j++) + if(look->partbooks[j])_ogg_free(look->partbooks[j]); + _ogg_free(look->partbooks); + for(j=0;jpartvals;j++) + _ogg_free(look->decodemap[j]); + _ogg_free(look->decodemap); + + memset(look,0,sizeof(*look)); + _ogg_free(look); + } +} + +static int ilog(unsigned int v){ + int ret=0; + while(v){ + ret++; + v>>=1; + } + return(ret); +} + +static int icount(unsigned int v){ + int ret=0; + while(v){ + ret+=v&1; + v>>=1; + } + return(ret); +} + +/* vorbis_info is for range checking */ +vorbis_info_residue *res0_unpack(vorbis_info *vi,oggpack_buffer *opb){ + int j,acc=0; + vorbis_info_residue0 *info=(vorbis_info_residue0 *)_ogg_calloc(1,sizeof(*info)); + codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; + + info->begin=oggpack_read(opb,24); + info->end=oggpack_read(opb,24); + info->grouping=oggpack_read(opb,24)+1; + info->partitions=oggpack_read(opb,6)+1; + info->groupbook=oggpack_read(opb,8); + + /* check for premature EOP */ + if(info->groupbook<0)goto errout; + + for(j=0;jpartitions;j++){ + int cascade=oggpack_read(opb,3); + int cflag=oggpack_read(opb,1); + if(cflag<0) goto errout; + if(cflag){ + int c=oggpack_read(opb,5); + if(c<0) goto errout; + cascade|=(c<<3); + } + info->secondstages[j]=cascade; + + acc+=icount(cascade); + } + for(j=0;jbooklist[j]=book; + } + + if(info->groupbook>=ci->books)goto errout; + for(j=0;jbooklist[j]>=ci->books)goto errout; + if(ci->book_param[info->booklist[j]]->maptype==0)goto errout; + } + + /* verify the phrasebook is not specifying an impossible or + inconsistent partitioning scheme. */ + /* modify the phrasebook ranging check from r16327; an early beta + encoder had a bug where it used an oversized phrasebook by + accident. These files should continue to be playable, but don't + allow an exploit */ + { + int entries = ci->book_param[info->groupbook]->entries; + int dim = ci->book_param[info->groupbook]->dim; + int partvals = 1; + if (dim<1) goto errout; + while(dim>0){ + partvals *= info->partitions; + if(partvals > entries) goto errout; + dim--; + } + info->partvals = partvals; + } + + return(info); + errout: + res0_free_info(info); + return(NULL); +} + +vorbis_look_residue *res0_look(vorbis_dsp_state *vd,vorbis_info_mode *vm, + vorbis_info_residue *vr){ + vorbis_info_residue0 *info=(vorbis_info_residue0 *)vr; + vorbis_look_residue0 *look=(vorbis_look_residue0 *)_ogg_calloc(1,sizeof(*look)); + codec_setup_info *ci=(codec_setup_info *)vd->vi->codec_setup; + + int j,k,acc=0; + int dim; + int maxstage=0; + look->info=info; + look->map=vm->mapping; + + look->parts=info->partitions; + look->fullbooks=ci->fullbooks; + look->phrasebook=ci->fullbooks+info->groupbook; + dim=look->phrasebook->dim; + + look->partbooks=(codebook ***)_ogg_calloc(look->parts,sizeof(*look->partbooks)); + + for(j=0;jparts;j++){ + int stages=ilog(info->secondstages[j]); + if(stages){ + if(stages>maxstage)maxstage=stages; + look->partbooks[j]=(codebook **)_ogg_calloc(stages,sizeof(*look->partbooks[j])); + for(k=0;ksecondstages[j]&(1<partbooks[j][k]=ci->fullbooks+info->booklist[acc++]; +#ifdef TRAIN_RES + look->training_data[k][j]=calloc(look->partbooks[j][k]->entries, + sizeof(***look->training_data)); +#endif + } + } + } + + look->partvals=look->parts; + for(j=1;jpartvals*=look->parts; + look->stages=maxstage; + look->decodemap=(int **)_ogg_malloc(look->partvals*sizeof(*look->decodemap)); + for(j=0;jpartvals;j++){ + long val=j; + long mult=look->partvals/look->parts; + look->decodemap[j]=(int *)_ogg_malloc(dim*sizeof(*look->decodemap[j])); + for(k=0;kparts; + look->decodemap[j][k]=deco; + } + } + + return(look); +} + + +/* a truncated packet here just means 'stop working'; it's not an error */ +static int _01inverse(vorbis_block *vb,vorbis_look_residue *vl, + ogg_int32_t **in,int ch, + long (*decodepart)(codebook *, ogg_int32_t *, + oggpack_buffer *,int,int)){ + + long i,j,k,l,s; + vorbis_look_residue0 *look=(vorbis_look_residue0 *)vl; + vorbis_info_residue0 *info=look->info; + + /* move all this setup out later */ + int samples_per_partition=info->grouping; + int partitions_per_word=look->phrasebook->dim; + int max=vb->pcmend>>1; + int end=(info->endend:max); + int n=end-info->begin; + + if(n>0){ + int partvals=n/samples_per_partition; + int partwords=(partvals+partitions_per_word-1)/partitions_per_word; + int ***partword=(int ***)alloca(ch*sizeof(*partword)); + + for(j=0;jstages;s++){ + + /* each loop decodes on partition codeword containing + partitions_pre_word partitions */ + for(i=0,l=0;iphrasebook,&vb->opb); + if(temp==-1 || temp>=info->partvals)goto eopbreak; + partword[j][l]=look->decodemap[temp]; + if(partword[j][l]==NULL)goto errout; + } + } + + /* now we decode residual values for the partitions */ + for(k=0;kbegin+i*samples_per_partition; + if(info->secondstages[partword[j][l][k]]&(1<partbooks[partword[j][l][k]][s]; + if(stagebook){ + if(decodepart(stagebook,in[j]+offset,&vb->opb, + samples_per_partition,-8)==-1)goto eopbreak; + } + } + } + } + } + } + errout: + eopbreak: + return(0); +} + +int res0_inverse(vorbis_block *vb,vorbis_look_residue *vl, + ogg_int32_t **in,int *nonzero,int ch){ + int i,used=0; + for(i=0;iinfo; + + /* move all this setup out later */ + int samples_per_partition=info->grouping; + int partitions_per_word=look->phrasebook->dim; + int max=(vb->pcmend*ch)>>1; + int end=(info->endend:max); + int n=end-info->begin; + + if(n>0){ + + int partvals=n/samples_per_partition; + int partwords=(partvals+partitions_per_word-1)/partitions_per_word; + int **partword=(int **)_vorbis_block_alloc(vb,partwords*sizeof(*partword)); + int beginoff=info->begin/ch; + + for(i=0;istages;s++){ + for(i=0,l=0;iphrasebook,&vb->opb); + if(temp==-1 || temp>=info->partvals)goto eopbreak; + partword[l]=look->decodemap[temp]; + if(partword[l]==NULL)goto errout; + } + + /* now we decode residual values for the partitions */ + for(k=0;ksecondstages[partword[l][k]]&(1<partbooks[partword[l][k]][s]; + + if(stagebook){ + if(vorbis_book_decodevv_add(stagebook,in, + i*samples_per_partition+beginoff,ch, + &vb->opb, + samples_per_partition,-8)==-1) + goto eopbreak; + } + } + } + } + } + errout: + eopbreak: + return(0); +} + + +vorbis_func_residue residue0_exportbundle={ + &res0_unpack, + &res0_look, + &res0_free_info, + &res0_free_look, + &res0_inverse +}; + +vorbis_func_residue residue1_exportbundle={ + &res0_unpack, + &res0_look, + &res0_free_info, + &res0_free_look, + &res1_inverse +}; + +vorbis_func_residue residue2_exportbundle={ + &res0_unpack, + &res0_look, + &res0_free_info, + &res0_free_look, + &res2_inverse +}; diff --git a/media/libtremor/lib/tremor_sharedbook.c b/media/libtremor/lib/tremor_sharedbook.c new file mode 100644 index 000000000000..188485e3ffb4 --- /dev/null +++ b/media/libtremor/lib/tremor_sharedbook.c @@ -0,0 +1,447 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * + * * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * + * * + ******************************************************************** + + function: basic shared codebook operations + + ********************************************************************/ + +#include +#include +#include +#include +#include "misc.h" +#include "ivorbiscodec.h" +#include "codebook.h" + +/**** pack/unpack helpers ******************************************/ +int _ilog(unsigned int v){ + int ret=0; + while(v){ + ret++; + v>>=1; + } + return(ret); +} + +/* 32 bit float (not IEEE; nonnormalized mantissa + + biased exponent) : neeeeeee eeemmmmm mmmmmmmm mmmmmmmm + Why not IEEE? It's just not that important here. */ + +#define VQ_FEXP 10 +#define VQ_FMAN 21 +#define VQ_FEXP_BIAS 768 /* bias toward values smaller than 1. */ + +static ogg_int32_t _float32_unpack(long val,int *point){ + long mant=val&0x1fffff; + int sign=val&0x80000000; + long exp =(val&0x7fe00000L)>>VQ_FMAN; + + exp-=(VQ_FMAN-1)+VQ_FEXP_BIAS; + + if(mant){ + while(!(mant&0x40000000)){ + mant<<=1; + exp-=1; + } + + if(sign)mant= -mant; + }else{ + sign=0; + exp=-9999; + } + + *point=exp; + return mant; +} + +/* given a list of word lengths, generate a list of codewords. Works + for length ordered or unordered, always assigns the lowest valued + codewords first. Extended to handle unused entries (length 0) */ +ogg_uint32_t *_make_words(long *l,long n,long sparsecount){ + long i,j,count=0; + ogg_uint32_t marker[33]; + ogg_uint32_t *r=(ogg_uint32_t *)_ogg_malloc((sparsecount?sparsecount:n)*sizeof(*r)); + memset(marker,0,sizeof(marker)); + + for(i=0;i0){ + ogg_uint32_t entry=marker[length]; + + /* when we claim a node for an entry, we also claim the nodes + below it (pruning off the imagined tree that may have dangled + from it) as well as blocking the use of any nodes directly + above for leaves */ + + /* update ourself */ + if(length<32 && (entry>>length)){ + /* error condition; the lengths must specify an overpopulated tree */ + _ogg_free(r); + return(NULL); + } + r[count++]=entry; + + /* Look to see if the next shorter marker points to the node + above. if so, update it and repeat. */ + { + for(j=length;j>0;j--){ + + if(marker[j]&1){ + /* have to jump branches */ + if(j==1) + marker[1]++; + else + marker[j]=marker[j-1]<<1; + break; /* invariant says next upper marker would already + have been moved if it was on the same path */ + } + marker[j]++; + } + } + + /* prune the tree; the implicit invariant says all the longer + markers were dangling from our just-taken node. Dangle them + from our *new* node. */ + for(j=length+1;j<33;j++) + if((marker[j]>>1) == entry){ + entry=marker[j]; + marker[j]=marker[j-1]<<1; + }else + break; + }else + if(sparsecount==0)count++; + } + + /* sanity check the huffman tree; an underpopulated tree must be + rejected. The only exception is the one-node pseudo-nil tree, + which appears to be underpopulated because the tree doesn't + really exist; there's only one possible 'codeword' or zero bits, + but the above tree-gen code doesn't mark that. */ + if(sparsecount != 1){ + for(i=1;i<33;i++) + if(marker[i] & (0xffffffffUL>>(32-i))){ + _ogg_free(r); + return(NULL); + } + } + + /* bitreverse the words because our bitwise packer/unpacker is LSb + endian */ + for(i=0,count=0;i>j)&1; + } + + if(sparsecount){ + if(l[i]) + r[count++]=temp; + }else + r[count++]=temp; + } + + return(r); +} + +/* there might be a straightforward one-line way to do the below + that's portable and totally safe against roundoff, but I haven't + thought of it. Therefore, we opt on the side of caution */ +long _book_maptype1_quantvals(const static_codebook *b){ + /* get us a starting hint, we'll polish it below */ + int bits=_ilog(b->entries); + int vals=b->entries>>((bits-1)*(b->dim-1)/b->dim); + + while(1){ + long acc=1; + long acc1=1; + int i; + for(i=0;idim;i++){ + acc*=vals; + acc1*=vals+1; + } + if(acc<=b->entries && acc1>b->entries){ + return(vals); + }else{ + if(acc>b->entries){ + vals--; + }else{ + vals++; + } + } + } +} + +/* different than what _book_unquantize does for mainline: + we repack the book in a fixed point format that shares the same + binary point. Upon first use, we can shift point if needed */ + +/* we need to deal with two map types: in map type 1, the values are + generated algorithmically (each column of the vector counts through + the values in the quant vector). in map type 2, all the values came + in in an explicit list. Both value lists must be unpacked */ + +ogg_int32_t *_book_unquantize(const static_codebook *b,int n,int *sparsemap, + int *maxpoint){ + long j,k,count=0; + if(b->maptype==1 || b->maptype==2){ + int quantvals; + int minpoint,delpoint; + ogg_int32_t mindel=_float32_unpack(b->q_min,&minpoint); + ogg_int32_t delta=_float32_unpack(b->q_delta,&delpoint); + ogg_int32_t *r=(ogg_int32_t *)_ogg_calloc(n*b->dim,sizeof(*r)); + int *rp=(int *)_ogg_calloc(n*b->dim,sizeof(*rp)); + + *maxpoint=minpoint; + + /* maptype 1 and 2 both use a quantized value vector, but + different sizes */ + switch(b->maptype){ + case 1: + /* most of the time, entries%dimensions == 0, but we need to be + well defined. We define that the possible vales at each + scalar is values == entries/dim. If entries%dim != 0, we'll + have 'too few' values (values*dimentries;j++){ + if((sparsemap && b->lengthlist[j]) || !sparsemap){ + ogg_int32_t last=0; + int lastpoint=0; + int indexdiv=1; + for(k=0;kdim;k++){ + int index= (j/indexdiv)%quantvals; + int point=0; + int val=VFLOAT_MULTI(delta,delpoint, + abs(b->quantlist[index]),&point); + + val=VFLOAT_ADD(mindel,minpoint,val,point,&point); + val=VFLOAT_ADD(last,lastpoint,val,point,&point); + + if(b->q_sequencep){ + last=val; + lastpoint=point; + } + + if(sparsemap){ + r[sparsemap[count]*b->dim+k]=val; + rp[sparsemap[count]*b->dim+k]=point; + }else{ + r[count*b->dim+k]=val; + rp[count*b->dim+k]=point; + } + if(*maxpointentries;j++){ + if((sparsemap && b->lengthlist[j]) || !sparsemap){ + ogg_int32_t last=0; + int lastpoint=0; + + for(k=0;kdim;k++){ + int point=0; + int val=VFLOAT_MULTI(delta,delpoint, + abs(b->quantlist[j*b->dim+k]),&point); + + val=VFLOAT_ADD(mindel,minpoint,val,point,&point); + val=VFLOAT_ADD(last,lastpoint,val,point,&point); + + if(b->q_sequencep){ + last=val; + lastpoint=point; + } + + if(sparsemap){ + r[sparsemap[count]*b->dim+k]=val; + rp[sparsemap[count]*b->dim+k]=point; + }else{ + r[count*b->dim+k]=val; + rp[count*b->dim+k]=point; + } + if(*maxpointdim;j++) + if(rp[j]<*maxpoint) + r[j]>>=*maxpoint-rp[j]; + + _ogg_free(rp); + return(r); + } + return(NULL); +} + +void vorbis_staticbook_destroy(static_codebook *b){ + if(b->quantlist)_ogg_free(b->quantlist); + if(b->lengthlist)_ogg_free(b->lengthlist); + memset(b,0,sizeof(*b)); + _ogg_free(b); +} + +void vorbis_book_clear(codebook *b){ + /* static book is not cleared; we're likely called on the lookup and + the static codebook belongs to the info struct */ + if(b->valuelist)_ogg_free(b->valuelist); + if(b->codelist)_ogg_free(b->codelist); + + if(b->dec_index)_ogg_free(b->dec_index); + if(b->dec_codelengths)_ogg_free(b->dec_codelengths); + if(b->dec_firsttable)_ogg_free(b->dec_firsttable); + + memset(b,0,sizeof(*b)); +} + +static ogg_uint32_t bitreverse(ogg_uint32_t x){ + x= ((x>>16)&0x0000ffffUL) | ((x<<16)&0xffff0000UL); + x= ((x>> 8)&0x00ff00ffUL) | ((x<< 8)&0xff00ff00UL); + x= ((x>> 4)&0x0f0f0f0fUL) | ((x<< 4)&0xf0f0f0f0UL); + x= ((x>> 2)&0x33333333UL) | ((x<< 2)&0xccccccccUL); + return((x>> 1)&0x55555555UL) | ((x<< 1)&0xaaaaaaaaUL); +} + +static int sort32a(const void *a,const void *b){ + return (**(ogg_uint32_t **)a>**(ogg_uint32_t **)b)- + (**(ogg_uint32_t **)a<**(ogg_uint32_t **)b); +} + +/* decode codebook arrangement is more heavily optimized than encode */ +int vorbis_book_init_decode(codebook *c,const static_codebook *s){ + int i,j,n=0,tabn; + int *sortindex; + memset(c,0,sizeof(*c)); + + /* count actually used entries */ + for(i=0;ientries;i++) + if(s->lengthlist[i]>0) + n++; + + c->entries=s->entries; + c->used_entries=n; + c->dim=s->dim; + + if(n>0){ + /* two different remappings go on here. + + First, we collapse the likely sparse codebook down only to + actually represented values/words. This collapsing needs to be + indexed as map-valueless books are used to encode original entry + positions as integers. + + Second, we reorder all vectors, including the entry index above, + by sorted bitreversed codeword to allow treeless decode. */ + + /* perform sort */ + ogg_uint32_t *codes=_make_words(s->lengthlist,s->entries,c->used_entries); + ogg_uint32_t **codep=(ogg_uint32_t **)alloca(sizeof(*codep)*n); + + if(codes==NULL)goto err_out; + + for(i=0;icodelist=(ogg_uint32_t *)_ogg_malloc(n*sizeof(*c->codelist)); + /* the index is a reverse index */ + for(i=0;icodelist[sortindex[i]]=codes[i]; + _ogg_free(codes); + + + + c->valuelist=_book_unquantize(s,n,sortindex,&c->binarypoint); + c->dec_index=(int *)_ogg_malloc(n*sizeof(*c->dec_index)); + + for(n=0,i=0;ientries;i++) + if(s->lengthlist[i]>0) + c->dec_index[sortindex[n++]]=i; + + c->dec_codelengths=(char *)_ogg_malloc(n*sizeof(*c->dec_codelengths)); + for(n=0,i=0;ientries;i++) + if(s->lengthlist[i]>0) + c->dec_codelengths[sortindex[n++]]=s->lengthlist[i]; + + c->dec_firsttablen=_ilog(c->used_entries)-4; /* this is magic */ + if(c->dec_firsttablen<5)c->dec_firsttablen=5; + if(c->dec_firsttablen>8)c->dec_firsttablen=8; + + tabn=1<dec_firsttablen; + c->dec_firsttable=(ogg_uint32_t *)_ogg_calloc(tabn,sizeof(*c->dec_firsttable)); + c->dec_maxlength=0; + + for(i=0;idec_maxlengthdec_codelengths[i]) + c->dec_maxlength=c->dec_codelengths[i]; + if(c->dec_codelengths[i]<=c->dec_firsttablen){ + ogg_uint32_t orig=bitreverse(c->codelist[i]); + for(j=0;j<(1<<(c->dec_firsttablen-c->dec_codelengths[i]));j++) + c->dec_firsttable[orig|(j<dec_codelengths[i])]=i+1; + } + } + + /* now fill in 'unused' entries in the firsttable with hi/lo search + hints for the non-direct-hits */ + { + ogg_uint32_t mask=0xfffffffeUL<<(31-c->dec_firsttablen); + long lo=0,hi=0; + + for(i=0;idec_firsttablen); + if(c->dec_firsttable[bitreverse(word)]==0){ + while((lo+1)codelist[lo+1]<=word)lo++; + while( hi=(c->codelist[hi]&mask))hi++; + + /* we only actually have 15 bits per hint to play with here. + In order to overflow gracefully (nothing breaks, efficiency + just drops), encode as the difference from the extremes. */ + { + unsigned long loval=lo; + unsigned long hival=n-hi; + + if(loval>0x7fff)loval=0x7fff; + if(hival>0x7fff)hival=0x7fff; + c->dec_firsttable[bitreverse(word)]= + 0x80000000UL | (loval<<15) | hival; + } + } + } + } + } + + return(0); + err_out: + vorbis_book_clear(c); + return(-1); +} + diff --git a/media/libtremor/lib/tremor_synthesis.c b/media/libtremor/lib/tremor_synthesis.c new file mode 100644 index 000000000000..c7680f6d02f2 --- /dev/null +++ b/media/libtremor/lib/tremor_synthesis.c @@ -0,0 +1,131 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * + * * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 * + * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * + * * + ******************************************************************** + + function: single-block PCM synthesis + last mod: $Id: synthesis.c,v 1.4 2003/03/29 03:07:21 xiphmont Exp $ + + ********************************************************************/ + +#include +#include +#include "ivorbiscodec.h" +#include "codec_internal.h" +#include "registry.h" +#include "misc.h" +#include "block.h" + +static int _vorbis_synthesis1(vorbis_block *vb,ogg_packet *op,int decodep){ + vorbis_dsp_state *vd= vb ? vb->vd : 0; + private_state *b= vd ? (private_state *)vd->backend_state: 0; + vorbis_info *vi= vd ? vd->vi : 0; + codec_setup_info *ci= vi ? (codec_setup_info *)vi->codec_setup : 0; + oggpack_buffer *opb=vb ? &vb->opb : 0; + int type,mode,i; + + if (!vd || !b || !vi || !ci || !opb) { + return OV_EBADPACKET; + } + + /* first things first. Make sure decode is ready */ + _vorbis_block_ripcord(vb); + oggpack_readinit(opb,op->packet,op->bytes); + + /* Check the packet type */ + if(oggpack_read(opb,1)!=0){ + /* Oops. This is not an audio data packet */ + return(OV_ENOTAUDIO); + } + + /* read our mode and pre/post windowsize */ + mode=oggpack_read(opb,b->modebits); + if(mode==-1)return(OV_EBADPACKET); + + vb->mode=mode; + if(!ci->mode_param[mode]){ + return(OV_EBADPACKET); + } + + vb->W=ci->mode_param[mode]->blockflag; + if(vb->W){ + vb->lW=oggpack_read(opb,1); + vb->nW=oggpack_read(opb,1); + if(vb->nW==-1) return(OV_EBADPACKET); + }else{ + vb->lW=0; + vb->nW=0; + } + + /* more setup */ + vb->granulepos=op->granulepos; + vb->sequence=op->packetno-3; /* first block is third packet */ + vb->eofflag=op->e_o_s; + + if(decodep){ + /* alloc pcm passback storage */ + vb->pcmend=ci->blocksizes[vb->W]; + vb->pcm=(ogg_int32_t **)_vorbis_block_alloc(vb,sizeof(*vb->pcm)*vi->channels); + for(i=0;ichannels;i++) + vb->pcm[i]=(ogg_int32_t *)_vorbis_block_alloc(vb,vb->pcmend*sizeof(*vb->pcm[i])); + + /* unpack_header enforces range checking */ + type=ci->map_type[ci->mode_param[mode]->mapping]; + + return(_mapping_P[type]->inverse(vb,b->mode[mode])); + }else{ + /* no pcm */ + vb->pcmend=0; + vb->pcm=NULL; + + return(0); + } +} + +int vorbis_synthesis(vorbis_block *vb,ogg_packet *op){ + return _vorbis_synthesis1(vb,op,1); +} + +/* used to track pcm position without actually performing decode. + Useful for sequential 'fast forward' */ +int vorbis_synthesis_trackonly(vorbis_block *vb,ogg_packet *op){ + return _vorbis_synthesis1(vb,op,0); +} + +long vorbis_packet_blocksize(vorbis_info *vi,ogg_packet *op){ + codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; + oggpack_buffer opb; + int mode; + + oggpack_readinit(&opb,op->packet,op->bytes); + + /* Check the packet type */ + if(oggpack_read(&opb,1)!=0){ + /* Oops. This is not an audio data packet */ + return(OV_ENOTAUDIO); + } + + { + int modebits=0; + int v=ci->modes; + while(v>1){ + modebits++; + v>>=1; + } + + /* read our mode and pre/post windowsize */ + mode=oggpack_read(&opb,modebits); + } + if(mode==-1 || !ci->mode_param[mode])return(OV_EBADPACKET); + return(ci->blocksizes[ci->mode_param[mode]->blockflag]); +} + + diff --git a/media/libtremor/lib/tremor_window.c b/media/libtremor/lib/tremor_window.c new file mode 100644 index 000000000000..006a1ee6b51a --- /dev/null +++ b/media/libtremor/lib/tremor_window.c @@ -0,0 +1,83 @@ +/******************************************************************** + * * + * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * + * * + * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * + * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * + * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * + * * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * + * * + ******************************************************************** + + function: window functions + + ********************************************************************/ + +#include +#include +#include "misc.h" +#include "window.h" +#include "window_lookup.h" + +const void *_vorbis_window(int type, int left){ + + switch(type){ + case 0: + + switch(left){ + case 32: + return vwin64; + case 64: + return vwin128; + case 128: + return vwin256; + case 256: + return vwin512; + case 512: + return vwin1024; + case 1024: + return vwin2048; + case 2048: + return vwin4096; + case 4096: + return vwin8192; + default: + return(0); + } + break; + default: + return(0); + } +} + +void _vorbis_apply_window(ogg_int32_t *d,const void *window_p[2], + long *blocksizes, + int lW,int W,int nW){ + + LOOKUP_T *window[2]={window_p[0],window_p[1]}; + long n=blocksizes[W]; + long ln=blocksizes[lW]; + long rn=blocksizes[nW]; + + long leftbegin=n/4-ln/4; + long leftend=leftbegin+ln/2; + + long rightbegin=n/2+n/4-rn/4; + long rightend=rightbegin+rn/2; + + int i,p; + + for(i=0;i + +static const LOOKUP_T vwin64[32] = { + X(0x001f0003), X(0x01168c98), X(0x030333c8), X(0x05dfe3a4), + X(0x09a49562), X(0x0e45df18), X(0x13b47ef2), X(0x19dcf676), + X(0x20a74d83), X(0x27f7137c), X(0x2fabb05a), X(0x37a1105a), + X(0x3fb0ab28), X(0x47b2dcd1), X(0x4f807bc6), X(0x56f48e70), + X(0x5dedfc79), X(0x64511653), X(0x6a08cfff), X(0x6f079328), + X(0x734796f4), X(0x76cab7f2), X(0x7999d6e8), X(0x7bc3cf9f), + X(0x7d5c20c1), X(0x7e7961df), X(0x7f33a567), X(0x7fa2e1d0), + X(0x7fdd78a5), X(0x7ff6ec6d), X(0x7ffed0e9), X(0x7ffffc3f), +}; + +static const LOOKUP_T vwin128[64] = { + X(0x0007c04d), X(0x0045bb89), X(0x00c18b87), X(0x017ae294), + X(0x02714a4e), X(0x03a4217a), X(0x05129952), X(0x06bbb24f), + X(0x089e38a1), X(0x0ab8c073), X(0x0d09a228), X(0x0f8ef6bd), + X(0x12469488), X(0x152e0c7a), X(0x1842a81c), X(0x1b81686d), + X(0x1ee705d9), X(0x226ff15d), X(0x26185705), X(0x29dc21cc), + X(0x2db700fe), X(0x31a46f08), X(0x359fb9c1), X(0x39a40c0c), + X(0x3dac78b6), X(0x41b40674), X(0x45b5bcb0), X(0x49acb109), + X(0x4d94152b), X(0x516744bd), X(0x5521d320), X(0x58bf98a5), + X(0x5c3cbef4), X(0x5f95cc5d), X(0x62c7add7), X(0x65cfbf64), + X(0x68abd2ba), X(0x6b5a3405), X(0x6dd9acab), X(0x7029840d), + X(0x72497e38), X(0x7439d8ac), X(0x75fb4532), X(0x778ee30a), + X(0x78f6367e), X(0x7a331f1a), X(0x7b47cccd), X(0x7c36b416), + X(0x7d028192), X(0x7dae0d18), X(0x7e3c4caa), X(0x7eb04763), + X(0x7f0d08a7), X(0x7f5593b7), X(0x7f8cd7d5), X(0x7fb5a513), + X(0x7fd2a1fc), X(0x7fe64212), X(0x7ff2bd4c), X(0x7ffa0890), + X(0x7ffdcf39), X(0x7fff6dac), X(0x7fffed01), X(0x7fffffc4), +}; + +static const LOOKUP_T vwin256[128] = { + X(0x0001f018), X(0x00117066), X(0x00306e9e), X(0x005ee5f1), + X(0x009ccf26), X(0x00ea208b), X(0x0146cdea), X(0x01b2c87f), + X(0x022dfedf), X(0x02b85ced), X(0x0351cbbd), X(0x03fa317f), + X(0x04b17167), X(0x05776b90), X(0x064bfcdc), X(0x072efedd), + X(0x082047b4), X(0x091fa9f1), X(0x0a2cf477), X(0x0b47f25d), + X(0x0c706ad2), X(0x0da620ff), X(0x0ee8d3ef), X(0x10383e75), + X(0x11941716), X(0x12fc0ff6), X(0x146fd6c8), X(0x15ef14c2), + X(0x17796e8e), X(0x190e844f), X(0x1aadf196), X(0x1c574d6e), + X(0x1e0a2a62), X(0x1fc61688), X(0x218a9b9c), X(0x23573f12), + X(0x252b823d), X(0x2706e269), X(0x28e8d913), X(0x2ad0dc0e), + X(0x2cbe5dc1), X(0x2eb0cd60), X(0x30a79733), X(0x32a224d5), + X(0x349fdd8b), X(0x36a02690), X(0x38a2636f), X(0x3aa5f65e), + X(0x3caa409e), X(0x3eaea2df), X(0x40b27da6), X(0x42b531b8), + X(0x44b62086), X(0x46b4ac99), X(0x48b03a05), X(0x4aa82ed5), + X(0x4c9bf37d), X(0x4e8af349), X(0x50749ccb), X(0x52586246), + X(0x5435ba1c), X(0x560c1f31), X(0x57db1152), X(0x59a21591), + X(0x5b60b6a3), X(0x5d168535), X(0x5ec31839), X(0x60660d36), + X(0x61ff0886), X(0x638db595), X(0x6511c717), X(0x668af734), + X(0x67f907b0), X(0x695bc207), X(0x6ab2f787), X(0x6bfe815a), + X(0x6d3e4090), X(0x6e721e16), X(0x6f9a0ab5), X(0x70b5fef8), + X(0x71c5fb16), X(0x72ca06cd), X(0x73c2313d), X(0x74ae90b2), + X(0x758f4275), X(0x76646a85), X(0x772e335c), X(0x77eccda0), + X(0x78a06fd7), X(0x79495613), X(0x79e7c19c), X(0x7a7bf894), + X(0x7b064596), X(0x7b86f757), X(0x7bfe6044), X(0x7c6cd615), + X(0x7cd2b16e), X(0x7d304d71), X(0x7d860756), X(0x7dd43e06), + X(0x7e1b51ad), X(0x7e5ba355), X(0x7e95947e), X(0x7ec986bb), + X(0x7ef7db4a), X(0x7f20f2b9), X(0x7f452c7f), X(0x7f64e6a7), + X(0x7f807d71), X(0x7f984aff), X(0x7faca700), X(0x7fbde662), + X(0x7fcc5b04), X(0x7fd85372), X(0x7fe21a99), X(0x7fe9f791), + X(0x7ff02d58), X(0x7ff4fa9e), X(0x7ff89990), X(0x7ffb3faa), + X(0x7ffd1d8b), X(0x7ffe5ecc), X(0x7fff29e0), X(0x7fff9ff3), + X(0x7fffdcd2), X(0x7ffff6d6), X(0x7ffffed0), X(0x7ffffffc), +}; + +static const LOOKUP_T vwin512[256] = { + X(0x00007c06), X(0x00045c32), X(0x000c1c62), X(0x0017bc4c), + X(0x00273b7a), X(0x003a9955), X(0x0051d51c), X(0x006cede7), + X(0x008be2a9), X(0x00aeb22a), X(0x00d55b0d), X(0x00ffdbcc), + X(0x012e32b6), X(0x01605df5), X(0x01965b85), X(0x01d02939), + X(0x020dc4ba), X(0x024f2b83), X(0x02945ae6), X(0x02dd5004), + X(0x032a07d3), X(0x037a7f19), X(0x03ceb26e), X(0x04269e37), + X(0x04823eab), X(0x04e18fcc), X(0x05448d6d), X(0x05ab3329), + X(0x06157c68), X(0x0683645e), X(0x06f4e607), X(0x0769fc25), + X(0x07e2a146), X(0x085ecfbc), X(0x08de819f), X(0x0961b0cc), + X(0x09e856e3), X(0x0a726d46), X(0x0affed1d), X(0x0b90cf4c), + X(0x0c250c79), X(0x0cbc9d0b), X(0x0d577926), X(0x0df598aa), + X(0x0e96f337), X(0x0f3b8026), X(0x0fe3368f), X(0x108e0d42), + X(0x113bfaca), X(0x11ecf56b), X(0x12a0f324), X(0x1357e9ac), + X(0x1411ce70), X(0x14ce9698), X(0x158e3702), X(0x1650a444), + X(0x1715d2aa), X(0x17ddb638), X(0x18a842aa), X(0x19756b72), + X(0x1a4523b9), X(0x1b175e62), X(0x1bec0e04), X(0x1cc324f0), + X(0x1d9c9532), X(0x1e78508a), X(0x1f564876), X(0x20366e2e), + X(0x2118b2a2), X(0x21fd0681), X(0x22e35a37), X(0x23cb9dee), + X(0x24b5c18e), X(0x25a1b4c0), X(0x268f66f1), X(0x277ec74e), + X(0x286fc4cc), X(0x29624e23), X(0x2a5651d7), X(0x2b4bbe34), + X(0x2c428150), X(0x2d3a8913), X(0x2e33c332), X(0x2f2e1d35), + X(0x30298478), X(0x3125e62d), X(0x32232f61), X(0x33214cfc), + X(0x34202bc2), X(0x351fb85a), X(0x361fdf4f), X(0x37208d10), + X(0x3821adf7), X(0x39232e49), X(0x3a24fa3c), X(0x3b26fdf6), + X(0x3c292593), X(0x3d2b5d29), X(0x3e2d90c8), X(0x3f2fac7f), + X(0x40319c5f), X(0x41334c81), X(0x4234a905), X(0x43359e16), + X(0x443617f3), X(0x453602eb), X(0x46354b65), X(0x4733dde1), + X(0x4831a6ff), X(0x492e937f), X(0x4a2a9045), X(0x4b258a5f), + X(0x4c1f6f06), X(0x4d182ba2), X(0x4e0fadce), X(0x4f05e35b), + X(0x4ffaba53), X(0x50ee20fd), X(0x51e005e1), X(0x52d057ca), + X(0x53bf05ca), X(0x54abff3b), X(0x559733c7), X(0x56809365), + X(0x57680e62), X(0x584d955d), X(0x59311952), X(0x5a128b96), + X(0x5af1dddd), X(0x5bcf023a), X(0x5ca9eb27), X(0x5d828b81), + X(0x5e58d68d), X(0x5f2cbffc), X(0x5ffe3be9), X(0x60cd3edf), + X(0x6199bdda), X(0x6263ae45), X(0x632b0602), X(0x63efbb66), + X(0x64b1c53f), X(0x65711ad0), X(0x662db3d7), X(0x66e7888d), + X(0x679e91a5), X(0x6852c84e), X(0x69042635), X(0x69b2a582), + X(0x6a5e40dd), X(0x6b06f36c), X(0x6bacb8d2), X(0x6c4f8d30), + X(0x6cef6d26), X(0x6d8c55d4), X(0x6e2644d4), X(0x6ebd3840), + X(0x6f512ead), X(0x6fe2272e), X(0x7070214f), X(0x70fb1d17), + X(0x71831b06), X(0x72081c16), X(0x728a21b5), X(0x73092dc8), + X(0x738542a6), X(0x73fe631b), X(0x74749261), X(0x74e7d421), + X(0x75582c72), X(0x75c59fd5), X(0x76303333), X(0x7697ebdd), + X(0x76fccf85), X(0x775ee443), X(0x77be308a), X(0x781abb2e), + X(0x78748b59), X(0x78cba88e), X(0x79201aa7), X(0x7971e9cd), + X(0x79c11e79), X(0x7a0dc170), X(0x7a57dbc2), X(0x7a9f76c1), + X(0x7ae49c07), X(0x7b27556b), X(0x7b67ad02), X(0x7ba5ad1b), + X(0x7be1603a), X(0x7c1ad118), X(0x7c520a9e), X(0x7c8717e1), + X(0x7cba0421), X(0x7ceadac3), X(0x7d19a74f), X(0x7d46756e), + X(0x7d7150e5), X(0x7d9a4592), X(0x7dc15f69), X(0x7de6aa71), + X(0x7e0a32c0), X(0x7e2c0479), X(0x7e4c2bc7), X(0x7e6ab4db), + X(0x7e87abe9), X(0x7ea31d24), X(0x7ebd14be), X(0x7ed59edd), + X(0x7eecc7a3), X(0x7f029b21), X(0x7f17255a), X(0x7f2a723f), + X(0x7f3c8daa), X(0x7f4d835d), X(0x7f5d5f00), X(0x7f6c2c1b), + X(0x7f79f617), X(0x7f86c83a), X(0x7f92ada2), X(0x7f9db146), + X(0x7fa7ddf3), X(0x7fb13e46), X(0x7fb9dcb0), X(0x7fc1c36c), + X(0x7fc8fc83), X(0x7fcf91c7), X(0x7fd58cd2), X(0x7fdaf702), + X(0x7fdfd979), X(0x7fe43d1c), X(0x7fe82a8b), X(0x7febaa29), + X(0x7feec412), X(0x7ff1801c), X(0x7ff3e5d6), X(0x7ff5fc86), + X(0x7ff7cb29), X(0x7ff9586f), X(0x7ffaaaba), X(0x7ffbc81e), + X(0x7ffcb660), X(0x7ffd7af3), X(0x7ffe1afa), X(0x7ffe9b42), + X(0x7fff0047), X(0x7fff4e2f), X(0x7fff88c9), X(0x7fffb390), + X(0x7fffd1a6), X(0x7fffe5d7), X(0x7ffff296), X(0x7ffff9fd), + X(0x7ffffdcd), X(0x7fffff6d), X(0x7fffffed), X(0x7fffffff), +}; + +static const LOOKUP_T vwin1024[512] = { + X(0x00001f02), X(0x0001170e), X(0x00030724), X(0x0005ef40), + X(0x0009cf59), X(0x000ea767), X(0x0014775e), X(0x001b3f2e), + X(0x0022fec8), X(0x002bb618), X(0x00356508), X(0x00400b81), + X(0x004ba968), X(0x00583ea0), X(0x0065cb0a), X(0x00744e84), + X(0x0083c8ea), X(0x00943a14), X(0x00a5a1da), X(0x00b80010), + X(0x00cb5488), X(0x00df9f10), X(0x00f4df76), X(0x010b1584), + X(0x01224101), X(0x013a61b2), X(0x01537759), X(0x016d81b6), + X(0x01888087), X(0x01a47385), X(0x01c15a69), X(0x01df34e6), + X(0x01fe02b1), X(0x021dc377), X(0x023e76e7), X(0x02601ca9), + X(0x0282b466), X(0x02a63dc1), X(0x02cab85d), X(0x02f023d6), + X(0x03167fcb), X(0x033dcbd3), X(0x03660783), X(0x038f3270), + X(0x03b94c29), X(0x03e4543a), X(0x04104a2e), X(0x043d2d8b), + X(0x046afdd5), X(0x0499ba8c), X(0x04c9632d), X(0x04f9f734), + X(0x052b7615), X(0x055ddf46), X(0x05913237), X(0x05c56e53), + X(0x05fa9306), X(0x06309fb6), X(0x066793c5), X(0x069f6e93), + X(0x06d82f7c), X(0x0711d5d9), X(0x074c60fe), X(0x0787d03d), + X(0x07c422e4), X(0x0801583e), X(0x083f6f91), X(0x087e681f), + X(0x08be4129), X(0x08fef9ea), X(0x0940919a), X(0x0983076d), + X(0x09c65a92), X(0x0a0a8a38), X(0x0a4f9585), X(0x0a957b9f), + X(0x0adc3ba7), X(0x0b23d4b9), X(0x0b6c45ee), X(0x0bb58e5a), + X(0x0bffad0f), X(0x0c4aa11a), X(0x0c966982), X(0x0ce3054d), + X(0x0d30737b), X(0x0d7eb308), X(0x0dcdc2eb), X(0x0e1da21a), + X(0x0e6e4f83), X(0x0ebfca11), X(0x0f1210ad), X(0x0f652238), + X(0x0fb8fd91), X(0x100da192), X(0x10630d11), X(0x10b93ee0), + X(0x111035cb), X(0x1167f09a), X(0x11c06e13), X(0x1219acf5), + X(0x1273abfb), X(0x12ce69db), X(0x1329e54a), X(0x13861cf3), + X(0x13e30f80), X(0x1440bb97), X(0x149f1fd8), X(0x14fe3ade), + X(0x155e0b40), X(0x15be8f92), X(0x161fc662), X(0x1681ae38), + X(0x16e4459b), X(0x17478b0b), X(0x17ab7d03), X(0x181019fb), + X(0x18756067), X(0x18db4eb3), X(0x1941e34a), X(0x19a91c92), + X(0x1a10f8ea), X(0x1a7976af), X(0x1ae29439), X(0x1b4c4fda), + X(0x1bb6a7e2), X(0x1c219a9a), X(0x1c8d2649), X(0x1cf9492e), + X(0x1d660188), X(0x1dd34d8e), X(0x1e412b74), X(0x1eaf996a), + X(0x1f1e959b), X(0x1f8e1e2f), X(0x1ffe3146), X(0x206ecd01), + X(0x20dfef78), X(0x215196c2), X(0x21c3c0f0), X(0x22366c10), + X(0x22a9962a), X(0x231d3d45), X(0x23915f60), X(0x2405fa7a), + X(0x247b0c8c), X(0x24f09389), X(0x25668d65), X(0x25dcf80c), + X(0x2653d167), X(0x26cb175e), X(0x2742c7d0), X(0x27bae09e), + X(0x28335fa2), X(0x28ac42b3), X(0x292587a5), X(0x299f2c48), + X(0x2a192e69), X(0x2a938bd1), X(0x2b0e4247), X(0x2b894f8d), + X(0x2c04b164), X(0x2c806588), X(0x2cfc69b2), X(0x2d78bb9a), + X(0x2df558f4), X(0x2e723f6f), X(0x2eef6cbb), X(0x2f6cde83), + X(0x2fea9270), X(0x30688627), X(0x30e6b74e), X(0x31652385), + X(0x31e3c86b), X(0x3262a39e), X(0x32e1b2b8), X(0x3360f352), + X(0x33e06303), X(0x345fff5e), X(0x34dfc5f8), X(0x355fb462), + X(0x35dfc82a), X(0x365ffee0), X(0x36e0560f), X(0x3760cb43), + X(0x37e15c05), X(0x386205df), X(0x38e2c657), X(0x39639af5), + X(0x39e4813e), X(0x3a6576b6), X(0x3ae678e3), X(0x3b678547), + X(0x3be89965), X(0x3c69b2c1), X(0x3ceacedc), X(0x3d6beb37), + X(0x3ded0557), X(0x3e6e1abb), X(0x3eef28e6), X(0x3f702d5a), + X(0x3ff1259a), X(0x40720f29), X(0x40f2e789), X(0x4173ac3f), + X(0x41f45ad0), X(0x4274f0c2), X(0x42f56b9a), X(0x4375c8e0), + X(0x43f6061d), X(0x447620db), X(0x44f616a5), X(0x4575e509), + X(0x45f58994), X(0x467501d6), X(0x46f44b62), X(0x477363cb), + X(0x47f248a6), X(0x4870f78e), X(0x48ef6e1a), X(0x496da9e8), + X(0x49eba897), X(0x4a6967c8), X(0x4ae6e521), X(0x4b641e47), + X(0x4be110e5), X(0x4c5dbaa7), X(0x4cda193f), X(0x4d562a5f), + X(0x4dd1ebbd), X(0x4e4d5b15), X(0x4ec87623), X(0x4f433aa9), + X(0x4fbda66c), X(0x5037b734), X(0x50b16acf), X(0x512abf0e), + X(0x51a3b1c5), X(0x521c40ce), X(0x52946a06), X(0x530c2b50), + X(0x53838292), X(0x53fa6db8), X(0x5470eab3), X(0x54e6f776), + X(0x555c91fc), X(0x55d1b844), X(0x56466851), X(0x56baa02f), + X(0x572e5deb), X(0x57a19f98), X(0x58146352), X(0x5886a737), + X(0x58f8696d), X(0x5969a81c), X(0x59da6177), X(0x5a4a93b4), + X(0x5aba3d0f), X(0x5b295bcb), X(0x5b97ee30), X(0x5c05f28d), + X(0x5c736738), X(0x5ce04a8d), X(0x5d4c9aed), X(0x5db856c1), + X(0x5e237c78), X(0x5e8e0a89), X(0x5ef7ff6f), X(0x5f6159b0), + X(0x5fca17d4), X(0x6032386e), X(0x6099ba15), X(0x61009b69), + X(0x6166db11), X(0x61cc77b9), X(0x62317017), X(0x6295c2e7), + X(0x62f96eec), X(0x635c72f1), X(0x63becdc8), X(0x64207e4b), + X(0x6481835a), X(0x64e1dbde), X(0x654186c8), X(0x65a0830e), + X(0x65fecfb1), X(0x665c6bb7), X(0x66b95630), X(0x67158e30), + X(0x677112d7), X(0x67cbe34b), X(0x6825feb9), X(0x687f6456), + X(0x68d81361), X(0x69300b1e), X(0x69874ada), X(0x69ddd1ea), + X(0x6a339fab), X(0x6a88b382), X(0x6add0cdb), X(0x6b30ab2a), + X(0x6b838dec), X(0x6bd5b4a6), X(0x6c271ee2), X(0x6c77cc36), + X(0x6cc7bc3d), X(0x6d16ee9b), X(0x6d6562fb), X(0x6db31911), + X(0x6e001099), X(0x6e4c4955), X(0x6e97c311), X(0x6ee27d9f), + X(0x6f2c78d9), X(0x6f75b4a2), X(0x6fbe30e4), X(0x7005ed91), + X(0x704ceaa1), X(0x70932816), X(0x70d8a5f8), X(0x711d6457), + X(0x7161634b), X(0x71a4a2f3), X(0x71e72375), X(0x7228e500), + X(0x7269e7c8), X(0x72aa2c0a), X(0x72e9b209), X(0x73287a12), + X(0x73668476), X(0x73a3d18f), X(0x73e061bc), X(0x741c3566), + X(0x74574cfa), X(0x7491a8ee), X(0x74cb49be), X(0x75042fec), + X(0x753c5c03), X(0x7573ce92), X(0x75aa882f), X(0x75e08979), + X(0x7615d313), X(0x764a65a7), X(0x767e41e5), X(0x76b16884), + X(0x76e3da40), X(0x771597dc), X(0x7746a221), X(0x7776f9dd), + X(0x77a69fe6), X(0x77d59514), X(0x7803da49), X(0x7831706a), + X(0x785e5861), X(0x788a9320), X(0x78b6219c), X(0x78e104cf), + X(0x790b3dbb), X(0x7934cd64), X(0x795db4d5), X(0x7985f51d), + X(0x79ad8f50), X(0x79d48486), X(0x79fad5de), X(0x7a208478), + X(0x7a45917b), X(0x7a69fe12), X(0x7a8dcb6c), X(0x7ab0fabb), + X(0x7ad38d36), X(0x7af5841a), X(0x7b16e0a3), X(0x7b37a416), + X(0x7b57cfb8), X(0x7b7764d4), X(0x7b9664b6), X(0x7bb4d0b0), + X(0x7bd2aa14), X(0x7beff23b), X(0x7c0caa7f), X(0x7c28d43c), + X(0x7c4470d2), X(0x7c5f81a5), X(0x7c7a081a), X(0x7c940598), + X(0x7cad7b8b), X(0x7cc66b5e), X(0x7cded680), X(0x7cf6be64), + X(0x7d0e247b), X(0x7d250a3c), X(0x7d3b711c), X(0x7d515a95), + X(0x7d66c822), X(0x7d7bbb3c), X(0x7d903563), X(0x7da43814), + X(0x7db7c4d0), X(0x7dcadd16), X(0x7ddd826a), X(0x7defb64d), + X(0x7e017a44), X(0x7e12cfd3), X(0x7e23b87f), X(0x7e3435cc), + X(0x7e444943), X(0x7e53f467), X(0x7e6338c0), X(0x7e7217d5), + X(0x7e80932b), X(0x7e8eac49), X(0x7e9c64b7), X(0x7ea9bdf8), + X(0x7eb6b994), X(0x7ec35910), X(0x7ecf9def), X(0x7edb89b6), + X(0x7ee71de9), X(0x7ef25c09), X(0x7efd4598), X(0x7f07dc16), + X(0x7f122103), X(0x7f1c15dc), X(0x7f25bc1f), X(0x7f2f1547), + X(0x7f3822cd), X(0x7f40e62b), X(0x7f4960d6), X(0x7f519443), + X(0x7f5981e7), X(0x7f612b31), X(0x7f689191), X(0x7f6fb674), + X(0x7f769b45), X(0x7f7d416c), X(0x7f83aa51), X(0x7f89d757), + X(0x7f8fc9df), X(0x7f958348), X(0x7f9b04ef), X(0x7fa0502e), + X(0x7fa56659), X(0x7faa48c7), X(0x7faef8c7), X(0x7fb377a7), + X(0x7fb7c6b3), X(0x7fbbe732), X(0x7fbfda67), X(0x7fc3a196), + X(0x7fc73dfa), X(0x7fcab0ce), X(0x7fcdfb4a), X(0x7fd11ea0), + X(0x7fd41c00), X(0x7fd6f496), X(0x7fd9a989), X(0x7fdc3bff), + X(0x7fdead17), X(0x7fe0fdee), X(0x7fe32f9d), X(0x7fe54337), + X(0x7fe739ce), X(0x7fe9146c), X(0x7fead41b), X(0x7fec79dd), + X(0x7fee06b2), X(0x7fef7b94), X(0x7ff0d97b), X(0x7ff22158), + X(0x7ff35417), X(0x7ff472a3), X(0x7ff57de0), X(0x7ff676ac), + X(0x7ff75de3), X(0x7ff8345a), X(0x7ff8fae4), X(0x7ff9b24b), + X(0x7ffa5b58), X(0x7ffaf6cd), X(0x7ffb8568), X(0x7ffc07e2), + X(0x7ffc7eed), X(0x7ffceb38), X(0x7ffd4d6d), X(0x7ffda631), + X(0x7ffdf621), X(0x7ffe3dd8), X(0x7ffe7dea), X(0x7ffeb6e7), + X(0x7ffee959), X(0x7fff15c4), X(0x7fff3ca9), X(0x7fff5e80), + X(0x7fff7bc0), X(0x7fff94d6), X(0x7fffaa2d), X(0x7fffbc29), + X(0x7fffcb29), X(0x7fffd786), X(0x7fffe195), X(0x7fffe9a3), + X(0x7fffeffa), X(0x7ffff4dd), X(0x7ffff889), X(0x7ffffb37), + X(0x7ffffd1a), X(0x7ffffe5d), X(0x7fffff29), X(0x7fffffa0), + X(0x7fffffdd), X(0x7ffffff7), X(0x7fffffff), X(0x7fffffff), +}; + +static const LOOKUP_T vwin2048[1024] = { + X(0x000007c0), X(0x000045c4), X(0x0000c1ca), X(0x00017bd3), + X(0x000273de), X(0x0003a9eb), X(0x00051df9), X(0x0006d007), + X(0x0008c014), X(0x000aee1e), X(0x000d5a25), X(0x00100428), + X(0x0012ec23), X(0x00161216), X(0x001975fe), X(0x001d17da), + X(0x0020f7a8), X(0x00251564), X(0x0029710c), X(0x002e0a9e), + X(0x0032e217), X(0x0037f773), X(0x003d4ab0), X(0x0042dbca), + X(0x0048aabe), X(0x004eb788), X(0x00550224), X(0x005b8a8f), + X(0x006250c5), X(0x006954c1), X(0x0070967e), X(0x007815f9), + X(0x007fd32c), X(0x0087ce13), X(0x009006a9), X(0x00987ce9), + X(0x00a130cc), X(0x00aa224f), X(0x00b3516b), X(0x00bcbe1a), + X(0x00c66856), X(0x00d0501a), X(0x00da755f), X(0x00e4d81f), + X(0x00ef7853), X(0x00fa55f4), X(0x010570fc), X(0x0110c963), + X(0x011c5f22), X(0x01283232), X(0x0134428c), X(0x01409027), + X(0x014d1afb), X(0x0159e302), X(0x0166e831), X(0x01742a82), + X(0x0181a9ec), X(0x018f6665), X(0x019d5fe5), X(0x01ab9663), + X(0x01ba09d6), X(0x01c8ba34), X(0x01d7a775), X(0x01e6d18d), + X(0x01f63873), X(0x0205dc1e), X(0x0215bc82), X(0x0225d997), + X(0x02363350), X(0x0246c9a3), X(0x02579c86), X(0x0268abed), + X(0x0279f7cc), X(0x028b801a), X(0x029d44c9), X(0x02af45ce), + X(0x02c1831d), X(0x02d3fcaa), X(0x02e6b269), X(0x02f9a44c), + X(0x030cd248), X(0x03203c4f), X(0x0333e255), X(0x0347c44b), + X(0x035be225), X(0x03703bd5), X(0x0384d14d), X(0x0399a280), + X(0x03aeaf5e), X(0x03c3f7d9), X(0x03d97be4), X(0x03ef3b6e), + X(0x0405366a), X(0x041b6cc8), X(0x0431de78), X(0x04488b6c), + X(0x045f7393), X(0x047696dd), X(0x048df53b), X(0x04a58e9b), + X(0x04bd62ee), X(0x04d57223), X(0x04edbc28), X(0x050640ed), + X(0x051f0060), X(0x0537fa70), X(0x05512f0a), X(0x056a9e1e), + X(0x05844798), X(0x059e2b67), X(0x05b84978), X(0x05d2a1b8), + X(0x05ed3414), X(0x06080079), X(0x062306d3), X(0x063e470f), + X(0x0659c119), X(0x067574dd), X(0x06916247), X(0x06ad8941), + X(0x06c9e9b8), X(0x06e68397), X(0x070356c8), X(0x07206336), + X(0x073da8cb), X(0x075b2772), X(0x0778df15), X(0x0796cf9c), + X(0x07b4f8f3), X(0x07d35b01), X(0x07f1f5b1), X(0x0810c8eb), + X(0x082fd497), X(0x084f189e), X(0x086e94e9), X(0x088e495e), + X(0x08ae35e6), X(0x08ce5a68), X(0x08eeb6cc), X(0x090f4af8), + X(0x093016d3), X(0x09511a44), X(0x09725530), X(0x0993c77f), + X(0x09b57115), X(0x09d751d8), X(0x09f969ae), X(0x0a1bb87c), + X(0x0a3e3e26), X(0x0a60fa91), X(0x0a83eda2), X(0x0aa7173c), + X(0x0aca7743), X(0x0aee0d9b), X(0x0b11da28), X(0x0b35dccc), + X(0x0b5a156a), X(0x0b7e83e5), X(0x0ba3281f), X(0x0bc801fa), + X(0x0bed1159), X(0x0c12561c), X(0x0c37d025), X(0x0c5d7f55), + X(0x0c83638d), X(0x0ca97cae), X(0x0ccfca97), X(0x0cf64d2a), + X(0x0d1d0444), X(0x0d43efc7), X(0x0d6b0f92), X(0x0d926383), + X(0x0db9eb79), X(0x0de1a752), X(0x0e0996ee), X(0x0e31ba29), + X(0x0e5a10e2), X(0x0e829af6), X(0x0eab5841), X(0x0ed448a2), + X(0x0efd6bf4), X(0x0f26c214), X(0x0f504ade), X(0x0f7a062e), + X(0x0fa3f3df), X(0x0fce13cd), X(0x0ff865d2), X(0x1022e9ca), + X(0x104d9f8e), X(0x107886f9), X(0x10a39fe5), X(0x10ceea2c), + X(0x10fa65a6), X(0x1126122d), X(0x1151ef9a), X(0x117dfdc5), + X(0x11aa3c87), X(0x11d6abb6), X(0x12034b2c), X(0x12301ac0), + X(0x125d1a48), X(0x128a499b), X(0x12b7a891), X(0x12e536ff), + X(0x1312f4bb), X(0x1340e19c), X(0x136efd75), X(0x139d481e), + X(0x13cbc16a), X(0x13fa692f), X(0x14293f40), X(0x14584371), + X(0x14877597), X(0x14b6d585), X(0x14e6630d), X(0x15161e04), + X(0x1546063b), X(0x15761b85), X(0x15a65db3), X(0x15d6cc99), + X(0x16076806), X(0x16382fcd), X(0x166923bf), X(0x169a43ab), + X(0x16cb8f62), X(0x16fd06b5), X(0x172ea973), X(0x1760776b), + X(0x1792706e), X(0x17c49449), X(0x17f6e2cb), X(0x18295bc3), + X(0x185bfeff), X(0x188ecc4c), X(0x18c1c379), X(0x18f4e452), + X(0x19282ea4), X(0x195ba23c), X(0x198f3ee6), X(0x19c3046e), + X(0x19f6f2a1), X(0x1a2b094a), X(0x1a5f4833), X(0x1a93af28), + X(0x1ac83df3), X(0x1afcf460), X(0x1b31d237), X(0x1b66d744), + X(0x1b9c034e), X(0x1bd15621), X(0x1c06cf84), X(0x1c3c6f40), + X(0x1c72351e), X(0x1ca820e6), X(0x1cde3260), X(0x1d146953), + X(0x1d4ac587), X(0x1d8146c3), X(0x1db7eccd), X(0x1deeb76c), + X(0x1e25a667), X(0x1e5cb982), X(0x1e93f085), X(0x1ecb4b33), + X(0x1f02c953), X(0x1f3a6aaa), X(0x1f722efb), X(0x1faa160b), + X(0x1fe21f9e), X(0x201a4b79), X(0x2052995d), X(0x208b0910), + X(0x20c39a53), X(0x20fc4cea), X(0x21352097), X(0x216e151c), + X(0x21a72a3a), X(0x21e05fb5), X(0x2219b54d), X(0x22532ac3), + X(0x228cbfd8), X(0x22c6744d), X(0x230047e2), X(0x233a3a58), + X(0x23744b6d), X(0x23ae7ae3), X(0x23e8c878), X(0x242333ec), + X(0x245dbcfd), X(0x24986369), X(0x24d326f1), X(0x250e0750), + X(0x25490446), X(0x25841d90), X(0x25bf52ec), X(0x25faa417), + X(0x263610cd), X(0x267198cc), X(0x26ad3bcf), X(0x26e8f994), + X(0x2724d1d6), X(0x2760c451), X(0x279cd0c0), X(0x27d8f6e0), + X(0x2815366a), X(0x28518f1b), X(0x288e00ac), X(0x28ca8ad8), + X(0x29072d5a), X(0x2943e7eb), X(0x2980ba45), X(0x29bda422), + X(0x29faa53c), X(0x2a37bd4a), X(0x2a74ec07), X(0x2ab2312b), + X(0x2aef8c6f), X(0x2b2cfd8b), X(0x2b6a8437), X(0x2ba8202c), + X(0x2be5d120), X(0x2c2396cc), X(0x2c6170e7), X(0x2c9f5f29), + X(0x2cdd6147), X(0x2d1b76fa), X(0x2d599ff7), X(0x2d97dbf5), + X(0x2dd62aab), X(0x2e148bcf), X(0x2e52ff16), X(0x2e918436), + X(0x2ed01ae5), X(0x2f0ec2d9), X(0x2f4d7bc6), X(0x2f8c4562), + X(0x2fcb1f62), X(0x300a097a), X(0x3049035f), X(0x30880cc6), + X(0x30c72563), X(0x31064cea), X(0x3145830f), X(0x3184c786), + X(0x31c41a03), X(0x32037a39), X(0x3242e7dc), X(0x3282629f), + X(0x32c1ea36), X(0x33017e53), X(0x33411ea9), X(0x3380caec), + X(0x33c082ce), X(0x34004602), X(0x34401439), X(0x347fed27), + X(0x34bfd07e), X(0x34ffbdf0), X(0x353fb52e), X(0x357fb5ec), + X(0x35bfbfda), X(0x35ffd2aa), X(0x363fee0f), X(0x368011b9), + X(0x36c03d5a), X(0x370070a4), X(0x3740ab48), X(0x3780ecf7), + X(0x37c13562), X(0x3801843a), X(0x3841d931), X(0x388233f7), + X(0x38c2943d), X(0x3902f9b4), X(0x3943640d), X(0x3983d2f8), + X(0x39c44626), X(0x3a04bd48), X(0x3a45380e), X(0x3a85b62a), + X(0x3ac6374a), X(0x3b06bb20), X(0x3b47415c), X(0x3b87c9ae), + X(0x3bc853c7), X(0x3c08df57), X(0x3c496c0f), X(0x3c89f99f), + X(0x3cca87b6), X(0x3d0b1605), X(0x3d4ba43d), X(0x3d8c320e), + X(0x3dccbf27), X(0x3e0d4b3a), X(0x3e4dd5f6), X(0x3e8e5f0c), + X(0x3ecee62b), X(0x3f0f6b05), X(0x3f4fed49), X(0x3f906ca8), + X(0x3fd0e8d2), X(0x40116177), X(0x4051d648), X(0x409246f6), + X(0x40d2b330), X(0x41131aa7), X(0x41537d0c), X(0x4193da10), + X(0x41d43162), X(0x421482b4), X(0x4254cdb7), X(0x4295121b), + X(0x42d54f91), X(0x431585ca), X(0x4355b477), X(0x4395db49), + X(0x43d5f9f1), X(0x44161021), X(0x44561d8a), X(0x449621dd), + X(0x44d61ccc), X(0x45160e08), X(0x4555f544), X(0x4595d230), + X(0x45d5a47f), X(0x46156be3), X(0x4655280e), X(0x4694d8b2), + X(0x46d47d82), X(0x4714162f), X(0x4753a26d), X(0x479321ef), + X(0x47d29466), X(0x4811f987), X(0x48515104), X(0x48909a91), + X(0x48cfd5e1), X(0x490f02a7), X(0x494e2098), X(0x498d2f66), + X(0x49cc2ec7), X(0x4a0b1e6f), X(0x4a49fe11), X(0x4a88cd62), + X(0x4ac78c18), X(0x4b0639e6), X(0x4b44d683), X(0x4b8361a2), + X(0x4bc1dafa), X(0x4c004241), X(0x4c3e972c), X(0x4c7cd970), + X(0x4cbb08c5), X(0x4cf924e1), X(0x4d372d7a), X(0x4d752247), + X(0x4db30300), X(0x4df0cf5a), X(0x4e2e870f), X(0x4e6c29d6), + X(0x4ea9b766), X(0x4ee72f78), X(0x4f2491c4), X(0x4f61de02), + X(0x4f9f13ec), X(0x4fdc333b), X(0x50193ba8), X(0x50562ced), + X(0x509306c3), X(0x50cfc8e5), X(0x510c730d), X(0x514904f6), + X(0x51857e5a), X(0x51c1def5), X(0x51fe2682), X(0x523a54bc), + X(0x52766961), X(0x52b2642c), X(0x52ee44d9), X(0x532a0b26), + X(0x5365b6d0), X(0x53a14793), X(0x53dcbd2f), X(0x54181760), + X(0x545355e5), X(0x548e787d), X(0x54c97ee6), X(0x550468e1), + X(0x553f362c), X(0x5579e687), X(0x55b479b3), X(0x55eeef70), + X(0x5629477f), X(0x566381a1), X(0x569d9d97), X(0x56d79b24), + X(0x57117a0a), X(0x574b3a0a), X(0x5784dae9), X(0x57be5c69), + X(0x57f7be4d), X(0x5831005a), X(0x586a2254), X(0x58a32400), + X(0x58dc0522), X(0x5914c57f), X(0x594d64de), X(0x5985e305), + X(0x59be3fba), X(0x59f67ac3), X(0x5a2e93e9), X(0x5a668af2), + X(0x5a9e5fa6), X(0x5ad611ce), X(0x5b0da133), X(0x5b450d9d), + X(0x5b7c56d7), X(0x5bb37ca9), X(0x5bea7ede), X(0x5c215d41), + X(0x5c58179d), X(0x5c8eadbe), X(0x5cc51f6f), X(0x5cfb6c7c), + X(0x5d3194b2), X(0x5d6797de), X(0x5d9d75cf), X(0x5dd32e51), + X(0x5e08c132), X(0x5e3e2e43), X(0x5e737551), X(0x5ea8962d), + X(0x5edd90a7), X(0x5f12648e), X(0x5f4711b4), X(0x5f7b97ea), + X(0x5faff702), X(0x5fe42ece), X(0x60183f20), X(0x604c27cc), + X(0x607fe8a6), X(0x60b38180), X(0x60e6f22f), X(0x611a3a89), + X(0x614d5a62), X(0x61805190), X(0x61b31fe9), X(0x61e5c545), + X(0x62184179), X(0x624a945d), X(0x627cbdca), X(0x62aebd98), + X(0x62e0939f), X(0x63123fba), X(0x6343c1c1), X(0x6375198f), + X(0x63a646ff), X(0x63d749ec), X(0x64082232), X(0x6438cfad), + X(0x64695238), X(0x6499a9b3), X(0x64c9d5f9), X(0x64f9d6ea), + X(0x6529ac63), X(0x65595643), X(0x6588d46a), X(0x65b826b8), + X(0x65e74d0e), X(0x6616474b), X(0x66451552), X(0x6673b704), + X(0x66a22c44), X(0x66d074f4), X(0x66fe90f8), X(0x672c8033), + X(0x675a428a), X(0x6787d7e1), X(0x67b5401f), X(0x67e27b27), + X(0x680f88e1), X(0x683c6934), X(0x68691c05), X(0x6895a13e), + X(0x68c1f8c7), X(0x68ee2287), X(0x691a1e68), X(0x6945ec54), + X(0x69718c35), X(0x699cfdf5), X(0x69c8417f), X(0x69f356c0), + X(0x6a1e3da3), X(0x6a48f615), X(0x6a738002), X(0x6a9ddb5a), + X(0x6ac80808), X(0x6af205fd), X(0x6b1bd526), X(0x6b457575), + X(0x6b6ee6d8), X(0x6b982940), X(0x6bc13c9f), X(0x6bea20e5), + X(0x6c12d605), X(0x6c3b5bf1), X(0x6c63b29c), X(0x6c8bd9fb), + X(0x6cb3d200), X(0x6cdb9aa0), X(0x6d0333d0), X(0x6d2a9d86), + X(0x6d51d7b7), X(0x6d78e25a), X(0x6d9fbd67), X(0x6dc668d3), + X(0x6dece498), X(0x6e1330ad), X(0x6e394d0c), X(0x6e5f39ae), + X(0x6e84f68d), X(0x6eaa83a2), X(0x6ecfe0ea), X(0x6ef50e5e), + X(0x6f1a0bfc), X(0x6f3ed9bf), X(0x6f6377a4), X(0x6f87e5a8), + X(0x6fac23c9), X(0x6fd03206), X(0x6ff4105c), X(0x7017becc), + X(0x703b3d54), X(0x705e8bf5), X(0x7081aaaf), X(0x70a49984), + X(0x70c75874), X(0x70e9e783), X(0x710c46b2), X(0x712e7605), + X(0x7150757f), X(0x71724523), X(0x7193e4f6), X(0x71b554fd), + X(0x71d6953e), X(0x71f7a5bd), X(0x72188681), X(0x72393792), + X(0x7259b8f5), X(0x727a0ab2), X(0x729a2cd2), X(0x72ba1f5d), + X(0x72d9e25c), X(0x72f975d8), X(0x7318d9db), X(0x73380e6f), + X(0x735713a0), X(0x7375e978), X(0x73949003), X(0x73b3074c), + X(0x73d14f61), X(0x73ef684f), X(0x740d5222), X(0x742b0ce9), + X(0x744898b1), X(0x7465f589), X(0x74832381), X(0x74a022a8), + X(0x74bcf30e), X(0x74d994c3), X(0x74f607d8), X(0x75124c5f), + X(0x752e6268), X(0x754a4a05), X(0x7566034b), X(0x75818e4a), + X(0x759ceb16), X(0x75b819c4), X(0x75d31a66), X(0x75eded12), + X(0x760891dc), X(0x762308da), X(0x763d5221), X(0x76576dc8), + X(0x76715be4), X(0x768b1c8c), X(0x76a4afd9), X(0x76be15e0), + X(0x76d74ebb), X(0x76f05a82), X(0x7709394d), X(0x7721eb35), + X(0x773a7054), X(0x7752c8c4), X(0x776af49f), X(0x7782f400), + X(0x779ac701), X(0x77b26dbd), X(0x77c9e851), X(0x77e136d8), + X(0x77f8596f), X(0x780f5032), X(0x78261b3f), X(0x783cbab2), + X(0x78532eaa), X(0x78697745), X(0x787f94a0), X(0x789586db), + X(0x78ab4e15), X(0x78c0ea6d), X(0x78d65c03), X(0x78eba2f7), + X(0x7900bf68), X(0x7915b179), X(0x792a7949), X(0x793f16fb), + X(0x79538aaf), X(0x7967d488), X(0x797bf4a8), X(0x798feb31), + X(0x79a3b846), X(0x79b75c0a), X(0x79cad6a1), X(0x79de282e), + X(0x79f150d5), X(0x7a0450bb), X(0x7a172803), X(0x7a29d6d3), + X(0x7a3c5d50), X(0x7a4ebb9f), X(0x7a60f1e6), X(0x7a73004a), + X(0x7a84e6f2), X(0x7a96a604), X(0x7aa83da7), X(0x7ab9ae01), + X(0x7acaf73a), X(0x7adc1979), X(0x7aed14e6), X(0x7afde9a8), + X(0x7b0e97e8), X(0x7b1f1fcd), X(0x7b2f8182), X(0x7b3fbd2d), + X(0x7b4fd2f9), X(0x7b5fc30f), X(0x7b6f8d98), X(0x7b7f32bd), + X(0x7b8eb2a9), X(0x7b9e0d85), X(0x7bad437d), X(0x7bbc54b9), + X(0x7bcb4166), X(0x7bda09ae), X(0x7be8adbc), X(0x7bf72dbc), + X(0x7c0589d8), X(0x7c13c23d), X(0x7c21d716), X(0x7c2fc88f), + X(0x7c3d96d5), X(0x7c4b4214), X(0x7c58ca78), X(0x7c66302d), + X(0x7c737362), X(0x7c809443), X(0x7c8d92fc), X(0x7c9a6fbc), + X(0x7ca72aaf), X(0x7cb3c404), X(0x7cc03be8), X(0x7ccc9288), + X(0x7cd8c814), X(0x7ce4dcb9), X(0x7cf0d0a5), X(0x7cfca406), + X(0x7d08570c), X(0x7d13e9e5), X(0x7d1f5cbf), X(0x7d2aafca), + X(0x7d35e335), X(0x7d40f72e), X(0x7d4bebe4), X(0x7d56c188), + X(0x7d617848), X(0x7d6c1054), X(0x7d7689db), X(0x7d80e50e), + X(0x7d8b221b), X(0x7d954133), X(0x7d9f4286), X(0x7da92643), + X(0x7db2ec9b), X(0x7dbc95bd), X(0x7dc621da), X(0x7dcf9123), + X(0x7dd8e3c6), X(0x7de219f6), X(0x7deb33e2), X(0x7df431ba), + X(0x7dfd13af), X(0x7e05d9f2), X(0x7e0e84b4), X(0x7e171424), + X(0x7e1f8874), X(0x7e27e1d4), X(0x7e302074), X(0x7e384487), + X(0x7e404e3c), X(0x7e483dc4), X(0x7e501350), X(0x7e57cf11), + X(0x7e5f7138), X(0x7e66f9f4), X(0x7e6e6979), X(0x7e75bff5), + X(0x7e7cfd9a), X(0x7e842298), X(0x7e8b2f22), X(0x7e922366), + X(0x7e98ff97), X(0x7e9fc3e4), X(0x7ea6707f), X(0x7ead0598), + X(0x7eb38360), X(0x7eb9ea07), X(0x7ec039bf), X(0x7ec672b7), + X(0x7ecc9521), X(0x7ed2a12c), X(0x7ed8970a), X(0x7ede76ea), + X(0x7ee440fd), X(0x7ee9f573), X(0x7eef947d), X(0x7ef51e4b), + X(0x7efa930d), X(0x7efff2f2), X(0x7f053e2b), X(0x7f0a74e8), + X(0x7f0f9758), X(0x7f14a5ac), X(0x7f19a013), X(0x7f1e86bc), + X(0x7f2359d8), X(0x7f281995), X(0x7f2cc623), X(0x7f315fb1), + X(0x7f35e66e), X(0x7f3a5a8a), X(0x7f3ebc33), X(0x7f430b98), + X(0x7f4748e7), X(0x7f4b7450), X(0x7f4f8e01), X(0x7f539629), + X(0x7f578cf5), X(0x7f5b7293), X(0x7f5f4732), X(0x7f630b00), + X(0x7f66be2b), X(0x7f6a60df), X(0x7f6df34b), X(0x7f71759b), + X(0x7f74e7fe), X(0x7f784aa0), X(0x7f7b9daf), X(0x7f7ee156), + X(0x7f8215c3), X(0x7f853b22), X(0x7f88519f), X(0x7f8b5967), + X(0x7f8e52a6), X(0x7f913d87), X(0x7f941a36), X(0x7f96e8df), + X(0x7f99a9ad), X(0x7f9c5ccb), X(0x7f9f0265), X(0x7fa19aa5), + X(0x7fa425b5), X(0x7fa6a3c1), X(0x7fa914f3), X(0x7fab7974), + X(0x7fadd16f), X(0x7fb01d0d), X(0x7fb25c78), X(0x7fb48fd9), + X(0x7fb6b75a), X(0x7fb8d323), X(0x7fbae35d), X(0x7fbce831), + X(0x7fbee1c7), X(0x7fc0d047), X(0x7fc2b3d9), X(0x7fc48ca5), + X(0x7fc65ad3), X(0x7fc81e88), X(0x7fc9d7ee), X(0x7fcb872a), + X(0x7fcd2c63), X(0x7fcec7bf), X(0x7fd05966), X(0x7fd1e17c), + X(0x7fd36027), X(0x7fd4d58d), X(0x7fd641d3), X(0x7fd7a51e), + X(0x7fd8ff94), X(0x7fda5157), X(0x7fdb9a8e), X(0x7fdcdb5b), + X(0x7fde13e2), X(0x7fdf4448), X(0x7fe06caf), X(0x7fe18d3b), + X(0x7fe2a60e), X(0x7fe3b74b), X(0x7fe4c114), X(0x7fe5c38b), + X(0x7fe6bed2), X(0x7fe7b30a), X(0x7fe8a055), X(0x7fe986d4), + X(0x7fea66a7), X(0x7feb3ff0), X(0x7fec12cd), X(0x7fecdf5f), + X(0x7feda5c5), X(0x7fee6620), X(0x7fef208d), X(0x7fefd52c), + X(0x7ff0841c), X(0x7ff12d7a), X(0x7ff1d164), X(0x7ff26ff9), + X(0x7ff30955), X(0x7ff39d96), X(0x7ff42cd9), X(0x7ff4b739), + X(0x7ff53cd4), X(0x7ff5bdc5), X(0x7ff63a28), X(0x7ff6b217), + X(0x7ff725af), X(0x7ff7950a), X(0x7ff80043), X(0x7ff86773), + X(0x7ff8cab4), X(0x7ff92a21), X(0x7ff985d1), X(0x7ff9dddf), + X(0x7ffa3262), X(0x7ffa8374), X(0x7ffad12c), X(0x7ffb1ba1), + X(0x7ffb62ec), X(0x7ffba723), X(0x7ffbe85c), X(0x7ffc26b0), + X(0x7ffc6233), X(0x7ffc9afb), X(0x7ffcd11e), X(0x7ffd04b1), + X(0x7ffd35c9), X(0x7ffd647b), X(0x7ffd90da), X(0x7ffdbafa), + X(0x7ffde2f0), X(0x7ffe08ce), X(0x7ffe2ca7), X(0x7ffe4e8e), + X(0x7ffe6e95), X(0x7ffe8cce), X(0x7ffea94a), X(0x7ffec41b), + X(0x7ffedd52), X(0x7ffef4ff), X(0x7fff0b33), X(0x7fff1ffd), + X(0x7fff336e), X(0x7fff4593), X(0x7fff567d), X(0x7fff663a), + X(0x7fff74d8), X(0x7fff8265), X(0x7fff8eee), X(0x7fff9a81), + X(0x7fffa52b), X(0x7fffaef8), X(0x7fffb7f5), X(0x7fffc02d), + X(0x7fffc7ab), X(0x7fffce7c), X(0x7fffd4a9), X(0x7fffda3e), + X(0x7fffdf44), X(0x7fffe3c6), X(0x7fffe7cc), X(0x7fffeb60), + X(0x7fffee8a), X(0x7ffff153), X(0x7ffff3c4), X(0x7ffff5e3), + X(0x7ffff7b8), X(0x7ffff94b), X(0x7ffffaa1), X(0x7ffffbc1), + X(0x7ffffcb2), X(0x7ffffd78), X(0x7ffffe19), X(0x7ffffe9a), + X(0x7ffffeff), X(0x7fffff4e), X(0x7fffff89), X(0x7fffffb3), + X(0x7fffffd2), X(0x7fffffe6), X(0x7ffffff3), X(0x7ffffffa), + X(0x7ffffffe), X(0x7fffffff), X(0x7fffffff), X(0x7fffffff), +}; + +static const LOOKUP_T vwin4096[2048] = { + X(0x000001f0), X(0x00001171), X(0x00003072), X(0x00005ef5), + X(0x00009cf8), X(0x0000ea7c), X(0x00014780), X(0x0001b405), + X(0x0002300b), X(0x0002bb91), X(0x00035698), X(0x0004011e), + X(0x0004bb25), X(0x000584ac), X(0x00065db3), X(0x0007463a), + X(0x00083e41), X(0x000945c7), X(0x000a5ccc), X(0x000b8350), + X(0x000cb954), X(0x000dfed7), X(0x000f53d8), X(0x0010b857), + X(0x00122c55), X(0x0013afd1), X(0x001542ca), X(0x0016e541), + X(0x00189735), X(0x001a58a7), X(0x001c2995), X(0x001e09ff), + X(0x001ff9e6), X(0x0021f948), X(0x00240826), X(0x00262680), + X(0x00285454), X(0x002a91a3), X(0x002cde6c), X(0x002f3aaf), + X(0x0031a66b), X(0x003421a0), X(0x0036ac4f), X(0x00394675), + X(0x003bf014), X(0x003ea92a), X(0x004171b7), X(0x004449bb), + X(0x00473135), X(0x004a2824), X(0x004d2e8a), X(0x00504463), + X(0x005369b2), X(0x00569e74), X(0x0059e2aa), X(0x005d3652), + X(0x0060996d), X(0x00640bf9), X(0x00678df7), X(0x006b1f66), + X(0x006ec045), X(0x00727093), X(0x00763051), X(0x0079ff7d), + X(0x007dde16), X(0x0081cc1d), X(0x0085c991), X(0x0089d671), + X(0x008df2bc), X(0x00921e71), X(0x00965991), X(0x009aa41a), + X(0x009efe0c), X(0x00a36766), X(0x00a7e028), X(0x00ac6850), + X(0x00b0ffde), X(0x00b5a6d1), X(0x00ba5d28), X(0x00bf22e4), + X(0x00c3f802), X(0x00c8dc83), X(0x00cdd065), X(0x00d2d3a8), + X(0x00d7e64a), X(0x00dd084c), X(0x00e239ac), X(0x00e77a69), + X(0x00ecca83), X(0x00f229f9), X(0x00f798ca), X(0x00fd16f5), + X(0x0102a479), X(0x01084155), X(0x010ded89), X(0x0113a913), + X(0x011973f3), X(0x011f4e27), X(0x012537af), X(0x012b308a), + X(0x013138b7), X(0x01375035), X(0x013d7702), X(0x0143ad1f), + X(0x0149f289), X(0x01504741), X(0x0156ab44), X(0x015d1e92), + X(0x0163a12a), X(0x016a330b), X(0x0170d433), X(0x017784a3), + X(0x017e4458), X(0x01851351), X(0x018bf18e), X(0x0192df0d), + X(0x0199dbcd), X(0x01a0e7cd), X(0x01a8030c), X(0x01af2d89), + X(0x01b66743), X(0x01bdb038), X(0x01c50867), X(0x01cc6fd0), + X(0x01d3e670), X(0x01db6c47), X(0x01e30153), X(0x01eaa593), + X(0x01f25907), X(0x01fa1bac), X(0x0201ed81), X(0x0209ce86), + X(0x0211beb8), X(0x0219be17), X(0x0221cca2), X(0x0229ea56), + X(0x02321733), X(0x023a5337), X(0x02429e60), X(0x024af8af), + X(0x02536220), X(0x025bdab3), X(0x02646267), X(0x026cf93a), + X(0x02759f2a), X(0x027e5436), X(0x0287185d), X(0x028feb9d), + X(0x0298cdf4), X(0x02a1bf62), X(0x02aabfe5), X(0x02b3cf7b), + X(0x02bcee23), X(0x02c61bdb), X(0x02cf58a2), X(0x02d8a475), + X(0x02e1ff55), X(0x02eb693e), X(0x02f4e230), X(0x02fe6a29), + X(0x03080127), X(0x0311a729), X(0x031b5c2d), X(0x03252031), + X(0x032ef334), X(0x0338d534), X(0x0342c630), X(0x034cc625), + X(0x0356d512), X(0x0360f2f6), X(0x036b1fce), X(0x03755b99), + X(0x037fa655), X(0x038a0001), X(0x0394689a), X(0x039ee020), + X(0x03a9668f), X(0x03b3fbe6), X(0x03bea024), X(0x03c95347), + X(0x03d4154d), X(0x03dee633), X(0x03e9c5f9), X(0x03f4b49b), + X(0x03ffb219), X(0x040abe71), X(0x0415d9a0), X(0x042103a5), + X(0x042c3c7d), X(0x04378428), X(0x0442daa2), X(0x044e3fea), + X(0x0459b3fd), X(0x046536db), X(0x0470c880), X(0x047c68eb), + X(0x0488181a), X(0x0493d60b), X(0x049fa2bc), X(0x04ab7e2a), + X(0x04b76854), X(0x04c36137), X(0x04cf68d1), X(0x04db7f21), + X(0x04e7a424), X(0x04f3d7d8), X(0x05001a3b), X(0x050c6b4a), + X(0x0518cb04), X(0x05253966), X(0x0531b66e), X(0x053e421a), + X(0x054adc68), X(0x05578555), X(0x05643cdf), X(0x05710304), + X(0x057dd7c1), X(0x058abb15), X(0x0597acfd), X(0x05a4ad76), + X(0x05b1bc7f), X(0x05beda14), X(0x05cc0635), X(0x05d940dd), + X(0x05e68a0b), X(0x05f3e1bd), X(0x060147f0), X(0x060ebca1), + X(0x061c3fcf), X(0x0629d176), X(0x06377194), X(0x06452027), + X(0x0652dd2c), X(0x0660a8a2), X(0x066e8284), X(0x067c6ad1), + X(0x068a6186), X(0x069866a1), X(0x06a67a1e), X(0x06b49bfc), + X(0x06c2cc38), X(0x06d10acf), X(0x06df57bf), X(0x06edb304), + X(0x06fc1c9d), X(0x070a9487), X(0x07191abe), X(0x0727af40), + X(0x0736520b), X(0x0745031c), X(0x0753c270), X(0x07629004), + X(0x07716bd6), X(0x078055e2), X(0x078f4e26), X(0x079e549f), + X(0x07ad694b), X(0x07bc8c26), X(0x07cbbd2e), X(0x07dafc5f), + X(0x07ea49b7), X(0x07f9a533), X(0x08090ed1), X(0x0818868c), + X(0x08280c62), X(0x0837a051), X(0x08474255), X(0x0856f26b), + X(0x0866b091), X(0x08767cc3), X(0x088656fe), X(0x08963f3f), + X(0x08a63584), X(0x08b639c8), X(0x08c64c0a), X(0x08d66c45), + X(0x08e69a77), X(0x08f6d69d), X(0x090720b3), X(0x091778b7), + X(0x0927dea5), X(0x0938527a), X(0x0948d433), X(0x095963cc), + X(0x096a0143), X(0x097aac94), X(0x098b65bb), X(0x099c2cb6), + X(0x09ad0182), X(0x09bde41a), X(0x09ced47d), X(0x09dfd2a5), + X(0x09f0de90), X(0x0a01f83b), X(0x0a131fa3), X(0x0a2454c3), + X(0x0a359798), X(0x0a46e820), X(0x0a584656), X(0x0a69b237), + X(0x0a7b2bc0), X(0x0a8cb2ec), X(0x0a9e47ba), X(0x0aafea24), + X(0x0ac19a29), X(0x0ad357c3), X(0x0ae522ef), X(0x0af6fbab), + X(0x0b08e1f1), X(0x0b1ad5c0), X(0x0b2cd712), X(0x0b3ee5e5), + X(0x0b510234), X(0x0b632bfd), X(0x0b75633b), X(0x0b87a7eb), + X(0x0b99fa08), X(0x0bac5990), X(0x0bbec67e), X(0x0bd140cf), + X(0x0be3c87e), X(0x0bf65d89), X(0x0c08ffeb), X(0x0c1bafa1), + X(0x0c2e6ca6), X(0x0c4136f6), X(0x0c540e8f), X(0x0c66f36c), + X(0x0c79e588), X(0x0c8ce4e1), X(0x0c9ff172), X(0x0cb30b37), + X(0x0cc6322c), X(0x0cd9664d), X(0x0ceca797), X(0x0cfff605), + X(0x0d135193), X(0x0d26ba3d), X(0x0d3a2fff), X(0x0d4db2d5), + X(0x0d6142ba), X(0x0d74dfac), X(0x0d8889a5), X(0x0d9c40a1), + X(0x0db0049d), X(0x0dc3d593), X(0x0dd7b380), X(0x0deb9e60), + X(0x0dff962f), X(0x0e139ae7), X(0x0e27ac85), X(0x0e3bcb05), + X(0x0e4ff662), X(0x0e642e98), X(0x0e7873a2), X(0x0e8cc57d), + X(0x0ea12423), X(0x0eb58f91), X(0x0eca07c2), X(0x0ede8cb1), + X(0x0ef31e5b), X(0x0f07bcba), X(0x0f1c67cb), X(0x0f311f88), + X(0x0f45e3ee), X(0x0f5ab4f7), X(0x0f6f92a0), X(0x0f847ce3), + X(0x0f9973bc), X(0x0fae7726), X(0x0fc3871e), X(0x0fd8a39d), + X(0x0fedcca1), X(0x10030223), X(0x1018441f), X(0x102d9291), + X(0x1042ed74), X(0x105854c3), X(0x106dc879), X(0x10834892), + X(0x1098d508), X(0x10ae6dd8), X(0x10c412fc), X(0x10d9c46f), + X(0x10ef822d), X(0x11054c30), X(0x111b2274), X(0x113104f5), + X(0x1146f3ac), X(0x115cee95), X(0x1172f5ab), X(0x118908e9), + X(0x119f284a), X(0x11b553ca), X(0x11cb8b62), X(0x11e1cf0f), + X(0x11f81ecb), X(0x120e7a90), X(0x1224e25a), X(0x123b5624), + X(0x1251d5e9), X(0x126861a3), X(0x127ef94e), X(0x12959ce3), + X(0x12ac4c5f), X(0x12c307bb), X(0x12d9cef2), X(0x12f0a200), + X(0x130780df), X(0x131e6b8a), X(0x133561fa), X(0x134c642c), + X(0x1363721a), X(0x137a8bbe), X(0x1391b113), X(0x13a8e214), + X(0x13c01eba), X(0x13d76702), X(0x13eebae5), X(0x14061a5e), + X(0x141d8567), X(0x1434fbfb), X(0x144c7e14), X(0x14640bae), + X(0x147ba4c1), X(0x14934949), X(0x14aaf941), X(0x14c2b4a2), + X(0x14da7b67), X(0x14f24d8a), X(0x150a2b06), X(0x152213d5), + X(0x153a07f1), X(0x15520755), X(0x156a11fb), X(0x158227dd), + X(0x159a48f5), X(0x15b2753d), X(0x15caacb1), X(0x15e2ef49), + X(0x15fb3d01), X(0x161395d2), X(0x162bf9b6), X(0x164468a8), + X(0x165ce2a1), X(0x1675679c), X(0x168df793), X(0x16a69280), + X(0x16bf385c), X(0x16d7e922), X(0x16f0a4cc), X(0x17096b54), + X(0x17223cb4), X(0x173b18e5), X(0x1753ffe2), X(0x176cf1a5), + X(0x1785ee27), X(0x179ef562), X(0x17b80750), X(0x17d123eb), + X(0x17ea4b2d), X(0x18037d10), X(0x181cb98d), X(0x1836009e), + X(0x184f523c), X(0x1868ae63), X(0x1882150a), X(0x189b862c), + X(0x18b501c4), X(0x18ce87c9), X(0x18e81836), X(0x1901b305), + X(0x191b582f), X(0x193507ad), X(0x194ec17a), X(0x1968858f), + X(0x198253e5), X(0x199c2c75), X(0x19b60f3a), X(0x19cffc2d), + X(0x19e9f347), X(0x1a03f482), X(0x1a1dffd7), X(0x1a381540), + X(0x1a5234b5), X(0x1a6c5e31), X(0x1a8691ac), X(0x1aa0cf21), + X(0x1abb1687), X(0x1ad567da), X(0x1aefc311), X(0x1b0a2826), + X(0x1b249712), X(0x1b3f0fd0), X(0x1b599257), X(0x1b741ea1), + X(0x1b8eb4a7), X(0x1ba95462), X(0x1bc3fdcd), X(0x1bdeb0de), + X(0x1bf96d91), X(0x1c1433dd), X(0x1c2f03bc), X(0x1c49dd27), + X(0x1c64c017), X(0x1c7fac85), X(0x1c9aa269), X(0x1cb5a1be), + X(0x1cd0aa7c), X(0x1cebbc9c), X(0x1d06d816), X(0x1d21fce4), + X(0x1d3d2aff), X(0x1d586260), X(0x1d73a2fe), X(0x1d8eecd4), + X(0x1daa3fda), X(0x1dc59c09), X(0x1de1015a), X(0x1dfc6fc5), + X(0x1e17e743), X(0x1e3367cd), X(0x1e4ef15b), X(0x1e6a83e7), + X(0x1e861f6a), X(0x1ea1c3da), X(0x1ebd7133), X(0x1ed9276b), + X(0x1ef4e67c), X(0x1f10ae5e), X(0x1f2c7f0a), X(0x1f485879), + X(0x1f643aa2), X(0x1f80257f), X(0x1f9c1908), X(0x1fb81536), + X(0x1fd41a00), X(0x1ff02761), X(0x200c3d4f), X(0x20285bc3), + X(0x204482b7), X(0x2060b221), X(0x207ce9fb), X(0x20992a3e), + X(0x20b572e0), X(0x20d1c3dc), X(0x20ee1d28), X(0x210a7ebe), + X(0x2126e895), X(0x21435aa6), X(0x215fd4ea), X(0x217c5757), + X(0x2198e1e8), X(0x21b57493), X(0x21d20f51), X(0x21eeb21b), + X(0x220b5ce7), X(0x22280fb0), X(0x2244ca6c), X(0x22618d13), + X(0x227e579f), X(0x229b2a06), X(0x22b80442), X(0x22d4e649), + X(0x22f1d015), X(0x230ec19d), X(0x232bbad9), X(0x2348bbc1), + X(0x2365c44c), X(0x2382d474), X(0x239fec30), X(0x23bd0b78), + X(0x23da3244), X(0x23f7608b), X(0x24149646), X(0x2431d36c), + X(0x244f17f5), X(0x246c63da), X(0x2489b711), X(0x24a71193), + X(0x24c47358), X(0x24e1dc57), X(0x24ff4c88), X(0x251cc3e2), + X(0x253a425e), X(0x2557c7f4), X(0x2575549a), X(0x2592e848), + X(0x25b082f7), X(0x25ce249e), X(0x25ebcd34), X(0x26097cb2), + X(0x2627330e), X(0x2644f040), X(0x2662b441), X(0x26807f07), + X(0x269e5089), X(0x26bc28c1), X(0x26da07a4), X(0x26f7ed2b), + X(0x2715d94d), X(0x2733cc02), X(0x2751c540), X(0x276fc500), + X(0x278dcb39), X(0x27abd7e2), X(0x27c9eaf3), X(0x27e80463), + X(0x28062429), X(0x28244a3e), X(0x28427697), X(0x2860a92d), + X(0x287ee1f7), X(0x289d20eb), X(0x28bb6603), X(0x28d9b134), + X(0x28f80275), X(0x291659c0), X(0x2934b709), X(0x29531a49), + X(0x29718378), X(0x298ff28b), X(0x29ae677b), X(0x29cce23e), + X(0x29eb62cb), X(0x2a09e91b), X(0x2a287523), X(0x2a4706dc), + X(0x2a659e3c), X(0x2a843b39), X(0x2aa2ddcd), X(0x2ac185ec), + X(0x2ae0338f), X(0x2afee6ad), X(0x2b1d9f3c), X(0x2b3c5d33), + X(0x2b5b208b), X(0x2b79e939), X(0x2b98b734), X(0x2bb78a74), + X(0x2bd662ef), X(0x2bf5409d), X(0x2c142374), X(0x2c330b6b), + X(0x2c51f87a), X(0x2c70ea97), X(0x2c8fe1b9), X(0x2caeddd6), + X(0x2ccddee7), X(0x2cece4e1), X(0x2d0befbb), X(0x2d2aff6d), + X(0x2d4a13ec), X(0x2d692d31), X(0x2d884b32), X(0x2da76de4), + X(0x2dc69540), X(0x2de5c13d), X(0x2e04f1d0), X(0x2e2426f0), + X(0x2e436095), X(0x2e629eb4), X(0x2e81e146), X(0x2ea1283f), + X(0x2ec07398), X(0x2edfc347), X(0x2eff1742), X(0x2f1e6f80), + X(0x2f3dcbf8), X(0x2f5d2ca0), X(0x2f7c916f), X(0x2f9bfa5c), + X(0x2fbb675d), X(0x2fdad869), X(0x2ffa4d76), X(0x3019c67b), + X(0x3039436f), X(0x3058c448), X(0x307848fc), X(0x3097d183), + X(0x30b75dd3), X(0x30d6ede2), X(0x30f681a6), X(0x31161917), + X(0x3135b42b), X(0x315552d8), X(0x3174f514), X(0x31949ad7), + X(0x31b44417), X(0x31d3f0ca), X(0x31f3a0e6), X(0x32135462), + X(0x32330b35), X(0x3252c555), X(0x327282b7), X(0x32924354), + X(0x32b20720), X(0x32d1ce13), X(0x32f19823), X(0x33116546), + X(0x33313573), X(0x3351089f), X(0x3370dec2), X(0x3390b7d1), + X(0x33b093c3), X(0x33d0728f), X(0x33f05429), X(0x3410388a), + X(0x34301fa7), X(0x34500977), X(0x346ff5ef), X(0x348fe506), + X(0x34afd6b3), X(0x34cfcaeb), X(0x34efc1a5), X(0x350fbad7), + X(0x352fb678), X(0x354fb47d), X(0x356fb4dd), X(0x358fb78e), + X(0x35afbc86), X(0x35cfc3bc), X(0x35efcd25), X(0x360fd8b8), + X(0x362fe66c), X(0x364ff636), X(0x3670080c), X(0x36901be5), + X(0x36b031b7), X(0x36d04978), X(0x36f0631e), X(0x37107ea0), + X(0x37309bf3), X(0x3750bb0e), X(0x3770dbe6), X(0x3790fe73), + X(0x37b122aa), X(0x37d14881), X(0x37f16fee), X(0x381198e8), + X(0x3831c365), X(0x3851ef5a), X(0x38721cbe), X(0x38924b87), + X(0x38b27bac), X(0x38d2ad21), X(0x38f2dfde), X(0x391313d8), + X(0x39334906), X(0x39537f5d), X(0x3973b6d4), X(0x3993ef60), + X(0x39b428f9), X(0x39d46393), X(0x39f49f25), X(0x3a14dba6), + X(0x3a35190a), X(0x3a555748), X(0x3a759657), X(0x3a95d62c), + X(0x3ab616be), X(0x3ad65801), X(0x3af699ed), X(0x3b16dc78), + X(0x3b371f97), X(0x3b576341), X(0x3b77a76c), X(0x3b97ec0d), + X(0x3bb8311b), X(0x3bd8768b), X(0x3bf8bc55), X(0x3c19026d), + X(0x3c3948ca), X(0x3c598f62), X(0x3c79d62b), X(0x3c9a1d1b), + X(0x3cba6428), X(0x3cdaab48), X(0x3cfaf271), X(0x3d1b3999), + X(0x3d3b80b6), X(0x3d5bc7be), X(0x3d7c0ea8), X(0x3d9c5569), + X(0x3dbc9bf7), X(0x3ddce248), X(0x3dfd2852), X(0x3e1d6e0c), + X(0x3e3db36c), X(0x3e5df866), X(0x3e7e3cf2), X(0x3e9e8106), + X(0x3ebec497), X(0x3edf079b), X(0x3eff4a09), X(0x3f1f8bd7), + X(0x3f3fccfa), X(0x3f600d69), X(0x3f804d1a), X(0x3fa08c02), + X(0x3fc0ca19), X(0x3fe10753), X(0x400143a7), X(0x40217f0a), + X(0x4041b974), X(0x4061f2da), X(0x40822b32), X(0x40a26272), + X(0x40c29891), X(0x40e2cd83), X(0x41030140), X(0x412333bd), + X(0x414364f1), X(0x416394d2), X(0x4183c355), X(0x41a3f070), + X(0x41c41c1b), X(0x41e4464a), X(0x42046ef4), X(0x42249610), + X(0x4244bb92), X(0x4264df72), X(0x428501a5), X(0x42a52222), + X(0x42c540de), X(0x42e55dd0), X(0x430578ed), X(0x4325922d), + X(0x4345a985), X(0x4365beeb), X(0x4385d255), X(0x43a5e3ba), + X(0x43c5f30f), X(0x43e6004b), X(0x44060b65), X(0x44261451), + X(0x44461b07), X(0x44661f7c), X(0x448621a7), X(0x44a6217d), + X(0x44c61ef6), X(0x44e61a07), X(0x450612a6), X(0x452608ca), + X(0x4545fc69), X(0x4565ed79), X(0x4585dbf1), X(0x45a5c7c6), + X(0x45c5b0ef), X(0x45e59761), X(0x46057b15), X(0x46255bfe), + X(0x46453a15), X(0x4665154f), X(0x4684eda2), X(0x46a4c305), + X(0x46c4956e), X(0x46e464d3), X(0x4704312b), X(0x4723fa6c), + X(0x4743c08d), X(0x47638382), X(0x47834344), X(0x47a2ffc9), + X(0x47c2b906), X(0x47e26ef2), X(0x48022183), X(0x4821d0b1), + X(0x48417c71), X(0x486124b9), X(0x4880c981), X(0x48a06abe), + X(0x48c00867), X(0x48dfa272), X(0x48ff38d6), X(0x491ecb8a), + X(0x493e5a84), X(0x495de5b9), X(0x497d6d22), X(0x499cf0b4), + X(0x49bc7066), X(0x49dbec2e), X(0x49fb6402), X(0x4a1ad7db), + X(0x4a3a47ad), X(0x4a59b370), X(0x4a791b1a), X(0x4a987ea1), + X(0x4ab7ddfd), X(0x4ad73924), X(0x4af6900c), X(0x4b15e2ad), + X(0x4b3530fc), X(0x4b547af1), X(0x4b73c082), X(0x4b9301a6), + X(0x4bb23e53), X(0x4bd17681), X(0x4bf0aa25), X(0x4c0fd937), + X(0x4c2f03ae), X(0x4c4e297f), X(0x4c6d4aa3), X(0x4c8c670f), + X(0x4cab7eba), X(0x4cca919c), X(0x4ce99fab), X(0x4d08a8de), + X(0x4d27ad2c), X(0x4d46ac8b), X(0x4d65a6f3), X(0x4d849c5a), + X(0x4da38cb7), X(0x4dc27802), X(0x4de15e31), X(0x4e003f3a), + X(0x4e1f1b16), X(0x4e3df1ba), X(0x4e5cc31e), X(0x4e7b8f3a), + X(0x4e9a5603), X(0x4eb91771), X(0x4ed7d37b), X(0x4ef68a18), + X(0x4f153b3f), X(0x4f33e6e7), X(0x4f528d08), X(0x4f712d97), + X(0x4f8fc88e), X(0x4fae5de1), X(0x4fcced8a), X(0x4feb777f), + X(0x5009fbb6), X(0x50287a28), X(0x5046f2cc), X(0x50656598), + X(0x5083d284), X(0x50a23988), X(0x50c09a9a), X(0x50def5b1), + X(0x50fd4ac7), X(0x511b99d0), X(0x5139e2c5), X(0x5158259e), + X(0x51766251), X(0x519498d6), X(0x51b2c925), X(0x51d0f334), + X(0x51ef16fb), X(0x520d3473), X(0x522b4b91), X(0x52495c4e), + X(0x526766a2), X(0x52856a83), X(0x52a367e9), X(0x52c15ecd), + X(0x52df4f24), X(0x52fd38e8), X(0x531b1c10), X(0x5338f892), + X(0x5356ce68), X(0x53749d89), X(0x539265eb), X(0x53b02788), + X(0x53cde257), X(0x53eb964f), X(0x54094369), X(0x5426e99c), + X(0x544488df), X(0x5462212c), X(0x547fb279), X(0x549d3cbe), + X(0x54babff4), X(0x54d83c12), X(0x54f5b110), X(0x55131ee7), + X(0x5530858d), X(0x554de4fc), X(0x556b3d2a), X(0x55888e11), + X(0x55a5d7a8), X(0x55c319e7), X(0x55e054c7), X(0x55fd883f), + X(0x561ab447), X(0x5637d8d8), X(0x5654f5ea), X(0x56720b75), + X(0x568f1971), X(0x56ac1fd7), X(0x56c91e9e), X(0x56e615c0), + X(0x57030534), X(0x571fecf2), X(0x573cccf3), X(0x5759a530), + X(0x577675a0), X(0x57933e3c), X(0x57affefd), X(0x57ccb7db), + X(0x57e968ce), X(0x580611cf), X(0x5822b2d6), X(0x583f4bdd), + X(0x585bdcdb), X(0x587865c9), X(0x5894e69f), X(0x58b15f57), + X(0x58cdcfe9), X(0x58ea384e), X(0x5906987d), X(0x5922f071), + X(0x593f4022), X(0x595b8788), X(0x5977c69c), X(0x5993fd57), + X(0x59b02bb2), X(0x59cc51a6), X(0x59e86f2c), X(0x5a04843c), + X(0x5a2090d0), X(0x5a3c94e0), X(0x5a589065), X(0x5a748359), + X(0x5a906db4), X(0x5aac4f70), X(0x5ac82884), X(0x5ae3f8ec), + X(0x5affc09f), X(0x5b1b7f97), X(0x5b3735cd), X(0x5b52e33a), + X(0x5b6e87d8), X(0x5b8a239f), X(0x5ba5b689), X(0x5bc1408f), + X(0x5bdcc1aa), X(0x5bf839d5), X(0x5c13a907), X(0x5c2f0f3b), + X(0x5c4a6c6a), X(0x5c65c08d), X(0x5c810b9e), X(0x5c9c4d97), + X(0x5cb78670), X(0x5cd2b623), X(0x5ceddcaa), X(0x5d08f9ff), + X(0x5d240e1b), X(0x5d3f18f8), X(0x5d5a1a8f), X(0x5d7512da), + X(0x5d9001d3), X(0x5daae773), X(0x5dc5c3b5), X(0x5de09692), + X(0x5dfb6004), X(0x5e162004), X(0x5e30d68d), X(0x5e4b8399), + X(0x5e662721), X(0x5e80c11f), X(0x5e9b518e), X(0x5eb5d867), + X(0x5ed055a4), X(0x5eeac940), X(0x5f053334), X(0x5f1f937b), + X(0x5f39ea0f), X(0x5f5436ea), X(0x5f6e7a06), X(0x5f88b35d), + X(0x5fa2e2e9), X(0x5fbd08a6), X(0x5fd7248d), X(0x5ff13698), + X(0x600b3ec2), X(0x60253d05), X(0x603f315b), X(0x60591bc0), + X(0x6072fc2d), X(0x608cd29e), X(0x60a69f0b), X(0x60c06171), + X(0x60da19ca), X(0x60f3c80f), X(0x610d6c3d), X(0x6127064d), + X(0x6140963a), X(0x615a1bff), X(0x61739797), X(0x618d08fc), + X(0x61a67029), X(0x61bfcd1a), X(0x61d91fc8), X(0x61f2682f), + X(0x620ba64a), X(0x6224da13), X(0x623e0386), X(0x6257229d), + X(0x62703754), X(0x628941a6), X(0x62a2418e), X(0x62bb3706), + X(0x62d4220a), X(0x62ed0296), X(0x6305d8a3), X(0x631ea42f), + X(0x63376533), X(0x63501bab), X(0x6368c793), X(0x638168e5), + X(0x6399ff9e), X(0x63b28bb8), X(0x63cb0d2f), X(0x63e383ff), + X(0x63fbf022), X(0x64145195), X(0x642ca853), X(0x6444f457), + X(0x645d359e), X(0x64756c22), X(0x648d97e0), X(0x64a5b8d3), + X(0x64bdcef6), X(0x64d5da47), X(0x64eddabf), X(0x6505d05c), + X(0x651dbb19), X(0x65359af2), X(0x654d6fe3), X(0x656539e7), + X(0x657cf8fb), X(0x6594ad1b), X(0x65ac5643), X(0x65c3f46e), + X(0x65db8799), X(0x65f30fc0), X(0x660a8ce0), X(0x6621fef3), + X(0x663965f7), X(0x6650c1e7), X(0x666812c1), X(0x667f5880), + X(0x66969320), X(0x66adc29e), X(0x66c4e6f7), X(0x66dc0026), + X(0x66f30e28), X(0x670a10fa), X(0x67210898), X(0x6737f4ff), + X(0x674ed62b), X(0x6765ac19), X(0x677c76c5), X(0x6793362c), + X(0x67a9ea4b), X(0x67c0931f), X(0x67d730a3), X(0x67edc2d6), + X(0x680449b3), X(0x681ac538), X(0x68313562), X(0x68479a2d), + X(0x685df396), X(0x6874419b), X(0x688a8438), X(0x68a0bb6a), + X(0x68b6e72e), X(0x68cd0782), X(0x68e31c63), X(0x68f925cd), + X(0x690f23be), X(0x69251633), X(0x693afd29), X(0x6950d89e), + X(0x6966a88f), X(0x697c6cf8), X(0x699225d9), X(0x69a7d32d), + X(0x69bd74f3), X(0x69d30b27), X(0x69e895c8), X(0x69fe14d2), + X(0x6a138844), X(0x6a28f01b), X(0x6a3e4c54), X(0x6a539ced), + X(0x6a68e1e4), X(0x6a7e1b37), X(0x6a9348e3), X(0x6aa86ae6), + X(0x6abd813d), X(0x6ad28be7), X(0x6ae78ae2), X(0x6afc7e2b), + X(0x6b1165c0), X(0x6b26419f), X(0x6b3b11c7), X(0x6b4fd634), + X(0x6b648ee6), X(0x6b793bda), X(0x6b8ddd0e), X(0x6ba27281), + X(0x6bb6fc31), X(0x6bcb7a1b), X(0x6bdfec3e), X(0x6bf45299), + X(0x6c08ad29), X(0x6c1cfbed), X(0x6c313ee4), X(0x6c45760a), + X(0x6c59a160), X(0x6c6dc0e4), X(0x6c81d493), X(0x6c95dc6d), + X(0x6ca9d86f), X(0x6cbdc899), X(0x6cd1acea), X(0x6ce5855f), + X(0x6cf951f7), X(0x6d0d12b1), X(0x6d20c78c), X(0x6d347087), + X(0x6d480da0), X(0x6d5b9ed6), X(0x6d6f2427), X(0x6d829d94), + X(0x6d960b1a), X(0x6da96cb9), X(0x6dbcc270), X(0x6dd00c3c), + X(0x6de34a1f), X(0x6df67c16), X(0x6e09a221), X(0x6e1cbc3f), + X(0x6e2fca6e), X(0x6e42ccaf), X(0x6e55c300), X(0x6e68ad60), + X(0x6e7b8bd0), X(0x6e8e5e4d), X(0x6ea124d8), X(0x6eb3df70), + X(0x6ec68e13), X(0x6ed930c3), X(0x6eebc77d), X(0x6efe5242), + X(0x6f10d111), X(0x6f2343e9), X(0x6f35aacb), X(0x6f4805b5), + X(0x6f5a54a8), X(0x6f6c97a2), X(0x6f7ecea4), X(0x6f90f9ae), + X(0x6fa318be), X(0x6fb52bd6), X(0x6fc732f4), X(0x6fd92e19), + X(0x6feb1d44), X(0x6ffd0076), X(0x700ed7ad), X(0x7020a2eb), + X(0x7032622f), X(0x7044157a), X(0x7055bcca), X(0x70675821), + X(0x7078e77e), X(0x708a6ae2), X(0x709be24c), X(0x70ad4dbd), + X(0x70bead36), X(0x70d000b5), X(0x70e1483d), X(0x70f283cc), + X(0x7103b363), X(0x7114d704), X(0x7125eead), X(0x7136fa60), + X(0x7147fa1c), X(0x7158ede4), X(0x7169d5b6), X(0x717ab193), + X(0x718b817d), X(0x719c4573), X(0x71acfd76), X(0x71bda988), + X(0x71ce49a8), X(0x71deddd7), X(0x71ef6617), X(0x71ffe267), + X(0x721052ca), X(0x7220b73e), X(0x72310fc6), X(0x72415c62), + X(0x72519d14), X(0x7261d1db), X(0x7271faba), X(0x728217b1), + X(0x729228c0), X(0x72a22dea), X(0x72b22730), X(0x72c21491), + X(0x72d1f611), X(0x72e1cbaf), X(0x72f1956c), X(0x7301534c), + X(0x7311054d), X(0x7320ab72), X(0x733045bc), X(0x733fd42d), + X(0x734f56c5), X(0x735ecd86), X(0x736e3872), X(0x737d9789), + X(0x738ceacf), X(0x739c3243), X(0x73ab6de7), X(0x73ba9dbe), + X(0x73c9c1c8), X(0x73d8da08), X(0x73e7e67f), X(0x73f6e72e), + X(0x7405dc17), X(0x7414c53c), X(0x7423a29f), X(0x74327442), + X(0x74413a26), X(0x744ff44d), X(0x745ea2b9), X(0x746d456c), + X(0x747bdc68), X(0x748a67ae), X(0x7498e741), X(0x74a75b23), + X(0x74b5c356), X(0x74c41fdb), X(0x74d270b6), X(0x74e0b5e7), + X(0x74eeef71), X(0x74fd1d57), X(0x750b3f9a), X(0x7519563c), + X(0x75276140), X(0x753560a8), X(0x75435477), X(0x75513cae), + X(0x755f1951), X(0x756cea60), X(0x757aafdf), X(0x758869d1), + X(0x75961837), X(0x75a3bb14), X(0x75b1526a), X(0x75bede3c), + X(0x75cc5e8d), X(0x75d9d35f), X(0x75e73cb5), X(0x75f49a91), + X(0x7601ecf6), X(0x760f33e6), X(0x761c6f65), X(0x76299f74), + X(0x7636c417), X(0x7643dd51), X(0x7650eb24), X(0x765ded93), + X(0x766ae4a0), X(0x7677d050), X(0x7684b0a4), X(0x7691859f), + X(0x769e4f45), X(0x76ab0d98), X(0x76b7c09c), X(0x76c46852), + X(0x76d104bf), X(0x76dd95e6), X(0x76ea1bc9), X(0x76f6966b), + X(0x770305d0), X(0x770f69fb), X(0x771bc2ef), X(0x772810af), + X(0x7734533e), X(0x77408aa0), X(0x774cb6d7), X(0x7758d7e8), + X(0x7764edd5), X(0x7770f8a2), X(0x777cf852), X(0x7788ece8), + X(0x7794d668), X(0x77a0b4d5), X(0x77ac8833), X(0x77b85085), + X(0x77c40dce), X(0x77cfc013), X(0x77db6756), X(0x77e7039b), + X(0x77f294e6), X(0x77fe1b3b), X(0x7809969c), X(0x7815070e), + X(0x78206c93), X(0x782bc731), X(0x783716ea), X(0x78425bc3), + X(0x784d95be), X(0x7858c4e1), X(0x7863e92d), X(0x786f02a8), + X(0x787a1156), X(0x78851539), X(0x78900e56), X(0x789afcb1), + X(0x78a5e04d), X(0x78b0b92f), X(0x78bb875b), X(0x78c64ad4), + X(0x78d1039e), X(0x78dbb1be), X(0x78e65537), X(0x78f0ee0e), + X(0x78fb7c46), X(0x7905ffe4), X(0x791078ec), X(0x791ae762), + X(0x79254b4a), X(0x792fa4a7), X(0x7939f380), X(0x794437d7), + X(0x794e71b0), X(0x7958a111), X(0x7962c5fd), X(0x796ce078), + X(0x7976f087), X(0x7980f62f), X(0x798af173), X(0x7994e258), + X(0x799ec8e2), X(0x79a8a515), X(0x79b276f7), X(0x79bc3e8b), + X(0x79c5fbd6), X(0x79cfaedc), X(0x79d957a2), X(0x79e2f62c), + X(0x79ec8a7f), X(0x79f6149f), X(0x79ff9492), X(0x7a090a5a), + X(0x7a1275fe), X(0x7a1bd781), X(0x7a252ee9), X(0x7a2e7c39), + X(0x7a37bf77), X(0x7a40f8a7), X(0x7a4a27ce), X(0x7a534cf0), + X(0x7a5c6813), X(0x7a65793b), X(0x7a6e806d), X(0x7a777dad), + X(0x7a807100), X(0x7a895a6b), X(0x7a9239f4), X(0x7a9b0f9e), + X(0x7aa3db6f), X(0x7aac9d6b), X(0x7ab55597), X(0x7abe03f9), + X(0x7ac6a895), X(0x7acf4370), X(0x7ad7d48f), X(0x7ae05bf6), + X(0x7ae8d9ac), X(0x7af14db5), X(0x7af9b815), X(0x7b0218d2), + X(0x7b0a6ff2), X(0x7b12bd78), X(0x7b1b016a), X(0x7b233bce), + X(0x7b2b6ca7), X(0x7b3393fc), X(0x7b3bb1d1), X(0x7b43c62c), + X(0x7b4bd111), X(0x7b53d286), X(0x7b5bca90), X(0x7b63b935), + X(0x7b6b9e78), X(0x7b737a61), X(0x7b7b4cf3), X(0x7b831634), + X(0x7b8ad629), X(0x7b928cd8), X(0x7b9a3a45), X(0x7ba1de77), + X(0x7ba97972), X(0x7bb10b3c), X(0x7bb893d9), X(0x7bc01350), + X(0x7bc789a6), X(0x7bcef6e0), X(0x7bd65b03), X(0x7bddb616), + X(0x7be5081c), X(0x7bec511c), X(0x7bf3911b), X(0x7bfac81f), + X(0x7c01f62c), X(0x7c091b49), X(0x7c10377b), X(0x7c174ac7), + X(0x7c1e5532), X(0x7c2556c4), X(0x7c2c4f80), X(0x7c333f6c), + X(0x7c3a268e), X(0x7c4104ec), X(0x7c47da8a), X(0x7c4ea76f), + X(0x7c556ba1), X(0x7c5c2724), X(0x7c62d9fe), X(0x7c698435), + X(0x7c7025cf), X(0x7c76bed0), X(0x7c7d4f40), X(0x7c83d723), + X(0x7c8a567f), X(0x7c90cd5a), X(0x7c973bb9), X(0x7c9da1a2), + X(0x7ca3ff1b), X(0x7caa542a), X(0x7cb0a0d3), X(0x7cb6e51e), + X(0x7cbd210f), X(0x7cc354ac), X(0x7cc97ffc), X(0x7ccfa304), + X(0x7cd5bdc9), X(0x7cdbd051), X(0x7ce1daa3), X(0x7ce7dcc3), + X(0x7cedd6b8), X(0x7cf3c888), X(0x7cf9b238), X(0x7cff93cf), + X(0x7d056d51), X(0x7d0b3ec5), X(0x7d110830), X(0x7d16c99a), + X(0x7d1c8306), X(0x7d22347c), X(0x7d27de00), X(0x7d2d7f9a), + X(0x7d33194f), X(0x7d38ab24), X(0x7d3e351f), X(0x7d43b748), + X(0x7d4931a2), X(0x7d4ea435), X(0x7d540f06), X(0x7d59721b), + X(0x7d5ecd7b), X(0x7d64212a), X(0x7d696d2f), X(0x7d6eb190), + X(0x7d73ee53), X(0x7d79237e), X(0x7d7e5117), X(0x7d837723), + X(0x7d8895a9), X(0x7d8dacae), X(0x7d92bc3a), X(0x7d97c451), + X(0x7d9cc4f9), X(0x7da1be39), X(0x7da6b017), X(0x7dab9a99), + X(0x7db07dc4), X(0x7db5599e), X(0x7dba2e2f), X(0x7dbefb7b), + X(0x7dc3c189), X(0x7dc8805e), X(0x7dcd3802), X(0x7dd1e879), + X(0x7dd691ca), X(0x7ddb33fb), X(0x7ddfcf12), X(0x7de46315), + X(0x7de8f00a), X(0x7ded75f8), X(0x7df1f4e3), X(0x7df66cd3), + X(0x7dfaddcd), X(0x7dff47d7), X(0x7e03aaf8), X(0x7e080735), + X(0x7e0c5c95), X(0x7e10ab1e), X(0x7e14f2d5), X(0x7e1933c1), + X(0x7e1d6de8), X(0x7e21a150), X(0x7e25cdff), X(0x7e29f3fc), + X(0x7e2e134c), X(0x7e322bf5), X(0x7e363dfd), X(0x7e3a496b), + X(0x7e3e4e45), X(0x7e424c90), X(0x7e464454), X(0x7e4a3595), + X(0x7e4e205a), X(0x7e5204aa), X(0x7e55e289), X(0x7e59b9ff), + X(0x7e5d8b12), X(0x7e6155c7), X(0x7e651a24), X(0x7e68d831), + X(0x7e6c8ff2), X(0x7e70416e), X(0x7e73ecac), X(0x7e7791b0), + X(0x7e7b3082), X(0x7e7ec927), X(0x7e825ba6), X(0x7e85e804), + X(0x7e896e48), X(0x7e8cee77), X(0x7e906899), X(0x7e93dcb2), + X(0x7e974aca), X(0x7e9ab2e5), X(0x7e9e150b), X(0x7ea17141), + X(0x7ea4c78e), X(0x7ea817f7), X(0x7eab6283), X(0x7eaea737), + X(0x7eb1e61a), X(0x7eb51f33), X(0x7eb85285), X(0x7ebb8019), + X(0x7ebea7f4), X(0x7ec1ca1d), X(0x7ec4e698), X(0x7ec7fd6d), + X(0x7ecb0ea1), X(0x7ece1a3a), X(0x7ed1203f), X(0x7ed420b6), + X(0x7ed71ba4), X(0x7eda110f), X(0x7edd00ff), X(0x7edfeb78), + X(0x7ee2d081), X(0x7ee5b01f), X(0x7ee88a5a), X(0x7eeb5f36), + X(0x7eee2eba), X(0x7ef0f8ed), X(0x7ef3bdd3), X(0x7ef67d73), + X(0x7ef937d3), X(0x7efbecf9), X(0x7efe9ceb), X(0x7f0147ae), + X(0x7f03ed4a), X(0x7f068dc4), X(0x7f092922), X(0x7f0bbf69), + X(0x7f0e50a1), X(0x7f10dcce), X(0x7f1363f7), X(0x7f15e622), + X(0x7f186355), X(0x7f1adb95), X(0x7f1d4ee9), X(0x7f1fbd57), + X(0x7f2226e4), X(0x7f248b96), X(0x7f26eb74), X(0x7f294683), + X(0x7f2b9cc9), X(0x7f2dee4d), X(0x7f303b13), X(0x7f328322), + X(0x7f34c680), X(0x7f370533), X(0x7f393f40), X(0x7f3b74ad), + X(0x7f3da581), X(0x7f3fd1c1), X(0x7f41f972), X(0x7f441c9c), + X(0x7f463b43), X(0x7f48556d), X(0x7f4a6b21), X(0x7f4c7c64), + X(0x7f4e893c), X(0x7f5091ae), X(0x7f5295c1), X(0x7f54957a), + X(0x7f5690e0), X(0x7f5887f7), X(0x7f5a7ac5), X(0x7f5c6951), + X(0x7f5e53a0), X(0x7f6039b8), X(0x7f621b9e), X(0x7f63f958), + X(0x7f65d2ed), X(0x7f67a861), X(0x7f6979ba), X(0x7f6b46ff), + X(0x7f6d1034), X(0x7f6ed560), X(0x7f709687), X(0x7f7253b1), + X(0x7f740ce1), X(0x7f75c21f), X(0x7f777370), X(0x7f7920d8), + X(0x7f7aca5f), X(0x7f7c7008), X(0x7f7e11db), X(0x7f7fafdd), + X(0x7f814a13), X(0x7f82e082), X(0x7f847331), X(0x7f860224), + X(0x7f878d62), X(0x7f8914f0), X(0x7f8a98d4), X(0x7f8c1912), + X(0x7f8d95b0), X(0x7f8f0eb5), X(0x7f908425), X(0x7f91f605), + X(0x7f93645c), X(0x7f94cf2f), X(0x7f963683), X(0x7f979a5d), + X(0x7f98fac4), X(0x7f9a57bb), X(0x7f9bb14a), X(0x7f9d0775), + X(0x7f9e5a41), X(0x7f9fa9b4), X(0x7fa0f5d3), X(0x7fa23ea4), + X(0x7fa3842b), X(0x7fa4c66f), X(0x7fa60575), X(0x7fa74141), + X(0x7fa879d9), X(0x7fa9af42), X(0x7faae182), X(0x7fac109e), + X(0x7fad3c9a), X(0x7fae657d), X(0x7faf8b4c), X(0x7fb0ae0b), + X(0x7fb1cdc0), X(0x7fb2ea70), X(0x7fb40420), X(0x7fb51ad5), + X(0x7fb62e95), X(0x7fb73f64), X(0x7fb84d48), X(0x7fb95846), + X(0x7fba6062), X(0x7fbb65a2), X(0x7fbc680c), X(0x7fbd67a3), + X(0x7fbe646d), X(0x7fbf5e70), X(0x7fc055af), X(0x7fc14a31), + X(0x7fc23bf9), X(0x7fc32b0d), X(0x7fc41773), X(0x7fc5012e), + X(0x7fc5e844), X(0x7fc6ccba), X(0x7fc7ae94), X(0x7fc88dd8), + X(0x7fc96a8a), X(0x7fca44af), X(0x7fcb1c4c), X(0x7fcbf167), + X(0x7fccc403), X(0x7fcd9425), X(0x7fce61d3), X(0x7fcf2d11), + X(0x7fcff5e3), X(0x7fd0bc4f), X(0x7fd1805a), X(0x7fd24207), + X(0x7fd3015c), X(0x7fd3be5d), X(0x7fd47910), X(0x7fd53178), + X(0x7fd5e79b), X(0x7fd69b7c), X(0x7fd74d21), X(0x7fd7fc8e), + X(0x7fd8a9c8), X(0x7fd954d4), X(0x7fd9fdb5), X(0x7fdaa471), + X(0x7fdb490b), X(0x7fdbeb89), X(0x7fdc8bef), X(0x7fdd2a42), + X(0x7fddc685), X(0x7fde60be), X(0x7fdef8f0), X(0x7fdf8f20), + X(0x7fe02353), X(0x7fe0b58d), X(0x7fe145d3), X(0x7fe1d428), + X(0x7fe26091), X(0x7fe2eb12), X(0x7fe373b0), X(0x7fe3fa6f), + X(0x7fe47f53), X(0x7fe50260), X(0x7fe5839b), X(0x7fe60308), + X(0x7fe680ab), X(0x7fe6fc88), X(0x7fe776a4), X(0x7fe7ef02), + X(0x7fe865a7), X(0x7fe8da97), X(0x7fe94dd6), X(0x7fe9bf68), + X(0x7fea2f51), X(0x7fea9d95), X(0x7feb0a39), X(0x7feb7540), + X(0x7febdeae), X(0x7fec4687), X(0x7fecaccf), X(0x7fed118b), + X(0x7fed74be), X(0x7fedd66c), X(0x7fee3698), X(0x7fee9548), + X(0x7feef27e), X(0x7fef4e3f), X(0x7fefa88e), X(0x7ff0016f), + X(0x7ff058e7), X(0x7ff0aef8), X(0x7ff103a6), X(0x7ff156f6), + X(0x7ff1a8eb), X(0x7ff1f988), X(0x7ff248d2), X(0x7ff296cc), + X(0x7ff2e37a), X(0x7ff32edf), X(0x7ff378ff), X(0x7ff3c1de), + X(0x7ff4097e), X(0x7ff44fe5), X(0x7ff49515), X(0x7ff4d911), + X(0x7ff51bde), X(0x7ff55d7f), X(0x7ff59df7), X(0x7ff5dd4a), + X(0x7ff61b7b), X(0x7ff6588d), X(0x7ff69485), X(0x7ff6cf65), + X(0x7ff70930), X(0x7ff741eb), X(0x7ff77998), X(0x7ff7b03b), + X(0x7ff7e5d7), X(0x7ff81a6f), X(0x7ff84e06), X(0x7ff880a1), + X(0x7ff8b241), X(0x7ff8e2ea), X(0x7ff912a0), X(0x7ff94165), + X(0x7ff96f3d), X(0x7ff99c2b), X(0x7ff9c831), X(0x7ff9f354), + X(0x7ffa1d95), X(0x7ffa46f9), X(0x7ffa6f81), X(0x7ffa9731), + X(0x7ffabe0d), X(0x7ffae416), X(0x7ffb0951), X(0x7ffb2dbf), + X(0x7ffb5164), X(0x7ffb7442), X(0x7ffb965d), X(0x7ffbb7b8), + X(0x7ffbd854), X(0x7ffbf836), X(0x7ffc175f), X(0x7ffc35d3), + X(0x7ffc5394), X(0x7ffc70a5), X(0x7ffc8d09), X(0x7ffca8c2), + X(0x7ffcc3d4), X(0x7ffcde3f), X(0x7ffcf809), X(0x7ffd1132), + X(0x7ffd29be), X(0x7ffd41ae), X(0x7ffd5907), X(0x7ffd6fc9), + X(0x7ffd85f9), X(0x7ffd9b97), X(0x7ffdb0a7), X(0x7ffdc52b), + X(0x7ffdd926), X(0x7ffdec99), X(0x7ffdff88), X(0x7ffe11f4), + X(0x7ffe23e0), X(0x7ffe354f), X(0x7ffe4642), X(0x7ffe56bc), + X(0x7ffe66bf), X(0x7ffe764e), X(0x7ffe856a), X(0x7ffe9416), + X(0x7ffea254), X(0x7ffeb026), X(0x7ffebd8e), X(0x7ffeca8f), + X(0x7ffed72a), X(0x7ffee362), X(0x7ffeef38), X(0x7ffefaaf), + X(0x7fff05c9), X(0x7fff1087), X(0x7fff1aec), X(0x7fff24f9), + X(0x7fff2eb1), X(0x7fff3816), X(0x7fff4128), X(0x7fff49eb), + X(0x7fff5260), X(0x7fff5a88), X(0x7fff6266), X(0x7fff69fc), + X(0x7fff714b), X(0x7fff7854), X(0x7fff7f1a), X(0x7fff859f), + X(0x7fff8be3), X(0x7fff91ea), X(0x7fff97b3), X(0x7fff9d41), + X(0x7fffa296), X(0x7fffa7b3), X(0x7fffac99), X(0x7fffb14b), + X(0x7fffb5c9), X(0x7fffba15), X(0x7fffbe31), X(0x7fffc21d), + X(0x7fffc5dc), X(0x7fffc96f), X(0x7fffccd8), X(0x7fffd016), + X(0x7fffd32d), X(0x7fffd61c), X(0x7fffd8e7), X(0x7fffdb8d), + X(0x7fffde0f), X(0x7fffe071), X(0x7fffe2b1), X(0x7fffe4d2), + X(0x7fffe6d5), X(0x7fffe8bb), X(0x7fffea85), X(0x7fffec34), + X(0x7fffedc9), X(0x7fffef45), X(0x7ffff0aa), X(0x7ffff1f7), + X(0x7ffff330), X(0x7ffff453), X(0x7ffff562), X(0x7ffff65f), + X(0x7ffff749), X(0x7ffff823), X(0x7ffff8ec), X(0x7ffff9a6), + X(0x7ffffa51), X(0x7ffffaee), X(0x7ffffb7e), X(0x7ffffc02), + X(0x7ffffc7a), X(0x7ffffce7), X(0x7ffffd4a), X(0x7ffffda3), + X(0x7ffffdf4), X(0x7ffffe3c), X(0x7ffffe7c), X(0x7ffffeb6), + X(0x7ffffee8), X(0x7fffff15), X(0x7fffff3c), X(0x7fffff5e), + X(0x7fffff7b), X(0x7fffff95), X(0x7fffffaa), X(0x7fffffbc), + X(0x7fffffcb), X(0x7fffffd7), X(0x7fffffe2), X(0x7fffffea), + X(0x7ffffff0), X(0x7ffffff5), X(0x7ffffff9), X(0x7ffffffb), + X(0x7ffffffd), X(0x7ffffffe), X(0x7fffffff), X(0x7fffffff), + X(0x7fffffff), X(0x7fffffff), X(0x7fffffff), X(0x7fffffff), +}; + +static const LOOKUP_T vwin8192[4096] = { + X(0x0000007c), X(0x0000045c), X(0x00000c1d), X(0x000017bd), + X(0x0000273e), X(0x00003a9f), X(0x000051e0), X(0x00006d02), + X(0x00008c03), X(0x0000aee5), X(0x0000d5a7), X(0x00010049), + X(0x00012ecb), X(0x0001612d), X(0x00019770), X(0x0001d193), + X(0x00020f96), X(0x00025178), X(0x0002973c), X(0x0002e0df), + X(0x00032e62), X(0x00037fc5), X(0x0003d509), X(0x00042e2c), + X(0x00048b30), X(0x0004ec13), X(0x000550d7), X(0x0005b97a), + X(0x000625fe), X(0x00069661), X(0x00070aa4), X(0x000782c8), + X(0x0007fecb), X(0x00087eae), X(0x00090271), X(0x00098a14), + X(0x000a1597), X(0x000aa4f9), X(0x000b383b), X(0x000bcf5d), + X(0x000c6a5f), X(0x000d0941), X(0x000dac02), X(0x000e52a3), + X(0x000efd23), X(0x000fab84), X(0x00105dc3), X(0x001113e3), + X(0x0011cde2), X(0x00128bc0), X(0x00134d7e), X(0x0014131b), + X(0x0014dc98), X(0x0015a9f4), X(0x00167b30), X(0x0017504a), + X(0x00182945), X(0x0019061e), X(0x0019e6d7), X(0x001acb6f), + X(0x001bb3e6), X(0x001ca03c), X(0x001d9071), X(0x001e8485), + X(0x001f7c79), X(0x0020784b), X(0x002177fc), X(0x00227b8c), + X(0x002382fb), X(0x00248e49), X(0x00259d76), X(0x0026b081), + X(0x0027c76b), X(0x0028e234), X(0x002a00dc), X(0x002b2361), + X(0x002c49c6), X(0x002d7409), X(0x002ea22a), X(0x002fd42a), + X(0x00310a08), X(0x003243c5), X(0x00338160), X(0x0034c2d9), + X(0x00360830), X(0x00375165), X(0x00389e78), X(0x0039ef6a), + X(0x003b4439), X(0x003c9ce6), X(0x003df971), X(0x003f59da), + X(0x0040be20), X(0x00422645), X(0x00439247), X(0x00450226), + X(0x004675e3), X(0x0047ed7e), X(0x004968f5), X(0x004ae84b), + X(0x004c6b7d), X(0x004df28d), X(0x004f7d7a), X(0x00510c44), + X(0x00529eeb), X(0x00543570), X(0x0055cfd1), X(0x00576e0f), + X(0x00591029), X(0x005ab621), X(0x005c5ff5), X(0x005e0da6), + X(0x005fbf33), X(0x0061749d), X(0x00632de4), X(0x0064eb06), + X(0x0066ac05), X(0x006870e0), X(0x006a3998), X(0x006c062b), + X(0x006dd69b), X(0x006faae6), X(0x0071830d), X(0x00735f10), + X(0x00753eef), X(0x007722a9), X(0x00790a3f), X(0x007af5b1), + X(0x007ce4fe), X(0x007ed826), X(0x0080cf29), X(0x0082ca08), + X(0x0084c8c2), X(0x0086cb57), X(0x0088d1c7), X(0x008adc11), + X(0x008cea37), X(0x008efc37), X(0x00911212), X(0x00932bc7), + X(0x00954957), X(0x00976ac2), X(0x00999006), X(0x009bb925), + X(0x009de61e), X(0x00a016f1), X(0x00a24b9e), X(0x00a48425), + X(0x00a6c086), X(0x00a900c0), X(0x00ab44d4), X(0x00ad8cc2), + X(0x00afd889), X(0x00b22829), X(0x00b47ba2), X(0x00b6d2f5), + X(0x00b92e21), X(0x00bb8d26), X(0x00bdf004), X(0x00c056ba), + X(0x00c2c149), X(0x00c52fb1), X(0x00c7a1f1), X(0x00ca180a), + X(0x00cc91fb), X(0x00cf0fc5), X(0x00d19166), X(0x00d416df), + X(0x00d6a031), X(0x00d92d5a), X(0x00dbbe5b), X(0x00de5333), + X(0x00e0ebe3), X(0x00e3886b), X(0x00e628c9), X(0x00e8ccff), + X(0x00eb750c), X(0x00ee20f0), X(0x00f0d0ab), X(0x00f3843d), + X(0x00f63ba5), X(0x00f8f6e4), X(0x00fbb5fa), X(0x00fe78e5), + X(0x01013fa7), X(0x01040a3f), X(0x0106d8ae), X(0x0109aaf2), + X(0x010c810c), X(0x010f5afb), X(0x011238c0), X(0x01151a5b), + X(0x0117ffcb), X(0x011ae910), X(0x011dd62a), X(0x0120c719), + X(0x0123bbdd), X(0x0126b476), X(0x0129b0e4), X(0x012cb126), + X(0x012fb53c), X(0x0132bd27), X(0x0135c8e6), X(0x0138d879), + X(0x013bebdf), X(0x013f031a), X(0x01421e28), X(0x01453d0a), + X(0x01485fbf), X(0x014b8648), X(0x014eb0a4), X(0x0151ded2), + X(0x015510d4), X(0x015846a8), X(0x015b8050), X(0x015ebdc9), + X(0x0161ff15), X(0x01654434), X(0x01688d24), X(0x016bd9e6), + X(0x016f2a7b), X(0x01727ee1), X(0x0175d718), X(0x01793321), + X(0x017c92fc), X(0x017ff6a7), X(0x01835e24), X(0x0186c972), + X(0x018a3890), X(0x018dab7f), X(0x0191223f), X(0x01949ccf), + X(0x01981b2f), X(0x019b9d5f), X(0x019f235f), X(0x01a2ad2f), + X(0x01a63acf), X(0x01a9cc3e), X(0x01ad617c), X(0x01b0fa8a), + X(0x01b49767), X(0x01b83813), X(0x01bbdc8d), X(0x01bf84d6), + X(0x01c330ee), X(0x01c6e0d4), X(0x01ca9488), X(0x01ce4c0b), + X(0x01d2075b), X(0x01d5c679), X(0x01d98964), X(0x01dd501d), + X(0x01e11aa3), X(0x01e4e8f6), X(0x01e8bb17), X(0x01ec9104), + X(0x01f06abd), X(0x01f44844), X(0x01f82996), X(0x01fc0eb5), + X(0x01fff7a0), X(0x0203e456), X(0x0207d4d9), X(0x020bc926), + X(0x020fc140), X(0x0213bd24), X(0x0217bcd4), X(0x021bc04e), + X(0x021fc793), X(0x0223d2a3), X(0x0227e17d), X(0x022bf421), + X(0x02300a90), X(0x023424c8), X(0x023842ca), X(0x023c6495), + X(0x02408a2a), X(0x0244b389), X(0x0248e0b0), X(0x024d11a0), + X(0x02514659), X(0x02557eda), X(0x0259bb24), X(0x025dfb35), + X(0x02623f0f), X(0x026686b1), X(0x026ad21a), X(0x026f214b), + X(0x02737443), X(0x0277cb02), X(0x027c2588), X(0x028083d5), + X(0x0284e5e9), X(0x02894bc2), X(0x028db562), X(0x029222c8), + X(0x029693f4), X(0x029b08e6), X(0x029f819d), X(0x02a3fe19), + X(0x02a87e5b), X(0x02ad0261), X(0x02b18a2c), X(0x02b615bb), + X(0x02baa50f), X(0x02bf3827), X(0x02c3cf03), X(0x02c869a3), + X(0x02cd0807), X(0x02d1aa2d), X(0x02d65017), X(0x02daf9c4), + X(0x02dfa734), X(0x02e45866), X(0x02e90d5b), X(0x02edc612), + X(0x02f2828b), X(0x02f742c6), X(0x02fc06c3), X(0x0300ce80), + X(0x030599ff), X(0x030a6940), X(0x030f3c40), X(0x03141302), + X(0x0318ed84), X(0x031dcbc6), X(0x0322adc8), X(0x0327938a), + X(0x032c7d0c), X(0x03316a4c), X(0x03365b4d), X(0x033b500c), + X(0x03404889), X(0x034544c6), X(0x034a44c0), X(0x034f4879), + X(0x03544ff0), X(0x03595b24), X(0x035e6a16), X(0x03637cc5), + X(0x03689331), X(0x036dad5a), X(0x0372cb40), X(0x0377ece2), + X(0x037d1240), X(0x03823b5a), X(0x03876830), X(0x038c98c1), + X(0x0391cd0e), X(0x03970516), X(0x039c40d8), X(0x03a18055), + X(0x03a6c38d), X(0x03ac0a7f), X(0x03b1552b), X(0x03b6a390), + X(0x03bbf5af), X(0x03c14b88), X(0x03c6a519), X(0x03cc0263), + X(0x03d16366), X(0x03d6c821), X(0x03dc3094), X(0x03e19cc0), + X(0x03e70ca2), X(0x03ec803d), X(0x03f1f78e), X(0x03f77296), + X(0x03fcf155), X(0x040273cb), X(0x0407f9f7), X(0x040d83d9), + X(0x04131170), X(0x0418a2bd), X(0x041e37c0), X(0x0423d077), + X(0x04296ce4), X(0x042f0d04), X(0x0434b0da), X(0x043a5863), + X(0x044003a0), X(0x0445b290), X(0x044b6534), X(0x04511b8b), + X(0x0456d595), X(0x045c9352), X(0x046254c1), X(0x046819e1), + X(0x046de2b4), X(0x0473af39), X(0x04797f6e), X(0x047f5355), + X(0x04852aec), X(0x048b0635), X(0x0490e52d), X(0x0496c7d6), + X(0x049cae2e), X(0x04a29836), X(0x04a885ed), X(0x04ae7753), + X(0x04b46c68), X(0x04ba652b), X(0x04c0619d), X(0x04c661bc), + X(0x04cc658a), X(0x04d26d04), X(0x04d8782c), X(0x04de8701), + X(0x04e49983), X(0x04eaafb0), X(0x04f0c98a), X(0x04f6e710), + X(0x04fd0842), X(0x05032d1e), X(0x050955a6), X(0x050f81d8), + X(0x0515b1b5), X(0x051be53d), X(0x05221c6e), X(0x05285748), + X(0x052e95cd), X(0x0534d7fa), X(0x053b1dd0), X(0x0541674e), + X(0x0547b475), X(0x054e0544), X(0x055459bb), X(0x055ab1d9), + X(0x05610d9e), X(0x05676d0a), X(0x056dd01c), X(0x057436d5), + X(0x057aa134), X(0x05810f38), X(0x058780e2), X(0x058df631), + X(0x05946f25), X(0x059aebbe), X(0x05a16bfa), X(0x05a7efdb), + X(0x05ae775f), X(0x05b50287), X(0x05bb9152), X(0x05c223c0), + X(0x05c8b9d0), X(0x05cf5382), X(0x05d5f0d6), X(0x05dc91cc), + X(0x05e33663), X(0x05e9de9c), X(0x05f08a75), X(0x05f739ee), + X(0x05fded07), X(0x0604a3c0), X(0x060b5e19), X(0x06121c11), + X(0x0618dda8), X(0x061fa2dd), X(0x06266bb1), X(0x062d3822), + X(0x06340831), X(0x063adbde), X(0x0641b328), X(0x06488e0e), + X(0x064f6c91), X(0x06564eaf), X(0x065d346a), X(0x06641dc0), + X(0x066b0ab1), X(0x0671fb3d), X(0x0678ef64), X(0x067fe724), + X(0x0686e27f), X(0x068de173), X(0x0694e400), X(0x069bea27), + X(0x06a2f3e6), X(0x06aa013d), X(0x06b1122c), X(0x06b826b3), + X(0x06bf3ed1), X(0x06c65a86), X(0x06cd79d1), X(0x06d49cb3), + X(0x06dbc32b), X(0x06e2ed38), X(0x06ea1adb), X(0x06f14c13), + X(0x06f880df), X(0x06ffb940), X(0x0706f535), X(0x070e34bd), + X(0x071577d9), X(0x071cbe88), X(0x072408c9), X(0x072b569d), + X(0x0732a802), X(0x0739fcf9), X(0x07415582), X(0x0748b19b), + X(0x07501145), X(0x0757747f), X(0x075edb49), X(0x076645a3), + X(0x076db38c), X(0x07752503), X(0x077c9a09), X(0x0784129e), + X(0x078b8ec0), X(0x07930e70), X(0x079a91ac), X(0x07a21876), + X(0x07a9a2cc), X(0x07b130ad), X(0x07b8c21b), X(0x07c05714), + X(0x07c7ef98), X(0x07cf8ba6), X(0x07d72b3f), X(0x07dece62), + X(0x07e6750e), X(0x07ee1f43), X(0x07f5cd01), X(0x07fd7e48), + X(0x08053316), X(0x080ceb6d), X(0x0814a74a), X(0x081c66af), + X(0x0824299a), X(0x082bf00c), X(0x0833ba03), X(0x083b8780), + X(0x08435882), X(0x084b2d09), X(0x08530514), X(0x085ae0a3), + X(0x0862bfb6), X(0x086aa24c), X(0x08728865), X(0x087a7201), + X(0x08825f1e), X(0x088a4fbe), X(0x089243de), X(0x089a3b80), + X(0x08a236a2), X(0x08aa3545), X(0x08b23767), X(0x08ba3d09), + X(0x08c2462a), X(0x08ca52c9), X(0x08d262e7), X(0x08da7682), + X(0x08e28d9c), X(0x08eaa832), X(0x08f2c645), X(0x08fae7d4), + X(0x09030cdf), X(0x090b3566), X(0x09136168), X(0x091b90e5), + X(0x0923c3dc), X(0x092bfa4d), X(0x09343437), X(0x093c719b), + X(0x0944b277), X(0x094cf6cc), X(0x09553e99), X(0x095d89dd), + X(0x0965d899), X(0x096e2acb), X(0x09768073), X(0x097ed991), + X(0x09873625), X(0x098f962e), X(0x0997f9ac), X(0x09a0609e), + X(0x09a8cb04), X(0x09b138dd), X(0x09b9aa29), X(0x09c21ee8), + X(0x09ca9719), X(0x09d312bc), X(0x09db91d0), X(0x09e41456), + X(0x09ec9a4b), X(0x09f523b1), X(0x09fdb087), X(0x0a0640cc), + X(0x0a0ed47f), X(0x0a176ba2), X(0x0a200632), X(0x0a28a42f), + X(0x0a31459a), X(0x0a39ea72), X(0x0a4292b5), X(0x0a4b3e65), + X(0x0a53ed80), X(0x0a5ca006), X(0x0a6555f7), X(0x0a6e0f51), + X(0x0a76cc16), X(0x0a7f8c44), X(0x0a884fda), X(0x0a9116d9), + X(0x0a99e140), X(0x0aa2af0e), X(0x0aab8043), X(0x0ab454df), + X(0x0abd2ce1), X(0x0ac60849), X(0x0acee716), X(0x0ad7c948), + X(0x0ae0aedf), X(0x0ae997d9), X(0x0af28437), X(0x0afb73f7), + X(0x0b04671b), X(0x0b0d5da0), X(0x0b165788), X(0x0b1f54d0), + X(0x0b285579), X(0x0b315983), X(0x0b3a60ec), X(0x0b436bb5), + X(0x0b4c79dd), X(0x0b558b63), X(0x0b5ea048), X(0x0b67b88a), + X(0x0b70d429), X(0x0b79f324), X(0x0b83157c), X(0x0b8c3b30), + X(0x0b95643f), X(0x0b9e90a8), X(0x0ba7c06c), X(0x0bb0f38a), + X(0x0bba2a01), X(0x0bc363d1), X(0x0bcca0f9), X(0x0bd5e17a), + X(0x0bdf2552), X(0x0be86c81), X(0x0bf1b706), X(0x0bfb04e2), + X(0x0c045613), X(0x0c0daa99), X(0x0c170274), X(0x0c205da3), + X(0x0c29bc25), X(0x0c331dfb), X(0x0c3c8323), X(0x0c45eb9e), + X(0x0c4f576a), X(0x0c58c688), X(0x0c6238f6), X(0x0c6baeb5), + X(0x0c7527c3), X(0x0c7ea421), X(0x0c8823cd), X(0x0c91a6c8), + X(0x0c9b2d10), X(0x0ca4b6a6), X(0x0cae4389), X(0x0cb7d3b8), + X(0x0cc16732), X(0x0ccafdf8), X(0x0cd49809), X(0x0cde3564), + X(0x0ce7d609), X(0x0cf179f7), X(0x0cfb212e), X(0x0d04cbad), + X(0x0d0e7974), X(0x0d182a83), X(0x0d21ded8), X(0x0d2b9673), + X(0x0d355154), X(0x0d3f0f7b), X(0x0d48d0e6), X(0x0d529595), + X(0x0d5c5d88), X(0x0d6628be), X(0x0d6ff737), X(0x0d79c8f2), + X(0x0d839dee), X(0x0d8d762c), X(0x0d9751aa), X(0x0da13068), + X(0x0dab1266), X(0x0db4f7a3), X(0x0dbee01e), X(0x0dc8cbd8), + X(0x0dd2bace), X(0x0ddcad02), X(0x0de6a272), X(0x0df09b1e), + X(0x0dfa9705), X(0x0e049627), X(0x0e0e9883), X(0x0e189e19), + X(0x0e22a6e8), X(0x0e2cb2f0), X(0x0e36c230), X(0x0e40d4a8), + X(0x0e4aea56), X(0x0e55033b), X(0x0e5f1f56), X(0x0e693ea7), + X(0x0e73612c), X(0x0e7d86e5), X(0x0e87afd3), X(0x0e91dbf3), + X(0x0e9c0b47), X(0x0ea63dcc), X(0x0eb07383), X(0x0ebaac6b), + X(0x0ec4e883), X(0x0ecf27cc), X(0x0ed96a44), X(0x0ee3afea), + X(0x0eedf8bf), X(0x0ef844c2), X(0x0f0293f2), X(0x0f0ce64e), + X(0x0f173bd6), X(0x0f21948a), X(0x0f2bf069), X(0x0f364f72), + X(0x0f40b1a5), X(0x0f4b1701), X(0x0f557f86), X(0x0f5feb32), + X(0x0f6a5a07), X(0x0f74cc02), X(0x0f7f4124), X(0x0f89b96b), + X(0x0f9434d8), X(0x0f9eb369), X(0x0fa9351e), X(0x0fb3b9f7), + X(0x0fbe41f3), X(0x0fc8cd11), X(0x0fd35b51), X(0x0fddecb2), + X(0x0fe88134), X(0x0ff318d6), X(0x0ffdb397), X(0x10085177), + X(0x1012f275), X(0x101d9691), X(0x10283dca), X(0x1032e81f), + X(0x103d9591), X(0x1048461e), X(0x1052f9c5), X(0x105db087), + X(0x10686a62), X(0x10732756), X(0x107de763), X(0x1088aa87), + X(0x109370c2), X(0x109e3a14), X(0x10a9067c), X(0x10b3d5f9), + X(0x10bea88b), X(0x10c97e31), X(0x10d456eb), X(0x10df32b8), + X(0x10ea1197), X(0x10f4f387), X(0x10ffd889), X(0x110ac09b), + X(0x1115abbe), X(0x112099ef), X(0x112b8b2f), X(0x11367f7d), + X(0x114176d9), X(0x114c7141), X(0x11576eb6), X(0x11626f36), + X(0x116d72c1), X(0x11787957), X(0x118382f6), X(0x118e8f9e), + X(0x11999f4f), X(0x11a4b208), X(0x11afc7c7), X(0x11bae08e), + X(0x11c5fc5a), X(0x11d11b2c), X(0x11dc3d02), X(0x11e761dd), + X(0x11f289ba), X(0x11fdb49b), X(0x1208e27e), X(0x12141362), + X(0x121f4748), X(0x122a7e2d), X(0x1235b812), X(0x1240f4f6), + X(0x124c34d9), X(0x125777b9), X(0x1262bd96), X(0x126e0670), + X(0x12795245), X(0x1284a115), X(0x128ff2e0), X(0x129b47a5), + X(0x12a69f63), X(0x12b1fa19), X(0x12bd57c7), X(0x12c8b86c), + X(0x12d41c08), X(0x12df829a), X(0x12eaec21), X(0x12f6589d), + X(0x1301c80c), X(0x130d3a6f), X(0x1318afc4), X(0x1324280b), + X(0x132fa344), X(0x133b216d), X(0x1346a286), X(0x1352268e), + X(0x135dad85), X(0x1369376a), X(0x1374c43c), X(0x138053fb), + X(0x138be6a5), X(0x13977c3b), X(0x13a314bc), X(0x13aeb026), + X(0x13ba4e79), X(0x13c5efb5), X(0x13d193d9), X(0x13dd3ae4), + X(0x13e8e4d6), X(0x13f491ad), X(0x1400416a), X(0x140bf40b), + X(0x1417a98f), X(0x142361f7), X(0x142f1d41), X(0x143adb6d), + X(0x14469c7a), X(0x14526067), X(0x145e2734), X(0x1469f0df), + X(0x1475bd69), X(0x14818cd0), X(0x148d5f15), X(0x14993435), + X(0x14a50c31), X(0x14b0e708), X(0x14bcc4b8), X(0x14c8a542), + X(0x14d488a5), X(0x14e06edf), X(0x14ec57f1), X(0x14f843d9), + X(0x15043297), X(0x1510242b), X(0x151c1892), X(0x15280fcd), + X(0x153409dc), X(0x154006bc), X(0x154c066e), X(0x155808f1), + X(0x15640e44), X(0x15701666), X(0x157c2157), X(0x15882f16), + X(0x15943fa2), X(0x15a052fb), X(0x15ac691f), X(0x15b8820f), + X(0x15c49dc8), X(0x15d0bc4c), X(0x15dcdd98), X(0x15e901ad), + X(0x15f52888), X(0x1601522b), X(0x160d7e93), X(0x1619adc1), + X(0x1625dfb3), X(0x16321469), X(0x163e4be2), X(0x164a861d), + X(0x1656c31a), X(0x166302d8), X(0x166f4555), X(0x167b8a92), + X(0x1687d28e), X(0x16941d47), X(0x16a06abe), X(0x16acbaf0), + X(0x16b90ddf), X(0x16c56388), X(0x16d1bbeb), X(0x16de1708), + X(0x16ea74dd), X(0x16f6d56a), X(0x170338ae), X(0x170f9ea8), + X(0x171c0758), X(0x172872bd), X(0x1734e0d6), X(0x174151a2), + X(0x174dc520), X(0x175a3b51), X(0x1766b432), X(0x17732fc4), + X(0x177fae05), X(0x178c2ef4), X(0x1798b292), X(0x17a538dd), + X(0x17b1c1d4), X(0x17be4d77), X(0x17cadbc5), X(0x17d76cbc), + X(0x17e4005e), X(0x17f096a7), X(0x17fd2f98), X(0x1809cb31), + X(0x1816696f), X(0x18230a53), X(0x182faddc), X(0x183c5408), + X(0x1848fcd8), X(0x1855a849), X(0x1862565d), X(0x186f0711), + X(0x187bba64), X(0x18887057), X(0x189528e9), X(0x18a1e418), + X(0x18aea1e3), X(0x18bb624b), X(0x18c8254e), X(0x18d4eaeb), + X(0x18e1b321), X(0x18ee7df1), X(0x18fb4b58), X(0x19081b57), + X(0x1914edec), X(0x1921c317), X(0x192e9ad6), X(0x193b7529), + X(0x19485210), X(0x19553189), X(0x19621393), X(0x196ef82e), + X(0x197bdf59), X(0x1988c913), X(0x1995b55c), X(0x19a2a432), + X(0x19af9595), X(0x19bc8983), X(0x19c97ffd), X(0x19d67900), + X(0x19e3748e), X(0x19f072a3), X(0x19fd7341), X(0x1a0a7665), + X(0x1a177c10), X(0x1a248440), X(0x1a318ef4), X(0x1a3e9c2c), + X(0x1a4babe7), X(0x1a58be24), X(0x1a65d2e2), X(0x1a72ea20), + X(0x1a8003de), X(0x1a8d201a), X(0x1a9a3ed5), X(0x1aa7600c), + X(0x1ab483bf), X(0x1ac1a9ee), X(0x1aced297), X(0x1adbfdba), + X(0x1ae92b56), X(0x1af65b69), X(0x1b038df4), X(0x1b10c2f5), + X(0x1b1dfa6b), X(0x1b2b3456), X(0x1b3870b5), X(0x1b45af87), + X(0x1b52f0ca), X(0x1b60347f), X(0x1b6d7aa4), X(0x1b7ac339), + X(0x1b880e3c), X(0x1b955bad), X(0x1ba2ab8b), X(0x1baffdd5), + X(0x1bbd528a), X(0x1bcaa9a9), X(0x1bd80332), X(0x1be55f24), + X(0x1bf2bd7d), X(0x1c001e3d), X(0x1c0d8164), X(0x1c1ae6ef), + X(0x1c284edf), X(0x1c35b932), X(0x1c4325e7), X(0x1c5094fe), + X(0x1c5e0677), X(0x1c6b7a4f), X(0x1c78f086), X(0x1c86691b), + X(0x1c93e40d), X(0x1ca1615c), X(0x1caee107), X(0x1cbc630c), + X(0x1cc9e76b), X(0x1cd76e23), X(0x1ce4f733), X(0x1cf2829a), + X(0x1d001057), X(0x1d0da06a), X(0x1d1b32d1), X(0x1d28c78c), + X(0x1d365e9a), X(0x1d43f7f9), X(0x1d5193a9), X(0x1d5f31aa), + X(0x1d6cd1f9), X(0x1d7a7497), X(0x1d881982), X(0x1d95c0ba), + X(0x1da36a3d), X(0x1db1160a), X(0x1dbec422), X(0x1dcc7482), + X(0x1dda272b), X(0x1de7dc1a), X(0x1df59350), X(0x1e034ccb), + X(0x1e11088a), X(0x1e1ec68c), X(0x1e2c86d1), X(0x1e3a4958), + X(0x1e480e20), X(0x1e55d527), X(0x1e639e6d), X(0x1e7169f1), + X(0x1e7f37b2), X(0x1e8d07b0), X(0x1e9ad9e8), X(0x1ea8ae5b), + X(0x1eb68507), X(0x1ec45dec), X(0x1ed23908), X(0x1ee0165b), + X(0x1eedf5e4), X(0x1efbd7a1), X(0x1f09bb92), X(0x1f17a1b6), + X(0x1f258a0d), X(0x1f337494), X(0x1f41614b), X(0x1f4f5032), + X(0x1f5d4147), X(0x1f6b3489), X(0x1f7929f7), X(0x1f872192), + X(0x1f951b56), X(0x1fa31744), X(0x1fb1155b), X(0x1fbf159a), + X(0x1fcd17ff), X(0x1fdb1c8b), X(0x1fe9233b), X(0x1ff72c0f), + X(0x20053706), X(0x20134420), X(0x2021535a), X(0x202f64b4), + X(0x203d782e), X(0x204b8dc6), X(0x2059a57c), X(0x2067bf4e), + X(0x2075db3b), X(0x2083f943), X(0x20921964), X(0x20a03b9e), + X(0x20ae5fef), X(0x20bc8657), X(0x20caaed5), X(0x20d8d967), + X(0x20e7060e), X(0x20f534c7), X(0x21036592), X(0x2111986e), + X(0x211fcd59), X(0x212e0454), X(0x213c3d5d), X(0x214a7873), + X(0x2158b594), X(0x2166f4c1), X(0x217535f8), X(0x21837938), + X(0x2191be81), X(0x21a005d0), X(0x21ae4f26), X(0x21bc9a81), + X(0x21cae7e0), X(0x21d93743), X(0x21e788a8), X(0x21f5dc0e), + X(0x22043174), X(0x221288da), X(0x2220e23e), X(0x222f3da0), + X(0x223d9afe), X(0x224bfa58), X(0x225a5bac), X(0x2268bef9), + X(0x2277243f), X(0x22858b7d), X(0x2293f4b0), X(0x22a25fda), + X(0x22b0ccf8), X(0x22bf3c09), X(0x22cdad0d), X(0x22dc2002), + X(0x22ea94e8), X(0x22f90bbe), X(0x23078482), X(0x2315ff33), + X(0x23247bd1), X(0x2332fa5b), X(0x23417acf), X(0x234ffd2c), + X(0x235e8173), X(0x236d07a0), X(0x237b8fb4), X(0x238a19ae), + X(0x2398a58c), X(0x23a7334d), X(0x23b5c2f1), X(0x23c45477), + X(0x23d2e7dd), X(0x23e17d22), X(0x23f01446), X(0x23fead47), + X(0x240d4825), X(0x241be4dd), X(0x242a8371), X(0x243923dd), + X(0x2447c622), X(0x24566a3e), X(0x24651031), X(0x2473b7f8), + X(0x24826194), X(0x24910d03), X(0x249fba44), X(0x24ae6957), + X(0x24bd1a39), X(0x24cbccea), X(0x24da816a), X(0x24e937b7), + X(0x24f7efcf), X(0x2506a9b3), X(0x25156560), X(0x252422d6), + X(0x2532e215), X(0x2541a31a), X(0x255065e4), X(0x255f2a74), + X(0x256df0c7), X(0x257cb8dd), X(0x258b82b4), X(0x259a4e4c), + X(0x25a91ba4), X(0x25b7eaba), X(0x25c6bb8e), X(0x25d58e1e), + X(0x25e46269), X(0x25f3386e), X(0x2602102d), X(0x2610e9a4), + X(0x261fc4d3), X(0x262ea1b7), X(0x263d8050), X(0x264c609e), + X(0x265b429e), X(0x266a2650), X(0x26790bb3), X(0x2687f2c6), + X(0x2696db88), X(0x26a5c5f7), X(0x26b4b213), X(0x26c39fda), + X(0x26d28f4c), X(0x26e18067), X(0x26f0732b), X(0x26ff6796), + X(0x270e5da7), X(0x271d555d), X(0x272c4eb7), X(0x273b49b5), + X(0x274a4654), X(0x27594495), X(0x27684475), X(0x277745f4), + X(0x27864910), X(0x27954dc9), X(0x27a4541e), X(0x27b35c0d), + X(0x27c26596), X(0x27d170b7), X(0x27e07d6f), X(0x27ef8bbd), + X(0x27fe9ba0), X(0x280dad18), X(0x281cc022), X(0x282bd4be), + X(0x283aeaeb), X(0x284a02a7), X(0x28591bf2), X(0x286836cb), + X(0x28775330), X(0x28867120), X(0x2895909b), X(0x28a4b19e), + X(0x28b3d42a), X(0x28c2f83d), X(0x28d21dd5), X(0x28e144f3), + X(0x28f06d94), X(0x28ff97b8), X(0x290ec35d), X(0x291df082), + X(0x292d1f27), X(0x293c4f4a), X(0x294b80eb), X(0x295ab407), + X(0x2969e89e), X(0x29791eaf), X(0x29885639), X(0x29978f3b), + X(0x29a6c9b3), X(0x29b605a0), X(0x29c54302), X(0x29d481d7), + X(0x29e3c21e), X(0x29f303d6), X(0x2a0246fd), X(0x2a118b94), + X(0x2a20d198), X(0x2a301909), X(0x2a3f61e6), X(0x2a4eac2c), + X(0x2a5df7dc), X(0x2a6d44f4), X(0x2a7c9374), X(0x2a8be359), + X(0x2a9b34a2), X(0x2aaa8750), X(0x2ab9db60), X(0x2ac930d1), + X(0x2ad887a3), X(0x2ae7dfd3), X(0x2af73962), X(0x2b06944e), + X(0x2b15f096), X(0x2b254e38), X(0x2b34ad34), X(0x2b440d89), + X(0x2b536f34), X(0x2b62d236), X(0x2b72368d), X(0x2b819c38), + X(0x2b910336), X(0x2ba06b86), X(0x2bafd526), X(0x2bbf4015), + X(0x2bceac53), X(0x2bde19de), X(0x2bed88b5), X(0x2bfcf8d7), + X(0x2c0c6a43), X(0x2c1bdcf7), X(0x2c2b50f3), X(0x2c3ac635), + X(0x2c4a3cbd), X(0x2c59b488), X(0x2c692d97), X(0x2c78a7e7), + X(0x2c882378), X(0x2c97a049), X(0x2ca71e58), X(0x2cb69da4), + X(0x2cc61e2c), X(0x2cd59ff0), X(0x2ce522ed), X(0x2cf4a723), + X(0x2d042c90), X(0x2d13b334), X(0x2d233b0d), X(0x2d32c41a), + X(0x2d424e5a), X(0x2d51d9cc), X(0x2d61666e), X(0x2d70f440), + X(0x2d808340), X(0x2d90136e), X(0x2d9fa4c7), X(0x2daf374c), + X(0x2dbecafa), X(0x2dce5fd1), X(0x2dddf5cf), X(0x2ded8cf4), + X(0x2dfd253d), X(0x2e0cbeab), X(0x2e1c593b), X(0x2e2bf4ed), + X(0x2e3b91c0), X(0x2e4b2fb1), X(0x2e5acec1), X(0x2e6a6eee), + X(0x2e7a1037), X(0x2e89b29b), X(0x2e995618), X(0x2ea8faad), + X(0x2eb8a05a), X(0x2ec8471c), X(0x2ed7eef4), X(0x2ee797df), + X(0x2ef741dc), X(0x2f06eceb), X(0x2f16990a), X(0x2f264639), + X(0x2f35f475), X(0x2f45a3bd), X(0x2f555412), X(0x2f650570), + X(0x2f74b7d8), X(0x2f846b48), X(0x2f941fbe), X(0x2fa3d53a), + X(0x2fb38bbb), X(0x2fc3433f), X(0x2fd2fbc5), X(0x2fe2b54c), + X(0x2ff26fd3), X(0x30022b58), X(0x3011e7db), X(0x3021a55a), + X(0x303163d4), X(0x30412348), X(0x3050e3b5), X(0x3060a519), + X(0x30706773), X(0x30802ac3), X(0x308fef06), X(0x309fb43d), + X(0x30af7a65), X(0x30bf417d), X(0x30cf0985), X(0x30ded27a), + X(0x30ee9c5d), X(0x30fe672b), X(0x310e32e3), X(0x311dff85), + X(0x312dcd0f), X(0x313d9b80), X(0x314d6ad7), X(0x315d3b12), + X(0x316d0c30), X(0x317cde31), X(0x318cb113), X(0x319c84d4), + X(0x31ac5974), X(0x31bc2ef1), X(0x31cc054b), X(0x31dbdc7f), + X(0x31ebb48e), X(0x31fb8d74), X(0x320b6733), X(0x321b41c7), + X(0x322b1d31), X(0x323af96e), X(0x324ad67e), X(0x325ab45f), + X(0x326a9311), X(0x327a7291), X(0x328a52e0), X(0x329a33fb), + X(0x32aa15e1), X(0x32b9f892), X(0x32c9dc0c), X(0x32d9c04d), + X(0x32e9a555), X(0x32f98b22), X(0x330971b4), X(0x33195909), + X(0x3329411f), X(0x333929f6), X(0x3349138c), X(0x3358fde1), + X(0x3368e8f2), X(0x3378d4c0), X(0x3388c147), X(0x3398ae89), + X(0x33a89c82), X(0x33b88b32), X(0x33c87a98), X(0x33d86ab2), + X(0x33e85b80), X(0x33f84d00), X(0x34083f30), X(0x34183210), + X(0x3428259f), X(0x343819db), X(0x34480ec3), X(0x34580455), + X(0x3467fa92), X(0x3477f176), X(0x3487e902), X(0x3497e134), + X(0x34a7da0a), X(0x34b7d384), X(0x34c7cda0), X(0x34d7c85e), + X(0x34e7c3bb), X(0x34f7bfb7), X(0x3507bc50), X(0x3517b985), + X(0x3527b756), X(0x3537b5c0), X(0x3547b4c3), X(0x3557b45d), + X(0x3567b48d), X(0x3577b552), X(0x3587b6aa), X(0x3597b895), + X(0x35a7bb12), X(0x35b7be1e), X(0x35c7c1b9), X(0x35d7c5e1), + X(0x35e7ca96), X(0x35f7cfd6), X(0x3607d5a0), X(0x3617dbf3), + X(0x3627e2cd), X(0x3637ea2d), X(0x3647f212), X(0x3657fa7b), + X(0x36680366), X(0x36780cd2), X(0x368816bf), X(0x3698212b), + X(0x36a82c14), X(0x36b83779), X(0x36c8435a), X(0x36d84fb4), + X(0x36e85c88), X(0x36f869d2), X(0x37087793), X(0x371885c9), + X(0x37289473), X(0x3738a38f), X(0x3748b31d), X(0x3758c31a), + X(0x3768d387), X(0x3778e461), X(0x3788f5a7), X(0x37990759), + X(0x37a91975), X(0x37b92bf9), X(0x37c93ee4), X(0x37d95236), + X(0x37e965ed), X(0x37f97a08), X(0x38098e85), X(0x3819a363), + X(0x3829b8a2), X(0x3839ce3f), X(0x3849e43a), X(0x3859fa91), + X(0x386a1143), X(0x387a284f), X(0x388a3fb4), X(0x389a5770), + X(0x38aa6f83), X(0x38ba87ea), X(0x38caa0a5), X(0x38dab9b2), + X(0x38ead311), X(0x38faecbf), X(0x390b06bc), X(0x391b2107), + X(0x392b3b9e), X(0x393b5680), X(0x394b71ac), X(0x395b8d20), + X(0x396ba8dc), X(0x397bc4dd), X(0x398be124), X(0x399bfdae), + X(0x39ac1a7a), X(0x39bc3788), X(0x39cc54d5), X(0x39dc7261), + X(0x39ec902a), X(0x39fcae2f), X(0x3a0ccc70), X(0x3a1ceaea), + X(0x3a2d099c), X(0x3a3d2885), X(0x3a4d47a5), X(0x3a5d66f9), + X(0x3a6d8680), X(0x3a7da63a), X(0x3a8dc625), X(0x3a9de63f), + X(0x3aae0688), X(0x3abe26fe), X(0x3ace47a0), X(0x3ade686d), + X(0x3aee8963), X(0x3afeaa82), X(0x3b0ecbc7), X(0x3b1eed32), + X(0x3b2f0ec2), X(0x3b3f3075), X(0x3b4f524a), X(0x3b5f7440), + X(0x3b6f9656), X(0x3b7fb889), X(0x3b8fdada), X(0x3b9ffd46), + X(0x3bb01fce), X(0x3bc0426e), X(0x3bd06526), X(0x3be087f6), + X(0x3bf0aada), X(0x3c00cdd4), X(0x3c10f0e0), X(0x3c2113fe), + X(0x3c31372d), X(0x3c415a6b), X(0x3c517db7), X(0x3c61a110), + X(0x3c71c475), X(0x3c81e7e4), X(0x3c920b5c), X(0x3ca22edc), + X(0x3cb25262), X(0x3cc275ee), X(0x3cd2997e), X(0x3ce2bd11), + X(0x3cf2e0a6), X(0x3d03043b), X(0x3d1327cf), X(0x3d234b61), + X(0x3d336ef0), X(0x3d43927a), X(0x3d53b5ff), X(0x3d63d97c), + X(0x3d73fcf1), X(0x3d84205c), X(0x3d9443bd), X(0x3da46711), + X(0x3db48a58), X(0x3dc4ad91), X(0x3dd4d0ba), X(0x3de4f3d1), + X(0x3df516d7), X(0x3e0539c9), X(0x3e155ca6), X(0x3e257f6d), + X(0x3e35a21d), X(0x3e45c4b4), X(0x3e55e731), X(0x3e660994), + X(0x3e762bda), X(0x3e864e03), X(0x3e96700d), X(0x3ea691f7), + X(0x3eb6b3bf), X(0x3ec6d565), X(0x3ed6f6e8), X(0x3ee71845), + X(0x3ef7397c), X(0x3f075a8c), X(0x3f177b73), X(0x3f279c30), + X(0x3f37bcc2), X(0x3f47dd27), X(0x3f57fd5f), X(0x3f681d68), + X(0x3f783d40), X(0x3f885ce7), X(0x3f987c5c), X(0x3fa89b9c), + X(0x3fb8baa7), X(0x3fc8d97c), X(0x3fd8f819), X(0x3fe9167e), + X(0x3ff934a8), X(0x40095296), X(0x40197049), X(0x40298dbd), + X(0x4039aaf2), X(0x4049c7e7), X(0x4059e49a), X(0x406a010a), + X(0x407a1d36), X(0x408a391d), X(0x409a54bd), X(0x40aa7015), + X(0x40ba8b25), X(0x40caa5ea), X(0x40dac063), X(0x40eada90), + X(0x40faf46e), X(0x410b0dfe), X(0x411b273d), X(0x412b402a), + X(0x413b58c4), X(0x414b710a), X(0x415b88fa), X(0x416ba093), + X(0x417bb7d5), X(0x418bcebe), X(0x419be54c), X(0x41abfb7e), + X(0x41bc1153), X(0x41cc26ca), X(0x41dc3be2), X(0x41ec5099), + X(0x41fc64ef), X(0x420c78e1), X(0x421c8c6f), X(0x422c9f97), + X(0x423cb258), X(0x424cc4b2), X(0x425cd6a2), X(0x426ce827), + X(0x427cf941), X(0x428d09ee), X(0x429d1a2c), X(0x42ad29fb), + X(0x42bd3959), X(0x42cd4846), X(0x42dd56bf), X(0x42ed64c3), + X(0x42fd7252), X(0x430d7f6a), X(0x431d8c0a), X(0x432d9831), + X(0x433da3dd), X(0x434daf0d), X(0x435db9c0), X(0x436dc3f5), + X(0x437dcdab), X(0x438dd6df), X(0x439ddf92), X(0x43ade7c1), + X(0x43bdef6c), X(0x43cdf691), X(0x43ddfd2f), X(0x43ee0345), + X(0x43fe08d2), X(0x440e0dd4), X(0x441e124b), X(0x442e1634), + X(0x443e198f), X(0x444e1c5a), X(0x445e1e95), X(0x446e203e), + X(0x447e2153), X(0x448e21d5), X(0x449e21c0), X(0x44ae2115), + X(0x44be1fd1), X(0x44ce1df4), X(0x44de1b7d), X(0x44ee186a), + X(0x44fe14ba), X(0x450e106b), X(0x451e0b7e), X(0x452e05ef), + X(0x453dffbf), X(0x454df8eb), X(0x455df173), X(0x456de956), + X(0x457de092), X(0x458dd726), X(0x459dcd10), X(0x45adc251), + X(0x45bdb6e5), X(0x45cdaacd), X(0x45dd9e06), X(0x45ed9091), + X(0x45fd826a), X(0x460d7392), X(0x461d6407), X(0x462d53c8), + X(0x463d42d4), X(0x464d3129), X(0x465d1ec6), X(0x466d0baa), + X(0x467cf7d3), X(0x468ce342), X(0x469ccdf3), X(0x46acb7e7), + X(0x46bca11c), X(0x46cc8990), X(0x46dc7143), X(0x46ec5833), + X(0x46fc3e5f), X(0x470c23c6), X(0x471c0867), X(0x472bec40), + X(0x473bcf50), X(0x474bb196), X(0x475b9311), X(0x476b73c0), + X(0x477b53a1), X(0x478b32b4), X(0x479b10f6), X(0x47aaee67), + X(0x47bacb06), X(0x47caa6d1), X(0x47da81c7), X(0x47ea5be7), + X(0x47fa3530), X(0x480a0da1), X(0x4819e537), X(0x4829bbf3), + X(0x483991d3), X(0x484966d6), X(0x48593afb), X(0x48690e3f), + X(0x4878e0a3), X(0x4888b225), X(0x489882c4), X(0x48a8527e), + X(0x48b82153), X(0x48c7ef41), X(0x48d7bc47), X(0x48e78863), + X(0x48f75396), X(0x49071ddc), X(0x4916e736), X(0x4926afa2), + X(0x4936771f), X(0x49463dac), X(0x49560347), X(0x4965c7ef), + X(0x49758ba4), X(0x49854e63), X(0x4995102c), X(0x49a4d0fe), + X(0x49b490d7), X(0x49c44fb6), X(0x49d40d9a), X(0x49e3ca82), + X(0x49f3866c), X(0x4a034159), X(0x4a12fb45), X(0x4a22b430), + X(0x4a326c19), X(0x4a4222ff), X(0x4a51d8e1), X(0x4a618dbd), + X(0x4a714192), X(0x4a80f45f), X(0x4a90a623), X(0x4aa056dd), + X(0x4ab0068b), X(0x4abfb52c), X(0x4acf62c0), X(0x4adf0f44), + X(0x4aeebab9), X(0x4afe651c), X(0x4b0e0e6c), X(0x4b1db6a9), + X(0x4b2d5dd1), X(0x4b3d03e2), X(0x4b4ca8dd), X(0x4b5c4cbf), + X(0x4b6bef88), X(0x4b7b9136), X(0x4b8b31c8), X(0x4b9ad13d), + X(0x4baa6f93), X(0x4bba0ccb), X(0x4bc9a8e2), X(0x4bd943d7), + X(0x4be8dda9), X(0x4bf87658), X(0x4c080de1), X(0x4c17a444), + X(0x4c27397f), X(0x4c36cd92), X(0x4c46607b), X(0x4c55f239), + X(0x4c6582cb), X(0x4c75122f), X(0x4c84a065), X(0x4c942d6c), + X(0x4ca3b942), X(0x4cb343e6), X(0x4cc2cd57), X(0x4cd25594), + X(0x4ce1dc9c), X(0x4cf1626d), X(0x4d00e707), X(0x4d106a68), + X(0x4d1fec8f), X(0x4d2f6d7a), X(0x4d3eed2a), X(0x4d4e6b9d), + X(0x4d5de8d1), X(0x4d6d64c5), X(0x4d7cdf79), X(0x4d8c58eb), + X(0x4d9bd11a), X(0x4dab4804), X(0x4dbabdaa), X(0x4dca3209), + X(0x4dd9a520), X(0x4de916ef), X(0x4df88774), X(0x4e07f6ae), + X(0x4e17649c), X(0x4e26d13c), X(0x4e363c8f), X(0x4e45a692), + X(0x4e550f44), X(0x4e6476a4), X(0x4e73dcb2), X(0x4e83416c), + X(0x4e92a4d1), X(0x4ea206df), X(0x4eb16796), X(0x4ec0c6f5), + X(0x4ed024fa), X(0x4edf81a5), X(0x4eeedcf3), X(0x4efe36e5), + X(0x4f0d8f79), X(0x4f1ce6ad), X(0x4f2c3c82), X(0x4f3b90f4), + X(0x4f4ae405), X(0x4f5a35b1), X(0x4f6985fa), X(0x4f78d4dc), + X(0x4f882257), X(0x4f976e6a), X(0x4fa6b914), X(0x4fb60254), + X(0x4fc54a28), X(0x4fd49090), X(0x4fe3d58b), X(0x4ff31917), + X(0x50025b33), X(0x50119bde), X(0x5020db17), X(0x503018dd), + X(0x503f552f), X(0x504e900b), X(0x505dc971), X(0x506d0160), + X(0x507c37d7), X(0x508b6cd3), X(0x509aa055), X(0x50a9d25b), + X(0x50b902e4), X(0x50c831ef), X(0x50d75f7b), X(0x50e68b87), + X(0x50f5b612), X(0x5104df1a), X(0x5114069f), X(0x51232ca0), + X(0x5132511a), X(0x5141740f), X(0x5150957b), X(0x515fb55f), + X(0x516ed3b8), X(0x517df087), X(0x518d0bca), X(0x519c257f), + X(0x51ab3da7), X(0x51ba543f), X(0x51c96947), X(0x51d87cbd), + X(0x51e78ea1), X(0x51f69ef1), X(0x5205adad), X(0x5214bad3), + X(0x5223c662), X(0x5232d05a), X(0x5241d8b9), X(0x5250df7d), + X(0x525fe4a7), X(0x526ee835), X(0x527dea26), X(0x528cea78), + X(0x529be92c), X(0x52aae63f), X(0x52b9e1b0), X(0x52c8db80), + X(0x52d7d3ac), X(0x52e6ca33), X(0x52f5bf15), X(0x5304b251), + X(0x5313a3e5), X(0x532293d0), X(0x53318212), X(0x53406ea8), + X(0x534f5993), X(0x535e42d2), X(0x536d2a62), X(0x537c1043), + X(0x538af475), X(0x5399d6f6), X(0x53a8b7c4), X(0x53b796e0), + X(0x53c67447), X(0x53d54ffa), X(0x53e429f6), X(0x53f3023b), + X(0x5401d8c8), X(0x5410ad9c), X(0x541f80b5), X(0x542e5213), + X(0x543d21b5), X(0x544bef9a), X(0x545abbc0), X(0x54698627), + X(0x54784ece), X(0x548715b3), X(0x5495dad6), X(0x54a49e35), + X(0x54b35fd0), X(0x54c21fa6), X(0x54d0ddb5), X(0x54df99fd), + X(0x54ee547c), X(0x54fd0d32), X(0x550bc41d), X(0x551a793d), + X(0x55292c91), X(0x5537de16), X(0x55468dce), X(0x55553bb6), + X(0x5563e7cd), X(0x55729213), X(0x55813a87), X(0x558fe127), + X(0x559e85f2), X(0x55ad28e9), X(0x55bbca08), X(0x55ca6950), + X(0x55d906c0), X(0x55e7a257), X(0x55f63c13), X(0x5604d3f4), + X(0x561369f8), X(0x5621fe1f), X(0x56309067), X(0x563f20d1), + X(0x564daf5a), X(0x565c3c02), X(0x566ac6c7), X(0x56794faa), + X(0x5687d6a8), X(0x56965bc1), X(0x56a4def4), X(0x56b36040), + X(0x56c1dfa4), X(0x56d05d1f), X(0x56ded8af), X(0x56ed5255), + X(0x56fbca0f), X(0x570a3fdc), X(0x5718b3bc), X(0x572725ac), + X(0x573595ad), X(0x574403bd), X(0x57526fdb), X(0x5760da07), + X(0x576f423f), X(0x577da883), X(0x578c0cd1), X(0x579a6f29), + X(0x57a8cf8a), X(0x57b72df2), X(0x57c58a61), X(0x57d3e4d6), + X(0x57e23d50), X(0x57f093cd), X(0x57fee84e), X(0x580d3ad1), + X(0x581b8b54), X(0x5829d9d8), X(0x5838265c), X(0x584670dd), + X(0x5854b95c), X(0x5862ffd8), X(0x5871444f), X(0x587f86c1), + X(0x588dc72c), X(0x589c0591), X(0x58aa41ed), X(0x58b87c40), + X(0x58c6b489), X(0x58d4eac7), X(0x58e31ef9), X(0x58f1511f), + X(0x58ff8137), X(0x590daf40), X(0x591bdb3a), X(0x592a0524), + X(0x59382cfc), X(0x594652c2), X(0x59547675), X(0x59629815), + X(0x5970b79f), X(0x597ed513), X(0x598cf071), X(0x599b09b7), + X(0x59a920e5), X(0x59b735f9), X(0x59c548f4), X(0x59d359d2), + X(0x59e16895), X(0x59ef753b), X(0x59fd7fc4), X(0x5a0b882d), + X(0x5a198e77), X(0x5a2792a0), X(0x5a3594a9), X(0x5a43948e), + X(0x5a519251), X(0x5a5f8df0), X(0x5a6d876a), X(0x5a7b7ebe), + X(0x5a8973ec), X(0x5a9766f2), X(0x5aa557d0), X(0x5ab34685), + X(0x5ac1330f), X(0x5acf1d6f), X(0x5add05a3), X(0x5aeaebaa), + X(0x5af8cf84), X(0x5b06b12f), X(0x5b1490ab), X(0x5b226df7), + X(0x5b304912), X(0x5b3e21fc), X(0x5b4bf8b2), X(0x5b59cd35), + X(0x5b679f84), X(0x5b756f9e), X(0x5b833d82), X(0x5b91092e), + X(0x5b9ed2a3), X(0x5bac99e0), X(0x5bba5ee3), X(0x5bc821ac), + X(0x5bd5e23a), X(0x5be3a08c), X(0x5bf15ca1), X(0x5bff1679), + X(0x5c0cce12), X(0x5c1a836c), X(0x5c283686), X(0x5c35e760), + X(0x5c4395f7), X(0x5c51424c), X(0x5c5eec5e), X(0x5c6c942b), + X(0x5c7a39b4), X(0x5c87dcf7), X(0x5c957df3), X(0x5ca31ca8), + X(0x5cb0b915), X(0x5cbe5338), X(0x5ccbeb12), X(0x5cd980a1), + X(0x5ce713e5), X(0x5cf4a4dd), X(0x5d023387), X(0x5d0fbfe4), + X(0x5d1d49f2), X(0x5d2ad1b1), X(0x5d38571f), X(0x5d45da3c), + X(0x5d535b08), X(0x5d60d981), X(0x5d6e55a7), X(0x5d7bcf78), + X(0x5d8946f5), X(0x5d96bc1c), X(0x5da42eec), X(0x5db19f65), + X(0x5dbf0d86), X(0x5dcc794e), X(0x5dd9e2bd), X(0x5de749d1), + X(0x5df4ae8a), X(0x5e0210e7), X(0x5e0f70e7), X(0x5e1cce8a), + X(0x5e2a29ce), X(0x5e3782b4), X(0x5e44d93a), X(0x5e522d5f), + X(0x5e5f7f23), X(0x5e6cce85), X(0x5e7a1b85), X(0x5e876620), + X(0x5e94ae58), X(0x5ea1f42a), X(0x5eaf3797), X(0x5ebc789d), + X(0x5ec9b73c), X(0x5ed6f372), X(0x5ee42d41), X(0x5ef164a5), + X(0x5efe999f), X(0x5f0bcc2f), X(0x5f18fc52), X(0x5f262a09), + X(0x5f335553), X(0x5f407e2f), X(0x5f4da49d), X(0x5f5ac89b), + X(0x5f67ea29), X(0x5f750946), X(0x5f8225f2), X(0x5f8f402b), + X(0x5f9c57f2), X(0x5fa96d44), X(0x5fb68023), X(0x5fc3908c), + X(0x5fd09e7f), X(0x5fdda9fc), X(0x5feab302), X(0x5ff7b990), + X(0x6004bda5), X(0x6011bf40), X(0x601ebe62), X(0x602bbb09), + X(0x6038b534), X(0x6045ace4), X(0x6052a216), X(0x605f94cb), + X(0x606c8502), X(0x607972b9), X(0x60865df2), X(0x609346aa), + X(0x60a02ce1), X(0x60ad1096), X(0x60b9f1c9), X(0x60c6d079), + X(0x60d3aca5), X(0x60e0864d), X(0x60ed5d70), X(0x60fa320d), + X(0x61070424), X(0x6113d3b4), X(0x6120a0bc), X(0x612d6b3c), + X(0x613a3332), X(0x6146f89f), X(0x6153bb82), X(0x61607bd9), + X(0x616d39a5), X(0x6179f4e5), X(0x6186ad98), X(0x619363bd), + X(0x61a01753), X(0x61acc85b), X(0x61b976d3), X(0x61c622bc), + X(0x61d2cc13), X(0x61df72d8), X(0x61ec170c), X(0x61f8b8ad), + X(0x620557ba), X(0x6211f434), X(0x621e8e18), X(0x622b2568), + X(0x6237ba21), X(0x62444c44), X(0x6250dbd0), X(0x625d68c4), + X(0x6269f320), X(0x62767ae2), X(0x6283000b), X(0x628f829a), + X(0x629c028e), X(0x62a87fe6), X(0x62b4faa2), X(0x62c172c2), + X(0x62cde844), X(0x62da5b29), X(0x62e6cb6e), X(0x62f33915), + X(0x62ffa41c), X(0x630c0c83), X(0x63187248), X(0x6324d56d), + X(0x633135ef), X(0x633d93ce), X(0x6349ef0b), X(0x635647a3), + X(0x63629d97), X(0x636ef0e6), X(0x637b418f), X(0x63878f92), + X(0x6393daef), X(0x63a023a4), X(0x63ac69b1), X(0x63b8ad15), + X(0x63c4edd1), X(0x63d12be3), X(0x63dd674b), X(0x63e9a008), + X(0x63f5d61a), X(0x64020980), X(0x640e3a39), X(0x641a6846), + X(0x642693a5), X(0x6432bc56), X(0x643ee258), X(0x644b05ab), + X(0x6457264e), X(0x64634441), X(0x646f5f83), X(0x647b7814), + X(0x64878df3), X(0x6493a120), X(0x649fb199), X(0x64abbf5f), + X(0x64b7ca71), X(0x64c3d2ce), X(0x64cfd877), X(0x64dbdb69), + X(0x64e7dba6), X(0x64f3d92b), X(0x64ffd3fa), X(0x650bcc11), + X(0x6517c16f), X(0x6523b415), X(0x652fa402), X(0x653b9134), + X(0x65477bad), X(0x6553636a), X(0x655f486d), X(0x656b2ab3), + X(0x65770a3d), X(0x6582e70a), X(0x658ec11a), X(0x659a986d), + X(0x65a66d00), X(0x65b23ed5), X(0x65be0deb), X(0x65c9da41), + X(0x65d5a3d7), X(0x65e16aac), X(0x65ed2ebf), X(0x65f8f011), + X(0x6604aea1), X(0x66106a6e), X(0x661c2377), X(0x6627d9be), + X(0x66338d40), X(0x663f3dfd), X(0x664aebf5), X(0x66569728), + X(0x66623f95), X(0x666de53b), X(0x6679881b), X(0x66852833), + X(0x6690c583), X(0x669c600b), X(0x66a7f7ca), X(0x66b38cc0), + X(0x66bf1eec), X(0x66caae4f), X(0x66d63ae6), X(0x66e1c4b3), + X(0x66ed4bb4), X(0x66f8cfea), X(0x67045153), X(0x670fcfef), + X(0x671b4bbe), X(0x6726c4bf), X(0x67323af3), X(0x673dae58), + X(0x67491eee), X(0x67548cb5), X(0x675ff7ab), X(0x676b5fd2), + X(0x6776c528), X(0x678227ad), X(0x678d8761), X(0x6798e443), + X(0x67a43e52), X(0x67af958f), X(0x67bae9f9), X(0x67c63b8f), + X(0x67d18a52), X(0x67dcd640), X(0x67e81f59), X(0x67f3659d), + X(0x67fea90c), X(0x6809e9a5), X(0x68152768), X(0x68206254), + X(0x682b9a68), X(0x6836cfa6), X(0x6842020b), X(0x684d3199), + X(0x68585e4d), X(0x68638829), X(0x686eaf2b), X(0x6879d354), + X(0x6884f4a2), X(0x68901316), X(0x689b2eb0), X(0x68a6476d), + X(0x68b15d50), X(0x68bc7056), X(0x68c78080), X(0x68d28dcd), + X(0x68dd983e), X(0x68e89fd0), X(0x68f3a486), X(0x68fea65d), + X(0x6909a555), X(0x6914a16f), X(0x691f9aa9), X(0x692a9104), + X(0x69358480), X(0x6940751b), X(0x694b62d5), X(0x69564daf), + X(0x696135a7), X(0x696c1abe), X(0x6976fcf3), X(0x6981dc46), + X(0x698cb8b6), X(0x69979243), X(0x69a268ed), X(0x69ad3cb4), + X(0x69b80d97), X(0x69c2db96), X(0x69cda6b0), X(0x69d86ee5), + X(0x69e33436), X(0x69edf6a1), X(0x69f8b626), X(0x6a0372c5), + X(0x6a0e2c7e), X(0x6a18e350), X(0x6a23973c), X(0x6a2e4840), + X(0x6a38f65d), X(0x6a43a191), X(0x6a4e49de), X(0x6a58ef42), + X(0x6a6391be), X(0x6a6e3151), X(0x6a78cdfa), X(0x6a8367ba), + X(0x6a8dfe90), X(0x6a98927c), X(0x6aa3237d), X(0x6aadb194), + X(0x6ab83cc0), X(0x6ac2c500), X(0x6acd4a55), X(0x6ad7ccbf), + X(0x6ae24c3c), X(0x6aecc8cd), X(0x6af74271), X(0x6b01b929), + X(0x6b0c2cf4), X(0x6b169dd1), X(0x6b210bc1), X(0x6b2b76c2), + X(0x6b35ded6), X(0x6b4043fc), X(0x6b4aa632), X(0x6b55057a), + X(0x6b5f61d3), X(0x6b69bb3d), X(0x6b7411b7), X(0x6b7e6541), + X(0x6b88b5db), X(0x6b930385), X(0x6b9d4e3f), X(0x6ba79607), + X(0x6bb1dadf), X(0x6bbc1cc6), X(0x6bc65bbb), X(0x6bd097bf), + X(0x6bdad0d0), X(0x6be506f0), X(0x6bef3a1d), X(0x6bf96a58), + X(0x6c0397a0), X(0x6c0dc1f5), X(0x6c17e957), X(0x6c220dc6), + X(0x6c2c2f41), X(0x6c364dc9), X(0x6c40695c), X(0x6c4a81fc), + X(0x6c5497a7), X(0x6c5eaa5d), X(0x6c68ba1f), X(0x6c72c6eb), + X(0x6c7cd0c3), X(0x6c86d7a6), X(0x6c90db92), X(0x6c9adc8a), + X(0x6ca4da8b), X(0x6caed596), X(0x6cb8cdab), X(0x6cc2c2ca), + X(0x6cccb4f2), X(0x6cd6a424), X(0x6ce0905e), X(0x6cea79a1), + X(0x6cf45fee), X(0x6cfe4342), X(0x6d0823a0), X(0x6d120105), + X(0x6d1bdb73), X(0x6d25b2e8), X(0x6d2f8765), X(0x6d3958ea), + X(0x6d432777), X(0x6d4cf30a), X(0x6d56bba5), X(0x6d608147), + X(0x6d6a43f0), X(0x6d7403a0), X(0x6d7dc056), X(0x6d877a13), + X(0x6d9130d6), X(0x6d9ae4a0), X(0x6da4956f), X(0x6dae4345), + X(0x6db7ee20), X(0x6dc19601), X(0x6dcb3ae7), X(0x6dd4dcd3), + X(0x6dde7bc4), X(0x6de817bb), X(0x6df1b0b6), X(0x6dfb46b7), + X(0x6e04d9bc), X(0x6e0e69c7), X(0x6e17f6d5), X(0x6e2180e9), + X(0x6e2b0801), X(0x6e348c1d), X(0x6e3e0d3d), X(0x6e478b62), + X(0x6e51068a), X(0x6e5a7eb7), X(0x6e63f3e7), X(0x6e6d661b), + X(0x6e76d552), X(0x6e80418e), X(0x6e89aacc), X(0x6e93110f), + X(0x6e9c7454), X(0x6ea5d49d), X(0x6eaf31e9), X(0x6eb88c37), + X(0x6ec1e389), X(0x6ecb37de), X(0x6ed48936), X(0x6eddd790), + X(0x6ee722ee), X(0x6ef06b4d), X(0x6ef9b0b0), X(0x6f02f315), + X(0x6f0c327c), X(0x6f156ee6), X(0x6f1ea852), X(0x6f27dec1), + X(0x6f311232), X(0x6f3a42a5), X(0x6f43701a), X(0x6f4c9a91), + X(0x6f55c20a), X(0x6f5ee686), X(0x6f680803), X(0x6f712682), + X(0x6f7a4203), X(0x6f835a86), X(0x6f8c700b), X(0x6f958291), + X(0x6f9e921a), X(0x6fa79ea4), X(0x6fb0a830), X(0x6fb9aebd), + X(0x6fc2b24c), X(0x6fcbb2dd), X(0x6fd4b06f), X(0x6fddab03), + X(0x6fe6a299), X(0x6fef9730), X(0x6ff888c9), X(0x70017763), + X(0x700a62ff), X(0x70134b9c), X(0x701c313b), X(0x702513dc), + X(0x702df37e), X(0x7036d021), X(0x703fa9c6), X(0x7048806d), + X(0x70515415), X(0x705a24bf), X(0x7062f26b), X(0x706bbd17), + X(0x707484c6), X(0x707d4976), X(0x70860b28), X(0x708ec9dc), + X(0x70978591), X(0x70a03e48), X(0x70a8f400), X(0x70b1a6bb), + X(0x70ba5677), X(0x70c30335), X(0x70cbacf5), X(0x70d453b6), + X(0x70dcf77a), X(0x70e59840), X(0x70ee3607), X(0x70f6d0d1), + X(0x70ff689d), X(0x7107fd6b), X(0x71108f3b), X(0x71191e0d), + X(0x7121a9e2), X(0x712a32b9), X(0x7132b892), X(0x713b3b6e), + X(0x7143bb4c), X(0x714c382d), X(0x7154b211), X(0x715d28f7), + X(0x71659ce0), X(0x716e0dcc), X(0x71767bbb), X(0x717ee6ac), + X(0x71874ea1), X(0x718fb399), X(0x71981594), X(0x71a07493), + X(0x71a8d094), X(0x71b1299a), X(0x71b97fa2), X(0x71c1d2af), + X(0x71ca22bf), X(0x71d26fd2), X(0x71dab9ea), X(0x71e30106), + X(0x71eb4526), X(0x71f3864a), X(0x71fbc472), X(0x7203ff9e), + X(0x720c37cf), X(0x72146d05), X(0x721c9f3f), X(0x7224ce7e), + X(0x722cfac2), X(0x7235240b), X(0x723d4a59), X(0x72456dad), + X(0x724d8e05), X(0x7255ab63), X(0x725dc5c7), X(0x7265dd31), + X(0x726df1a0), X(0x72760315), X(0x727e1191), X(0x72861d12), + X(0x728e259a), X(0x72962b28), X(0x729e2dbd), X(0x72a62d59), + X(0x72ae29fc), X(0x72b623a5), X(0x72be1a56), X(0x72c60e0e), + X(0x72cdfece), X(0x72d5ec95), X(0x72ddd764), X(0x72e5bf3b), + X(0x72eda41a), X(0x72f58601), X(0x72fd64f1), X(0x730540e9), + X(0x730d19e9), X(0x7314eff3), X(0x731cc305), X(0x73249321), + X(0x732c6046), X(0x73342a75), X(0x733bf1ad), X(0x7343b5ef), + X(0x734b773b), X(0x73533591), X(0x735af0f2), X(0x7362a95d), + X(0x736a5ed3), X(0x73721153), X(0x7379c0df), X(0x73816d76), + X(0x73891719), X(0x7390bdc7), X(0x73986181), X(0x73a00247), + X(0x73a7a01a), X(0x73af3af8), X(0x73b6d2e4), X(0x73be67dc), + X(0x73c5f9e1), X(0x73cd88f3), X(0x73d51513), X(0x73dc9e40), + X(0x73e4247c), X(0x73eba7c5), X(0x73f3281c), X(0x73faa582), + X(0x74021ff7), X(0x7409977b), X(0x74110c0d), X(0x74187daf), + X(0x741fec61), X(0x74275822), X(0x742ec0f3), X(0x743626d5), + X(0x743d89c7), X(0x7444e9c9), X(0x744c46dd), X(0x7453a101), + X(0x745af837), X(0x74624c7f), X(0x74699dd8), X(0x7470ec44), + X(0x747837c2), X(0x747f8052), X(0x7486c5f5), X(0x748e08ac), + X(0x74954875), X(0x749c8552), X(0x74a3bf43), X(0x74aaf648), + X(0x74b22a62), X(0x74b95b90), X(0x74c089d2), X(0x74c7b52a), + X(0x74cedd97), X(0x74d6031a), X(0x74dd25b2), X(0x74e44561), + X(0x74eb6226), X(0x74f27c02), X(0x74f992f5), X(0x7500a6ff), + X(0x7507b820), X(0x750ec659), X(0x7515d1aa), X(0x751cda14), + X(0x7523df96), X(0x752ae231), X(0x7531e1e5), X(0x7538deb2), + X(0x753fd89a), X(0x7546cf9b), X(0x754dc3b7), X(0x7554b4ed), + X(0x755ba33e), X(0x75628eaa), X(0x75697732), X(0x75705cd5), + X(0x75773f95), X(0x757e1f71), X(0x7584fc6a), X(0x758bd67f), + X(0x7592adb2), X(0x75998203), X(0x75a05371), X(0x75a721fe), + X(0x75adeda9), X(0x75b4b673), X(0x75bb7c5c), X(0x75c23f65), + X(0x75c8ff8d), X(0x75cfbcd6), X(0x75d6773f), X(0x75dd2ec8), + X(0x75e3e373), X(0x75ea953f), X(0x75f1442d), X(0x75f7f03d), + X(0x75fe996f), X(0x76053fc5), X(0x760be33d), X(0x761283d8), + X(0x76192197), X(0x761fbc7b), X(0x76265482), X(0x762ce9af), + X(0x76337c01), X(0x763a0b78), X(0x76409814), X(0x764721d7), + X(0x764da8c1), X(0x76542cd1), X(0x765aae08), X(0x76612c67), + X(0x7667a7ee), X(0x766e209d), X(0x76749675), X(0x767b0975), + X(0x7681799f), X(0x7687e6f3), X(0x768e5170), X(0x7694b918), + X(0x769b1deb), X(0x76a17fe9), X(0x76a7df13), X(0x76ae3b68), + X(0x76b494ea), X(0x76baeb98), X(0x76c13f74), X(0x76c7907c), + X(0x76cddeb3), X(0x76d42a18), X(0x76da72ab), X(0x76e0b86d), + X(0x76e6fb5e), X(0x76ed3b7f), X(0x76f378d0), X(0x76f9b352), + X(0x76ffeb05), X(0x77061fe8), X(0x770c51fe), X(0x77128145), + X(0x7718adbf), X(0x771ed76c), X(0x7724fe4c), X(0x772b225f), + X(0x773143a7), X(0x77376223), X(0x773d7dd3), X(0x774396ba), + X(0x7749acd5), X(0x774fc027), X(0x7755d0af), X(0x775bde6f), + X(0x7761e965), X(0x7767f193), X(0x776df6fa), X(0x7773f998), + X(0x7779f970), X(0x777ff681), X(0x7785f0cd), X(0x778be852), + X(0x7791dd12), X(0x7797cf0d), X(0x779dbe43), X(0x77a3aab6), + X(0x77a99465), X(0x77af7b50), X(0x77b55f79), X(0x77bb40e0), + X(0x77c11f85), X(0x77c6fb68), X(0x77ccd48a), X(0x77d2aaec), + X(0x77d87e8d), X(0x77de4f6f), X(0x77e41d92), X(0x77e9e8f5), + X(0x77efb19b), X(0x77f57782), X(0x77fb3aad), X(0x7800fb1a), + X(0x7806b8ca), X(0x780c73bf), X(0x78122bf7), X(0x7817e175), + X(0x781d9438), X(0x78234440), X(0x7828f18f), X(0x782e9c25), + X(0x78344401), X(0x7839e925), X(0x783f8b92), X(0x78452b46), + X(0x784ac844), X(0x7850628b), X(0x7855fa1c), X(0x785b8ef8), + X(0x7861211e), X(0x7866b090), X(0x786c3d4d), X(0x7871c757), + X(0x78774ead), X(0x787cd351), X(0x78825543), X(0x7887d483), + X(0x788d5111), X(0x7892caef), X(0x7898421c), X(0x789db69a), + X(0x78a32868), X(0x78a89787), X(0x78ae03f8), X(0x78b36dbb), + X(0x78b8d4d1), X(0x78be393a), X(0x78c39af6), X(0x78c8fa06), + X(0x78ce566c), X(0x78d3b026), X(0x78d90736), X(0x78de5b9c), + X(0x78e3ad58), X(0x78e8fc6c), X(0x78ee48d7), X(0x78f3929b), + X(0x78f8d9b7), X(0x78fe1e2c), X(0x79035ffb), X(0x79089f24), + X(0x790ddba8), X(0x79131587), X(0x79184cc2), X(0x791d8159), + X(0x7922b34d), X(0x7927e29e), X(0x792d0f4d), X(0x7932395a), + X(0x793760c6), X(0x793c8591), X(0x7941a7bd), X(0x7946c749), + X(0x794be435), X(0x7950fe84), X(0x79561634), X(0x795b2b47), + X(0x79603dbc), X(0x79654d96), X(0x796a5ad4), X(0x796f6576), + X(0x79746d7e), X(0x797972eb), X(0x797e75bf), X(0x798375f9), + X(0x7988739b), X(0x798d6ea5), X(0x79926717), X(0x79975cf2), + X(0x799c5037), X(0x79a140e6), X(0x79a62f00), X(0x79ab1a85), + X(0x79b00376), X(0x79b4e9d3), X(0x79b9cd9d), X(0x79beaed4), + X(0x79c38d79), X(0x79c8698d), X(0x79cd4310), X(0x79d21a03), + X(0x79d6ee66), X(0x79dbc03a), X(0x79e08f7f), X(0x79e55c36), + X(0x79ea265f), X(0x79eeedfc), X(0x79f3b30c), X(0x79f87590), + X(0x79fd3589), X(0x7a01f2f7), X(0x7a06addc), X(0x7a0b6636), + X(0x7a101c08), X(0x7a14cf52), X(0x7a198013), X(0x7a1e2e4d), + X(0x7a22da01), X(0x7a27832f), X(0x7a2c29d7), X(0x7a30cdfa), + X(0x7a356f99), X(0x7a3a0eb4), X(0x7a3eab4c), X(0x7a434561), + X(0x7a47dcf5), X(0x7a4c7207), X(0x7a510498), X(0x7a5594a9), + X(0x7a5a223a), X(0x7a5ead4d), X(0x7a6335e0), X(0x7a67bbf6), + X(0x7a6c3f8f), X(0x7a70c0ab), X(0x7a753f4b), X(0x7a79bb6f), + X(0x7a7e3519), X(0x7a82ac48), X(0x7a8720fe), X(0x7a8b933b), + X(0x7a9002ff), X(0x7a94704b), X(0x7a98db20), X(0x7a9d437e), + X(0x7aa1a967), X(0x7aa60cd9), X(0x7aaa6dd7), X(0x7aaecc61), + X(0x7ab32877), X(0x7ab7821b), X(0x7abbd94b), X(0x7ac02e0a), + X(0x7ac48058), X(0x7ac8d035), X(0x7acd1da3), X(0x7ad168a1), + X(0x7ad5b130), X(0x7ad9f751), X(0x7ade3b05), X(0x7ae27c4c), + X(0x7ae6bb27), X(0x7aeaf796), X(0x7aef319a), X(0x7af36934), + X(0x7af79e64), X(0x7afbd12c), X(0x7b00018a), X(0x7b042f81), + X(0x7b085b10), X(0x7b0c8439), X(0x7b10aafc), X(0x7b14cf5a), + X(0x7b18f153), X(0x7b1d10e8), X(0x7b212e1a), X(0x7b2548e9), + X(0x7b296155), X(0x7b2d7761), X(0x7b318b0b), X(0x7b359c55), + X(0x7b39ab3f), X(0x7b3db7cb), X(0x7b41c1f8), X(0x7b45c9c8), + X(0x7b49cf3b), X(0x7b4dd251), X(0x7b51d30b), X(0x7b55d16b), + X(0x7b59cd70), X(0x7b5dc71b), X(0x7b61be6d), X(0x7b65b366), + X(0x7b69a608), X(0x7b6d9653), X(0x7b718447), X(0x7b756fe5), + X(0x7b79592e), X(0x7b7d4022), X(0x7b8124c3), X(0x7b850710), + X(0x7b88e70a), X(0x7b8cc4b3), X(0x7b90a00a), X(0x7b947911), + X(0x7b984fc8), X(0x7b9c242f), X(0x7b9ff648), X(0x7ba3c612), + X(0x7ba79390), X(0x7bab5ec1), X(0x7baf27a5), X(0x7bb2ee3f), + X(0x7bb6b28e), X(0x7bba7493), X(0x7bbe344e), X(0x7bc1f1c1), + X(0x7bc5acec), X(0x7bc965cf), X(0x7bcd1c6c), X(0x7bd0d0c3), + X(0x7bd482d4), X(0x7bd832a1), X(0x7bdbe02a), X(0x7bdf8b70), + X(0x7be33473), X(0x7be6db34), X(0x7bea7fb4), X(0x7bee21f4), + X(0x7bf1c1f3), X(0x7bf55fb3), X(0x7bf8fb35), X(0x7bfc9479), + X(0x7c002b7f), X(0x7c03c04a), X(0x7c0752d8), X(0x7c0ae32b), + X(0x7c0e7144), X(0x7c11fd23), X(0x7c1586c9), X(0x7c190e36), + X(0x7c1c936c), X(0x7c20166b), X(0x7c239733), X(0x7c2715c6), + X(0x7c2a9224), X(0x7c2e0c4e), X(0x7c318444), X(0x7c34fa07), + X(0x7c386d98), X(0x7c3bdef8), X(0x7c3f4e26), X(0x7c42bb25), + X(0x7c4625f4), X(0x7c498e95), X(0x7c4cf507), X(0x7c50594c), + X(0x7c53bb65), X(0x7c571b51), X(0x7c5a7913), X(0x7c5dd4aa), + X(0x7c612e17), X(0x7c64855b), X(0x7c67da76), X(0x7c6b2d6a), + X(0x7c6e7e37), X(0x7c71ccdd), X(0x7c75195e), X(0x7c7863ba), + X(0x7c7babf1), X(0x7c7ef206), X(0x7c8235f7), X(0x7c8577c6), + X(0x7c88b774), X(0x7c8bf502), X(0x7c8f306f), X(0x7c9269bd), + X(0x7c95a0ec), X(0x7c98d5fe), X(0x7c9c08f2), X(0x7c9f39cb), + X(0x7ca26887), X(0x7ca59528), X(0x7ca8bfb0), X(0x7cabe81d), + X(0x7caf0e72), X(0x7cb232af), X(0x7cb554d4), X(0x7cb874e2), + X(0x7cbb92db), X(0x7cbeaebe), X(0x7cc1c88d), X(0x7cc4e047), + X(0x7cc7f5ef), X(0x7ccb0984), X(0x7cce1b08), X(0x7cd12a7b), + X(0x7cd437dd), X(0x7cd74330), X(0x7cda4c74), X(0x7cdd53aa), + X(0x7ce058d3), X(0x7ce35bef), X(0x7ce65cff), X(0x7ce95c04), + X(0x7cec58ff), X(0x7cef53f0), X(0x7cf24cd7), X(0x7cf543b7), + X(0x7cf8388f), X(0x7cfb2b60), X(0x7cfe1c2b), X(0x7d010af1), + X(0x7d03f7b2), X(0x7d06e26f), X(0x7d09cb29), X(0x7d0cb1e0), + X(0x7d0f9696), X(0x7d12794b), X(0x7d1559ff), X(0x7d1838b4), + X(0x7d1b156a), X(0x7d1df022), X(0x7d20c8dd), X(0x7d239f9b), + X(0x7d26745e), X(0x7d294725), X(0x7d2c17f1), X(0x7d2ee6c4), + X(0x7d31b39f), X(0x7d347e81), X(0x7d37476b), X(0x7d3a0e5f), + X(0x7d3cd35d), X(0x7d3f9665), X(0x7d425779), X(0x7d451699), + X(0x7d47d3c6), X(0x7d4a8f01), X(0x7d4d484b), X(0x7d4fffa3), + X(0x7d52b50c), X(0x7d556885), X(0x7d581a0f), X(0x7d5ac9ac), + X(0x7d5d775c), X(0x7d60231f), X(0x7d62ccf6), X(0x7d6574e3), + X(0x7d681ae6), X(0x7d6abeff), X(0x7d6d612f), X(0x7d700178), + X(0x7d729fd9), X(0x7d753c54), X(0x7d77d6e9), X(0x7d7a6f9a), + X(0x7d7d0666), X(0x7d7f9b4f), X(0x7d822e55), X(0x7d84bf79), + X(0x7d874ebc), X(0x7d89dc1e), X(0x7d8c67a1), X(0x7d8ef144), + X(0x7d91790a), X(0x7d93fef2), X(0x7d9682fd), X(0x7d99052d), + X(0x7d9b8581), X(0x7d9e03fb), X(0x7da0809b), X(0x7da2fb62), + X(0x7da57451), X(0x7da7eb68), X(0x7daa60a8), X(0x7dacd413), + X(0x7daf45a9), X(0x7db1b56a), X(0x7db42357), X(0x7db68f71), + X(0x7db8f9b9), X(0x7dbb6230), X(0x7dbdc8d6), X(0x7dc02dac), + X(0x7dc290b3), X(0x7dc4f1eb), X(0x7dc75156), X(0x7dc9aef4), + X(0x7dcc0ac5), X(0x7dce64cc), X(0x7dd0bd07), X(0x7dd31379), + X(0x7dd56821), X(0x7dd7bb01), X(0x7dda0c1a), X(0x7ddc5b6b), + X(0x7ddea8f7), X(0x7de0f4bd), X(0x7de33ebe), X(0x7de586fc), + X(0x7de7cd76), X(0x7dea122e), X(0x7dec5525), X(0x7dee965a), + X(0x7df0d5d0), X(0x7df31386), X(0x7df54f7e), X(0x7df789b8), + X(0x7df9c235), X(0x7dfbf8f5), X(0x7dfe2dfa), X(0x7e006145), + X(0x7e0292d5), X(0x7e04c2ac), X(0x7e06f0cb), X(0x7e091d32), + X(0x7e0b47e1), X(0x7e0d70db), X(0x7e0f981f), X(0x7e11bdaf), + X(0x7e13e18a), X(0x7e1603b3), X(0x7e182429), X(0x7e1a42ed), + X(0x7e1c6001), X(0x7e1e7b64), X(0x7e209518), X(0x7e22ad1d), + X(0x7e24c375), X(0x7e26d81f), X(0x7e28eb1d), X(0x7e2afc70), + X(0x7e2d0c17), X(0x7e2f1a15), X(0x7e31266a), X(0x7e333115), + X(0x7e353a1a), X(0x7e374177), X(0x7e39472e), X(0x7e3b4b3f), + X(0x7e3d4dac), X(0x7e3f4e75), X(0x7e414d9a), X(0x7e434b1e), + X(0x7e4546ff), X(0x7e474140), X(0x7e4939e0), X(0x7e4b30e2), + X(0x7e4d2644), X(0x7e4f1a09), X(0x7e510c30), X(0x7e52fcbc), + X(0x7e54ebab), X(0x7e56d900), X(0x7e58c4bb), X(0x7e5aaedd), + X(0x7e5c9766), X(0x7e5e7e57), X(0x7e6063b2), X(0x7e624776), + X(0x7e6429a5), X(0x7e660a3f), X(0x7e67e945), X(0x7e69c6b8), + X(0x7e6ba299), X(0x7e6d7ce7), X(0x7e6f55a5), X(0x7e712cd3), + X(0x7e730272), X(0x7e74d682), X(0x7e76a904), X(0x7e7879f9), + X(0x7e7a4962), X(0x7e7c173f), X(0x7e7de392), X(0x7e7fae5a), + X(0x7e817799), X(0x7e833f50), X(0x7e85057f), X(0x7e86ca27), + X(0x7e888d49), X(0x7e8a4ee5), X(0x7e8c0efd), X(0x7e8dcd91), + X(0x7e8f8aa1), X(0x7e914630), X(0x7e93003c), X(0x7e94b8c8), + X(0x7e966fd4), X(0x7e982560), X(0x7e99d96e), X(0x7e9b8bfe), + X(0x7e9d3d10), X(0x7e9eeca7), X(0x7ea09ac2), X(0x7ea24762), + X(0x7ea3f288), X(0x7ea59c35), X(0x7ea7446a), X(0x7ea8eb27), + X(0x7eaa906c), X(0x7eac343c), X(0x7eadd696), X(0x7eaf777b), + X(0x7eb116ed), X(0x7eb2b4eb), X(0x7eb45177), X(0x7eb5ec91), + X(0x7eb7863b), X(0x7eb91e74), X(0x7ebab53e), X(0x7ebc4a99), + X(0x7ebdde87), X(0x7ebf7107), X(0x7ec1021b), X(0x7ec291c3), + X(0x7ec42001), X(0x7ec5acd5), X(0x7ec7383f), X(0x7ec8c241), + X(0x7eca4adb), X(0x7ecbd20d), X(0x7ecd57da), X(0x7ecedc41), + X(0x7ed05f44), X(0x7ed1e0e2), X(0x7ed3611d), X(0x7ed4dff6), + X(0x7ed65d6d), X(0x7ed7d983), X(0x7ed95438), X(0x7edacd8f), + X(0x7edc4586), X(0x7eddbc20), X(0x7edf315c), X(0x7ee0a53c), + X(0x7ee217c1), X(0x7ee388ea), X(0x7ee4f8b9), X(0x7ee6672f), + X(0x7ee7d44c), X(0x7ee94012), X(0x7eeaaa80), X(0x7eec1397), + X(0x7eed7b59), X(0x7eeee1c6), X(0x7ef046df), X(0x7ef1aaa5), + X(0x7ef30d18), X(0x7ef46e39), X(0x7ef5ce09), X(0x7ef72c88), + X(0x7ef889b8), X(0x7ef9e599), X(0x7efb402c), X(0x7efc9972), + X(0x7efdf16b), X(0x7eff4818), X(0x7f009d79), X(0x7f01f191), + X(0x7f03445f), X(0x7f0495e4), X(0x7f05e620), X(0x7f073516), + X(0x7f0882c5), X(0x7f09cf2d), X(0x7f0b1a51), X(0x7f0c6430), + X(0x7f0daccc), X(0x7f0ef425), X(0x7f103a3b), X(0x7f117f11), + X(0x7f12c2a5), X(0x7f1404fa), X(0x7f15460f), X(0x7f1685e6), + X(0x7f17c47f), X(0x7f1901db), X(0x7f1a3dfb), X(0x7f1b78e0), + X(0x7f1cb28a), X(0x7f1deafa), X(0x7f1f2231), X(0x7f20582f), + X(0x7f218cf5), X(0x7f22c085), X(0x7f23f2de), X(0x7f252401), + X(0x7f2653f0), X(0x7f2782ab), X(0x7f28b032), X(0x7f29dc87), + X(0x7f2b07aa), X(0x7f2c319c), X(0x7f2d5a5e), X(0x7f2e81f0), + X(0x7f2fa853), X(0x7f30cd88), X(0x7f31f18f), X(0x7f33146a), + X(0x7f343619), X(0x7f35569c), X(0x7f3675f6), X(0x7f379425), + X(0x7f38b12c), X(0x7f39cd0a), X(0x7f3ae7c0), X(0x7f3c0150), + X(0x7f3d19ba), X(0x7f3e30fe), X(0x7f3f471e), X(0x7f405c1a), + X(0x7f416ff3), X(0x7f4282a9), X(0x7f43943e), X(0x7f44a4b2), + X(0x7f45b405), X(0x7f46c239), X(0x7f47cf4e), X(0x7f48db45), + X(0x7f49e61f), X(0x7f4aefdc), X(0x7f4bf87e), X(0x7f4d0004), + X(0x7f4e0670), X(0x7f4f0bc2), X(0x7f500ffb), X(0x7f51131c), + X(0x7f521525), X(0x7f531618), X(0x7f5415f4), X(0x7f5514bb), + X(0x7f56126e), X(0x7f570f0c), X(0x7f580a98), X(0x7f590511), + X(0x7f59fe78), X(0x7f5af6ce), X(0x7f5bee14), X(0x7f5ce44a), + X(0x7f5dd972), X(0x7f5ecd8b), X(0x7f5fc097), X(0x7f60b296), + X(0x7f61a389), X(0x7f629370), X(0x7f63824e), X(0x7f647021), + X(0x7f655ceb), X(0x7f6648ad), X(0x7f673367), X(0x7f681d19), + X(0x7f6905c6), X(0x7f69ed6d), X(0x7f6ad40f), X(0x7f6bb9ad), + X(0x7f6c9e48), X(0x7f6d81e0), X(0x7f6e6475), X(0x7f6f460a), + X(0x7f70269d), X(0x7f710631), X(0x7f71e4c6), X(0x7f72c25c), + X(0x7f739ef4), X(0x7f747a8f), X(0x7f75552e), X(0x7f762ed1), + X(0x7f770779), X(0x7f77df27), X(0x7f78b5db), X(0x7f798b97), + X(0x7f7a605a), X(0x7f7b3425), X(0x7f7c06fa), X(0x7f7cd8d9), + X(0x7f7da9c2), X(0x7f7e79b7), X(0x7f7f48b8), X(0x7f8016c5), + X(0x7f80e3e0), X(0x7f81b009), X(0x7f827b40), X(0x7f834588), + X(0x7f840edf), X(0x7f84d747), X(0x7f859ec1), X(0x7f86654d), + X(0x7f872aec), X(0x7f87ef9e), X(0x7f88b365), X(0x7f897641), + X(0x7f8a3832), X(0x7f8af93a), X(0x7f8bb959), X(0x7f8c7890), + X(0x7f8d36df), X(0x7f8df448), X(0x7f8eb0ca), X(0x7f8f6c67), + X(0x7f90271e), X(0x7f90e0f2), X(0x7f9199e2), X(0x7f9251f0), + X(0x7f93091b), X(0x7f93bf65), X(0x7f9474ce), X(0x7f952958), + X(0x7f95dd01), X(0x7f968fcd), X(0x7f9741ba), X(0x7f97f2ca), + X(0x7f98a2fd), X(0x7f995254), X(0x7f9a00d0), X(0x7f9aae71), + X(0x7f9b5b38), X(0x7f9c0726), X(0x7f9cb23b), X(0x7f9d5c78), + X(0x7f9e05de), X(0x7f9eae6e), X(0x7f9f5627), X(0x7f9ffd0b), + X(0x7fa0a31b), X(0x7fa14856), X(0x7fa1ecbf), X(0x7fa29054), + X(0x7fa33318), X(0x7fa3d50b), X(0x7fa4762c), X(0x7fa5167e), + X(0x7fa5b601), X(0x7fa654b5), X(0x7fa6f29b), X(0x7fa78fb3), + X(0x7fa82bff), X(0x7fa8c77f), X(0x7fa96234), X(0x7fa9fc1e), + X(0x7faa953e), X(0x7fab2d94), X(0x7fabc522), X(0x7fac5be8), + X(0x7facf1e6), X(0x7fad871d), X(0x7fae1b8f), X(0x7faeaf3b), + X(0x7faf4222), X(0x7fafd445), X(0x7fb065a4), X(0x7fb0f641), + X(0x7fb1861b), X(0x7fb21534), X(0x7fb2a38c), X(0x7fb33124), + X(0x7fb3bdfb), X(0x7fb44a14), X(0x7fb4d56f), X(0x7fb5600c), + X(0x7fb5e9ec), X(0x7fb6730f), X(0x7fb6fb76), X(0x7fb78323), + X(0x7fb80a15), X(0x7fb8904d), X(0x7fb915cc), X(0x7fb99a92), + X(0x7fba1ea0), X(0x7fbaa1f7), X(0x7fbb2497), X(0x7fbba681), + X(0x7fbc27b5), X(0x7fbca835), X(0x7fbd2801), X(0x7fbda719), + X(0x7fbe257e), X(0x7fbea331), X(0x7fbf2032), X(0x7fbf9c82), + X(0x7fc01821), X(0x7fc09311), X(0x7fc10d52), X(0x7fc186e4), + X(0x7fc1ffc8), X(0x7fc277ff), X(0x7fc2ef89), X(0x7fc36667), + X(0x7fc3dc9a), X(0x7fc45221), X(0x7fc4c6ff), X(0x7fc53b33), + X(0x7fc5aebe), X(0x7fc621a0), X(0x7fc693db), X(0x7fc7056f), + X(0x7fc7765c), X(0x7fc7e6a3), X(0x7fc85645), X(0x7fc8c542), + X(0x7fc9339b), X(0x7fc9a150), X(0x7fca0e63), X(0x7fca7ad3), + X(0x7fcae6a2), X(0x7fcb51cf), X(0x7fcbbc5c), X(0x7fcc2649), + X(0x7fcc8f97), X(0x7fccf846), X(0x7fcd6058), X(0x7fcdc7cb), + X(0x7fce2ea2), X(0x7fce94dd), X(0x7fcefa7b), X(0x7fcf5f7f), + X(0x7fcfc3e8), X(0x7fd027b7), X(0x7fd08aed), X(0x7fd0ed8b), + X(0x7fd14f90), X(0x7fd1b0fd), X(0x7fd211d4), X(0x7fd27214), + X(0x7fd2d1bf), X(0x7fd330d4), X(0x7fd38f55), X(0x7fd3ed41), + X(0x7fd44a9a), X(0x7fd4a761), X(0x7fd50395), X(0x7fd55f37), + X(0x7fd5ba48), X(0x7fd614c9), X(0x7fd66eba), X(0x7fd6c81b), + X(0x7fd720ed), X(0x7fd77932), X(0x7fd7d0e8), X(0x7fd82812), + X(0x7fd87eae), X(0x7fd8d4bf), X(0x7fd92a45), X(0x7fd97f40), + X(0x7fd9d3b0), X(0x7fda2797), X(0x7fda7af5), X(0x7fdacdca), + X(0x7fdb2018), X(0x7fdb71dd), X(0x7fdbc31c), X(0x7fdc13d5), + X(0x7fdc6408), X(0x7fdcb3b6), X(0x7fdd02df), X(0x7fdd5184), + X(0x7fdd9fa5), X(0x7fdded44), X(0x7fde3a60), X(0x7fde86fb), + X(0x7fded314), X(0x7fdf1eac), X(0x7fdf69c4), X(0x7fdfb45d), + X(0x7fdffe76), X(0x7fe04811), X(0x7fe0912e), X(0x7fe0d9ce), + X(0x7fe121f0), X(0x7fe16996), X(0x7fe1b0c1), X(0x7fe1f770), + X(0x7fe23da4), X(0x7fe2835f), X(0x7fe2c89f), X(0x7fe30d67), + X(0x7fe351b5), X(0x7fe3958c), X(0x7fe3d8ec), X(0x7fe41bd4), + X(0x7fe45e46), X(0x7fe4a042), X(0x7fe4e1c8), X(0x7fe522da), + X(0x7fe56378), X(0x7fe5a3a1), X(0x7fe5e358), X(0x7fe6229b), + X(0x7fe6616d), X(0x7fe69fcc), X(0x7fe6ddbb), X(0x7fe71b39), + X(0x7fe75847), X(0x7fe794e5), X(0x7fe7d114), X(0x7fe80cd5), + X(0x7fe84827), X(0x7fe8830c), X(0x7fe8bd84), X(0x7fe8f78f), + X(0x7fe9312f), X(0x7fe96a62), X(0x7fe9a32b), X(0x7fe9db8a), + X(0x7fea137e), X(0x7fea4b09), X(0x7fea822b), X(0x7feab8e5), + X(0x7feaef37), X(0x7feb2521), X(0x7feb5aa4), X(0x7feb8fc1), + X(0x7febc478), X(0x7febf8ca), X(0x7fec2cb6), X(0x7fec603e), + X(0x7fec9363), X(0x7fecc623), X(0x7fecf881), X(0x7fed2a7c), + X(0x7fed5c16), X(0x7fed8d4e), X(0x7fedbe24), X(0x7fedee9b), + X(0x7fee1eb1), X(0x7fee4e68), X(0x7fee7dc0), X(0x7feeacb9), + X(0x7feedb54), X(0x7fef0991), X(0x7fef3771), X(0x7fef64f5), + X(0x7fef921d), X(0x7fefbee8), X(0x7fefeb59), X(0x7ff0176f), + X(0x7ff0432a), X(0x7ff06e8c), X(0x7ff09995), X(0x7ff0c444), + X(0x7ff0ee9c), X(0x7ff1189b), X(0x7ff14243), X(0x7ff16b94), + X(0x7ff1948e), X(0x7ff1bd32), X(0x7ff1e581), X(0x7ff20d7b), + X(0x7ff2351f), X(0x7ff25c70), X(0x7ff2836d), X(0x7ff2aa17), + X(0x7ff2d06d), X(0x7ff2f672), X(0x7ff31c24), X(0x7ff34185), + X(0x7ff36695), X(0x7ff38b55), X(0x7ff3afc4), X(0x7ff3d3e4), + X(0x7ff3f7b4), X(0x7ff41b35), X(0x7ff43e69), X(0x7ff4614e), + X(0x7ff483e6), X(0x7ff4a631), X(0x7ff4c82f), X(0x7ff4e9e1), + X(0x7ff50b47), X(0x7ff52c62), X(0x7ff54d33), X(0x7ff56db9), + X(0x7ff58df5), X(0x7ff5ade7), X(0x7ff5cd90), X(0x7ff5ecf1), + X(0x7ff60c09), X(0x7ff62ada), X(0x7ff64963), X(0x7ff667a5), + X(0x7ff685a1), X(0x7ff6a357), X(0x7ff6c0c7), X(0x7ff6ddf1), + X(0x7ff6fad7), X(0x7ff71778), X(0x7ff733d6), X(0x7ff74fef), + X(0x7ff76bc6), X(0x7ff78759), X(0x7ff7a2ab), X(0x7ff7bdba), + X(0x7ff7d888), X(0x7ff7f315), X(0x7ff80d61), X(0x7ff8276c), + X(0x7ff84138), X(0x7ff85ac4), X(0x7ff87412), X(0x7ff88d20), + X(0x7ff8a5f0), X(0x7ff8be82), X(0x7ff8d6d7), X(0x7ff8eeef), + X(0x7ff906c9), X(0x7ff91e68), X(0x7ff935cb), X(0x7ff94cf2), + X(0x7ff963dd), X(0x7ff97a8f), X(0x7ff99105), X(0x7ff9a742), + X(0x7ff9bd45), X(0x7ff9d30f), X(0x7ff9e8a0), X(0x7ff9fdf9), + X(0x7ffa131a), X(0x7ffa2803), X(0x7ffa3cb4), X(0x7ffa512f), + X(0x7ffa6573), X(0x7ffa7981), X(0x7ffa8d59), X(0x7ffaa0fc), + X(0x7ffab46a), X(0x7ffac7a3), X(0x7ffadaa8), X(0x7ffaed78), + X(0x7ffb0015), X(0x7ffb127f), X(0x7ffb24b6), X(0x7ffb36bb), + X(0x7ffb488d), X(0x7ffb5a2e), X(0x7ffb6b9d), X(0x7ffb7cdb), + X(0x7ffb8de9), X(0x7ffb9ec6), X(0x7ffbaf73), X(0x7ffbbff1), + X(0x7ffbd03f), X(0x7ffbe05e), X(0x7ffbf04f), X(0x7ffc0012), + X(0x7ffc0fa6), X(0x7ffc1f0d), X(0x7ffc2e47), X(0x7ffc3d54), + X(0x7ffc4c35), X(0x7ffc5ae9), X(0x7ffc6971), X(0x7ffc77ce), + X(0x7ffc8600), X(0x7ffc9407), X(0x7ffca1e4), X(0x7ffcaf96), + X(0x7ffcbd1f), X(0x7ffcca7e), X(0x7ffcd7b4), X(0x7ffce4c1), + X(0x7ffcf1a5), X(0x7ffcfe62), X(0x7ffd0af6), X(0x7ffd1763), + X(0x7ffd23a9), X(0x7ffd2fc8), X(0x7ffd3bc1), X(0x7ffd4793), + X(0x7ffd533f), X(0x7ffd5ec5), X(0x7ffd6a27), X(0x7ffd7563), + X(0x7ffd807a), X(0x7ffd8b6e), X(0x7ffd963d), X(0x7ffda0e8), + X(0x7ffdab70), X(0x7ffdb5d5), X(0x7ffdc017), X(0x7ffdca36), + X(0x7ffdd434), X(0x7ffdde0f), X(0x7ffde7c9), X(0x7ffdf161), + X(0x7ffdfad8), X(0x7ffe042f), X(0x7ffe0d65), X(0x7ffe167b), + X(0x7ffe1f71), X(0x7ffe2848), X(0x7ffe30ff), X(0x7ffe3997), + X(0x7ffe4211), X(0x7ffe4a6c), X(0x7ffe52a9), X(0x7ffe5ac8), + X(0x7ffe62c9), X(0x7ffe6aae), X(0x7ffe7275), X(0x7ffe7a1f), + X(0x7ffe81ad), X(0x7ffe891f), X(0x7ffe9075), X(0x7ffe97b0), + X(0x7ffe9ece), X(0x7ffea5d2), X(0x7ffeacbb), X(0x7ffeb38a), + X(0x7ffeba3e), X(0x7ffec0d8), X(0x7ffec758), X(0x7ffecdbf), + X(0x7ffed40d), X(0x7ffeda41), X(0x7ffee05d), X(0x7ffee660), + X(0x7ffeec4b), X(0x7ffef21f), X(0x7ffef7da), X(0x7ffefd7e), + X(0x7fff030b), X(0x7fff0881), X(0x7fff0de0), X(0x7fff1328), + X(0x7fff185b), X(0x7fff1d77), X(0x7fff227e), X(0x7fff276f), + X(0x7fff2c4b), X(0x7fff3112), X(0x7fff35c4), X(0x7fff3a62), + X(0x7fff3eeb), X(0x7fff4360), X(0x7fff47c2), X(0x7fff4c0f), + X(0x7fff504a), X(0x7fff5471), X(0x7fff5885), X(0x7fff5c87), + X(0x7fff6076), X(0x7fff6452), X(0x7fff681d), X(0x7fff6bd6), + X(0x7fff6f7d), X(0x7fff7313), X(0x7fff7698), X(0x7fff7a0c), + X(0x7fff7d6f), X(0x7fff80c2), X(0x7fff8404), X(0x7fff8736), + X(0x7fff8a58), X(0x7fff8d6b), X(0x7fff906e), X(0x7fff9362), + X(0x7fff9646), X(0x7fff991c), X(0x7fff9be3), X(0x7fff9e9c), + X(0x7fffa146), X(0x7fffa3e2), X(0x7fffa671), X(0x7fffa8f1), + X(0x7fffab65), X(0x7fffadca), X(0x7fffb023), X(0x7fffb26f), + X(0x7fffb4ae), X(0x7fffb6e0), X(0x7fffb906), X(0x7fffbb20), + X(0x7fffbd2e), X(0x7fffbf30), X(0x7fffc126), X(0x7fffc311), + X(0x7fffc4f1), X(0x7fffc6c5), X(0x7fffc88f), X(0x7fffca4d), + X(0x7fffcc01), X(0x7fffcdab), X(0x7fffcf4a), X(0x7fffd0e0), + X(0x7fffd26b), X(0x7fffd3ec), X(0x7fffd564), X(0x7fffd6d2), + X(0x7fffd838), X(0x7fffd993), X(0x7fffdae6), X(0x7fffdc31), + X(0x7fffdd72), X(0x7fffdeab), X(0x7fffdfdb), X(0x7fffe104), + X(0x7fffe224), X(0x7fffe33c), X(0x7fffe44d), X(0x7fffe556), + X(0x7fffe657), X(0x7fffe751), X(0x7fffe844), X(0x7fffe930), + X(0x7fffea15), X(0x7fffeaf3), X(0x7fffebca), X(0x7fffec9b), + X(0x7fffed66), X(0x7fffee2a), X(0x7fffeee8), X(0x7fffefa0), + X(0x7ffff053), X(0x7ffff0ff), X(0x7ffff1a6), X(0x7ffff247), + X(0x7ffff2e4), X(0x7ffff37a), X(0x7ffff40c), X(0x7ffff499), + X(0x7ffff520), X(0x7ffff5a3), X(0x7ffff621), X(0x7ffff69b), + X(0x7ffff710), X(0x7ffff781), X(0x7ffff7ee), X(0x7ffff857), + X(0x7ffff8bb), X(0x7ffff91c), X(0x7ffff979), X(0x7ffff9d2), + X(0x7ffffa27), X(0x7ffffa79), X(0x7ffffac8), X(0x7ffffb13), + X(0x7ffffb5b), X(0x7ffffba0), X(0x7ffffbe2), X(0x7ffffc21), + X(0x7ffffc5d), X(0x7ffffc96), X(0x7ffffccd), X(0x7ffffd01), + X(0x7ffffd32), X(0x7ffffd61), X(0x7ffffd8e), X(0x7ffffdb8), + X(0x7ffffde0), X(0x7ffffe07), X(0x7ffffe2b), X(0x7ffffe4d), + X(0x7ffffe6d), X(0x7ffffe8b), X(0x7ffffea8), X(0x7ffffec3), + X(0x7ffffedc), X(0x7ffffef4), X(0x7fffff0a), X(0x7fffff1f), + X(0x7fffff33), X(0x7fffff45), X(0x7fffff56), X(0x7fffff66), + X(0x7fffff75), X(0x7fffff82), X(0x7fffff8f), X(0x7fffff9a), + X(0x7fffffa5), X(0x7fffffaf), X(0x7fffffb8), X(0x7fffffc0), + X(0x7fffffc8), X(0x7fffffce), X(0x7fffffd5), X(0x7fffffda), + X(0x7fffffdf), X(0x7fffffe4), X(0x7fffffe8), X(0x7fffffeb), + X(0x7fffffef), X(0x7ffffff1), X(0x7ffffff4), X(0x7ffffff6), + X(0x7ffffff8), X(0x7ffffff9), X(0x7ffffffb), X(0x7ffffffc), + X(0x7ffffffd), X(0x7ffffffd), X(0x7ffffffe), X(0x7fffffff), + X(0x7fffffff), X(0x7fffffff), X(0x7fffffff), X(0x7fffffff), + X(0x7fffffff), X(0x7fffffff), X(0x7fffffff), X(0x7fffffff), + X(0x7fffffff), X(0x7fffffff), X(0x7fffffff), X(0x7fffffff), +}; + diff --git a/media/libtremor/moz.build b/media/libtremor/moz.build new file mode 100644 index 000000000000..f0a923592749 --- /dev/null +++ b/media/libtremor/moz.build @@ -0,0 +1,11 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# 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/. + +with Files('*'): + BUG_COMPONENT = ('Core', 'Audio/Video') + +DIRS += ['include/tremor', 'lib'] + diff --git a/media/libtremor/update.sh b/media/libtremor/update.sh new file mode 100755 index 000000000000..d27198cfe5b4 --- /dev/null +++ b/media/libtremor/update.sh @@ -0,0 +1,34 @@ +# Usage: cp $1/update.sh +# +# Copies the needed files from a directory containing the original +# libtremor source that we need for the Mozilla HTML5 media support. +cp $1/asm_arm.h ./lib/asm_arm.h +cp $1/backends.h ./lib/backends.h +cp $1/block.c ./lib/tremor_block.c +cp $1/block.h ./lib/block.h +cp $1/codebook.c ./lib/tremor_codebook.c +cp $1/codebook.h ./lib/codebook.h +cp $1/codec_internal.h ./lib/codec_internal.h +cp $1/floor0.c ./lib/tremor_floor0.c +cp $1/floor1.c ./lib/tremor_floor1.c +cp $1/info.c ./lib/tremor_info.c +cp $1/lsp_lookup.h ./lib/lsp_lookup.h +cp $1/mapping0.c ./lib/tremor_mapping0.c +cp $1/mdct_lookup.h ./lib/mdct_lookup.h +cp $1/mdct.c ./lib/tremor_mdct.c +cp $1/mdct.h ./lib/mdct.h +cp $1/misc.h ./lib/misc.h +cp $1/registry.c ./lib/tremor_registry.c +cp $1/registry.h ./lib/registry.h +cp $1/res012.c ./lib/tremor_res012.c +cp $1/sharedbook.c ./lib/tremor_sharedbook.c +cp $1/synthesis.c ./lib/tremor_synthesis.c +cp $1/window_lookup.h ./lib/window_lookup.h +cp $1/window.c ./lib/tremor_window.c +cp $1/window.h ./lib/window.h +cp $1/ivorbiscodec.h ./include/tremor/ivorbiscodec.h +cp $1/os.h ./lib/os.h +cp $1/COPYING ./COPYING +cp $1/README ./README +patch -p3 < ./bug719612.patch +patch -p3 < ./bug1117571-r19420.patch diff --git a/media/libvorbis/moz.build b/media/libvorbis/moz.build index af1ca189b4ec..f7306ae10fb3 100644 --- a/media/libvorbis/moz.build +++ b/media/libvorbis/moz.build @@ -48,16 +48,10 @@ if CONFIG['OS_ARCH'] == 'AIX': if CONFIG['OS_ARCH'] == 'SunOS': DEFINES['HAVE_ALLOCA_H'] = True -if CONFIG["OS_ARCH"] == "Linux": - OS_LIBS += [ - "m", - ] - # We allow warnings for third-party code that can be updated from upstream. AllowCompilerWarnings() -FINAL_LIBRARY = 'gkcodecs' -NoVisibilityFlags() +FINAL_LIBRARY = 'gkmedias' # Suppress warnings in third-party code. if CONFIG['CC_TYPE'] in ('clang', 'gcc'): diff --git a/mobile/android/installer/package-manifest.in b/mobile/android/installer/package-manifest.in index 08361b887064..db524134d855 100644 --- a/mobile/android/installer/package-manifest.in +++ b/mobile/android/installer/package-manifest.in @@ -42,7 +42,6 @@ @BINPATH@/@DLL_PREFIX@nspr4@DLL_SUFFIX@ #endif @BINPATH@/@DLL_PREFIX@lgpllibs@DLL_SUFFIX@ -@BINPATH@/@DLL_PREFIX@gkcodecs@DLL_SUFFIX@ #ifdef MOZ_FFVPX @BINPATH@/@DLL_PREFIX@mozavutil@DLL_SUFFIX@ @BINPATH@/@DLL_PREFIX@mozavcodec@DLL_SUFFIX@ diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index bee6a060ac5f..30457162d02a 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -10098,33 +10098,6 @@ #endif mirror: always -- name: media.ffvpx.vorbis.enabled - type: RelaxedAtomicBool -#ifdef MOZ_FFVPX - value: true -#else - value: false -#endif - mirror: always - -- name: media.ffvpx.opus.enabled - type: RelaxedAtomicBool -#ifdef MOZ_FFVPX - value: true -#else - value: false -#endif - mirror: always - -- name: media.ffvpx.wav.enabled - type: RelaxedAtomicBool -#ifdef MOZ_FFVPX - value: true -#else - value: false -#endif - mirror: always - # Set to true in marionette tests to disable the sanity test # which would lead to unnecessary start of the RDD process. - name: media.sanity-test.disabled diff --git a/mozglue/build/TsanOptions.cpp b/mozglue/build/TsanOptions.cpp index 99e4a9380700..6b19aad4576b 100644 --- a/mozglue/build/TsanOptions.cpp +++ b/mozglue/build/TsanOptions.cpp @@ -73,7 +73,6 @@ extern "C" const char* __tsan_default_suppressions() { "race:pa_format_info_set_prop_string_array\n" "race:pa_stream_get_index\n" "race:pa_stream_update_timing_info\n" - "race:vorbis_synthesis_init\n" // This is a callback from libglib-2 that is apparently // not fully suppressed through `called_from_lib`. "race:g_main_context_dispatch\n" diff --git a/third_party/libwebrtc/third_party/opus/src/include/opus.h b/third_party/libwebrtc/third_party/opus/src/include/opus.h index 4cfe534e20ef..89078a59e5b7 100644 --- a/third_party/libwebrtc/third_party/opus/src/include/opus.h +++ b/third_party/libwebrtc/third_party/opus/src/include/opus.h @@ -19,5 +19,5 @@ // This is a trampoline header meant to redirect from where libwebrtc code // expects third_party headers to where those headers exist in the Mozilla // Firefox repository. -#include +#include "../../media/libopus/include/opus.h" diff --git a/third_party/libwebrtc/third_party/opus/src/include/opus_multistream.h b/third_party/libwebrtc/third_party/opus/src/include/opus_multistream.h index 2e2c037885d5..0033f9a4493b 100644 --- a/third_party/libwebrtc/third_party/opus/src/include/opus_multistream.h +++ b/third_party/libwebrtc/third_party/opus/src/include/opus_multistream.h @@ -19,5 +19,5 @@ // This is a trampoline header meant to redirect from where libwebrtc code // expects third_party headers to where those headers exist in the Mozilla // Firefox repository. -#include +#include "../../media/libopus/include/opus_multistream.h" diff --git a/toolkit/content/license.html b/toolkit/content/license.html index b47f3d0998bd..49d69cf53996 100644 --- a/toolkit/content/license.html +++ b/toolkit/content/license.html @@ -5470,6 +5470,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  • media/libogg/, 2002
  • media/libtheora/, 2002-2007
  • media/libvorbis/, 2002-2004
  • +
  • media/libtremor/, 2002-2010
  • media/libspeex_resampler/, 2002-2008
  • diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build index 3faa0370cc1c..939d4f6a4b8d 100644 --- a/toolkit/library/moz.build +++ b/toolkit/library/moz.build @@ -152,7 +152,6 @@ USE_LIBS += [ ] USE_LIBS += [ - "gkcodecs", "lgpllibs", "nspr", "nss", diff --git a/toolkit/moz.configure b/toolkit/moz.configure index 51e9924123be..3c12aa860f5c 100644 --- a/toolkit/moz.configure +++ b/toolkit/moz.configure @@ -799,11 +799,30 @@ set_config("MOZ_FMP4", fmp4) set_define("MOZ_FMP4", fmp4) -set_config("MOZ_SAMPLE_TYPE_FLOAT32", True) -set_define("MOZ_SAMPLE_TYPE_FLOAT32", True) +@depends(target) +def sample_type_is_s16(target): + # Use integers over floats for audio on Android regardless of the CPU + # architecture, because audio backends for Android don't support floats. + # We also use integers on ARM because it's more efficient. + if target.os == "Android" or target.cpu == "arm": + return True -set_define("MOZ_VORBIS", True) -set_config("MOZ_VORBIS", True) + +@depends(sample_type_is_s16) +def sample_type_is_float(t): + if not t: + return True + + +set_config("MOZ_SAMPLE_TYPE_S16", sample_type_is_s16) +set_define("MOZ_SAMPLE_TYPE_S16", sample_type_is_s16) +set_config("MOZ_SAMPLE_TYPE_FLOAT32", sample_type_is_float) +set_define("MOZ_SAMPLE_TYPE_FLOAT32", sample_type_is_float) + +set_define("MOZ_VORBIS", sample_type_is_float) +set_config("MOZ_VORBIS", sample_type_is_float) +set_define("MOZ_TREMOR", sample_type_is_s16) +set_config("MOZ_TREMOR", sample_type_is_s16) option( "--disable-real-time-tracing", diff --git a/tools/rewriting/ThirdPartyPaths.txt b/tools/rewriting/ThirdPartyPaths.txt index 5ca21b3b5de9..24afdbb3b922 100644 --- a/tools/rewriting/ThirdPartyPaths.txt +++ b/tools/rewriting/ThirdPartyPaths.txt @@ -121,6 +121,7 @@ media/libpng/ media/libsoundtouch/ media/libspeex_resampler/ media/libtheora/ +media/libtremor/ media/libvorbis/ media/libvpx/ media/libwebp/ diff --git a/widget/android/bindings/MediaCodec-classes.txt b/widget/android/bindings/MediaCodec-classes.txt index a68b86e148e0..8830c11ccf94 100644 --- a/widget/android/bindings/MediaCodec-classes.txt +++ b/widget/android/bindings/MediaCodec-classes.txt @@ -9,7 +9,5 @@ # We only use constants from KeyStatus [android.media.MediaDrm$KeyStatus = skip:true] = skip:false -[android.media.AudioFormat = skip:true] - = skip:false [android.media.MediaFormat = exceptionMode:nsresult]