Commit 45b6443f authored by Sam Hocevar's avatar Sam Hocevar

We now have support for the field pictures. It shouldn't break teh frame

pictures, if you notice anything please ring my bell.

--Meuuh (live from Julie)
parent e9345712
...@@ -11,3 +11,5 @@ config.cache ...@@ -11,3 +11,5 @@ config.cache
config.status config.status
Makefile Makefile
build-stamp build-stamp
gvlc
fbvlc
O.1.99i :
* fixed the support for the field pictures, which involved a few dozens
bugs in the video parser and video decoder
Tue, 22 Aug 2000 01:31:58 +0200 Tue, 22 Aug 2000 01:31:58 +0200
0.1.99h : 0.1.99h :
......
...@@ -175,12 +175,12 @@ static __inline__ void Motion420( ...@@ -175,12 +175,12 @@ static __inline__ void Motion420(
i_source_offset = (p_mb->i_l_x + (i_mv_x >> 1)) i_source_offset = (p_mb->i_l_x + (i_mv_x >> 1))
+ (p_mb->i_motion_l_y + i_offset + (p_mb->i_motion_l_y + i_offset
+ (i_mv_y >> 1)
+ b_source_field) + b_source_field)
* p_mb->p_picture->i_width; * p_mb->p_picture->i_width
+ (i_mv_y >> 1) * p_mb->i_l_stride;
if( i_source_offset >= p_source->i_width * p_source->i_height ) if( i_source_offset >= p_source->i_width * p_source->i_height )
{ {
intf_ErrMsg( "vdec error: bad motion vector\n" ); intf_ErrMsg( "vdec error: bad motion vector (lum)\n" );
return; return;
} }
...@@ -201,13 +201,13 @@ static __inline__ void Motion420( ...@@ -201,13 +201,13 @@ static __inline__ void Motion420(
b_average ); b_average );
i_source_offset = (p_mb->i_c_x + ((i_mv_x/2) >> 1)) i_source_offset = (p_mb->i_c_x + ((i_mv_x/2) >> 1))
+ ((p_mb->i_motion_c_y + (i_offset >> 1) + (p_mb->i_motion_c_y + (i_offset >> 1)
+ ((i_mv_y/2) >> 1))
+ b_source_field) + b_source_field)
* p_mb->p_picture->i_chroma_width; * p_mb->p_picture->i_chroma_width
+ ((i_mv_y/2) >> 1) * p_mb->i_c_stride;
if( i_source_offset >= (p_source->i_width * p_source->i_height) / 4 ) if( i_source_offset >= (p_source->i_width * p_source->i_height) / 4 )
{ {
intf_ErrMsg( "vdec error: bad motion vector\n" ); intf_ErrMsg( "vdec error: bad motion vector (chroma)\n" );
return; return;
} }
...@@ -264,9 +264,9 @@ static __inline__ void Motion422( ...@@ -264,9 +264,9 @@ static __inline__ void Motion422(
p_source->p_y p_source->p_y
+ (p_mb->i_l_x + (i_mv_x >> 1)) + (p_mb->i_l_x + (i_mv_x >> 1))
+ (p_mb->i_motion_l_y + i_offset + (p_mb->i_motion_l_y + i_offset
+ (i_mv_y >> 1)
+ b_source_field) + b_source_field)
* p_mb->p_picture->i_width, * p_mb->p_picture->i_width
+ (i_mv_y >> 1) * p_mb->i_l_stride,
/* destination */ /* destination */
p_mb->p_picture->p_y p_mb->p_picture->p_y
+ (p_mb->i_l_x) + (p_mb->i_l_x)
...@@ -281,10 +281,10 @@ static __inline__ void Motion422( ...@@ -281,10 +281,10 @@ static __inline__ void Motion422(
b_average ); b_average );
i_source_offset = (p_mb->i_c_x + ((i_mv_x/2) >> 1)) i_source_offset = (p_mb->i_c_x + ((i_mv_x/2) >> 1))
+ ((p_mb->i_motion_c_y + (i_offset) + (p_mb->i_motion_c_y + i_offset
+ ((i_mv_y) >> 1))
+ b_source_field) + b_source_field)
* p_mb->p_picture->i_chroma_width; * p_mb->p_picture->i_chroma_width
+ (i_mv_y) >> 1) * p_mb->i_c_stride;
i_dest_offset = (p_mb->i_c_x) i_dest_offset = (p_mb->i_c_x)
+ (p_mb->i_motion_c_y + b_dest_field) + (p_mb->i_motion_c_y + b_dest_field)
* p_mb->p_picture->i_chroma_width; * p_mb->p_picture->i_chroma_width;
...@@ -335,9 +335,9 @@ static __inline__ void Motion444( ...@@ -335,9 +335,9 @@ static __inline__ void Motion444(
i_source_offset = (p_mb->i_l_x + (i_mv_x >> 1)) i_source_offset = (p_mb->i_l_x + (i_mv_x >> 1))
+ (p_mb->i_motion_l_y + i_offset + (p_mb->i_motion_l_y + i_offset
+ (i_mv_y >> 1)
+ b_source_field) + b_source_field)
* p_mb->p_picture->i_width; * p_mb->p_picture->i_width
+ (i_mv_y >> 1) * p_mb->i_l_stride;
i_dest_offset = (p_mb->i_l_x) i_dest_offset = (p_mb->i_l_x)
+ (p_mb->i_motion_l_y + b_dest_field) + (p_mb->i_motion_l_y + b_dest_field)
* p_mb->p_picture->i_width; * p_mb->p_picture->i_width;
...@@ -374,6 +374,7 @@ static __inline__ void Motion444( ...@@ -374,6 +374,7 @@ static __inline__ void Motion444(
* vdec_MotionFieldField : motion compensation for field motion type (field) * vdec_MotionFieldField : motion compensation for field motion type (field)
*****************************************************************************/ *****************************************************************************/
#define FIELDFIELD( MOTION ) \ #define FIELDFIELD( MOTION ) \
{ \
picture_t * p_pred; \ picture_t * p_pred; \
\ \
if( p_mb->i_mb_type & MB_MOTION_FORWARD ) \ if( p_mb->i_mb_type & MB_MOTION_FORWARD ) \
...@@ -398,6 +399,7 @@ static __inline__ void Motion444( ...@@ -398,6 +399,7 @@ static __inline__ void Motion444(
p_mb->pppi_motion_vectors[0][1][0], \ p_mb->pppi_motion_vectors[0][1][0], \
p_mb->pppi_motion_vectors[0][1][1], \ p_mb->pppi_motion_vectors[0][1][1], \
p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 1 ); \ p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 1 ); \
} \
} \ } \
\ \
else /* MB_MOTION_BACKWARD */ \ else /* MB_MOTION_BACKWARD */ \
...@@ -508,7 +510,7 @@ void vdec_MotionField16x8444( macroblock_t * p_mb ) ...@@ -508,7 +510,7 @@ void vdec_MotionField16x8444( macroblock_t * p_mb )
} }
/***************************************************************************** /*****************************************************************************
* vdec_MotionFieldDMVXXX?? : motion compensation for dmv motion type (field) * vdec_MotionFieldDMVXXX : motion compensation for dmv motion type (field)
*****************************************************************************/ *****************************************************************************/
#define FIELDDMV( MOTION ) \ #define FIELDDMV( MOTION ) \
{ \ { \
......
...@@ -54,8 +54,6 @@ ...@@ -54,8 +54,6 @@
#include "video_parser.h" #include "video_parser.h"
#include "video_fifo.h" #include "video_fifo.h"
static int i_count = 0;
/* /*
* Welcome to vpar_blocks.c ! Here's where the heavy processor-critical parsing * Welcome to vpar_blocks.c ! Here's where the heavy processor-critical parsing
* task is done. This file is divided in several parts : * task is done. This file is divided in several parts :
...@@ -1705,7 +1703,7 @@ if( p_vpar->picture.b_error ) \ ...@@ -1705,7 +1703,7 @@ if( p_vpar->picture.b_error ) \
/* Calculate block coordinates. */ \ /* Calculate block coordinates. */ \
p_mb->p_data[i_b] = p_data1 \ p_mb->p_data[i_b] = p_data1 \
+ pi_y[p_vpar->mb.b_dct_type][i_b] \ + pi_y[p_vpar->mb.b_dct_type][i_b] \
* p_vpar->sequence.i_width \ * p_vpar->picture.i_l_stride \
+ pi_x[i_b]; \ + pi_x[i_b]; \
\ \
PARSEERROR \ PARSEERROR \
...@@ -1738,7 +1736,7 @@ if( p_vpar->picture.b_error ) \ ...@@ -1738,7 +1736,7 @@ if( p_vpar->picture.b_error ) \
/* Calculate block coordinates. */ \ /* Calculate block coordinates. */ \
p_mb->p_data[i_b] = pp_data[i_b & 1] \ p_mb->p_data[i_b] = pp_data[i_b & 1] \
+ pi_y[p_vpar->mb.b_dct_type][i_b] \ + pi_y[p_vpar->mb.b_dct_type][i_b] \
* p_vpar->sequence.i_chroma_width \ * p_vpar->picture.i_c_stride \
+ pi_x[i_b]; \ + pi_x[i_b]; \
\ \
PARSEERROR \ PARSEERROR \
...@@ -1791,8 +1789,6 @@ static __inline__ void ParseMacroblock( ...@@ -1791,8 +1789,6 @@ static __inline__ void ParseMacroblock(
yuv_data_t * p_data1; yuv_data_t * p_data1;
yuv_data_t * p_data2; yuv_data_t * p_data2;
i_count++;
i_inc = MacroblockAddressIncrement( p_vpar ); i_inc = MacroblockAddressIncrement( p_vpar );
*pi_mb_address += i_inc; *pi_mb_address += i_inc;
...@@ -2217,16 +2213,15 @@ static __inline__ void SliceHeader( vpar_thread_t * p_vpar, ...@@ -2217,16 +2213,15 @@ static __inline__ void SliceHeader( vpar_thread_t * p_vpar,
else else
{ {
/* Try to find an optimized function. */ /* Try to find an optimized function. */
if( ppf_parse_mb[p_vpar->picture.i_structure] if( ppf_parse_mb[i_structure]
[p_vpar->picture.i_coding_type] == NULL ) [p_vpar->picture.i_coding_type] == NULL )
{ {
intf_ErrMsg( "vpar error: bad ppf_parse_mb function pointer (struct:%d, coding type:%d)\n", intf_ErrMsg( "vpar error: bad ppf_parse_mb function pointer (struct:%d, coding type:%d)\n",
p_vpar->picture.i_structure, p_vpar->picture.i_coding_type ); i_structure, i_coding_type );
} }
else else
{ {
ppf_parse_mb[p_vpar->picture.i_structure] ppf_parse_mb[i_structure][i_coding_type]
[p_vpar->picture.i_coding_type]
( p_vpar, pi_mb_address, i_mb_address_save, ( p_vpar, pi_mb_address, i_mb_address_save,
i_mb_base, b_mpeg2, i_coding_type, i_mb_base, b_mpeg2, i_coding_type,
i_chroma_format, i_structure, i_chroma_format, i_structure,
...@@ -2256,7 +2251,8 @@ void vpar_PictureData( vpar_thread_t * p_vpar, int i_mb_base ) ...@@ -2256,7 +2251,8 @@ void vpar_PictureData( vpar_thread_t * p_vpar, int i_mb_base )
while( ((p_vpar->picture.i_coding_type != I_CODING_TYPE while( ((p_vpar->picture.i_coding_type != I_CODING_TYPE
&& p_vpar->picture.i_coding_type != D_CODING_TYPE) && p_vpar->picture.i_coding_type != D_CODING_TYPE)
|| !p_vpar->picture.b_error) || !p_vpar->picture.b_error)
&& i_mb_address+i_mb_base < p_vpar->sequence.i_mb_size && i_mb_address < (p_vpar->sequence.i_mb_size
>> (p_vpar->picture.i_structure != FRAME_STRUCTURE))
&& !p_vpar->b_die ) && !p_vpar->b_die )
{ {
if( ((i_dummy = ShowBits( &p_vpar->bit_stream, 32 )) if( ((i_dummy = ShowBits( &p_vpar->bit_stream, 32 ))
......
...@@ -639,7 +639,17 @@ static void PictureHeader( vpar_thread_t * p_vpar ) ...@@ -639,7 +639,17 @@ static void PictureHeader( vpar_thread_t * p_vpar )
#endif #endif
/* Update context. */ /* Update context. */
if( i_structure != FRAME_STRUCTURE ) if( i_structure != FRAME_STRUCTURE )
{
if( (p_vpar->picture.i_current_structure | i_structure)
== FRAME_STRUCTURE )
{
p_vpar->picture.i_current_structure = 0;
}
else
{
p_vpar->picture.i_current_structure = i_structure; p_vpar->picture.i_current_structure = i_structure;
}
}
p_vpar->picture.p_picture = NULL; p_vpar->picture.p_picture = NULL;
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment