vlc | branch: master | Thomas Guillem <tho...@gllm.fr> | Fri Feb  9 18:28:56 
2018 +0100| [1b7e1c4bfcda375e2d4e657135aeaf3732e44af2] | 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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1b7e1c4bfcda375e2d4e657135aeaf3732e44af2
---

 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;
 }
 

_______________________________________________
vlc-commits mailing list
vlc-commits@videolan.org
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to