Commit b53b3a4f authored by Jun Zhao's avatar Jun Zhao Committed by Mark Thompson

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: 's avatarJun Zhao <jun.zhao@intel.com>
Signed-off-by: 's avatarYi A Wang <yi.a.wang@intel.com>
Signed-off-by: 's avatarMark Thompson <sw@jkqxz.net>
parent 0ddc24d2
...@@ -1190,9 +1190,19 @@ static av_cold int vaapi_encode_h264_init(AVCodecContext *avctx) ...@@ -1190,9 +1190,19 @@ static av_cold int vaapi_encode_h264_init(AVCodecContext *avctx)
switch (avctx->profile) { switch (avctx->profile) {
case FF_PROFILE_H264_CONSTRAINED_BASELINE: case FF_PROFILE_H264_CONSTRAINED_BASELINE:
ctx->va_profile = VAProfileH264ConstrainedBaseline; 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; break;
case FF_PROFILE_H264_BASELINE: case FF_PROFILE_H264_BASELINE:
ctx->va_profile = VAProfileH264Baseline; 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; break;
case FF_PROFILE_H264_MAIN: case FF_PROFILE_H264_MAIN:
ctx->va_profile = VAProfileH264Main; ctx->va_profile = VAProfileH264Main;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment