diff options
author | Boyuan Zhang <[email protected]> | 2018-10-23 11:15:52 -0400 |
---|---|---|
committer | Leo Liu <[email protected]> | 2018-10-26 13:23:06 -0400 |
commit | b15d0200a9a0eae8e2d69b70e8a3164040f17ed6 (patch) | |
tree | c35122d95dada955e627be1cadd1e8d04323712f | |
parent | 5cdeefe057d9da0a48630770dc8f01e0f5295fa2 (diff) |
vl: get h264 profile idc
Adding a function for converting h264 pipe video profile to profile idc
Signed-off-by: Boyuan Zhang <[email protected]>
Acked-by: Christian König <christian.koenig at amd.com>
-rw-r--r-- | src/gallium/auxiliary/util/u_video.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_video.h b/src/gallium/auxiliary/util/u_video.h index 967ebc57489..f6e93dd0387 100644 --- a/src/gallium/auxiliary/util/u_video.h +++ b/src/gallium/auxiliary/util/u_video.h @@ -239,6 +239,30 @@ u_get_h264_level(uint32_t width, uint32_t height, uint32_t *max_reference) return 52; } +static inline uint32_t +u_get_h264_profile_idc(enum pipe_video_profile profile) +{ + switch (profile) { + case PIPE_VIDEO_PROFILE_MPEG4_AVC_CONSTRAINED_BASELINE: + case PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE: + return 66; + case PIPE_VIDEO_PROFILE_MPEG4_AVC_MAIN: + return 77; + case PIPE_VIDEO_PROFILE_MPEG4_AVC_EXTENDED: + return 88; + case PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH: + return 100; + case PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH10: + return 110; + case PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH422: + return 122; + case PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH444: + return 244; + default: + return 66; //use baseline profile instead + } +} + #ifdef __cplusplus } #endif |