Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Varnish "Recommendation ITU-T H.273" Implementation #1033

Merged
merged 6 commits into from Aug 26, 2022

Conversation

KelSolaar
Copy link
Member

@KelSolaar KelSolaar commented Aug 21, 2022

Summary

This PR polishes the Recommendation ITU-T H.273 implementation from #987.

  • FFmpeg enums are not defining the dictionary keys anymore, the coupling is now looser but it should not be driven by names from another software.
  • Exposed the core objects to the base namespace.
  • I added definitions to describe the code points:
>>> colour.COLOUR_PRIMARIES_ITUTH273.keys()
dict_keys([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 22, 23])
>>> colour.COLOUR_PRIMARIES_ITUTH273.keys()
>>> description = colour.models.describe_video_signal_colour_primaries(1)
===============================================================================
*                                                                             *
*   Colour Primaries: 1                                                       *
*   -------------------                                                       *
*                                                                             *
*   Primaries        : [[ 0.64  0.33]                                         *
*                       [ 0.3   0.6 ]                                         *
*                       [ 0.15  0.06]]                                        *
*   Whitepoint       : [ 0.3127  0.329 ]                                      *
*   Whitepoint Name  : D65                                                    *
*   NPM              : [[ 0.4123908   0.35758434  0.18048079]                 *
*                       [ 0.21263901  0.71516868  0.07219232]                 *
*                       [ 0.01933082  0.11919478  0.95053215]]                *
*   NPM -1           : [[ 3.24096994 -1.53738318 -0.49861076]                 *
*                       [-0.96924364  1.8759675   0.04155506]                 *
*                       [ 0.05563008 -0.20397696  1.05697151]]                *
*   FFmpeg Constants : ['AVCOL_PRI_BT709', 'BT709']                           *
*                                                                             *
===============================================================================
>>> colour.TRANSFER_CHARACTERISTICS_ITUTH273.keys()
dict_keys([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19])
>>> description = colour.models.describe_video_signal_transfer_characteristics(1)
===============================================================================
*                                                                             *
*   Transfer Characteristics: 1                                               *
*   ---------------------------                                               *
*                                                                             *
*   Function         : <function oetf_BT709 at 0x165bb3550>                   *
*   FFmpeg Constants : ['AVCOL_TRC_BT709', 'BT709']                           *
*                                                                             *
===============================================================================
>>> colour.MATRIX_COEFFICIENTS_ITUTH273.keys()
dict_keys([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])
>>> description = colour.models.describe_video_signal_matrix_coefficients(1)
===============================================================================
*                                                                             *
*   Matrix Coefficients: 1                                                    *
*   ----------------------                                                    *
*                                                                             *
*   Matrix Coefficients : [ 0.2126  0.0722]                                   *
*   FFmpeg Constants    : ['AVCOL_SPC_BT709', 'BT709']                        *
*                                                                             *
===============================================================================
  • Unit tests have been implemented whilst ensuring that the domain-range scale support works.
  • Various transfer functions have been moved around.
  • Bibliography and keys are updated.
  • Updated and cleaned-up the docstrings, removed redundant info.
  • Added examples and docs.
  • Etc...

Preflight

Code Style and Quality

  • Unit tests have been implemented and passed.
  • Mypy static checking has been run and passed.
  • Pre-commit hooks have been run and passed.
  • New transformations have been added to the Automatic Colour Conversion Graph.
  • New transformations have been exported to the relevant namespaces, e.g. colour, colour.models.

Documentation

  • New features are documented along with examples if relevant.
  • The documentation is Sphinx and numpydoc compliant.

fxthomas and others added 4 commits August 13, 2022 18:09
This commit adds additional transfer function and primaries defined or
referenced to by ITU-T H.273, as well as aliases to their corresponding
video metadata tag values (ColourPrimaries, MatrixCoefficients and
TransferCharacteristics).
@KelSolaar KelSolaar requested a review from a team August 21, 2022 10:25
@KelSolaar
Copy link
Member Author

@fxthomas for VIS!

@coveralls
Copy link

coveralls commented Aug 21, 2022

Coverage Status

Coverage increased (+0.003%) to 99.839% when pulling 243e8e4 on feature/itu_t_h273 into 2dc8afc on develop.

@KelSolaar KelSolaar merged commit 0abf3ab into develop Aug 26, 2022
@KelSolaar KelSolaar deleted the feature/itu_t_h273 branch August 26, 2022 23:15
@fxthomas
Copy link
Contributor

Nice, thank you for taking the time to consolidate these! Looks good to me, and I'll take notes of the changes you did for the next time I need to contribute ;)

@KelSolaar KelSolaar added this to the v0.4.2 milestone Oct 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants