[FFmpeg-cvslog] rv34dsp: factorize a multiplication in the noround inverse transform

Christophe GISQUET git at videolan.org
Sun Apr 29 22:52:27 CEST 2012


ffmpeg | branch: master | Christophe GISQUET <christophe.gisquet at gmail.com> | Tue Apr 17 18:44:43 2012 +0000| [7fb8b491e5c10b3fbad53ffc89c60d3541114416] | committer: Ronald S. Bultje

rv34dsp: factorize a multiplication in the noround inverse transform

Signed-off-by: Ronald S. Bultje <rsbultje at gmail.com>

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

 libavcodec/rv34dsp.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/libavcodec/rv34dsp.c b/libavcodec/rv34dsp.c
index 4145c4d..1ddcea4 100644
--- a/libavcodec/rv34dsp.c
+++ b/libavcodec/rv34dsp.c
@@ -88,15 +88,15 @@ static void rv34_inv_transform_noround_c(DCTELEM *block){
     rv34_row_transform(temp, block);
 
     for(i = 0; i < 4; i++){
-        const int z0 = 13*(temp[4*0+i] +    temp[4*2+i]);
-        const int z1 = 13*(temp[4*0+i] -    temp[4*2+i]);
-        const int z2 =  7* temp[4*1+i] - 17*temp[4*3+i];
-        const int z3 = 17* temp[4*1+i] +  7*temp[4*3+i];
-
-        block[i*4+0] = ((z0 + z3) * 3) >> 11;
-        block[i*4+1] = ((z1 + z2) * 3) >> 11;
-        block[i*4+2] = ((z1 - z2) * 3) >> 11;
-        block[i*4+3] = ((z0 - z3) * 3) >> 11;
+        const int z0 = 39*(temp[4*0+i] +    temp[4*2+i]);
+        const int z1 = 39*(temp[4*0+i] -    temp[4*2+i]);
+        const int z2 = 21* temp[4*1+i] - 51*temp[4*3+i];
+        const int z3 = 51* temp[4*1+i] + 21*temp[4*3+i];
+
+        block[i*4+0] = (z0 + z3) >> 11;
+        block[i*4+1] = (z1 + z2) >> 11;
+        block[i*4+2] = (z1 - z2) >> 11;
+        block[i*4+3] = (z0 - z3) >> 11;
     }
 }
 



More information about the ffmpeg-cvslog mailing list