randd


Namerandd JSON
Version 0.2.2 PyPI version JSON
download
home_pagehttps://github.com/UWIVC/randd
SummaryA Python Library for Video Codec Comparison.
upload_time2024-01-31 18:41:08
maintainer
docs_urlNone
authorWentao Liu, Zhengfang Duanmu
requires_python>=3.10, <4
licenseMIT License
keywords rate-distortion performance video encoding
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Rate and Distortion: A toolkit for video codec comparison
=========================================================

.. intro-section-start

R&D is a Python library that faciliates multimedia codec comparison. It provides functions to perform rate-distortion analysis for a given codec with sparse samples in the rate-distortion space.

.. intro-section-end

.. feature-section-start

========
Features
========

* Efficiency: R&D provides the implementation of state-of-the-art rate-distortion function models, which enables efficient codec comparison with only sparse encoding samples.
* Accuracy: R&D is demonstrated to be more accuracy than the traditional BD-rate measure.
* Flexibility: R&D can be applied to analyze the encoder performance at different resolution, frame rate, and bit depth, with a unified interface.
* Robustness: R&D curve/surface fitting models are mathematically stable.
* Generalizability: R&D is compatible with most of the modern video quality assessment models such as PSNR, VMAF, and SSIMPlus.
* Extrapolation Capability: R&D can deliver reasonable codec performance analysis in the region where no encoding samples are provided.

.. feature-section-end

.. installation-section-start

============
Installation
============

`R&D <https://github.com/UWIVC/randd>`_ can be installed using ``pip`` or from source.

Install from source:

.. code-block:: sh

    $ git clone git@github.com:UWIVC/randd.git
    $ python setup.py install

Install from pip:

.. code-block:: sh

    $ pip install randd

.. installation-section-end

.. usage-example-start

============
Sample Usage
============

1D Example
----------
The following example illustrates how to use R&D to compare two video codecs with distortion measure being PSNR:

.. code-block:: python

    import randd as rd
    import numpy as np

    r1 = np.array([100., 400., 1500., 6000.])
    d1 = np.array([23.83, 25.89, 31.28, 38.22])
    r2 = np.array([100., 400., 1500., 6000.])
    d2 = np.array([16.25, 29.75, 33.52, 39.12])
    analyzer = rd.Analyzer(d_measure='psnr')
    quality_gain, bitrate_saving, summary = analyzer(r1, d1, r2, d2, codec1='h264', codec2='vp9')

.. image:: docs/source/_static/example1.png


2D Example
----------
The following example illustrates how to use R&D to compare two video codecs with distortion measure being VMAF. We can also specify the bitrate region [100, 3000] to compute the quality gain. Note that R&D can perform reasonable extrapolation to the region where no RD samples are given.

.. code-block:: python

    import randd as rd
    import numpy as np

    # 1st dim: bitrate, 2nd dim: diagonal size of spatial resolution
    r1 = np.array([[2400.,  400.], [1700.,  865.], [ 300., 1469.], [2100., 2203.]])
    d1 = np.array([28.39, 71.87, 26.98, 89.35])
    r2 = np.array([[2400.,  400.], [1700.,  865.], [ 300., 1469.], [2100., 2203.]])
    d2 = np.array([28.86, 75.03, 54.35, 96.49])
    analyzer = rd.Analyzer(d_measure='vmaf', ndim=2, r_roi=[100, 3000])
    quality_gain, bitrate_saving, summary = analyzer(r1, d1, r2, d2, codec1='h264', codec2='vp9')

.. image:: docs/source/_static/example2.png


Backward Compatibility
----------------------
R&D also provides implementation of traditional codec comparison tools such as BD-rate:

.. code-block:: python

    import randd as rd
    import numpy as np
    from randd.model import LogCubic

    r1 = np.array([100., 400., 1500., 6000.])
    d1 = np.array([23.83, 25.89, 31.28, 38.22])
    r2 = np.array([100., 400., 1500., 6000.])
    d2 = np.array([16.25, 29.75, 33.52, 39.12])
    analyzer = rd.Analyzer(d_measure='psnr', model1=LogCubic, model2=LogCubic)
    quality_gain, bitrate_saving, summary = analyzer(r1, d1, r2, d2, codec1='h264', codec2='vp9')

.. image:: docs/source/_static/example3.png

.. usage-example-end

=============
Documentation
=============

The full documentation is available at `<https://randd.readthedocs.io/>`_.


.. citation-section-start

========
Citation
========
We are making R&D publicly available. If you use R&D in your project, we kindly ask you to cite the following paper:

.. code-block:: tex

    @article{duanmu2020egrd,
        title={Characterizing Generalized Rate-Distortion Performance of Video Coding: An Eigen Analysis Approach},
        author={Duanmu, Zhengfang and Liu, Wentao and Li, Zhuoran and Ma, Kede and Wang, Zhou},
        journal={IEEE Transactions on Image Processing},
        volume={29},
        number={},
        pages={6180-6193},
        year={2020}
    }

.. citation-section-end


.. contact-section-start

========
Contacts
========

**Wentao Liu** - `@w238liu <https://ece.uwaterloo.ca/~w238liu>`_ - ``w238liu@uwaterloo.ca``

**Zhengfang Duanmu** - `@zduanmu <https://ece.uwaterloo.ca/~zduanmu>`_ - ``zduanmu@uwaterloo.ca``

.. contact-section-end

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/UWIVC/randd",
    "name": "randd",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.10, <4",
    "maintainer_email": "",
    "keywords": "rate-distortion performance,video encoding",
    "author": "Wentao Liu, Zhengfang Duanmu",
    "author_email": "liu.wen.tao90@gmail.com, alexduanmu@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/96/5a/a3a326bc909db31b3a48d2565b56db2aa6947f40432e9ac666ae5bf0708a/randd-0.2.2.tar.gz",
    "platform": null,
    "description": "Rate and Distortion: A toolkit for video codec comparison\n=========================================================\n\n.. intro-section-start\n\nR&D is a Python library that faciliates multimedia codec comparison. It provides functions to perform rate-distortion analysis for a given codec with sparse samples in the rate-distortion space.\n\n.. intro-section-end\n\n.. feature-section-start\n\n========\nFeatures\n========\n\n* Efficiency: R&D provides the implementation of state-of-the-art rate-distortion function models, which enables efficient codec comparison with only sparse encoding samples.\n* Accuracy: R&D is demonstrated to be more accuracy than the traditional BD-rate measure.\n* Flexibility: R&D can be applied to analyze the encoder performance at different resolution, frame rate, and bit depth, with a unified interface.\n* Robustness: R&D curve/surface fitting models are mathematically stable.\n* Generalizability: R&D is compatible with most of the modern video quality assessment models such as PSNR, VMAF, and SSIMPlus.\n* Extrapolation Capability: R&D can deliver reasonable codec performance analysis in the region where no encoding samples are provided.\n\n.. feature-section-end\n\n.. installation-section-start\n\n============\nInstallation\n============\n\n`R&D <https://github.com/UWIVC/randd>`_ can be installed using ``pip`` or from source.\n\nInstall from source:\n\n.. code-block:: sh\n\n    $ git clone git@github.com:UWIVC/randd.git\n    $ python setup.py install\n\nInstall from pip:\n\n.. code-block:: sh\n\n    $ pip install randd\n\n.. installation-section-end\n\n.. usage-example-start\n\n============\nSample Usage\n============\n\n1D Example\n----------\nThe following example illustrates how to use R&D to compare two video codecs with distortion measure being PSNR:\n\n.. code-block:: python\n\n    import randd as rd\n    import numpy as np\n\n    r1 = np.array([100., 400., 1500., 6000.])\n    d1 = np.array([23.83, 25.89, 31.28, 38.22])\n    r2 = np.array([100., 400., 1500., 6000.])\n    d2 = np.array([16.25, 29.75, 33.52, 39.12])\n    analyzer = rd.Analyzer(d_measure='psnr')\n    quality_gain, bitrate_saving, summary = analyzer(r1, d1, r2, d2, codec1='h264', codec2='vp9')\n\n.. image:: docs/source/_static/example1.png\n\n\n2D Example\n----------\nThe following example illustrates how to use R&D to compare two video codecs with distortion measure being VMAF. We can also specify the bitrate region [100, 3000] to compute the quality gain. Note that R&D can perform reasonable extrapolation to the region where no RD samples are given.\n\n.. code-block:: python\n\n    import randd as rd\n    import numpy as np\n\n    # 1st dim: bitrate, 2nd dim: diagonal size of spatial resolution\n    r1 = np.array([[2400.,  400.], [1700.,  865.], [ 300., 1469.], [2100., 2203.]])\n    d1 = np.array([28.39, 71.87, 26.98, 89.35])\n    r2 = np.array([[2400.,  400.], [1700.,  865.], [ 300., 1469.], [2100., 2203.]])\n    d2 = np.array([28.86, 75.03, 54.35, 96.49])\n    analyzer = rd.Analyzer(d_measure='vmaf', ndim=2, r_roi=[100, 3000])\n    quality_gain, bitrate_saving, summary = analyzer(r1, d1, r2, d2, codec1='h264', codec2='vp9')\n\n.. image:: docs/source/_static/example2.png\n\n\nBackward Compatibility\n----------------------\nR&D also provides implementation of traditional codec comparison tools such as BD-rate:\n\n.. code-block:: python\n\n    import randd as rd\n    import numpy as np\n    from randd.model import LogCubic\n\n    r1 = np.array([100., 400., 1500., 6000.])\n    d1 = np.array([23.83, 25.89, 31.28, 38.22])\n    r2 = np.array([100., 400., 1500., 6000.])\n    d2 = np.array([16.25, 29.75, 33.52, 39.12])\n    analyzer = rd.Analyzer(d_measure='psnr', model1=LogCubic, model2=LogCubic)\n    quality_gain, bitrate_saving, summary = analyzer(r1, d1, r2, d2, codec1='h264', codec2='vp9')\n\n.. image:: docs/source/_static/example3.png\n\n.. usage-example-end\n\n=============\nDocumentation\n=============\n\nThe full documentation is available at `<https://randd.readthedocs.io/>`_.\n\n\n.. citation-section-start\n\n========\nCitation\n========\nWe are making R&D publicly available. If you use R&D in your project, we kindly ask you to cite the following paper:\n\n.. code-block:: tex\n\n    @article{duanmu2020egrd,\n        title={Characterizing Generalized Rate-Distortion Performance of Video Coding: An Eigen Analysis Approach},\n        author={Duanmu, Zhengfang and Liu, Wentao and Li, Zhuoran and Ma, Kede and Wang, Zhou},\n        journal={IEEE Transactions on Image Processing},\n        volume={29},\n        number={},\n        pages={6180-6193},\n        year={2020}\n    }\n\n.. citation-section-end\n\n\n.. contact-section-start\n\n========\nContacts\n========\n\n**Wentao Liu** - `@w238liu <https://ece.uwaterloo.ca/~w238liu>`_ - ``w238liu@uwaterloo.ca``\n\n**Zhengfang Duanmu** - `@zduanmu <https://ece.uwaterloo.ca/~zduanmu>`_ - ``zduanmu@uwaterloo.ca``\n\n.. contact-section-end\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "A Python Library for Video Codec Comparison.",
    "version": "0.2.2",
    "project_urls": {
        "Bug Reports": "https://github.com/UWIVC/randd/issues",
        "Homepage": "https://github.com/UWIVC/randd",
        "Source": "https://github.com/UWIVC/randd/"
    },
    "split_keywords": [
        "rate-distortion performance",
        "video encoding"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "edc403591a6bfd18181bc3ea3794881154741f1e90c5dc72484e4dc7b92d18d5",
                "md5": "f3280a0db40ca07d3c177d921dc04c98",
                "sha256": "ad4f84432184e8362b47861d73e7de60173e66cc509bc36208024a175f5a0fba"
            },
            "downloads": -1,
            "filename": "randd-0.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f3280a0db40ca07d3c177d921dc04c98",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10, <4",
            "size": 9966090,
            "upload_time": "2024-01-31T18:40:57",
            "upload_time_iso_8601": "2024-01-31T18:40:57.194652Z",
            "url": "https://files.pythonhosted.org/packages/ed/c4/03591a6bfd18181bc3ea3794881154741f1e90c5dc72484e4dc7b92d18d5/randd-0.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "965aa3a326bc909db31b3a48d2565b56db2aa6947f40432e9ac666ae5bf0708a",
                "md5": "c353fd9938a13b8ed1d0d4ff1ecc01d7",
                "sha256": "ba023b63be8dcbebad1bf16704069ec417c4e360d73b3cefca5964f709ba98d9"
            },
            "downloads": -1,
            "filename": "randd-0.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "c353fd9938a13b8ed1d0d4ff1ecc01d7",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10, <4",
            "size": 11307826,
            "upload_time": "2024-01-31T18:41:08",
            "upload_time_iso_8601": "2024-01-31T18:41:08.049983Z",
            "url": "https://files.pythonhosted.org/packages/96/5a/a3a326bc909db31b3a48d2565b56db2aa6947f40432e9ac666ae5bf0708a/randd-0.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-31 18:41:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "UWIVC",
    "github_project": "randd",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "tox": true,
    "lcname": "randd"
}
        
Elapsed time: 0.43856s