<commit_before># Real-Time Video Codec Performance

This project contains a couple of `bash`/`python` scripts  that can be used to
generate quality metrics and graphs for realtime video codecs. Settings used are
aimed to be as close as possible to settings used by Chromium's
[WebRTC](https://code.webrtc.org) implementation.

Quality metrics can currently only be generated for `.yuv` files, any other raw
formats such as `.y4m` must currently be converted to `clip.WIDTH_HEIGHT.yuv`
before continuing. Width and height of the raw video is inferred from the
filename.

_This is not an official Google product._

## Building Dependencies

To build pinned versions of dependencies run:

    $ ./setup.sh

This requires installing git and build dependencies required to build libvpx out
of band.

## Generating Graphs

To generate graph data (after building dependencies), run:

    $ ./generate_graphdata.py clip.WIDTH_HEIGHT.yuv:FPS..

This will generate `out/graphdata.txt` which contains an array of JSON-formatted
data with metrics used to build graphs. This part takes a long time (may take
hours or even days depending on clips) as multiple clips are encoded using
various settings. Make sure to copy this file somewhere else after running or
risk running the whole thing again.

To generate graphs from existing graph data run:

    $ ./generate_graphs.py

This will generate several `.png` files under `out/`, where each clip and
temporal/spatial configuration are grouped together to generate graphs comparing
different encoders and layer performances for separate `SSIM`, `AvgPSNR` and
`GlbPSNR` metrics.

## Adding Encoder Implementations

This script currently only supports [libvpx](https://www.webmproject.org/code/)
implementations of VP8 and VP9. Adding support for additional encoders are
encouraged. This requires adding an entry under `generate_data.sh` which handles
the new encoder, including support for spatial/temporal configurations. To have
it run as part of data generation, add it to `generate_graphdata.py` as well.
<commit_msg>Add link to the derf set in README.md.<commit_after># Real-Time Video Codec Performance

_This is not an official Google product._

This project contains a couple of `bash` and `python` scripts  that can be used
to generate quality metrics and graphs for realtime video codecs. Settings used
are aimed to be as close as possible to settings used by Chromium's
[WebRTC](https://code.webrtc.org) implementation.

Quality metrics can currently only be generated for `.yuv` files, any other raw
formats such as `.y4m` must currently be converted to `clip.WIDTH_HEIGHT.yuv`
before continuing. Width and height of the raw video is inferred from the
filename.

A set of clips that can be used for this purpose, but currently require
conversion before being used, are available at
[Xiph.org Video Test Media](https://media.xiph.org/video/derf/), aka. "derf's
collection".


## Building Dependencies

To build pinned versions of dependencies run:

    $ ./setup.sh

This requires installing git and build dependencies required to build libvpx out
of band.


## Generating Graphs

To generate graph data (after building dependencies), run:

    $ ./generate_graphdata.py clip.WIDTH_HEIGHT.yuv:FPS..

This will generate `out/graphdata.txt` which contains an array of JSON-formatted
data with metrics used to build graphs. This part takes a long time (may take
hours or even days depending on clips) as multiple clips are encoded using
various settings. Make sure to copy this file somewhere else after running or
risk running the whole thing again.

To generate graphs from existing graph data run:

    $ ./generate_graphs.py

This will generate several `.png` files under `out/`, where each clip and
temporal/spatial configuration are grouped together to generate graphs comparing
different encoders and layer performances for separate `SSIM`, `AvgPSNR` and
`GlbPSNR` metrics.


## Adding Encoder Implementations

This script currently only supports [libvpx](https://www.webmproject.org/code/)
implementations of VP8 and VP9. Adding support for additional encoders are
encouraged. This requires adding an entry under `generate_data.sh` which handles
the new encoder, including support for spatial/temporal configurations. To have
it run as part of data generation, add it to `generate_graphdata.py` as well.

{'fraction_non_alphanumeric': 0.058323765786452354, 'fraction_numerical': 0.0013777267508610792, 'mean_word_length': 4.59178433889602, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 5, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4272371', 'n_tokens_mistral': 1177, 'n_tokens_neox': 1114, 'n_words': 589}