[FFmpeg-cvslog] vc2enc: use FFABS() instead of abs()

Rostislav Pehlivanov git at videolan.org
Fri Feb 26 13:56:20 CET 2016


ffmpeg | branch: master | Rostislav Pehlivanov <atomnuker at gmail.com> | Fri Feb 26 12:54:15 2016 +0000| [7db2e757c5944c8a6a4a947b88a84ec2d7a52dd6] | committer: Rostislav Pehlivanov

vc2enc: use FFABS() instead of abs()

Provides a minor speedup.

Signed-off-by: Rostislav Pehlivanov <atomnuker at gmail.com>

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

 libavcodec/vc2enc.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/vc2enc.c b/libavcodec/vc2enc.c
index 3f03061..81de82c 100644
--- a/libavcodec/vc2enc.c
+++ b/libavcodec/vc2enc.c
@@ -547,7 +547,7 @@ static av_always_inline void coeff_quantize_get(qcoef coeff, int qfactor,
                                                 uint8_t *len, uint32_t *eval)
 {
     QUANT(coeff)
-    get_vc2_ue_uint(abs(coeff), len, eval);
+    get_vc2_ue_uint(FFABS(coeff), len, eval);
     if (coeff) {
         *eval = (*eval << 1) | (coeff < 0);
         *len += 1;
@@ -558,7 +558,7 @@ static av_always_inline void coeff_quantize_encode(PutBitContext *pb, qcoef coef
                                                    int qfactor)
 {
     QUANT(coeff)
-    put_vc2_ue_uint(pb, abs(coeff));
+    put_vc2_ue_uint(pb, FFABS(coeff));
     if (coeff)
         put_bits(pb, 1, coeff < 0);
 }
@@ -631,7 +631,7 @@ static int count_hq_slice(VC2EncContext *s, int slice_x,
                             bits += s->coef_lut_len[2*quant_idx*COEF_LUT_TAB + coeff + COEF_LUT_TAB];
                         } else {
                             QUANT(coeff)
-                            bits += count_vc2_ue_uint(abs(coeff));
+                            bits += count_vc2_ue_uint(FFABS(coeff));
                             bits += !!coeff;
                         }
                     }



More information about the ffmpeg-cvslog mailing list