[FFmpeg-devel] [PATCH] dcaenc: small quantization simplification.

Clément Bœsch ubitux at gmail.com
Fri Jun 17 21:03:34 CEST 2011


Hi,

If I'm not wrong, the second binary and is pointless… Can anyone confirm?

-- 
Clément B.
-------------- next part --------------
From 6270ed89beeaf1970133904cc15641850112f136 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= <ubitux at gmail.com>
Date: Fri, 17 Jun 2011 21:00:03 +0200
Subject: [PATCH] dcaenc: small quantization simplification.

---
 libavcodec/dcaenc.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/libavcodec/dcaenc.c b/libavcodec/dcaenc.c
index 2b61bec..eccff08 100644
--- a/libavcodec/dcaenc.c
+++ b/libavcodec/dcaenc.c
@@ -365,8 +365,7 @@ static inline uint32_t quantize(int32_t sample, int bits)
 {
     av_assert0(sample <    1 << (bits - 1));
     av_assert0(sample >= -(1 << (bits - 1)));
-    sample &= sample & ((1 << bits) - 1);
-    return sample;
+    return sample & ((1 << bits) - 1);
 }
 
 static inline int find_scale_factor7(int64_t max_value, int bits)
-- 
1.7.5.2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110617/f7d13466/attachment.asc>


More information about the ffmpeg-devel mailing list