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

Initialize color_primaries to AVCOL_PRI_UNSPECIFIED if unspecified #15691

Merged
merged 2 commits into from Mar 28, 2019

Conversation

Projects
None yet
4 participants
@kszaq
Copy link
Contributor

commented Mar 6, 2019

Description

0 is AVCOL_PRI_RESERVED0 and will trigger color conversion in renderer which is unnecessary.

If initialized to AVCOL_PRI_UNSPECIFIED, renderer will try to guess color primaries and in most cases will not enable color coversion.

Motivation and Context

Improve inputstream.adaptive rendering performance. This PR reduces load on GPU when playing HD content.

How Has This Been Tested?

LibreELEC 8 on Amlogic S905 device. Confirmed that color conversion is not applied for 720p Netflix.

Screenshots (if appropriate):

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Clean up (non-breaking change which removes non-working, unmaintained functionality)
  • Improvement (non-breaking change which improves existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that will cause existing functionality to change)
  • Cosmetic change (non-breaking change that doesn't touch code)
  • None of the above (please explain below)

Checklist:

  • My code follows the Code Guidelines of this project
  • My change requires a change to the documentation, either Doxygen or wiki
  • I have updated the documentation accordingly
  • I have read the Contributing document
  • I have added tests to cover my change
  • All new and existing tests passed
[AddonVideoCodec] Initialize color_primaries to AVCOL_PRI_UNSPECIFIED
0 is AVCOL_PRI_RESERVED0 and will trigger color conversion in renderer
which is unnecessary.

If initialized to AVCOL_PRI_UNSPECIFIED, renderer will try to guess
color primaries and in most cases will not enable color coversion.

@lrusak lrusak requested a review from peak3d Mar 6, 2019

@kszaq

This comment has been minimized.

Copy link
Contributor Author

commented Mar 21, 2019

@peak3d Would you mind having a look?

[DVDVideoCodec] Properly reset color_primaries
On Reset() color_primaries should be set to AVCOL_PRI_UNSPECIFIED, not 0 which means AVCOL_PRI_RESERVED0.

@kszaq kszaq changed the title [AddonVideoCodec] Initialize color_primaries to AVCOL_PRI_UNSPECIFIED Initialize color_primaries to AVCOL_PRI_UNSPECIFIED if unspecified Mar 28, 2019

@kszaq

This comment has been minimized.

Copy link
Contributor Author

commented Mar 28, 2019

While the review is still pending, I additionally modified DVDVideoCodec.cpp.

Kodi already resets color_space to UNSPECIFIED enum, the same should be done with color_primaries.

@fritsch

This comment has been minimized.

Copy link
Member

commented Mar 28, 2019

Thanks. Fix is fine.

@peak3d peak3d merged commit 52e07cf into xbmc:master Mar 28, 2019

1 check passed

default You're awesome. Have a cookie
Details
@peak3d

This comment has been minimized.

Copy link
Contributor

commented Mar 28, 2019

thx @kszaq for contributing!

@Rechi Rechi added this to the Leia 18.2-rc1 milestone Mar 28, 2019

@kszaq kszaq deleted the kszaq:addon_primaries branch Mar 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.