diff msmpeg4.c @ 411:5c8b3a717929 libavcodec

workaround dc_scale bug in old ffmpeg msmpeg4v3 encoder (set workaround_bugs=1 for this)
author michaelni
date Tue, 21 May 2002 23:13:57 +0000
parents fce0a2520551
children 718a22dc121f
line wrap: on
line diff
--- a/msmpeg4.c	Tue May 21 23:07:26 2002 +0000
+++ b/msmpeg4.c	Tue May 21 23:13:57 2002 +0000
@@ -15,11 +15,14 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * msmpeg4v2 stuff by Michael Niedermayer <michaelni@gmx.at>
  */
 #include "avcodec.h"
 #include "dsputil.h"
 #include "mpegvideo.h"
 
+
 /*
  * You can also call this codec : MPEG4 with a twist ! 
  *
@@ -407,26 +410,20 @@
     }
 }
 
-
-#if 0
-/* identical to mpeg4 for msmpeg4v3 but not msmpeg4v2 */
-void msmpeg4_dc_scale(MpegEncContext * s)
+/* old ffmpeg msmpeg4v3 mode */
+void ff_old_msmpeg4_dc_scale(MpegEncContext * s)
 {
-    if (s->qscale < 5 || s->msmpeg4_version==2){
+    if (s->qscale < 5){
         s->y_dc_scale = 8;
         s->c_dc_scale = 8;
     }else if (s->qscale < 9){
         s->y_dc_scale = 2 * s->qscale;
         s->c_dc_scale = (s->qscale + 13)>>1;
-    }else if(s->qscale < 25){
+    }else{
         s->y_dc_scale = s->qscale + 8;
         s->c_dc_scale = (s->qscale + 13)>>1;
-    }else{
-        s->y_dc_scale = 2 * s->qscale - 16;
-        s->c_dc_scale = s->qscale - 6;
     }
 }
-#endif
 
 /* dir = 0: left, dir = 1: top prediction */
 static int msmpeg4_pred_dc(MpegEncContext * s, int n,