[FFmpeg-cvslog] hevc: set profile based on the profile compatibility flags if needed

Hendrik Leppkes git at videolan.org
Tue Jan 31 18:04:05 EET 2017


ffmpeg | branch: master | Hendrik Leppkes <h.leppkes at gmail.com> | Sat Jan 30 17:44:34 2016 +0100| [1ecb63cd1c1a4ddc5efed4abbc3158b969d8c5e4] | committer: Anton Khirnov

hevc: set profile based on the profile compatibility flags if needed

This fixes retrieving a valid profile for many of the FATE conformance samples,
allowing them to be properly decoded by the HWAccel after adding a profile check.

Signed-off-by: Anton Khirnov <anton at khirnov.net>

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

 libavcodec/hevc_ps.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index 583fa06..5c249d8 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -244,8 +244,12 @@ static void decode_profile_tier_level(GetBitContext *gb, AVCodecContext *avctx,
     else
         av_log(avctx, AV_LOG_WARNING, "Unknown HEVC profile: %d\n", ptl->profile_idc);
 
-    for (i = 0; i < 32; i++)
+    for (i = 0; i < 32; i++) {
         ptl->profile_compatibility_flag[i] = get_bits1(gb);
+
+        if (ptl->profile_idc == 0 && i > 0 && ptl->profile_compatibility_flag[i])
+            ptl->profile_idc = i;
+    }
     ptl->progressive_source_flag    = get_bits1(gb);
     ptl->interlaced_source_flag     = get_bits1(gb);
     ptl->non_packed_constraint_flag = get_bits1(gb);



More information about the ffmpeg-cvslog mailing list