Commit 84821085 authored by Christophe Massiot's avatar Christophe Massiot

* Support for pictures with a pitch different from the picture width,

inspired by Gildas Bazin.
parent 051e23d9
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vdec_ext-plugins.h : structures from the video decoder exported to plug-ins * vdec_ext-plugins.h : structures from the video decoder exported to plug-ins
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: vdec_ext-plugins.h,v 1.10 2002/04/05 01:05:22 gbazin Exp $ * $Id: vdec_ext-plugins.h,v 1.11 2002/04/15 23:04:08 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -60,7 +60,6 @@ typedef struct macroblock_s ...@@ -60,7 +60,6 @@ typedef struct macroblock_s
yuv_data_t * p_v_data; yuv_data_t * p_v_data;
/* pointers to the position /* pointers to the position
* in the final picture */ * in the final picture */
/* Motion compensation information */ /* Motion compensation information */
motion_inner_t p_motions[8]; motion_inner_t p_motions[8];
int i_nb_motions; int i_nb_motions;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* includes all common video types and constants. * includes all common video types and constants.
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: video.h,v 1.48 2002/04/05 01:05:22 gbazin Exp $ * $Id: video.h,v 1.49 2002/04/15 23:04:08 massiot Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -182,8 +182,11 @@ typedef struct picture_heap_s ...@@ -182,8 +182,11 @@ typedef struct picture_heap_s
/* Shortcuts */ /* Shortcuts */
#define Y_PIXELS p[Y_PLANE].p_pixels #define Y_PIXELS p[Y_PLANE].p_pixels
#define Y_PITCH p[Y_PLANE].i_pitch
#define U_PIXELS p[U_PLANE].p_pixels #define U_PIXELS p[U_PLANE].p_pixels
#define U_PITCH p[U_PLANE].i_pitch
#define V_PIXELS p[V_PLANE].p_pixels #define V_PIXELS p[V_PLANE].p_pixels
#define V_PITCH p[V_PLANE].i_pitch
static __inline__ int vout_ChromaCmp( u32 i_chroma, u32 i_amorhc ) static __inline__ int vout_ChromaCmp( u32 i_chroma, u32 i_amorhc )
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* mpeg_ps.c : Program Stream input module for vlc * mpeg_ps.c : Program Stream input module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: mpeg_ps.c,v 1.10 2002/04/10 17:47:58 jobi Exp $ * $Id: mpeg_ps.c,v 1.11 2002/04/15 23:04:08 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* *
...@@ -114,8 +114,7 @@ static int PSInit( input_thread_t * p_input ) ...@@ -114,8 +114,7 @@ static int PSInit( input_thread_t * p_input )
} }
else else
{ {
intf_WarnMsg( 2, "input: PS plug-in discarded (no startcode)" ); intf_WarnMsg( 2, "input error: this doesn't look like an MPEG PS stream, but continuing anyway" );
return( -1 );
} }
} }
else if( *(p_peek + 3) <= 0xb9 ) else if( *(p_peek + 3) <= 0xb9 )
...@@ -128,8 +127,8 @@ static int PSInit( input_thread_t * p_input ) ...@@ -128,8 +127,8 @@ static int PSInit( input_thread_t * p_input )
} }
else else
{ {
intf_WarnMsg( 2, "input: PS plug-in discarded (ES startcode)" ); intf_WarnMsg( 2, "input error: this seems to be an elementary stream (ES plug-in ?),");
return( -1 ); intf_WarnMsg( 2, "but continuing" );
} }
} }
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* video_parser.h : video parser thread * video_parser.h : video parser thread
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: video_parser.h,v 1.3 2002/01/02 14:37:42 sam Exp $ * $Id: video_parser.h,v 1.4 2002/04/15 23:04:08 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Jean-Marc Dressler <polux@via.ecp.fr> * Jean-Marc Dressler <polux@via.ecp.fr>
...@@ -160,7 +160,7 @@ typedef struct picture_parsing_s ...@@ -160,7 +160,7 @@ typedef struct picture_parsing_s
boolean_t b_top_field_first, b_concealment_mv; boolean_t b_top_field_first, b_concealment_mv;
boolean_t b_repeat_first_field; boolean_t b_repeat_first_field;
/* Relative to the current field */ /* Relative to the current field */
int i_coding_type, i_structure; int i_coding_type, i_structure, i_field_width;
boolean_t b_frame_structure; /* i_structure == FRAME_STRUCTURE */ boolean_t b_frame_structure; /* i_structure == FRAME_STRUCTURE */
boolean_t b_current_field; /* i_structure == TOP_FIELD */ boolean_t b_current_field; /* i_structure == TOP_FIELD */
boolean_t b_second_field; boolean_t b_second_field;
...@@ -168,8 +168,10 @@ typedef struct picture_parsing_s ...@@ -168,8 +168,10 @@ typedef struct picture_parsing_s
picture_t * p_picture; /* picture buffer from vout */ picture_t * p_picture; /* picture buffer from vout */
int i_current_structure; /* current parsed structure of int i_current_structure; /* current parsed structure of
* p_picture (second field ?) */ * p_picture (second field ?) */
int i_field_width;
boolean_t b_error; /* parsing error, try to recover */ boolean_t b_error; /* parsing error, try to recover */
/* Given by the video output */
int i_lum_stride, i_chrom_stride;
} picture_parsing_t; } picture_parsing_t;
/***************************************************************************** /*****************************************************************************
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vpar_headers.c : headers parsing * vpar_headers.c : headers parsing
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: vpar_headers.c,v 1.17 2002/03/17 17:00:38 sam Exp $ * $Id: vpar_headers.c,v 1.18 2002/04/15 23:04:08 massiot Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -843,8 +843,6 @@ static void PictureHeader( vpar_thread_t * p_vpar ) ...@@ -843,8 +843,6 @@ static void PictureHeader( vpar_thread_t * p_vpar )
/* Initialize values. */ /* Initialize values. */
vpar_SynchroDecode( p_vpar, p_vpar->picture.i_coding_type, i_structure ); vpar_SynchroDecode( p_vpar, p_vpar->picture.i_coding_type, i_structure );
P_picture->i_matrix_coefficients = p_vpar->sequence.i_matrix_coefficients; P_picture->i_matrix_coefficients = p_vpar->sequence.i_matrix_coefficients;
p_vpar->picture.i_field_width = ( p_vpar->sequence.i_width
<< ( 1 - p_vpar->picture.b_frame_structure ) );
/* Update the reference pointers. */ /* Update the reference pointers. */
ReferenceUpdate( p_vpar, p_vpar->picture.i_coding_type, P_picture ); ReferenceUpdate( p_vpar, p_vpar->picture.i_coding_type, P_picture );
...@@ -857,6 +855,13 @@ static void PictureHeader( vpar_thread_t * p_vpar ) ...@@ -857,6 +855,13 @@ static void PictureHeader( vpar_thread_t * p_vpar )
(i_structure != p_vpar->picture.i_current_structure); (i_structure != p_vpar->picture.i_current_structure);
p_vpar->picture.b_current_field = p_vpar->picture.b_current_field =
(i_structure == BOTTOM_FIELD ); (i_structure == BOTTOM_FIELD );
p_vpar->picture.i_lum_stride = p_vpar->picture.p_picture->Y_PITCH
<< ( 1 - p_vpar->picture.b_frame_structure );
p_vpar->picture.i_chrom_stride = p_vpar->picture.p_picture->U_PITCH
<< ( 1 - p_vpar->picture.b_frame_structure );
/* We suppose the pitch is the same for U and V planes. */
p_vpar->picture.i_field_width = p_vpar->sequence.i_width
<< ( 1 - p_vpar->picture.b_frame_structure );
if( !p_vpar->p_config->p_stream_ctrl->b_grayscale ) if( !p_vpar->p_config->p_stream_ctrl->b_grayscale )
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_pictures.c : picture management functions * vout_pictures.c : picture management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000 VideoLAN
* $Id: vout_pictures.c,v 1.20 2002/04/05 01:05:22 gbazin Exp $ * $Id: vout_pictures.c,v 1.21 2002/04/15 23:04:08 massiot Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -427,36 +427,46 @@ void vout_AllocatePicture( picture_t *p_pic, ...@@ -427,36 +427,46 @@ void vout_AllocatePicture( picture_t *p_pic,
case FOURCC_IYUV: case FOURCC_IYUV:
p_pic->p[ Y_PLANE ].i_lines = i_height; p_pic->p[ Y_PLANE ].i_lines = i_height;
p_pic->p[ Y_PLANE ].i_pitch = i_width; p_pic->p[ Y_PLANE ].i_pitch = i_width;
p_pic->p[ Y_PLANE ].i_visible_bytes = p_pic->p[ Y_PLANE ].i_pitch;
p_pic->p[ U_PLANE ].i_lines = i_height / 2; p_pic->p[ U_PLANE ].i_lines = i_height / 2;
p_pic->p[ U_PLANE ].i_pitch = i_width / 2; p_pic->p[ U_PLANE ].i_pitch = i_width / 2;
p_pic->p[ U_PLANE ].i_visible_bytes = p_pic->p[ U_PLANE ].i_pitch;
p_pic->p[ V_PLANE ].i_lines = i_height / 2; p_pic->p[ V_PLANE ].i_lines = i_height / 2;
p_pic->p[ V_PLANE ].i_pitch = i_width / 2; p_pic->p[ V_PLANE ].i_pitch = i_width / 2;
p_pic->p[ V_PLANE ].i_visible_bytes = p_pic->p[ V_PLANE ].i_pitch;
p_pic->i_planes = 3; p_pic->i_planes = 3;
break; break;
case FOURCC_I422: case FOURCC_I422:
p_pic->p[ Y_PLANE ].i_lines = i_height; p_pic->p[ Y_PLANE ].i_lines = i_height;
p_pic->p[ Y_PLANE ].i_pitch = i_width; p_pic->p[ Y_PLANE ].i_pitch = i_width;
p_pic->p[ Y_PLANE ].i_visible_bytes = p_pic->p[ Y_PLANE ].i_pitch;
p_pic->p[ U_PLANE ].i_lines = i_height; p_pic->p[ U_PLANE ].i_lines = i_height;
p_pic->p[ U_PLANE ].i_pitch = i_width / 2; p_pic->p[ U_PLANE ].i_pitch = i_width / 2;
p_pic->p[ U_PLANE ].i_visible_bytes = p_pic->p[ U_PLANE ].i_pitch;
p_pic->p[ V_PLANE ].i_lines = i_height; p_pic->p[ V_PLANE ].i_lines = i_height;
p_pic->p[ V_PLANE ].i_pitch = i_width / 2; p_pic->p[ V_PLANE ].i_pitch = i_width / 2;
p_pic->p[ V_PLANE ].i_visible_bytes = p_pic->p[ V_PLANE ].i_pitch;
p_pic->i_planes = 3; p_pic->i_planes = 3;
break; break;
case FOURCC_I444: case FOURCC_I444:
p_pic->p[ Y_PLANE ].i_lines = i_height; p_pic->p[ Y_PLANE ].i_lines = i_height;
p_pic->p[ Y_PLANE ].i_pitch = i_width; p_pic->p[ Y_PLANE ].i_pitch = i_width;
p_pic->p[ Y_PLANE ].i_visible_bytes = p_pic->p[ Y_PLANE ].i_pitch;
p_pic->p[ U_PLANE ].i_lines = i_height; p_pic->p[ U_PLANE ].i_lines = i_height;
p_pic->p[ U_PLANE ].i_pitch = i_width; p_pic->p[ U_PLANE ].i_pitch = i_width;
p_pic->p[ U_PLANE ].i_visible_bytes = p_pic->p[ U_PLANE ].i_pitch;
p_pic->p[ V_PLANE ].i_lines = i_height; p_pic->p[ V_PLANE ].i_lines = i_height;
p_pic->p[ V_PLANE ].i_pitch = i_width; p_pic->p[ V_PLANE ].i_pitch = i_width;
p_pic->p[ V_PLANE ].i_visible_bytes = p_pic->p[ V_PLANE ].i_pitch;
p_pic->i_planes = 3; p_pic->i_planes = 3;
break; break;
case FOURCC_Y211: case FOURCC_Y211:
p_pic->p->i_lines = i_height; p_pic->p->i_lines = i_height;
p_pic->p->i_pitch = i_width; p_pic->p->i_pitch = i_width;
p_pic->p->i_visible_bytes = p_pic->p->i_pitch;
p_pic->p->i_pixel_bytes = 4; p_pic->p->i_pixel_bytes = 4;
p_pic->i_planes = 1; p_pic->i_planes = 1;
break; break;
...@@ -464,6 +474,7 @@ void vout_AllocatePicture( picture_t *p_pic, ...@@ -464,6 +474,7 @@ void vout_AllocatePicture( picture_t *p_pic,
case FOURCC_RV15: case FOURCC_RV15:
p_pic->p->i_lines = i_height; p_pic->p->i_lines = i_height;
p_pic->p->i_pitch = i_width * 2; p_pic->p->i_pitch = i_width * 2;
p_pic->p->i_visible_bytes = p_pic->p->i_pitch;
p_pic->p->i_pixel_bytes = 2; p_pic->p->i_pixel_bytes = 2;
p_pic->p_heap->i_rmask = 0x001f; p_pic->p_heap->i_rmask = 0x001f;
p_pic->p_heap->i_gmask = 0x03e0; p_pic->p_heap->i_gmask = 0x03e0;
...@@ -474,6 +485,7 @@ void vout_AllocatePicture( picture_t *p_pic, ...@@ -474,6 +485,7 @@ void vout_AllocatePicture( picture_t *p_pic,
case FOURCC_RV16: case FOURCC_RV16:
p_pic->p->i_lines = i_height; p_pic->p->i_lines = i_height;
p_pic->p->i_pitch = i_width * 2; p_pic->p->i_pitch = i_width * 2;
p_pic->p->i_visible_bytes = p_pic->p->i_pitch;
p_pic->p->i_pixel_bytes = 2; p_pic->p->i_pixel_bytes = 2;
p_pic->p_heap->i_rmask = 0x001f; p_pic->p_heap->i_rmask = 0x001f;
p_pic->p_heap->i_gmask = 0x07e0; p_pic->p_heap->i_gmask = 0x07e0;
...@@ -484,6 +496,7 @@ void vout_AllocatePicture( picture_t *p_pic, ...@@ -484,6 +496,7 @@ void vout_AllocatePicture( picture_t *p_pic,
case FOURCC_RV32: case FOURCC_RV32:
p_pic->p->i_lines = i_height; p_pic->p->i_lines = i_height;
p_pic->p->i_pitch = i_width * 4; p_pic->p->i_pitch = i_width * 4;
p_pic->p->i_visible_bytes = p_pic->p->i_pitch;
p_pic->p->i_pixel_bytes = 4; p_pic->p->i_pixel_bytes = 4;
p_pic->p_heap->i_rmask = 0xff0000; p_pic->p_heap->i_rmask = 0xff0000;
p_pic->p_heap->i_gmask = 0x00ff00; p_pic->p_heap->i_gmask = 0x00ff00;
......
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