Skip to content

Commit

Permalink
docs: Add section about Import mode and frame validator
Browse files Browse the repository at this point in the history
Bug: 856562
Test: None
Change-Id: Iadd7c2f625aa52e50f3bba4e3c6903d3615f46b4
Reviewed-on: https://chromium-review.googlesource.com/c/1476939
Reviewed-by: David Staessens <dstaessens@chromium.org>
Commit-Queue: Hirokazu Honda <hiroh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#633548}
  • Loading branch information
rosetta-jpn authored and Commit Bot committed Feb 20, 2019
1 parent 439fb76 commit 00b9241
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions docs/media/gpu/vdatest_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,45 @@ a verbose H264 decoding test:

./video_decode_accelerator_unittest --single-process-tests --disable_rendering --gtest_filter="*TestDecodeTimeMedian*" --vmodule=*/media/gpu/*=4 --test_video_data=test-25fps.h264:320:240:250:258:35:150:1

## Import mode

There are two modes in which VDA runs, ALLOCATE and IMPORT. In ALLOCATE mode,
the video decoder is responsible for allocating the buffers containing the
decoded frames itself. In IMPORT mode, the buffers are allocated by the client
and provided to the decoder during decoding. ALLOCATE mode is used during
playback within Chrome (e.g. HTML5 videos), while IMPORT mode is used by ARC++
when Android applications require accelerated decoding.\\
VDAtest runs VDA in ALLOCATE mode by default. Use `--test_import` to run VDA in
IMPORT mode. VDA cannot run in IMPORT mode on platforms too old for ARC++ to be
enabled.

## (Recommended) Frame validator

Use `--frame_validator=check` to verify the correctness of frames decoded by
VideoDecodeAccelerator in all test cases. This validator is based on the fact
that a decoded content is deterministic in H.264, VP8 and VP9. It reads the
expected md5 value of each frame from `*.frames.md5`, for example, `test-25fps.h264.frames.md5`
for `test-25fps.h264`.\\
VDATest is able to read the memory of a decoded frame only if VDA runs in IMPORT
mode. Therefore, if `--frame_validator=check` is specified, VDATest runs as if
`--test_import` is specified. See [Import mode](#import-mode) about IMPORT mode.

### Dump mode

Use `--frame_validator=dump` to write down all the decoded frames. The output
format will be I420 and the saved file name will be `frame_%{frame-num}_%{width}x%{height}_I420.yuv`
in the specified directory or a directory whose name is the test file + `.frames`
if unspecified. Here, width and height are visible width and height. For
instance, they will be `test-25fps.h264.frames/frame_%{frame-num}_320x180_I420.yuv.`

### How to generate md5 values of decoded frames for a new video stream

It is necessary to generate md5 values of decoded frames for new test streams.
For this purpose, run VDATest with `--gtest_filter=VideoDecodeAcceleratorTest.DISABLED_GenMD5 --gtest_also_run_disabled_tests`.
The md5 values of decoded frames are written in `*.frames.md5`. For instance,
`test-25fps.h264.frames.md5` for `test-25fps.h264`. Note that if there is already
the `.frames.md5` file, this overwrites the file.

## Basic VEA usage

The VEA works in a similar fashion to the VDA, taking raw YUV files in I420
Expand Down

0 comments on commit 00b9241

Please sign in to comment.