]> git.sesse.net Git - vlc/commitdiff
CA MAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA...
authorGaël Hendryckx <jimmy@videolan.org>
Sun, 23 Jan 2000 02:32:41 +0000 (02:32 +0000)
committerGaël Hendryckx <jimmy@videolan.org>
Sun, 23 Jan 2000 02:32:41 +0000 (02:32 +0000)
--Meuuh

include/config.h
include/vlc.h
src/video_decoder/vdec_motion.c
src/video_decoder/video_decoder.c
src/video_parser/video_fifo.c
src/video_parser/vpar_blocks.c
src/video_parser/vpar_headers.c
src/video_parser/vpar_synchro.c

index f5bc7f435eaf783b7862f88419794fc9ecf78fd5..608a381648b06fa384cbb36fb72494d3168897f4 100644 (file)
@@ -73,7 +73,7 @@
  *******************************************************************************/
 
 /* General debugging support */
-//#define DEBUG
+#define DEBUG
 
 /* Modules specific debugging - this will produce a lot of output, but can be
  * usefull to track a bug */
 #define VOUT_DISPLAY_DELAY              100000
 
 /* Delay (in microseconds) between increments in idle levels */
-#define VOUT_IDLE_DELAY                 5000000
+#define VOUT_IDLE_DELAY                 5000000000000
 
 /* Number of pictures required to computes the FPS rate */
 #define VOUT_FPS_SAMPLES                20
index 211da39d28970f29eee472004aaff3642e0f65d0..ea47bfb85e92855f5752258764642f28d8b6d6a2 100644 (file)
@@ -69,7 +69,6 @@
 /* Video */
 #include "video.h"
 #include "video_output.h"
-#include "vdec_idct.h"
 
 #ifdef OLD_DECODER
 #include "video_decoder.h"
index 0c9ef7f4b0568e81b7391f95884ddf4bfd4b176d..50258cadf63399c1573ee3f54899be0457321bc9 100644 (file)
@@ -44,7 +44,7 @@
  *****************************************************************************/
 static void __inline__ MotionComponent( yuv_data_t * p_src, yuv_data_t * p_dest,
                                    int i_width, int i_height, int i_x_step,
-                                   int i_select )
+                                   int i_x_stride, int i_select )
 {
     int i_x, i_y, i_x1, i_y1;
     unsigned int i_dummy;
@@ -102,7 +102,7 @@ static void __inline__ MotionComponent( yuv_data_t * p_src, yuv_data_t * p_dest,
                      {
                          i_dummy = p_dest[i_x+i_x1]
                             + ((unsigned int)(p_src[i_x+i_x1] + 1
-                                     + p_src[i_x+i_x1 + i_x_step]) >> 1);
+                                     + p_src[i_x+i_x1 + i_x_stride]) >> 1);
                          p_dest[i_x + i_x1] = (i_dummy + 1) >> 1;
                      }
                 }
@@ -123,7 +123,7 @@ static void __inline__ MotionComponent( yuv_data_t * p_src, yuv_data_t * p_dest,
                      for( i_x1 = 0; i_x1 < 8; i_x1++ )
                      {
                          p_dest[i_x+i_x1] = (unsigned int)(p_src[i_x+i_x1] + 1
-                                            + p_src[i_x+i_x1 + i_x_step])
+                                            + p_src[i_x+i_x1 + i_x_stride])
                                           >> 1;  
                      }
                 }
@@ -190,8 +190,8 @@ static void __inline__ MotionComponent( yuv_data_t * p_src, yuv_data_t * p_dest,
                             + ((unsigned int)(
                                   p_src[i_x+i_x1]
                                 + p_src[i_x+i_x1 + 1]
-                                + p_src[i_x+i_x1 + i_x_step]
-                                + p_src[i_x+i_x1 + i_x_step + 1]
+                                + p_src[i_x+i_x1 + i_x_stride]
+                                + p_src[i_x+i_x1 + i_x_stride + 1]
                                 + 2) >> 2);
                          p_dest[i_x + i_x1] = (i_dummy + 1) >> 1;
                      }
@@ -216,8 +216,8 @@ static void __inline__ MotionComponent( yuv_data_t * p_src, yuv_data_t * p_dest,
                             = ((unsigned int)(
                                   p_src[i_x+i_x1]
                                 + p_src[i_x+i_x1 + 1] 
-                                + p_src[i_x+i_x1 + i_x_step]
-                                + p_src[i_x+i_x1 + i_x_step + 1]
+                                + p_src[i_x+i_x1 + i_x_stride]
+                                + p_src[i_x+i_x1 + i_x_stride + 1]
                                 + 2) >> 2);
                      }
                 }
@@ -282,6 +282,7 @@ typedef struct motion_arg_s
     int             i_height, i_offset;
     int             i_mv_x, i_mv_y;
     boolean_t       b_average;
+    int             i_l_x_step, i_c_x_step;
 } motion_arg_t;
 
 /*****************************************************************************
@@ -297,13 +298,15 @@ void vdec_MotionDummy( macroblock_t * p_mb )
  *****************************************************************************/
 void vdec_MotionFieldField( macroblock_t * p_mb )
 {
-#if 0
+#if 1
     motion_arg_t    args;
 
     args.i_height = 16;
     args.b_average = 0;
     args.b_dest_field = p_mb->b_motion_field;
     args.i_offset = 0;
+    args.i_l_x_step = p_mb->i_l_stride;
+    args.i_c_x_step = p_mb->i_c_stride;
 
     if( p_mb->i_mb_type & MB_MOTION_FORWARD )
     {
@@ -336,13 +339,15 @@ void vdec_MotionFieldField( macroblock_t * p_mb )
  *****************************************************************************/
 void vdec_MotionField16x8( macroblock_t * p_mb )
 {
-#if 0
+#if 1
     motion_arg_t    args;
 
     args.i_height = 8;
     args.b_average = 0;
     args.b_dest_field = p_mb->b_motion_field;
     args.i_offset = 0;
+    args.i_l_x_step = p_mb->i_l_stride;
+    args.i_c_x_step = p_mb->i_c_stride;
 
     if( p_mb->i_mb_type & MB_MOTION_FORWARD )
     {
@@ -441,6 +446,8 @@ void vdec_MotionFrameFrame( macroblock_t * p_mb )
     args.i_height = 16;
     args.b_average = 0;
     args.i_offset = 0;
+    args.i_l_x_step = p_mb->i_l_stride;
+    args.i_c_x_step = p_mb->i_c_stride;
 
     if( p_mb->i_mb_type & MB_MOTION_FORWARD )
     {
@@ -473,8 +480,8 @@ void vdec_MotionFrameField( macroblock_t * p_mb )
     args.i_height = 8;
     args.b_average = 0;
     args.i_offset = 0;
-    p_mb->i_l_stride <<= 1;
-    p_mb->i_c_stride <<= 1;
+    args.i_l_x_step = p_mb->i_l_stride << 1;
+    args.i_c_x_step = p_mb->i_c_stride << 1;
 
     if( p_mb->i_mb_type & MB_MOTION_FORWARD )
     {
@@ -483,14 +490,14 @@ void vdec_MotionFrameField( macroblock_t * p_mb )
         args.b_source_field = p_mb->ppi_field_select[0][0];
         args.b_dest_field = 0;
         args.i_mv_x = p_mb->pppi_motion_vectors[0][0][0];
-        args.i_mv_y = p_mb->pppi_motion_vectors[0][0][1] >> 1;
+        args.i_mv_y = p_mb->pppi_motion_vectors[0][0][1];
         p_mb->pf_chroma_motion( p_mb, &args );
 #endif
 #if 1
         args.b_source_field = p_mb->ppi_field_select[1][0];
         args.b_dest_field = 1;
-        args.i_mv_x = p_mb->pppi_motion_vectors[0][0][0];
-        args.i_mv_y = p_mb->pppi_motion_vectors[0][0][1] >> 1;
+        args.i_mv_x = p_mb->pppi_motion_vectors[1][0][0];
+        args.i_mv_y = p_mb->pppi_motion_vectors[1][0][1];
         p_mb->pf_chroma_motion( p_mb, &args );
 #endif
         args.b_average = 1;
@@ -503,13 +510,13 @@ void vdec_MotionFrameField( macroblock_t * p_mb )
         args.b_source_field = p_mb->ppi_field_select[0][1];
         args.b_dest_field = 0;
         args.i_mv_x = p_mb->pppi_motion_vectors[0][1][0];
-        args.i_mv_y = p_mb->pppi_motion_vectors[0][1][1] >> 1;
+        args.i_mv_y = p_mb->pppi_motion_vectors[0][1][1];
         p_mb->pf_chroma_motion( p_mb, &args );
 
         args.b_source_field = p_mb->ppi_field_select[1][1];
         args.b_dest_field = 1;
         args.i_mv_x = p_mb->pppi_motion_vectors[1][1][0];
-        args.i_mv_y = p_mb->pppi_motion_vectors[1][1][1] >> 1;
+        args.i_mv_y = p_mb->pppi_motion_vectors[1][1][1];
         p_mb->pf_chroma_motion( p_mb, &args );
     }
 #endif
@@ -524,8 +531,8 @@ void vdec_MotionFrameDMV( macroblock_t * p_mb )
     motion_arg_t    args;
     int             ppi_dmv[2][2];
 
-    p_mb->i_l_stride <<= 1;
-    p_mb->i_c_stride <<= 1;
+    args.i_l_x_step = p_mb->i_l_stride << 1;
+    args.i_c_x_step = p_mb->i_c_stride << 1;
     args.i_height = 8;
     args.b_average = 0;
     args.b_dest_field = 0;
@@ -587,7 +594,7 @@ void vdec_Motion420( macroblock_t * p_mb, motion_arg_t * p_motion )
                      /* prediction width and height */
                      16, p_motion->i_height,
                      /* step */
-                     p_mb->i_l_stride,
+                     p_motion->i_l_x_step, p_mb->i_l_stride,
                      /* select */
                      (p_motion->b_average << 2)
                        | ((p_motion->i_mv_y & 1) << 1)
@@ -604,7 +611,8 @@ void vdec_Motion420( macroblock_t * p_mb, motion_arg_t * p_motion )
                        + (p_mb->i_c_x)
                        + (p_mb->i_motion_c_y + p_motion->b_dest_field)
                          * p_mb->p_picture->i_chroma_width,
-                     8, p_motion->i_height >> 1, p_mb->i_c_stride,
+                     8, p_motion->i_height >> 1, p_motion->i_c_x_step,
+                     p_mb->i_c_stride,
                      (p_motion->b_average << 2)
                        | (((p_motion->i_mv_y/2) & 1) << 1)
                        | ((p_motion->i_mv_x/2) & 1) );
@@ -620,7 +628,8 @@ void vdec_Motion420( macroblock_t * p_mb, motion_arg_t * p_motion )
                        + (p_mb->i_c_x)
                        + (p_mb->i_motion_c_y + p_motion->b_dest_field)
                          * p_mb->p_picture->i_chroma_width,
-                     8, p_motion->i_height >> 1, p_mb->i_c_stride,
+                     8, p_motion->i_height >> 1, p_motion->i_c_x_step,
+                     p_mb->i_c_stride,
                      (p_motion->b_average << 2)
                        | (((p_motion->i_mv_y/2) & 1) << 1)
                        | ((p_motion->i_mv_x/2) & 1) );
@@ -631,6 +640,7 @@ void vdec_Motion420( macroblock_t * p_mb, motion_arg_t * p_motion )
  *****************************************************************************/
 void vdec_Motion422( macroblock_t * p_mb, motion_arg_t * p_motion )
 {
+#if 0
     /* Luminance */
     MotionComponent( p_motion->p_source->p_y
                        + (p_mb->i_l_x + (p_motion->i_mv_x >> 1))
@@ -678,6 +688,7 @@ void vdec_Motion422( macroblock_t * p_mb, motion_arg_t * p_motion )
                      (p_motion->b_average << 2)
                        | ((p_motion->i_mv_y & 1) << 1)
                        | ((p_motion->i_mv_x/2) & 1) );
+#endif
 }
 
 /*****************************************************************************
@@ -685,6 +696,7 @@ void vdec_Motion422( macroblock_t * p_mb, motion_arg_t * p_motion )
  *****************************************************************************/
 void vdec_Motion444( macroblock_t * p_mb, motion_arg_t * p_motion )
 {
+#if 0
     /* Luminance */
     MotionComponent( p_motion->p_source->p_y
                        + (p_mb->i_l_x + (p_motion->i_mv_x >> 1))
@@ -732,4 +744,5 @@ void vdec_Motion444( macroblock_t * p_mb, motion_arg_t * p_motion )
                      (p_motion->b_average << 2)
                        | ((p_motion->i_mv_y & 1) << 1)
                        | (p_motion->i_mv_x & 1) );
+#endif
 }
index cd9c7b39eda66de543fb534a6f0f70548d98ad6d..0a7365e3437eb6da3b12bb6745f9fa4677e58676 100644 (file)
@@ -256,7 +256,7 @@ static void DecodeMacroblock( vdec_thread_t *p_vdec, macroblock_t * p_mb )
      * Motion Compensation (ISO/IEC 13818-2 section 7.6)
      */
     (*p_mb->pf_motion)( p_mb );
-if( !p_mb->b_P_coding_type ) {
+
     /* luminance */
     for( i_b = 0; i_b < 4; i_b++ )
     {
@@ -288,7 +288,7 @@ if( !p_mb->b_P_coding_type ) {
         (p_mb->pf_addb[i_b])( p_vdec, p_mb->ppi_blocks[i_b],
                               p_mb->p_data[i_b], p_mb->i_addb_c_stride );
     }
-}
+
     /*
      * Decoding is finished, release the macroblock and free
      * unneeded memory.
index 9653733f5fb6bbc84f0acdac2d2edeaa2c87e9a1..2e46d87db086607fa7e1b5dac40d85f11f66db93 100644 (file)
@@ -147,7 +147,7 @@ void vpar_ReleaseMacroblock( video_fifo_t * p_fifo, macroblock_t * p_mb )
     /* Test if it was the last block of the picture */
     if( b_finished )
     {
-fprintf(stderr, "Image decodee\n");
+//fprintf(stderr, "Image decodee\n");
         /* Mark the picture to be displayed */
         vout_DisplayPicture( p_fifo->p_vpar->p_vout, p_mb->p_picture );
 
index 8011f28f706e3dc42eef7cdafb25e8f5b8698af7..6ff53b02dcb7ab542f99ec6432b42921f4d4ee03 100644 (file)
@@ -704,6 +704,7 @@ static __inline__ void MacroblockModes( vpar_thread_t * p_vpar,
         p_mb->pf_motion = pf_motion[p_vpar->picture.b_frame_structure]
                                    [p_vpar->mb.i_motion_type];
     }
+
     p_vpar->mb.i_mv_count = ppi_mv_count[p_vpar->picture.b_frame_structure]
                                         [p_vpar->mb.i_motion_type];
     p_vpar->mb.i_mv_format = ppi_mv_format[p_vpar->picture.b_frame_structure]
@@ -767,7 +768,7 @@ i_count++;
         static int          pi_dc_dct_reinit[4] = {128,256,512,1024};
         static f_motion_t   pf_motion_skipped[4] = {NULL, vdec_MotionFieldField,
                                 vdec_MotionFieldField, vdec_MotionFrameFrame};
-fprintf(stderr, "On sauuuute !\n");
+
         /* Reset DC predictors (7.2.1). */
         p_vpar->slice.pi_dc_dct_pred[0] = p_vpar->slice.pi_dc_dct_pred[1]
             = p_vpar->slice.pi_dc_dct_pred[2]
@@ -799,6 +800,7 @@ fprintf(stderr, "On sauuuute !\n");
         /* Motion type is picture structure. */
         p_mb->pf_motion = pf_motion_skipped[p_vpar->picture.i_structure];
         p_mb->i_mb_type = MB_MOTION_FORWARD;
+        memset( p_mb->pppi_motion_vectors, 0, 8*sizeof(int) );
 
         /* Set the field we use for motion compensation */
         p_mb->ppi_field_select[0][0] = p_mb->ppi_field_select[0][1]
@@ -1272,7 +1274,6 @@ if( i_parse >= 64 )
         p_mb->ppi_blocks[i_b][i_pos] = b_sign ? -i_level : i_level;
     }
 fprintf( stderr, "Non intra MPEG2 end (%d)\n", i_b );
-exit(0);
 //p_vpar->picture.b_error = 1;
 }
 
@@ -1513,6 +1514,5 @@ if( i_parse >= 64 )
     }
     
 fprintf( stderr, "MPEG2 end (%d)\n", i_b );
-exit(0);
 //p_vpar->b_error = 1;
 }
index ee66079c81489199aa447e005e903a15a984085e..310e11b868984af07b5d043e21f988bc05c74dd0 100644 (file)
@@ -530,8 +530,6 @@ static void PictureHeader( vpar_thread_t * p_vpar )
                                          [p_vpar->picture.i_coding_type];
     RemoveBits( &p_vpar->bit_stream, 16 ); /* vbv_delay */
 
-fprintf( stderr, "coding type: %d\n", p_vpar->picture.i_coding_type );
-    
     if( p_vpar->picture.i_coding_type == P_CODING_TYPE || p_vpar->picture.i_coding_type == B_CODING_TYPE )
     {
         p_vpar->picture.pb_full_pel_vector[0] = GetBits( &p_vpar->bit_stream, 1 );
@@ -755,7 +753,7 @@ memset( P_picture->p_data, 0, (p_vpar->sequence.i_mb_size*384));
     if( p_vpar->picture.b_error )
     {
         /* Trash picture. */
-fprintf(stderr, "Image trashee\n");
+//fprintf(stderr, "Image trashee\n");
         for( i_mb = 1; p_vpar->picture.pp_mb[i_mb]; i_mb++ )
         {
             vpar_DestroyMacroblock( &p_vpar->vfifo, p_vpar->picture.pp_mb[i_mb] );
@@ -771,7 +769,7 @@ fprintf(stderr, "Image trashee\n");
     }
     else if( p_vpar->picture.i_current_structure == FRAME_STRUCTURE )
     {
-fprintf(stderr, "Image parsee (%d)\n", p_vpar->picture.i_coding_type);
+//fprintf(stderr, "Image parsee (%d)\n", p_vpar->picture.i_coding_type);
         /* Frame completely parsed. */
         for( i_mb = 1; p_vpar->picture.pp_mb[i_mb] != NULL; i_mb++ )
         {
index 3688c0690c3ce7802cc17efd9eff8b435c182e6d..cf3438c4856498aabeedeec873f0bfd9650267fc 100644 (file)
@@ -145,13 +145,13 @@ void vpar_SynchroUpdateStructures( vpar_thread_t * p_vpar,
 boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type,
                               int i_structure )
 {
-    static int meuh = 0;
+    static int meuh = 1;
     static int truc = 0;
 //    return( 1 );
-    if( i_coding_type == 1 )
-        meuh = 0;
-    if( i_coding_type == 2 )
-        meuh++;
+//    if( i_coding_type == 1 )
+//        meuh = 0;
+//    if( i_coding_type == 2 )
+//        meuh++;
     truc++;
     if( truc == 3 )
     {