[FFmpeg-cvslog] avcodec/vaapi_encode_h264: Use av_clip_uintp2()

Michael Niedermayer git at videolan.org
Sun Jul 10 00:44:27 CEST 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Jul  3 22:41:20 2016 +0200| [e98ab799be9c5f0ab001729dc0ce2737cc2ae7da] | committer: Michael Niedermayer

avcodec/vaapi_encode_h264: Use av_clip_uintp2()

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e98ab799be9c5f0ab001729dc0ce2737cc2ae7da
---

 libavcodec/vaapi_encode_h264.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c
index db9071f..d576ede 100644
--- a/libavcodec/vaapi_encode_h264.c
+++ b/libavcodec/vaapi_encode_h264.c
@@ -861,12 +861,12 @@ static int vaapi_encode_h264_init_sequence_params(AVCodecContext *avctx)
             // Try to scale these to a sensible range so that the
             // golomb encode of the value is not overlong.
             mseq->bit_rate_scale =
-                av_clip(av_log2(avctx->bit_rate) - 15, 0, 15);
+                av_clip_uintp2(av_log2(avctx->bit_rate) - 15, 4);
             mseq->bit_rate_value_minus1[0] =
                 (avctx->bit_rate >> mseq->bit_rate_scale) - 1;
 
             mseq->cpb_size_scale =
-                av_clip(av_log2(priv->hrd_params.hrd.buffer_size) - 15, 0, 15);
+                av_clip_uintp2(av_log2(priv->hrd_params.hrd.buffer_size) - 15, 4);
             mseq->cpb_size_value_minus1[0] =
                 (priv->hrd_params.hrd.buffer_size >> mseq->cpb_size_scale) - 1;
 



More information about the ffmpeg-cvslog mailing list