|
Kodi Documentation 23.0
Kodi is an open source media player and entertainment hub.
|
#include "utils/AspectRatioVocabulary.h"#include "video/geometry/EffectiveGeometry.h"#include "video/geometry/GeometryPublication.h"#include "video/geometry/test/GeometryTestHelpers.h"#include <tuple>#include <utility>#include <gtest/gtest.h>Functions | |
| TEST (TestEffectiveGeometry, AnamorphicContentResolvesToItsDisplayedRatio) | |
| TEST (TestEffectiveGeometry, AMeasurementResolvesToItsVocabularyEntry) | |
| TEST (TestEffectiveGeometry, SnappingErrsTowardTheShapeTheRoomRestsAt) | |
| TEST (TestEffectiveGeometry, DetectionAndDeclarationOfTheSameRatioAgreeExactly) | |
| TEST (TestEffectiveGeometry, TheDetectedRatioIgnoresADeclarationOverIt) | |
| TEST (TestEffectiveGeometry, TheDetectedRatioIsZeroWhenNothingWasMeasured) | |
| TEST (TestEffectiveGeometry, AFullFrameMeasurementServesExactlyTheFrame) | |
| TEST (TestEffectiveGeometry, NothingKnownReportsTheWholeFrame) | |
| TEST (TestEffectiveGeometry, AMeasurementThatIsOnNoRealRatioIsRefused) | |
| TEST (TestEffectiveGeometry, AStaleMeasurementIsStillServed) | |
| TEST (TestEffectiveGeometry, RefusedMeasurementIsNotReportedStale) | |
| TEST (TestEffectiveGeometry, ADeclarationOutranksAMeasurement) | |
| TEST (TestEffectiveGeometry, ADeclarationIsNotPlausibilityChecked) | |
| TEST (TestEffectiveGeometry, ADeclarationIsCentredInTheFrame) | |
| TEST (TestEffectiveGeometry, ADeclarationOfTheFramesOwnRatioIsTheFrame) | |
| TEST (TestEffectiveGeometry, ADeclarationNarrowerThanTheFrameInsetsTheSides) | |
| TEST (TestEffectiveGeometry, ALiveReadingOutranksTheCache) | |
| TEST (TestEffectiveGeometry, VariablePolicyDecidesBetweenShowingAllOfItAndNamingItsRatio) | |
| TEST (TestEffectiveGeometry, MeasuredSectionsArePublishedInDisplaySpaceWithTheirOwnRatio) | |
| TEST (TestEffectiveGeometry, AnotherStreamWithholdsTheRecordWithoutDestroyingIt) | |
| TEST (TestEffectiveGeometry, AnotherStreamKeepsTheLiveReading) | |
| TEST (TestEffectiveGeometry, ASectionOnNoRealRatioCarriesNoLabel) | |
| TEST (TestEffectiveGeometry, ARectangleOnNoRealRatioCarriesNoLabel) | |
| TEST (TestEffectiveGeometry, ARecordForADifferentFileIsNotServed) | |
| TEST (TestEffectiveGeometry, ARecordThatCarriesNoReadingFallsBackToTheFrame) | |
| TEST (TestEffectiveGeometry, AGateRejectionIsReportedRatherThanJustActedOn) | |
| TEST (TestEffectiveGeometry, AnAcceptedMeasurementIsNotReportedAsRejected) | |
| TEST (TestEffectiveGeometry, ADeclarationClearsAGateRejection) | |
| TEST (TestEffectiveGeometry, NothingMeasuredIsNotAGateRejection) | |
| TEST (TestEffectiveGeometry, AQuarterTurnLeavesASectionsRatioUpright) | |
| TEST (TestEffectiveGeometry, AnUnmeasuredTitleContainsNoRatios) | |
| TEST (TestEffectiveGeometry, ARefusedMeasurementContainsNoRatiosEither) | |
| TEST (TestEffectiveGeometry, AMeasuredTitleContainsTheRatioItResolvedTo) | |
| TEST (TestEffectiveGeometry, ADeclaredTitleContainsTheRatioThatWasDeclared) | |
| TEST (TestEffectiveGeometry, TheRatiosOfAVariableTitleArePublishedDominantFirst) | |
| TEST (TestEffectiveGeometry, TheSameRatioMeasuredTwiceIsStillOneRatio) | |
| TEST (TestEffectiveGeometry, TheShapeAVariableTitleIsServedAtIsNotOneOfItsRatios) | |
| TEST (TestEffectiveGeometry, NothingIsDrawnUntilThereIsAPicture) | |
| TEST (TestEffectiveGeometry, RotationDoesNotDisqualifyTheRatioItWasShotAt) | |
| TEST (TestEffectiveGeometry, UncroppedContentIsDrawnWhereTheWholeVideoIs) | |
| TEST (TestEffectiveGeometry, TheBarsAreTakenAsAFractionOfTheFrame) | |
| TEST (TestEffectiveGeometry, ThePictureFollowsAVideoDrawnSmallerThanTheScreen) | |
| TEST (TestEffectiveGeometry, AZoomedVideoCarriesThePictureOffTheScreenWithIt) | |
| TEST (TestEffectiveGeometry, AnOffCentrePictureIsNotSymmetrised) | |
| TEST (TestEffectiveGeometry, APillarboxedPictureInsetsTheSides) | |
| TEST (TestEffectiveGeometry, AFrameOfNoSizeLeavesTheVideoRectangleAlone) | |
| TEST (TestEffectiveGeometry, ARotatedPictureIsMappedOntoTheRotatedVideoRectangle) | |
| TEST (TestEffectiveGeometry, TheSourceRegionOfAnUnmeasuredFrameIsTheFrame) | |
| TEST (TestEffectiveGeometry, BakedBarsAreCutFromTheSourceRegion) | |
| TEST (TestEffectiveGeometry, TheSourceRegionIsCutInCodedPixelsHoweverTheyAreShaped) | |
| TEST (TestEffectiveGeometry, TheSourceRegionOfOneStereoscopicViewKeepsItsFractions) | |
| TEST (TestEffectiveGeometry, ATurnedPictureIsCutInCodedSpace) | |
| TEST (TestEffectiveGeometry, TheSourceRegionIsNeverAnotherShapeThanTheContent) | |
| TEST (TestEffectiveGeometry, AGeometryDescribesTheRegionItWasMeasuredIn) | |
| TEST (TestEffectiveGeometry, ARendererDrawingTheWholeFrameSeesTheBars) | |
| TEST (TestEffectiveGeometry, ASourceCutToTheContentPutsThePictureEverywhereItIsDrawn) | |
| TEST (TestEffectiveGeometry, OnlyTheDrawnPartOfTheContentCounts) | |
| TEST (TestEffectiveGeometry, PictureOnScreenWithNothingKnownIsTheDestination) | |
| TEST (TestEffectiveGeometry, AReadingNarrowerThanWhatIsServedDoesNotMoveTheRoom) | |
| TEST (TestEffectiveGeometry, AReadingWiderThanWhatIsServedOpensTheRoom) | |
| The other half: a title opening on an ident before it settles has to open the masking, or it plays the whole film inside the ident's shape. | |
| TEST (TestEffectiveGeometry, DetectorNoiseAroundTheServedRatioDoesNotRatchetItOpen) | |
| TEST | ( | TestEffectiveGeometry | , |
| ADeclarationClearsAGateRejection | ) |
Pinning a title whose measurement came out wrong is what declaring is for, and a measurement wrong enough to be refused outright is the case it is most needed on. The flag says a measurement is being served in place of, so it cannot outlive being served over.
| TEST | ( | TestEffectiveGeometry | , |
| ADeclarationIsCentredInTheFrame | ) |
| TEST | ( | TestEffectiveGeometry | , |
| ADeclarationIsNotPlausibilityChecked | ) |
| TEST | ( | TestEffectiveGeometry | , |
| ADeclarationNarrowerThanTheFrameInsetsTheSides | ) |
| TEST | ( | TestEffectiveGeometry | , |
| ADeclarationOfTheFramesOwnRatioIsTheFrame | ) |
| TEST | ( | TestEffectiveGeometry | , |
| ADeclarationOutranksAMeasurement | ) |
| TEST | ( | TestEffectiveGeometry | , |
| ADeclaredTitleContainsTheRatioThatWasDeclared | ) |
| TEST | ( | TestEffectiveGeometry | , |
| AFrameOfNoSizeLeavesTheVideoRectangleAlone | ) |
| TEST | ( | TestEffectiveGeometry | , |
| AFullFrameMeasurementServesExactlyTheFrame | ) |
| TEST | ( | TestEffectiveGeometry | , |
| AGateRejectionIsReportedRatherThanJustActedOn | ) |
A rejected measurement and no measurement at all both serve the frame, so without this flag they are indistinguishable - and the right response to each is the opposite one.
3456x2160 is 1.60, which is 3.7% from the nearest detectable entry - beyond tolerance, so the gate rejects it and the coded frame stands.
Never narrower under uncertainty: the frame, not the rejected rectangle.
| TEST | ( | TestEffectiveGeometry | , |
| AGeometryDescribesTheRegionItWasMeasuredIn | ) |
The guard the render path cuts behind. A resolved geometry outlives the frame it came from, and on a stereoscopic stream the region rendered is one view - so the check is against the rectangle being drawn, not the packing that holds two of it. Asked against the packing, a half side-by-side title never matches and its bars are never discarded.
| TEST | ( | TestEffectiveGeometry | , |
| ALiveReadingOutranksTheCache | ) |
| TEST | ( | TestEffectiveGeometry | , |
| AMeasuredTitleContainsTheRatioItResolvedTo | ) |
| TEST | ( | TestEffectiveGeometry | , |
| AMeasurementResolvesToItsVocabularyEntry | ) |
| TEST | ( | TestEffectiveGeometry | , |
| AMeasurementThatIsOnNoRealRatioIsRefused | ) |
| TEST | ( | TestEffectiveGeometry | , |
| AnAcceptedMeasurementIsNotReportedAsRejected | ) |
| TEST | ( | TestEffectiveGeometry | , |
| AnamorphicContentResolvesToItsDisplayedRatio | ) |
| TEST | ( | TestEffectiveGeometry | , |
| AnOffCentrePictureIsNotSymmetrised | ) |
| TEST | ( | TestEffectiveGeometry | , |
| AnotherStreamKeepsTheLiveReading | ) |
A live reading is taken from whatever is decoding now, so it describes the stream in force whichever that is and is not withheld with the record.
| TEST | ( | TestEffectiveGeometry | , |
| AnotherStreamWithholdsTheRecordWithoutDestroyingIt | ) |
A measurement describes the stream the sampler took, so it is withheld while another one is decoding - withheld, not destroyed. The inputs are loaded once, as the file opens, so clearing them would leave a viewer who switched away and back watching the coded frame for the rest of the playback, reported as container exactly as an unmeasured title is.
| TEST | ( | TestEffectiveGeometry | , |
| AnUnmeasuredTitleContainsNoRatios | ) |
The distinction the count exists for: a title detected as 1.78 and a title never detected at all serve the same rectangle, and a consumer showing a badge has to tell them apart.
| TEST | ( | TestEffectiveGeometry | , |
| APillarboxedPictureInsetsTheSides | ) |
| TEST | ( | TestEffectiveGeometry | , |
| AQuarterTurnLeavesASectionsRatioUpright | ) |
A quarter turn is applied to a section exactly as it is to the answer, and its ratio stays the upright one - the vocabulary has no name below 1.00 for the turned figure to be given.
| TEST | ( | TestEffectiveGeometry | , |
| AReadingNarrowerThanWhatIsServedDoesNotMoveTheRoom | ) |
A title with one presentation ratio and scenes composed narrower inside it - a director framing a shot, not the film changing shape. Following one brings the masking in for the scene and out again after it, which is the room rearranging itself around the cutting.
| TEST | ( | TestEffectiveGeometry | , |
| AReadingWiderThanWhatIsServedOpensTheRoom | ) |
The other half: a title opening on an ident before it settles has to open the masking, or it plays the whole film inside the ident's shape.
| TEST | ( | TestEffectiveGeometry | , |
| ARecordForADifferentFileIsNotServed | ) |
Never narrower under uncertainty, on the path where the file itself has changed. The row describes a different encode, so its rectangle may be narrower than this file's picture - and a rectangle that is too narrow closes a mask over real picture.
What CVideoDatabase::GetContentGeometry returns once the identity check fails.
| TEST | ( | TestEffectiveGeometry | , |
| ARecordThatCarriesNoReadingFallsBackToTheFrame | ) |
A scan that opened the file and read nothing still stores a row, so that the sweep does not attempt it again every run. That row must not be mistaken for a measurement.
| TEST | ( | TestEffectiveGeometry | , |
| ARectangleOnNoRealRatioCarriesNoLabel | ) |
The same contract on the rectangle itself, which is the one Player.GetProperties and every skin label read. The frame here is on no entry at all, so the answer served for it has no name - and reporting the nearest would say a shape nothing was shot at is a real ratio.
| TEST | ( | TestEffectiveGeometry | , |
| ARefusedMeasurementContainsNoRatiosEither | ) |
A rejected measurement serves the frame as well, and the frame's own ratio is no more the content's here than it is above.
| TEST | ( | TestEffectiveGeometry | , |
| ARendererDrawingTheWholeFrameSeesTheBars | ) |
| TEST | ( | TestEffectiveGeometry | , |
| ARotatedPictureIsMappedOntoTheRotatedVideoRectangle | ) |
| TEST | ( | TestEffectiveGeometry | , |
| ASectionOnNoRealRatioCarriesNoLabel | ) |
The schema says a label is empty when the ratio corresponds to none, because a client compares it. Nearest() never rejects, so labelling through it would publish a section on no real ratio under the nearest entry's label - indistinguishable from a title actually shot at it.
| TEST | ( | TestEffectiveGeometry | , |
| ASourceCutToTheContentPutsThePictureEverywhereItIsDrawn | ) |
| TEST | ( | TestEffectiveGeometry | , |
| AStaleMeasurementIsStillServed | ) |
A deliberate exception to never-narrower, pinned so it stays deliberate: a superseded detector's answer is still served rather than discarded, because it is the best available and discarding it would report the whole frame as picture on every title ever measured.
| TEST | ( | TestEffectiveGeometry | , |
| ATurnedPictureIsCutInCodedSpace | ) |
| TEST | ( | TestEffectiveGeometry | , |
| AZoomedVideoCarriesThePictureOffTheScreenWithIt | ) |
| TEST | ( | TestEffectiveGeometry | , |
| BakedBarsAreCutFromTheSourceRegion | ) |
| TEST | ( | TestEffectiveGeometry | , |
| DetectionAndDeclarationOfTheSameRatioAgreeExactly | ) |
| TEST | ( | TestEffectiveGeometry | , |
| DetectorNoiseAroundTheServedRatioDoesNotRatchetItOpen | ) |
The detector wanders by a row or two between frames on the same shot. Without a floor those readings ratchet the masking open a pixel at a time for the length of the film.
| TEST | ( | TestEffectiveGeometry | , |
| MeasuredSectionsArePublishedInDisplaySpaceWithTheirOwnRatio | ) |
A section is published in display space and named the same way the served rectangle is, so a consumer does not have to reimplement Kodi's bucketing to describe one. Anamorphic, because that is where a section divided in its own coded pixels gives a different answer from the published one.
| TEST | ( | TestEffectiveGeometry | , |
| NothingIsDrawnUntilThereIsAPicture | ) |
Drawn() is what decides whether the payload carries a screen at all, and an empty rectangle published as one is a rectangle a consumer would drive a mask to.
| TEST | ( | TestEffectiveGeometry | , |
| NothingKnownReportsTheWholeFrame | ) |
| TEST | ( | TestEffectiveGeometry | , |
| NothingMeasuredIsNotAGateRejection | ) |
| TEST | ( | TestEffectiveGeometry | , |
| OnlyTheDrawnPartOfTheContentCounts | ) |
| TEST | ( | TestEffectiveGeometry | , |
| PictureOnScreenWithNothingKnownIsTheDestination | ) |
| TEST | ( | TestEffectiveGeometry | , |
| RefusedMeasurementIsNotReportedStale | ) |
| TEST | ( | TestEffectiveGeometry | , |
| RotationDoesNotDisqualifyTheRatioItWasShotAt | ) |
| TEST | ( | TestEffectiveGeometry | , |
| SnappingErrsTowardTheShapeTheRoomRestsAt | ) |
| TEST | ( | TestEffectiveGeometry | , |
| TheBarsAreTakenAsAFractionOfTheFrame | ) |
| TEST | ( | TestEffectiveGeometry | , |
| TheDetectedRatioIgnoresADeclarationOverIt | ) |
What the measurement alone gave, which is recorded alongside a declaration so a corrected detection can be told from one that never had an answer.
It is taken during the resolution rather than by resolving a second time with the declaration blanked, so the two have to be shown to agree - and the declaration must not reach it.
| TEST | ( | TestEffectiveGeometry | , |
| TheDetectedRatioIsZeroWhenNothingWasMeasured | ) |
Nothing measured is zero rather than the frame's own ratio, so a declaration made over a title that was never measured is not recorded as having corrected anything.
| TEST | ( | TestEffectiveGeometry | , |
| ThePictureFollowsAVideoDrawnSmallerThanTheScreen | ) |
| TEST | ( | TestEffectiveGeometry | , |
| TheRatiosOfAVariableTitleArePublishedDominantFirst | ) |
| TEST | ( | TestEffectiveGeometry | , |
| TheSameRatioMeasuredTwiceIsStillOneRatio | ) |
Two stored ratios can name one entry. What is published is the set of ratios the title contains, as the vocabulary names them.
| TEST | ( | TestEffectiveGeometry | , |
| TheShapeAVariableTitleIsServedAtIsNotOneOfItsRatios | ) |
A title letterboxed in one stretch and pillarboxed in another is served at the frame that covers both, and that shape is one the title is never in. What it contains is its own two ratios, which is what a badge says and what a masking system programmes against.
| TEST | ( | TestEffectiveGeometry | , |
| TheSourceRegionIsCutInCodedPixelsHoweverTheyAreShaped | ) |
| TEST | ( | TestEffectiveGeometry | , |
| TheSourceRegionIsNeverAnotherShapeThanTheContent | ) |
| TEST | ( | TestEffectiveGeometry | , |
| TheSourceRegionOfAnUnmeasuredFrameIsTheFrame | ) |
| TEST | ( | TestEffectiveGeometry | , |
| TheSourceRegionOfOneStereoscopicViewKeepsItsFractions | ) |
| TEST | ( | TestEffectiveGeometry | , |
| UncroppedContentIsDrawnWhereTheWholeVideoIs | ) |
| TEST | ( | TestEffectiveGeometry | , |
| VariablePolicyDecidesBetweenShowingAllOfItAndNamingItsRatio | ) |