[vlc-commits] videotoolbox: force P010 for HEVC10bits

Thomas Guillem git at videolan.org
Fri Feb 9 19:46:07 CET 2018


vlc/vlc-3.0 | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Feb  9 18:28:56 2018 +0100| [8a6e33e9c44df11c1a0ac5b0a6b9699be7320d93] | committer: Thomas Guillem

videotoolbox: force P010 for HEVC10bits

This allow smooth 4K HEVC 10bits playback on mac book.

TODO: Maybe, the same can be done for iOS.
(cherry picked from commit 1b7e1c4bfcda375e2d4e657135aeaf3732e44af2)
Signed-off-by: Thomas Guillem <thomas at gllm.fr>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=8a6e33e9c44df11c1a0ac5b0a6b9699be7320d93
---

 modules/codec/videotoolbox.m | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/modules/codec/videotoolbox.m b/modules/codec/videotoolbox.m
index 0f34a56fa1..e1f843ffeb 100644
--- a/modules/codec/videotoolbox.m
+++ b/modules/codec/videotoolbox.m
@@ -721,6 +721,20 @@ static bool LateStartHEVC(decoder_t *p_dec)
 
 static bool CodecSupportedHEVC(decoder_t *p_dec)
 {
+#if !TARGET_OS_IPHONE
+    decoder_sys_t *p_sys = p_dec->p_sys;
+
+    if (p_sys->i_forced_cvpx_format == 0)
+    {
+        /* Force P010 chroma instead of RGBA in order to improve performances. */
+        uint8_t i_profile, i_level;
+        if (hxxx_helper_get_current_profile_level(&p_sys->hh, &i_profile,
+                                                  &i_level))
+            return true;
+        if (i_profile == HEVC_PROFILE_MAIN_10)
+            p_sys->i_forced_cvpx_format = 'x420'; /* kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange */
+    }
+#endif
     return true;
 }
 



More information about the vlc-commits mailing list