diff mpegvideo.c @ 1422:efeed6e29f9b libavcodec

oooooops, having 2 Eterms open and doing cvs diff in one and cvs commit in the other sucks, especially if they are in different directories (MPlayer/main/libavcodec vs. ffmpeg/libavcodec)
author michaelni
date Mon, 25 Aug 2003 22:54:53 +0000
parents 340c90faa1dc
children 39ebefd82728
line wrap: on
line diff
--- a/mpegvideo.c	Mon Aug 25 22:47:32 2003 +0000
+++ b/mpegvideo.c	Mon Aug 25 22:54:53 2003 +0000
@@ -34,8 +34,8 @@
 #include "fastmemcpy.h"
 #endif
 
-#undef NDEBUG
-#include <assert.h>
+//#undef NDEBUG
+//#include <assert.h>
 
 #ifdef CONFIG_ENCODERS
 static void encode_picture(MpegEncContext *s, int picture_number);
@@ -191,7 +191,7 @@
 #endif
         
 #ifdef HAVE_MMX
-    MPV_common_init_mmx(s); //FIXME dont pass mpegenccontext to these, rather use dspcontext
+    MPV_common_init_mmx(s);
 #endif
 #ifdef ARCH_ALPHA
     MPV_common_init_axp(s);
@@ -279,7 +279,7 @@
         }
 
         CHECKED_ALLOCZ(pic->mbskip_table , mb_array_size * sizeof(uint8_t)+2) //the +2 is for the slice end check
-        CHECKED_ALLOCZ(pic->qscale_table , mb_array_size * sizeof(uint8_t)+3) //+3 for mpeg2 SIMD >>1
+        CHECKED_ALLOCZ(pic->qscale_table , mb_array_size * sizeof(uint8_t))
         CHECKED_ALLOCZ(pic->mb_type_base , big_mb_num    * sizeof(int))
         pic->mb_type= pic->mb_type_base + s->mb_stride+1;
         if(s->out_format == FMT_H264){
@@ -424,7 +424,7 @@
         
     CHECKED_ALLOCZ(s->error_status_table, mb_array_size*sizeof(uint8_t))
     
-    if (s->out_format == FMT_H263 || s->encoding || 1) {
+    if (s->out_format == FMT_H263 || s->encoding) {
         int size;
 
         /* MV prediction */
@@ -581,7 +581,7 @@
     s->data_partitioning= avctx->flags & CODEC_FLAG_PART;
     s->quarter_sample= (avctx->flags & CODEC_FLAG_QPEL)!=0;
     s->mpeg_quant= avctx->mpeg_quant;
-    
+
     if (s->gop_size <= 1) {
         s->intra_only = 1;
         s->gop_size = 12;
@@ -622,12 +622,12 @@
         fprintf(stderr, "b frames not supporetd by codec\n");
         return -1;
     }
-/*    
+    
     if(s->mpeg_quant && s->codec_id != CODEC_ID_MPEG4){ //FIXME mpeg2 uses that too
         fprintf(stderr, "mpeg2 style quantization not supporetd by codec\n");
         return -1;
     }
-  */      
+        
     if(s->codec_id==CODEC_ID_MJPEG){
         s->intra_quant_bias= 1<<(QUANT_BIAS_SHIFT-1); //(a + x/2)/x
         s->inter_quant_bias= 0;
@@ -1009,7 +1009,6 @@
         
         if( alloc_picture(s, (Picture*)pic, 0) < 0)
             return -1;
-        assert(pic->data[0]);
 
         s->current_picture_ptr= &s->picture[i];
     }
@@ -2352,8 +2351,7 @@
         }
     }
     break;
-    default:
-        printf("X");
+
     }
 }
 
@@ -3005,9 +3003,7 @@
         for(i=0;i<6;i++) {
             if(!skip_dct[i]){
                 int overflow;
-START_TIMER;
                 s->block_last_index[i] = s->dct_quantize(s, s->block[i], i, s->qscale, &overflow);
-STOP_TIMER("dct_quant");
             // FIXME we could decide to change to quantizer instead of clipping
             // JS: I don't think that would be a good idea it could lower quality instead
             //     of improve it. Just INTRADC clipping deserves changes in quantizer
@@ -4018,7 +4014,7 @@
         start_i = 1;
         last_non_zero = 0;
         qmat = s->q_intra_matrix[qscale];
-        if(s->mpeg_quant)
+        if(s->mpeg_quant || s->out_format == FMT_MPEG1)
             bias= 1<<(QMAT_SHIFT-1);
         length     = s->intra_ac_vlc_length;
         last_length= s->intra_ac_vlc_last_length;