changeset 641:eaa9ef2e2557 libavcodec

fixing encoding at high QPs (was broken after the dct accuracy increase due to too small inverse table)
author michaelni
date Mon, 02 Sep 2002 16:56:29 +0000
parents d2f47c6c6b41
children 4263629270c8
files i386/mpegvideo_mmx_template.c
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/i386/mpegvideo_mmx_template.c	Mon Sep 02 16:48:40 2002 +0000
+++ b/i386/mpegvideo_mmx_template.c	Mon Sep 02 16:56:29 2002 +0000
@@ -46,9 +46,9 @@
     if (s->mb_intra) {
         int dummy;
         if (n < 4)
-            q = s->y_dc_scale<<3;
+            q = s->y_dc_scale;
         else
-            q = s->c_dc_scale<<3;
+            q = s->c_dc_scale;
         /* note: block[0] is assumed to be positive */
         if (!s->h263_aic) {
 #if 1
@@ -56,7 +56,7 @@
         	"xorl %%edx, %%edx	\n\t"
         	"mul %%ecx		\n\t"
         	: "=d" (level), "=a"(dummy)
-        	: "a" (block[0] + (q >> 1)), "c" (inverse[q])
+        	: "a" ((block[0]>>2) + q), "c" (inverse[q<<1])
         );
 #else
         asm volatile (
@@ -64,13 +64,13 @@
         	"divw %%cx		\n\t"
         	"movzwl %%ax, %%eax	\n\t"
         	: "=a" (level)
-        	: "a" (block[0] + (q >> 1)), "c" (q)
+        	: "a" ((block[0]>>2) + q), "c" (q<<1)
         	: "%edx"
         );
 #endif
         } else
             /* For AIC we skip quant/dequant of INTRADC */
-            level = block[0]>>3;
+            level = (block[0] + 4)>>3;
             
         block[0]=0; //avoid fake overflow
 //        temp_block[0] = (block[0] + (q >> 1)) / q;