diff options
author | Jun Zhao <mypopydev@gmail.com> | 2017-01-08 11:01:32 +0800 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2017-01-09 00:28:08 +0000 |
commit | b53b3a4f6abcc97d4cdcc1f025ef803fcfab18c6 (patch) | |
tree | 61fa5265b481fc5fd00365e21eadad6eb5cf8251 | |
parent | 0ddc24d23248b5070c7fcdaee22c7852381fce1d (diff) |
lavc/vaapi_encode_h264: disable B frames in baseline profile
Disable B frames when using baseline/constrained baseline profile,
following H.264 spec Annex A.2.1.
Signed-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Yi A Wang <yi.a.wang@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
-rw-r--r-- | libavcodec/vaapi_encode_h264.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c index 69cc483455..00d8e6a3bf 100644 --- a/libavcodec/vaapi_encode_h264.c +++ b/libavcodec/vaapi_encode_h264.c @@ -1190,9 +1190,19 @@ static av_cold int vaapi_encode_h264_init(AVCodecContext *avctx) switch (avctx->profile) { case FF_PROFILE_H264_CONSTRAINED_BASELINE: ctx->va_profile = VAProfileH264ConstrainedBaseline; + if (avctx->max_b_frames != 0) { + avctx->max_b_frames = 0; + av_log(avctx, AV_LOG_WARNING, "H.264 constrained baseline profile " + "doesn't support encoding with B frames, disabling them.\n"); + } break; case FF_PROFILE_H264_BASELINE: ctx->va_profile = VAProfileH264Baseline; + if (avctx->max_b_frames != 0) { + avctx->max_b_frames = 0; + av_log(avctx, AV_LOG_WARNING, "H.264 baseline profile " + "doesn't support encoding with B frames, disabling them.\n"); + } break; case FF_PROFILE_H264_MAIN: ctx->va_profile = VAProfileH264Main; |