diff options
author | Mark Thompson <sw@jkqxz.net> | 2018-09-18 23:31:00 +0100 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2018-09-23 14:42:34 +0100 |
commit | 4b2e3de8c0fc87bfddd98cfab95bb1afe63c7fff (patch) | |
tree | f8dfb8dc6877e7357787e257664f9f20365cbcd1 /libavcodec | |
parent | 6522ba30e93cd9060da011c8c591dce1b273c4ce (diff) | |
download | ffmpeg-4b2e3de8c0fc87bfddd98cfab95bb1afe63c7fff.tar.gz |
cbs_h264: Fix default value for max mv lengths
A recent version of the standard changed the max and default to 15, from
16 in older versions. This updates the default to 15 to match, but the
max stays as 16 so that we don't reject older streams.
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/cbs_h264_syntax_template.c | 6 | ||||
-rw-r--r-- | libavcodec/vaapi_encode_h264.c | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/libavcodec/cbs_h264_syntax_template.c b/libavcodec/cbs_h264_syntax_template.c index 027b555db6..1efa97dccb 100644 --- a/libavcodec/cbs_h264_syntax_template.c +++ b/libavcodec/cbs_h264_syntax_template.c @@ -185,6 +185,8 @@ static int FUNC(vui_parameters)(CodedBitstreamContext *ctx, RWContext *rw, flag(motion_vectors_over_pic_boundaries_flag); ue(max_bytes_per_pic_denom, 0, 16); ue(max_bits_per_mb_denom, 0, 16); + // The current version of the standard constrains this to be in + // [0,15], but older versions allow 16. ue(log2_max_mv_length_horizontal, 0, 16); ue(log2_max_mv_length_vertical, 0, 16); ue(max_num_reorder_frames, 0, H264_MAX_DPB_FRAMES); @@ -193,8 +195,8 @@ static int FUNC(vui_parameters)(CodedBitstreamContext *ctx, RWContext *rw, infer(motion_vectors_over_pic_boundaries_flag, 1); infer(max_bytes_per_pic_denom, 2); infer(max_bits_per_mb_denom, 1); - infer(log2_max_mv_length_horizontal, 16); - infer(log2_max_mv_length_vertical, 16); + infer(log2_max_mv_length_horizontal, 15); + infer(log2_max_mv_length_vertical, 15); if ((sps->profile_idc == 44 || sps->profile_idc == 86 || sps->profile_idc == 110 || sps->profile_idc == 110 || diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c index e55ed0f59c..8feae0d42f 100644 --- a/libavcodec/vaapi_encode_h264.c +++ b/libavcodec/vaapi_encode_h264.c @@ -491,8 +491,8 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx) sps->vui.bitstream_restriction_flag = 1; sps->vui.motion_vectors_over_pic_boundaries_flag = 1; - sps->vui.log2_max_mv_length_horizontal = 16; - sps->vui.log2_max_mv_length_vertical = 16; + sps->vui.log2_max_mv_length_horizontal = 15; + sps->vui.log2_max_mv_length_vertical = 15; sps->vui.max_num_reorder_frames = (ctx->b_per_p > 0); sps->vui.max_dec_frame_buffering = sps->max_num_ref_frames; |