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>
This commit is contained in:
Decai Lin 2019-03-20 17:14:47 +08:00 committed by Mark Thompson
parent 1e34014010
commit ec1e4a8baf
5 changed files with 74 additions and 4 deletions

View file

@ -89,6 +89,7 @@ const H264LevelDescriptor *ff_h264_get_level(int level_idc,
const H264LevelDescriptor *ff_h264_guess_level(int profile_idc,
int64_t bitrate,
int framerate,
int width, int height,
int max_dec_frame_buffering)
{
@ -120,6 +121,9 @@ const H264LevelDescriptor *ff_h264_guess_level(int profile_idc,
FFMIN(level->max_dpb_mbs / (width_mbs * height_mbs), 16);
if (max_dec_frame_buffering > max_dpb_frames)
continue;
if (framerate > (level->max_mbps / (width_mbs * height_mbs)))
continue;
}
return level;