|
Kodi Documentation 23.0
Kodi is an open source media player and entertainment hub.
|
#include "video/geometry/ContentGeometryCombiner.h"#include "video/geometry/test/GeometryTestHelpers.h"#include <vector>#include <gtest/gtest.h>Functions | |
| TEST (TestContentGeometryCombiner, UnanimousSamples) | |
| TEST (TestContentGeometryCombiner, LoneOutlierIsAbsorbed) | |
| TEST (TestContentGeometryCombiner, DegenerateSamplesAreDiscarded) | |
| TEST (TestContentGeometryCombiner, LowConfidenceSamplesAreDiscarded) | |
| TEST (TestContentGeometryCombiner, TwoStationaryClustersMeanVaries) | |
| TEST (TestContentGeometryCombiner, VariesIsCountedNotWeighted) | |
| std::vector< GeometrySample > | ANinthInRivals () |
| Sixteen scope samples with two full-frame rivals: two of eighteen is a ninth, exactly at the default varies share. | |
| TEST (TestContentGeometryCombiner, ANinthOfTheSamplesIsEnoughToVary) | |
| TEST (TestContentGeometryCombiner, BelowTheShareTheTitleDoesNotVary) | |
| TEST (TestContentGeometryCombiner, TheShareIsSettable) | |
| TEST (TestContentGeometryCombiner, SingleRivalSampleIsNotACluster) | |
| TEST (TestContentGeometryCombiner, NoUsableSamplesReportsTheCodedFrame) | |
| TEST (TestContentGeometryCombiner, NoSamplesAtAllReportsTheCodedFrame) | |
| TEST (TestContentGeometryCombiner, EdgesWithinToleranceAreOneCluster) | |
| Boundary ringing moves an edge by a line or two; that is the same edge. | |
| TEST (TestContentGeometryCombiner, EdgesBeyondToleranceAreSeparateClusters) | |
| Beyond the tolerance they are different edges, and two of them means the title varies. | |
| TEST (TestContentGeometryCombiner, DominantClusterIsChosenOnWeight) | |
| TEST (TestContentGeometryCombiner, StationaryUnscoredSamplesStillRead) | |
| TEST (TestContentGeometryCombiner, TooFewUnscoredSamplesDoNotRead) | |
| One unscored reading is a point, and two is a coincidence. Neither is stationarity. | |
| TEST (TestContentGeometryCombiner, UnscoredSamplesAreStillDroppedWhenTheTitleScored) | |
| TEST (TestContentGeometryCombiner, ClusterCentreIsTheMedianOfItsMembers) | |
| TEST (TestContentGeometryCombiner, PillarboxAndLetterboxAreDistinguished) | |
| Pillarboxing, to prove clustering is on the whole rectangle and not on height alone. | |
| TEST (TestContentGeometryCombiner, AnUnexplainedShapeSurvivesAsAReasonToLookAgain) | |
| TEST (TestContentGeometryCombiner, ANearbyDiscardedReadingIsNotAnUnexplainedShape) | |
| TEST (TestContentGeometryCombiner, TheShapesAreTheAnswerThenEachRivalThatCounts) | |
| The shapes a title is in: the dominant one, then each rival seen often enough to count. | |
| TEST (TestContentGeometryCombiner, AFixedTitleIsInOneShape) | |
| TEST (TestContentGeometryCombiner, ARivalAtExactlyTheVariesShareVaries) | |
| TEST (TestContentGeometryCombiner, ARivalAtExactlyTheMinimumSampleCountVaries) | |
| And the count rule beside it, also >=: minRivalSamples of 2 means two samples qualify. | |
| TEST (TestContentGeometryCombiner, ReadingsExactlyToleranceApartAreOneShape) | |
| std::vector< GeometrySample > ANinthInRivals | ( | ) |
Sixteen scope samples with two full-frame rivals: two of eighteen is a ninth, exactly at the default varies share.
| TEST | ( | TestContentGeometryCombiner | , |
| AFixedTitleIsInOneShape | ) |
| TEST | ( | TestContentGeometryCombiner | , |
| ANearbyDiscardedReadingIsNotAnUnexplainedShape | ) |
The rule must not fire on the noise it was carved out of: a reading a few pixels off is the same shape, and clustering already has it.
| TEST | ( | TestContentGeometryCombiner | , |
| ANinthOfTheSamplesIsEnoughToVary | ) |
The threshold itself, which decides a published field and is a tenth by default.
Measured on a title cut in three ratios: a thorough scan found a genuine scope sequence in twenty of a hundred and seventy-nine usable samples - a ninth - while the fifth this rule once demanded published the title as one that does not vary, contradicting its own stored detail, which listed the second shape.
| TEST | ( | TestContentGeometryCombiner | , |
| AnUnexplainedShapeSurvivesAsAReasonToLookAgain | ) |
WandaVision S01E01 in miniature: a 4:3 sitcom body whose closing act is scope, on content dark enough beside the pillarbox that every sample scores nothing. Corroboration then falls to repetition, and the lone scope reading has none - correctly, since one sample is not a section. Erasing it silently is the problem: it is the only sign the sampling caught the edge of something, and a title stored as fixed 4:3 is never revisited.
| TEST | ( | TestContentGeometryCombiner | , |
| ARivalAtExactlyTheMinimumSampleCountVaries | ) |
And the count rule beside it, also >=: minRivalSamples of 2 means two samples qualify.
| TEST | ( | TestContentGeometryCombiner | , |
| ARivalAtExactlyTheVariesShareVaries | ) |
The share rule is >=, so a rival at exactly variesShare varies. Tested either side of 0.10 already; this is the value itself, which is the one a reader has to guess at.
| TEST | ( | TestContentGeometryCombiner | , |
| BelowTheShareTheTitleDoesNotVary | ) |
| TEST | ( | TestContentGeometryCombiner | , |
| ClusterCentreIsTheMedianOfItsMembers | ) |
| TEST | ( | TestContentGeometryCombiner | , |
| DegenerateSamplesAreDiscarded | ) |
A cut to black is dark and flat on every line, so the detector reports maximum bars. That is not a very narrow reading, it is no reading, and combining it as narrow is the most likely way a mask ends up closing onto picture.
| TEST | ( | TestContentGeometryCombiner | , |
| DominantClusterIsChosenOnWeight | ) |
The dominant cluster is chosen on weight, so a handful of confident samples beat a larger group of doubtful ones - but only for the rectangle. varies is unaffected, by design.
| TEST | ( | TestContentGeometryCombiner | , |
| EdgesBeyondToleranceAreSeparateClusters | ) |
Beyond the tolerance they are different edges, and two of them means the title varies.
| TEST | ( | TestContentGeometryCombiner | , |
| EdgesWithinToleranceAreOneCluster | ) |
Boundary ringing moves an edge by a line or two; that is the same edge.
| TEST | ( | TestContentGeometryCombiner | , |
| LoneOutlierIsAbsorbed | ) |
The Menu, 2026-08-06: eight samples at 263/263 and one dark-scene reading of 3062x1015. The outlier must vanish without trace. A "widest wins" rule would take the outlier's width in some frames and collapse the film; a median over edges would survive this but not the variable-aspect case below.
| TEST | ( | TestContentGeometryCombiner | , |
| LowConfidenceSamplesAreDiscarded | ) |
| TEST | ( | TestContentGeometryCombiner | , |
| NoSamplesAtAllReportsTheCodedFrame | ) |
| TEST | ( | TestContentGeometryCombiner | , |
| NoUsableSamplesReportsTheCodedFrame | ) |
Never narrower under uncertainty. With nothing to go on the answer is the coded frame, which shows bars at worst; anything narrower risks masking real picture.
| TEST | ( | TestContentGeometryCombiner | , |
| PillarboxAndLetterboxAreDistinguished | ) |
Pillarboxing, to prove clustering is on the whole rectangle and not on height alone.
| TEST | ( | TestContentGeometryCombiner | , |
| ReadingsExactlyToleranceApartAreOneShape | ) |
Two readings exactly tolerance apart are the same shape. The same 8 is the live selector's jitter floor and the merge's match window, so three places have to agree what "the same edge" means - and each of them tests either side of it rather than on it.
| TEST | ( | TestContentGeometryCombiner | , |
| SingleRivalSampleIsNotACluster | ) |
The Wolf of Wall Street: one sample of five landed in a genuine pillarboxed sequence. One sample is a point, not a cluster, and stationarity is a claim about repetition - so this is not enough to call the title variable, however real the reading turned out to be.
| TEST | ( | TestContentGeometryCombiner | , |
| StationaryUnscoredSamplesStillRead | ) |
WandaVision S01E01, 4:3 pillarboxed black-and-white: the picture beside the bar never clears the detector's margin, so every sample scores zero, and every sample agrees to within 2px across the runtime. Discarding these loses the only reading there is and the episode reports 16:9.
| TEST | ( | TestContentGeometryCombiner | , |
| TheShapesAreTheAnswerThenEachRivalThatCounts | ) |
The shapes a title is in: the dominant one, then each rival seen often enough to count.
| TEST | ( | TestContentGeometryCombiner | , |
| TheShareIsSettable | ) |
| TEST | ( | TestContentGeometryCombiner | , |
| TooFewUnscoredSamplesDoNotRead | ) |
One unscored reading is a point, and two is a coincidence. Neither is stationarity.
| TEST | ( | TestContentGeometryCombiner | , |
| TwoStationaryClustersMeanVaries | ) |
Mandalorian & Grogu, IMAX HYBRID: alternates between full frame and 2.40 through the film. Two stationary clusters is what varying geometry looks like.
| TEST | ( | TestContentGeometryCombiner | , |
| UnanimousSamples | ) |
| TEST | ( | TestContentGeometryCombiner | , |
| UnscoredSamplesAreStillDroppedWhenTheTitleScored | ) |
The rescue applies only where the title scored nothing at all. A confident reading elsewhere means confidence is working here, so an unscored cluster is the suspect one.
| TEST | ( | TestContentGeometryCombiner | , |
| VariesIsCountedNotWeighted | ) |
The bias this rule exists to defeat, and the reason varies is counted rather than weighted. A full-frame reading scores top marks by construction - no edges means no soft boundary to dock it for - while the letterboxed readings of the same title score far lower because they have boundaries. Weighted, the minority geometry disappears; counted, it survives. Measured on a real variable-aspect title, where weighting hid it completely.