diff options
author | Decai Lin <decai.lin@intel.com> | 2019-03-20 17:14:47 +0800 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2019-03-27 00:13:27 +0000 |
commit | ec1e4a8baf1bfdb693555ffea7c280e1cf842dfc (patch) | |
tree | 6b77b46f90a2a4dbd96492b0501a9f54a84b5758 /libavcodec/vaapi_encode_h264.c | |
parent | 1e34014010dba9325fc5430934b51a61a5007c63 (diff) | |
download | ffmpeg-ec1e4a8baf1bfdb693555ffea7c280e1cf842dfc.tar.gz |
lavc/h264_levels: add MaxMBPS checking and update fate test.
1. add MaxMBPS checking for level idc setting to align with AVC spec
AnnexA table A-1/A-6 level limits.
2. update h264 level fate test.
Signed-off-by: Decai Lin <decai.lin@intel.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
Diffstat (limited to 'libavcodec/vaapi_encode_h264.c')
-rw-r--r-- | libavcodec/vaapi_encode_h264.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c index 91be33f99f..4cf99d7c78 100644 --- a/libavcodec/vaapi_encode_h264.c +++ b/libavcodec/vaapi_encode_h264.c @@ -329,9 +329,16 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx) sps->level_idc = avctx->level; } else { const H264LevelDescriptor *level; + int framerate; + + if (avctx->framerate.num > 0 && avctx->framerate.den > 0) + framerate = avctx->framerate.num / avctx->framerate.den; + else + framerate = 0; level = ff_h264_guess_level(sps->profile_idc, avctx->bit_rate, + framerate, priv->mb_width * 16, priv->mb_height * 16, priv->dpb_frames); |