From 98c92aaf4e7babdd95d6c8b5888346b2d02ab2ad Mon Sep 17 00:00:00 2001 From: Christophe Massiot Date: Sun, 27 Aug 2000 16:21:49 +0000 Subject: [PATCH] =?utf8?q?Un=20bug=20cette=20fois-ci=20avec=20le=20parseur?= =?utf8?q?=20et=20un=20traitement=20erron=EF=BF=BD=20des=20macroblocs=20sa?= =?utf8?q?ut=EF=BF=BDs=20dans=20les=20images=20B=20qui=20provoquait=20des?= =?utf8?q?=20carr=EF=BF=BDs.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/video_parser/vpar_blocks.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/video_parser/vpar_blocks.c b/src/video_parser/vpar_blocks.c index 478ae514f0..7e47970031 100644 --- a/src/video_parser/vpar_blocks.c +++ b/src/video_parser/vpar_blocks.c @@ -1581,9 +1581,23 @@ static __inline__ void SkippedMacroblock( vpar_thread_t * p_vpar, int i_mb, /* Motion type is picture structure. */ p_mb->pf_motion = pf_motion_skipped[i_chroma_format] [i_structure]; - p_mb->i_mb_type = MB_MOTION_FORWARD; p_mb->i_coded_block_pattern = 0; - memset( p_mb->pppi_motion_vectors, 0, 8*sizeof(int) ); + + /* Motion direction and motion vectors depend on the coding type. */ + if( i_coding_type == B_CODING_TYPE ) + { + int i, j, k; + p_mb->i_mb_type = p_vpar->mb.i_motion_dir; + for( i = 0; i < 2; i++ ) + for( j = 0; j < 2; j++ ) + for( k = 0; k < 2; k++ ) + p_mb->pppi_motion_vectors[i][j][k] = p_vpar->mb.pppi_pmv[i][j][k]; + } + else if( i_coding_type == P_CODING_TYPE ) + { + 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] @@ -1625,6 +1639,14 @@ static __inline__ void MacroblockModes( vpar_thread_t * p_vpar, p_mb->i_mb_type = DMBType( p_vpar ); } + if( i_coding_type == B_CODING_TYPE ) + { + /* We need to remember the motion direction of the last macroblock + * before a skipped macroblock (ISO/IEC 13818-2 7.6.6) */ + p_vpar->mb.i_motion_dir = p_mb->i_mb_type + & (MB_MOTION_FORWARD | MB_MOTION_BACKWARD); + } + /* SCALABILITY : warning, we don't know if spatial_temporal_weight_code * has to be dropped, take care if you use scalable streams. */ /* RemoveBits( &p_vpar->bit_stream, 2 ); */ -- 2.39.2