Don't verify decoder output timestamps for interlaced encodings.
Additional changes on top of below commit to cover all cases.
https://android-review.googlesource.com/c/platform/cts/+/1431811/
Bug: 215463419
Change-Id: Ieeeba46e89f02b98c67fc452aabc832dfb6a189b
diff --git a/tests/media/jni/NativeCodecDecoderTest.cpp b/tests/media/jni/NativeCodecDecoderTest.cpp
index d68a040..03c845b 100644
--- a/tests/media/jni/NativeCodecDecoderTest.cpp
+++ b/tests/media/jni/NativeCodecDecoderTest.cpp
@@ -472,8 +472,10 @@
AMediaExtractor_seekTo(mExtractor, 0, mode);
test->reset();
if (!doWork(23)) return false;
- CHECK_ERR(!test->isPtsStrictlyIncreasing(mPrevOutputPts), "",
- "pts is not strictly increasing", isPass);
+ if (!mIsInterlaced) {
+ CHECK_ERR(!test->isPtsStrictlyIncreasing(mPrevOutputPts), "",
+ "pts is not strictly increasing", isPass);
+ }
/* test flush in running state */
if (!flushCodec()) return false;
@@ -560,8 +562,13 @@
CHECK_ERR(loopCounter != 0 && (!ref->equals(test)), log, "output is flaky", isPass);
CHECK_ERR(loopCounter == 0 && mIsAudio && (!ref->isPtsStrictlyIncreasing(mPrevOutputPts)),
log, "pts is not strictly increasing", isPass);
- CHECK_ERR(loopCounter == 0 && !mIsAudio && (!ref->isOutPtsListIdenticalToInpPtsList(false)),
- log, "input pts list and output pts list are not identical", isPass);
+ // TODO: Timestamps for deinterlaced content are under review. (E.g. can decoders
+ // produce multiple progressive frames?) For now, do not verify timestamps.
+ if (!mIsInterlaced) {
+ CHECK_ERR(loopCounter == 0 && !mIsAudio &&
+ (!ref->isOutPtsListIdenticalToInpPtsList(false)),
+ log, "input pts list and output pts list are not identical", isPass);
+ }
loopCounter++;
}
return isPass;
@@ -638,9 +645,13 @@
CHECK_ERR(loopCounter == 0 && mIsAudio &&
(!ref->isPtsStrictlyIncreasing(mPrevOutputPts)),
log, "pts is not strictly increasing", isPass);
- CHECK_ERR(loopCounter == 0 && !mIsAudio &&
- (!ref->isOutPtsListIdenticalToInpPtsList(false)),
- log, "input pts list and output pts list are not identical", isPass);
+ // TODO: Timestamps for deinterlaced content are under review. (E.g. can decoders
+ // produce multiple progressive frames?) For now, do not verify timestamps.
+ if (!mIsInterlaced) {
+ CHECK_ERR(loopCounter == 0 && !mIsAudio &&
+ (!ref->isOutPtsListIdenticalToInpPtsList(false)),
+ log, "input pts list and output pts list are not identical", isPass);
+ }
if (validateFormat) {
if (mIsCodecInAsyncMode ? !mAsyncHandle.hasOutputFormatChanged()
: !mSignalledOutFormatChanged) {
diff --git a/tests/media/src/android/mediav2/cts/CodecDecoderTest.java b/tests/media/src/android/mediav2/cts/CodecDecoderTest.java
index 16faa41..53d4226 100644
--- a/tests/media/src/android/mediav2/cts/CodecDecoderTest.java
+++ b/tests/media/src/android/mediav2/cts/CodecDecoderTest.java
@@ -256,9 +256,15 @@
assertTrue(log + " pts is not strictly increasing",
ref.isPtsStrictlyIncreasing(mPrevOutputPts));
} else {
- assertTrue(
- log + " input pts list and output pts list are not identical",
- ref.isOutPtsListIdenticalToInpPtsList(false));
+ // TODO: Timestamps for deinterlaced content are under review.
+ // (E.g. can decoders produce multiple progressive frames?)
+ // For now, do not verify timestamps.
+ if (!mIsInterlaced) {
+ assertTrue(
+ log +
+ " input pts list and output pts list are not identical",
+ ref.isOutPtsListIdenticalToInpPtsList(false));
+ }
}
}
if (validateFormat) {
@@ -309,8 +315,12 @@
assertTrue("reference output pts is not strictly increasing",
ref.isPtsStrictlyIncreasing(mPrevOutputPts));
} else {
- assertTrue("input pts list and output pts list are not identical",
- ref.isOutPtsListIdenticalToInpPtsList(false));
+ // TODO: Timestamps for deinterlaced content are under review. (E.g. can decoders
+ // produce multiple progressive frames?) For now, do not verify timestamps.
+ if (!mIsInterlaced) {
+ assertTrue("input pts list and output pts list are not identical",
+ ref.isOutPtsListIdenticalToInpPtsList(false));
+ }
}
mOutputBuff = test;
setUpSource(mTestFile);
@@ -343,8 +353,10 @@
mExtractor.seekTo(0, mode);
test.reset();
doWork(23);
- assertTrue(log + " pts is not strictly increasing",
- test.isPtsStrictlyIncreasing(mPrevOutputPts));
+ if (!mIsInterlaced) {
+ assertTrue(log + " pts is not strictly increasing",
+ test.isPtsStrictlyIncreasing(mPrevOutputPts));
+ }
boolean checkMetrics = (mOutputCount != 0);
@@ -435,10 +447,14 @@
assertTrue("config reference output pts is not strictly increasing",
configRef.isPtsStrictlyIncreasing(mPrevOutputPts));
} else {
- assertTrue("input pts list and reference pts list are not identical",
- ref.isOutPtsListIdenticalToInpPtsList(false));
- assertTrue("input pts list and reconfig ref output pts list are not identical",
- ref.isOutPtsListIdenticalToInpPtsList(false));
+ // TODO: Timestamps for deinterlaced content are under review. (E.g. can decoders
+ // produce multiple progressive frames?) For now, do not verify timestamps.
+ if (!mIsInterlaced) {
+ assertTrue("input pts list and reference pts list are not identical",
+ ref.isOutPtsListIdenticalToInpPtsList(false));
+ assertTrue("input pts list and reconfig ref output pts list are not identical",
+ ref.isOutPtsListIdenticalToInpPtsList(false));
+ }
}
mOutputBuff = test;
mCodec = MediaCodec.createByCodecName(mCodecName);
@@ -606,9 +622,14 @@
assertTrue(log + " pts is not strictly increasing",
ref.isPtsStrictlyIncreasing(mPrevOutputPts));
} else {
- assertTrue(
- log + " input pts list and output pts list are not identical",
- ref.isOutPtsListIdenticalToInpPtsList(false));
+ // TODO: Timestamps for deinterlaced content are under review.
+ // (E.g. can decoders produce multiple progressive frames?)
+ // For now, do not verify timestamps.
+ if (!mIsInterlaced) {
+ assertTrue(
+ log + " input pts list and output pts list are not identical",
+ ref.isOutPtsListIdenticalToInpPtsList(false));
+ }
}
}
loopCounter++;
@@ -695,9 +716,15 @@
assertTrue(log + " pts is not strictly increasing",
ref.isPtsStrictlyIncreasing(mPrevOutputPts));
} else {
- assertTrue(
- log + " input pts list and output pts list are not identical",
- ref.isOutPtsListIdenticalToInpPtsList(false));
+ // TODO: Timestamps for deinterlaced content are under review.
+ // (E.g. can decoders produce multiple progressive frames?)
+ // For now, do not verify timestamps.
+ if (!mIsInterlaced) {
+ assertTrue(
+ log +
+ " input pts list and output pts list are not identical",
+ ref.isOutPtsListIdenticalToInpPtsList(false));
+ }
}
}
if (validateFormat) {
@@ -757,8 +784,12 @@
assertTrue("reference output pts is not strictly increasing",
ref.isPtsStrictlyIncreasing(mPrevOutputPts));
} else {
- assertTrue("input pts list and output pts list are not identical",
- ref.isOutPtsListIdenticalToInpPtsList(false));
+ // TODO: Timestamps for deinterlaced content are under review. (E.g. can decoders
+ // produce multiple progressive frames?) For now, do not verify timestamps.
+ if (!mIsInterlaced) {
+ assertTrue("input pts list and output pts list are not identical",
+ ref.isOutPtsListIdenticalToInpPtsList(false));
+ }
}
mSaveToMem = true;
mOutputBuff = test;