From 4ec7ef56bd03e9c5bc51ba1923ee535a8f1b3fd0 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 23 Jun 2013 01:22:26 +0200 Subject: sonic: simplify quant cliping Signed-off-by: Michael Niedermayer --- libavcodec/sonic.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'libavcodec/sonic.c') diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c index fc56f94a4f..85248b1579 100644 --- a/libavcodec/sonic.c +++ b/libavcodec/sonic.c @@ -722,10 +722,7 @@ static int sonic_encode_frame(AVCodecContext *avctx, AVPacket *avpkt, quant = (int)(BASE_QUANT*s->quantization*energy2/SAMPLE_FACTOR); // av_log(avctx, AV_LOG_DEBUG, "quant: %d energy: %f / %f\n", quant, energy1, energy2); - if (quant < 1) - quant = 1; - if (quant > 65534) - quant = 65534; + quant = av_clip(quant, 1, 65534); set_ue_golomb(&pb, quant); -- cgit v1.2.3