Commit 6443d5b8 by andrewlewis Committed by Ian Baker

Add an SSIM test with 360p input

This test should run on all devices from API 21 (the media uses Baseline
profile level 3.0 H.264) to give us coverage of the full pipeline (forcing
re-encoding) and SSIM calculation on all devices.

PiperOrigin-RevId: 443650002
parent 5a3ed342
......@@ -57,6 +57,10 @@ public final class AndroidTestUtil {
.setFrameRate(30.00f)
.build();
/** Baseline profile level 3.0 H.264 stream, which should be supported on all devices. */
public static final String MP4_ASSET_WITH_INCREASING_TIMESTAMPS_360P_15S_URI_STRING =
"asset:///media/mp4/sample_with_increasing_timestamps_360p.mp4";
public static final String MP4_ASSET_SEF_URI_STRING =
"asset:///media/mp4/sample_sef_slow_motion.mp4";
public static final Format MP4_ASSET_SEF_FORMAT =
......
......@@ -86,4 +86,29 @@ public final class TranscodeQualityTest {
assertThat(result.ssim).isGreaterThan(0.90);
}
@Test
public void transcodeAvcToAvc360p_ssimIsGreaterThan90Percent() throws Exception {
Context context = ApplicationProvider.getApplicationContext();
String testId = "transcodeAvcToAvc360p_ssim";
// Note: We never skip this test as the input and output formats should be within CDD
// requirements on all supported API versions.
Transformer transformer =
new Transformer.Builder(context)
.setTransformationRequest(
new TransformationRequest.Builder().setVideoMimeType(MimeTypes.VIDEO_H264).build())
.setEncoderFactory(AndroidTestUtil.FORCE_ENCODE_ENCODER_FACTORY)
.setRemoveAudio(true)
.build();
TransformationTestResult result =
new TransformerAndroidTestRunner.Builder(context, transformer)
.setCalculateSsim(true)
.build()
.run(testId, AndroidTestUtil.MP4_ASSET_WITH_INCREASING_TIMESTAMPS_360P_15S_URI_STRING);
assertThat(result.ssim).isGreaterThan(0.90);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment