[Drdivx-commits] SF.net SVN: drdivx: [222] DrDivX/trunk/drdivx2
Brought to you by:
harikrishnan_v,
seabass089
From: <ro...@us...> - 2006-07-11 15:19:08
|
Revision: 222 Author: robUx4 Date: 2006-07-11 08:18:51 -0700 (Tue, 11 Jul 2006) ViewCVS: http://svn.sourceforge.net/drdivx/?rev=222&view=rev Log Message: ----------- Update framerate decimation when using a custom profile (move ResolveFPS to IProfileBundle) Modified Paths: -------------- DrDivX/trunk/drdivx2/Changelog DrDivX/trunk/drdivx2/include/ProfileBundle.h DrDivX/trunk/drdivx2/src/job/JobImpl.cpp DrDivX/trunk/drdivx2/src/profile/FitFileSizeProfileBundleBuilder.cpp DrDivX/trunk/drdivx2/src/profile/ProfileBundleBuilderImpl.cpp DrDivX/trunk/drdivx2/src/profile/ProfileBundleBuilderImpl.h DrDivX/trunk/drdivx2/src/profile/ProfileBundleImpl.cpp DrDivX/trunk/drdivx2/src/profile/ProfileBundleImpl.h DrDivX/trunk/drdivx2/src/profile/QualityProfileBundleBuilder.cpp Modified: DrDivX/trunk/drdivx2/Changelog =================================================================== --- DrDivX/trunk/drdivx2/Changelog 2006-07-10 23:22:34 UTC (rev 221) +++ DrDivX/trunk/drdivx2/Changelog 2006-07-11 15:18:51 UTC (rev 222) @@ -13,6 +13,7 @@ Fix a crash when an unsupported codec is found during encoding Fix a crash when boost is set but the audio output is AC3 Resize some elements of the UI to better fit large languages and 120 DPI display +Update framerate decimation when using a custom profile - DrFFMPEG fix clipping audio when the channel mapping is guessed (AAC via RealMediaSplitter.ax) Modified: DrDivX/trunk/drdivx2/include/ProfileBundle.h =================================================================== --- DrDivX/trunk/drdivx2/include/ProfileBundle.h 2006-07-10 23:22:34 UTC (rev 221) +++ DrDivX/trunk/drdivx2/include/ProfileBundle.h 2006-07-11 15:18:51 UTC (rev 222) @@ -72,6 +72,11 @@ virtual ErrorCode GetPropertyBundle(IPropertyBundle **propertyBundle) = 0; virtual bool IsCustom() const = 0; + + virtual void ResolveFPS( + uint32_t inVidFrameRate, + uint32_t inVidFrameScale, + uint32_t & outVidFrameRateDecimation) const = 0; }; // Declarations for the DLL's exported functions and typedef'ed function Modified: DrDivX/trunk/drdivx2/src/job/JobImpl.cpp =================================================================== --- DrDivX/trunk/drdivx2/src/job/JobImpl.cpp 2006-07-10 23:22:34 UTC (rev 221) +++ DrDivX/trunk/drdivx2/src/job/JobImpl.cpp 2006-07-11 15:18:51 UTC (rev 222) @@ -454,6 +454,24 @@ uint32_t resizeVidHeight = (uint32_t) floor(correctVidHeight / moduloHeight + 0.5) * moduloHeight; ProfilePropertyHelper::SetUInt32PropertyValue(vidProfile, VIDEO_ENC_RESIZE_HEIGHT_PROP, resizeVidHeight); } + + uint32_t inVidFrameRate = 0; + uint32_t inVidFrameScale = 0; + uint32_t outVidFrameRateDecimation = 1; + + // Resolve output frame rate + vidTrack->GetProperty(VIDEO_TRACK_FRAME_RATE_PROP, &vidProperty); + if (vidProperty != NULL) + { + inVidFrameRate = PropertyHelper::GetUInt32Value(vidProperty); + } + vidTrack->GetProperty(VIDEO_TRACK_FRAME_SCALE_PROP, &vidProperty); + if (vidProperty != NULL) + { + inVidFrameScale = PropertyHelper::GetUInt32Value(vidProperty); + } + profileBundle->ResolveFPS(inVidFrameRate, inVidFrameScale, outVidFrameRateDecimation); + ProfilePropertyHelper::SetUInt32PropertyValue(vidProfile, VIDEO_ENC_FRAME_RATE_DECIMATION_PROP, outVidFrameRateDecimation); } if (intensive == true) Modified: DrDivX/trunk/drdivx2/src/profile/FitFileSizeProfileBundleBuilder.cpp =================================================================== --- DrDivX/trunk/drdivx2/src/profile/FitFileSizeProfileBundleBuilder.cpp 2006-07-10 23:22:34 UTC (rev 221) +++ DrDivX/trunk/drdivx2/src/profile/FitFileSizeProfileBundleBuilder.cpp 2006-07-11 15:18:51 UTC (rev 222) @@ -162,7 +162,7 @@ } // Resolve output frame rate - ResolveFPS(videoTrack, inVidFrameRate, inVidFrameScale, outVidFrameRateDecimation); + profileBundle->ResolveFPS(inVidFrameRate, inVidFrameScale, outVidFrameRateDecimation); DivXEncoderInterlace interlace = ProgressiveOutput; Modified: DrDivX/trunk/drdivx2/src/profile/ProfileBundleBuilderImpl.cpp =================================================================== --- DrDivX/trunk/drdivx2/src/profile/ProfileBundleBuilderImpl.cpp 2006-07-10 23:22:34 UTC (rev 221) +++ DrDivX/trunk/drdivx2/src/profile/ProfileBundleBuilderImpl.cpp 2006-07-11 15:18:51 UTC (rev 222) @@ -96,46 +96,6 @@ return far; } -// Return FPS for specified video source -void ProfileBundleBuilderImpl::ResolveFPS(ITrack* videoTrack, - uint32_t inVidFrameRate, - uint32_t inVidFrameScale, - uint32_t & outVidFrameRateDecimation) -{ - if (certification != NoCertification) - { - CertificationProfile certProfile; - - // Find the correct certification struct for the specified certification level - switch (certification) - { - case HandheldCertification: - certProfile = HandheldCertificationProfile; - break; - case PortableCertification: - certProfile = PortableCertificationProfile; - break; - case HomeTheaterCertification: - certProfile = HomeTheaterCertificationProfile; - break; - case HighDefinitionCertification: - certProfile = HighDefinitionCertificationProfile; - break; - }; - - outVidFrameRateDecimation = 0; - uint32_t fps = 0; - - // Limit the frame rate to certification limit - do - { - outVidFrameRateDecimation++; - fps = inVidFrameRate / (inVidFrameScale * outVidFrameRateDecimation); - } - while (fps > certProfile.maxFPS); - } -} - // Resolve video resolution to make it conform to specified constraints bool ProfileBundleBuilderImpl::ResolveResolution(uint32_t & resizeVidWidth, uint32_t & resizeVidHeight, Modified: DrDivX/trunk/drdivx2/src/profile/ProfileBundleBuilderImpl.h =================================================================== --- DrDivX/trunk/drdivx2/src/profile/ProfileBundleBuilderImpl.h 2006-07-10 23:22:34 UTC (rev 221) +++ DrDivX/trunk/drdivx2/src/profile/ProfileBundleBuilderImpl.h 2006-07-11 15:18:51 UTC (rev 222) @@ -47,11 +47,6 @@ Certification certification; IPropertyBundle *hintPropBundle; - void ResolveFPS(ITrack* videoTrack, - uint32_t inVidFrameRate, - uint32_t inVidFrameScale, - uint32_t & outVidFrameRateDecimation); - double ResolveFAR(uint32_t width, uint32_t height, PAR *par); bool ResolveResolution(uint32_t & resizeVidWidth, Modified: DrDivX/trunk/drdivx2/src/profile/ProfileBundleImpl.cpp =================================================================== --- DrDivX/trunk/drdivx2/src/profile/ProfileBundleImpl.cpp 2006-07-10 23:22:34 UTC (rev 221) +++ DrDivX/trunk/drdivx2/src/profile/ProfileBundleImpl.cpp 2006-07-11 15:18:51 UTC (rev 222) @@ -496,6 +496,46 @@ return isCustom || (type == CustomProfileBundle); } +// Return FPS for specified video source +void ProfileBundleImpl::ResolveFPS( + uint32_t inVidFrameRate, + uint32_t inVidFrameScale, + uint32_t & outVidFrameRateDecimation) const +{ + if (certification != NoCertification) + { + CertificationProfile certProfile; + + // Find the correct certification struct for the specified certification level + switch (certification) + { + case HandheldCertification: + certProfile = HandheldCertificationProfile; + break; + case PortableCertification: + certProfile = PortableCertificationProfile; + break; + case HomeTheaterCertification: + certProfile = HomeTheaterCertificationProfile; + break; + case HighDefinitionCertification: + certProfile = HighDefinitionCertificationProfile; + break; + }; + + outVidFrameRateDecimation = 0; + uint32_t fps = 0; + + // Limit the frame rate to certification limit + do + { + outVidFrameRateDecimation++; + fps = inVidFrameRate / (inVidFrameScale * outVidFrameRateDecimation); + } + while (fps > certProfile.maxFPS); + } +} + int CreateProfileBundle(IProfileBundle **profileBundle) { *profileBundle = new ProfileBundleImpl(); Modified: DrDivX/trunk/drdivx2/src/profile/ProfileBundleImpl.h =================================================================== --- DrDivX/trunk/drdivx2/src/profile/ProfileBundleImpl.h 2006-07-10 23:22:34 UTC (rev 221) +++ DrDivX/trunk/drdivx2/src/profile/ProfileBundleImpl.h 2006-07-11 15:18:51 UTC (rev 222) @@ -59,6 +59,11 @@ virtual bool IsCustom() const; + void ResolveFPS( + uint32_t inVidFrameRate, + uint32_t inVidFrameScale, + uint32_t & outVidFrameRateDecimation) const; + virtual ~ProfileBundleImpl(); protected: Modified: DrDivX/trunk/drdivx2/src/profile/QualityProfileBundleBuilder.cpp =================================================================== --- DrDivX/trunk/drdivx2/src/profile/QualityProfileBundleBuilder.cpp 2006-07-10 23:22:34 UTC (rev 221) +++ DrDivX/trunk/drdivx2/src/profile/QualityProfileBundleBuilder.cpp 2006-07-11 15:18:51 UTC (rev 222) @@ -247,7 +247,7 @@ inVidFrameScale = value.uint32Val; // Resolve output frame rate - ResolveFPS(videoTrack, inVidFrameRate, inVidFrameScale, outVidFrameRateDecimation); + profileBundle->ResolveFPS(inVidFrameRate, inVidFrameScale, outVidFrameRateDecimation); DivXEncoderInterlace interlace = ProgressiveOutput; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |