Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
84821085
Commit
84821085
authored
Apr 15, 2002
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Support for pictures with a pitch different from the picture width,
inspired by Gildas Bazin.
parent
051e23d9
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
161 additions
and
160 deletions
+161
-160
include/vdec_ext-plugins.h
include/vdec_ext-plugins.h
+1
-2
include/video.h
include/video.h
+4
-1
plugins/mpeg_system/mpeg_ps.c
plugins/mpeg_system/mpeg_ps.c
+4
-5
plugins/mpeg_vdec/video_decoder.c
plugins/mpeg_vdec/video_decoder.c
+39
-67
plugins/mpeg_vdec/video_parser.h
plugins/mpeg_vdec/video_parser.h
+5
-3
plugins/mpeg_vdec/vpar_blocks.c
plugins/mpeg_vdec/vpar_blocks.c
+86
-78
plugins/mpeg_vdec/vpar_headers.c
plugins/mpeg_vdec/vpar_headers.c
+8
-3
src/video_output/vout_pictures.c
src/video_output/vout_pictures.c
+14
-1
No files found.
include/vdec_ext-plugins.h
View file @
84821085
...
@@ -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.1
0 2002/04/05 01:05:22 gbazin
Exp $
* $Id: vdec_ext-plugins.h,v 1.1
1 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
;
...
...
include/video.h
View file @
84821085
...
@@ -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.4
8 2002/04/05 01:05:22 gbazin
Exp $
* $Id: video.h,v 1.4
9 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
)
{
{
...
...
plugins/mpeg_system/mpeg_ps.c
View file @
84821085
...
@@ -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.1
0 2002/04/10 17:47:58 jobi
Exp $
* $Id: mpeg_ps.c,v 1.1
1 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"
);
}
}
}
}
...
...
plugins/mpeg_vdec/video_decoder.c
View file @
84821085
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* video_decoder.c : video decoder thread
* video_decoder.c : video decoder thread
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* Copyright (C) 1999-2001 VideoLAN
* $Id: video_decoder.c,v 1.
6 2002/02/19 00:50:19 sam
Exp $
* $Id: video_decoder.c,v 1.
7 2002/04/15 23:04:08 massiot
Exp $
*
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Lespinasse <walken@zoy.org>
* Michel Lespinasse <walken@zoy.org>
...
@@ -222,63 +222,41 @@ static __inline__ void MotionBlock( vdec_pool_t * p_pool,
...
@@ -222,63 +222,41 @@ static __inline__ void MotionBlock( vdec_pool_t * p_pool,
/*****************************************************************************
/*****************************************************************************
* DecodeMacroblock: decode a macroblock
* DecodeMacroblock: decode a macroblock
*****************************************************************************/
*****************************************************************************/
#define DECODE_INTRA_BLOCK( i_b, p_dest
, I_CHROMA )
\
#define DECODE_INTRA_BLOCK( i_b, p_dest
)
\
p_idct = &p_mb->p_idcts[i_b]; \
p_idct = &p_mb->p_idcts[i_b]; \
p_idct->pf_idct( p_idct->pi_block, p_dest, \
p_idct->pf_idct( p_idct->pi_block, p_dest, \
i_b < 4 ? i_lum_dct_stride : \
i_b < 4 ? i_lum_dct_stride : i_chrom_dct_stride, \
I_CHROMA == CHROMA_420 ? \
p_vpar->picture.i_field_width >> 1 : \
i_chrom_dct_stride, \
p_vdec->p_idct_data, p_idct->i_sparse_pos );
p_vdec->p_idct_data, p_idct->i_sparse_pos );
#define DECODE_NONINTRA_BLOCK( i_b, p_dest
, I_CHROMA )
\
#define DECODE_NONINTRA_BLOCK( i_b, p_dest
)
\
if( p_mb->i_coded_block_pattern & (1 << (11 - (i_b))) ) \
if( p_mb->i_coded_block_pattern & (1 << (11 - (i_b))) ) \
{ \
{ \
DECODE_INTRA_BLOCK( i_b, p_dest
, I_CHROMA );
\
DECODE_INTRA_BLOCK( i_b, p_dest
);
\
}
}
#define DECLARE_DECODEMB( PSZ_NAME, I_CHROMA ) \
#define DECLARE_DECODEMB( PSZ_NAME, I_CHROMA ) \
void PSZ_NAME ( vdec_thread_t *p_vdec, macroblock_t * p_mb ) \
void PSZ_NAME ( vdec_thread_t *p_vdec, macroblock_t * p_mb ) \
{ \
{ \
int i, i_lum_dct_offset, i_lum_dct_stride; \
int i, i_lum_dct_offset, i_lum_dct_stride; \
/* This is to keep the compiler happy with CHROMA_420 and CHROMA_NONE */
\
int i_chrom_dct_offset, i_chrom_dct_stride; \
int i_chrom_dct_offset __attribute__((unused)); \
int i_chrom_dct_stride __attribute__((unused)); \
idct_inner_t * p_idct; \
idct_inner_t * p_idct; \
vdec_pool_t * p_pool = p_vdec->p_pool; \
vdec_pool_t * p_pool = p_vdec->p_pool; \
vpar_thread_t * p_vpar = p_pool->p_vpar; \
vpar_thread_t * p_vpar = p_pool->p_vpar; \
\
\
if( p_mb->i_mb_modes & DCT_TYPE_INTERLACED ) \
if( p_mb->i_mb_modes & DCT_TYPE_INTERLACED ) \
{ \
{ \
i_lum_dct_offset = p_vpar->picture.i_field_width; \
i_lum_dct_offset = p_vpar->picture.i_lum_stride; \
i_lum_dct_stride = p_vpar->picture.i_field_width * 2; \
i_lum_dct_stride = p_vpar->picture.i_lum_stride * 2; \
if( I_CHROMA == CHROMA_422 ) \
{ \
i_chrom_dct_offset = p_vpar->picture.i_field_width >> 1; \
i_chrom_dct_stride = p_vpar->picture.i_field_width; \
} \
else if( I_CHROMA == CHROMA_444 ) \
{ \
i_chrom_dct_offset = p_vpar->picture.i_field_width; \
i_chrom_dct_stride = p_vpar->picture.i_field_width * 2; \
} \
} \
} \
else \
else \
{ \
{ \
i_lum_dct_offset = p_vpar->picture.i_field_width * 8; \
i_lum_dct_offset = p_vpar->picture.i_lum_stride * 8; \
i_lum_dct_stride = p_vpar->picture.i_field_width; \
i_lum_dct_stride = p_vpar->picture.i_lum_stride; \
if( I_CHROMA == CHROMA_422 ) \
{ \
i_chrom_dct_offset = p_vpar->picture.i_field_width * 4; \
i_chrom_dct_stride = p_vpar->picture.i_field_width >> 1; \
} \
else if( I_CHROMA == CHROMA_444 ) \
{ \
i_chrom_dct_offset = p_vpar->picture.i_field_width * 8; \
i_chrom_dct_stride = p_vpar->picture.i_field_width; \
} \
} \
} \
\
\
i_chrom_dct_offset = p_vpar->picture.i_chrom_stride * 8; \
i_chrom_dct_stride = p_vpar->picture.i_chrom_stride; \
\
if( !(p_mb->i_mb_modes & MB_INTRA) ) \
if( !(p_mb->i_mb_modes & MB_INTRA) ) \
{ \
{ \
/* \
/* \
...
@@ -300,32 +278,28 @@ void PSZ_NAME ( vdec_thread_t *p_vdec, macroblock_t * p_mb ) \
...
@@ -300,32 +278,28 @@ void PSZ_NAME ( vdec_thread_t *p_vdec, macroblock_t * p_mb ) \
* adding prediction and coefficient data (ISO/IEC \
* adding prediction and coefficient data (ISO/IEC \
* 13818-2 section 7.6.8) \
* 13818-2 section 7.6.8) \
*/
\
*/
\
DECODE_NONINTRA_BLOCK( 0, p_mb->p_y_data, I_CHROMA ); \
DECODE_NONINTRA_BLOCK( 0, p_mb->p_y_data ); \
DECODE_NONINTRA_BLOCK( 1, p_mb->p_y_data + 8, I_CHROMA ); \
DECODE_NONINTRA_BLOCK( 1, p_mb->p_y_data + 8 ); \
DECODE_NONINTRA_BLOCK( 2, p_mb->p_y_data + i_lum_dct_offset, \
DECODE_NONINTRA_BLOCK( 2, p_mb->p_y_data + i_lum_dct_offset ); \
I_CHROMA ); \
DECODE_NONINTRA_BLOCK( 3, p_mb->p_y_data + i_lum_dct_offset + 8 ); \
DECODE_NONINTRA_BLOCK( 3, p_mb->p_y_data + i_lum_dct_offset + 8, \
I_CHROMA ); \
if( I_CHROMA != CHROMA_NONE ) \
if( I_CHROMA != CHROMA_NONE ) \
{ \
{ \
DECODE_NONINTRA_BLOCK( 4, p_mb->p_u_data
, I_CHROMA );
\
DECODE_NONINTRA_BLOCK( 4, p_mb->p_u_data
);
\
DECODE_NONINTRA_BLOCK( 5, p_mb->p_v_data
, I_CHROMA );
\
DECODE_NONINTRA_BLOCK( 5, p_mb->p_v_data
);
\
if( I_CHROMA != CHROMA_420 ) \
if( I_CHROMA != CHROMA_420 ) \
{ \
{ \
DECODE_NONINTRA_BLOCK( 6, p_mb->p_u_data \
DECODE_NONINTRA_BLOCK( 6, p_mb->p_u_data \
+ i_chrom_dct_offset
, I_CHROMA );
\
+ i_chrom_dct_offset
);
\
DECODE_NONINTRA_BLOCK( 7, p_mb->p_v_data \
DECODE_NONINTRA_BLOCK( 7, p_mb->p_v_data \
+ i_chrom_dct_offset
, I_CHROMA );
\
+ i_chrom_dct_offset
);
\
if( I_CHROMA == CHROMA_444 ) \
if( I_CHROMA == CHROMA_444 ) \
{ \
{ \
DECODE_NONINTRA_BLOCK( 8, p_mb->p_u_data + 8, \
DECODE_NONINTRA_BLOCK( 8, p_mb->p_u_data + 8 ); \
I_CHROMA ); \
DECODE_NONINTRA_BLOCK( 9, p_mb->p_v_data + 8 ); \
DECODE_NONINTRA_BLOCK( 9, p_mb->p_v_data + 8, \
I_CHROMA ); \
DECODE_NONINTRA_BLOCK( 10, p_mb->p_u_data + 8 \
DECODE_NONINTRA_BLOCK( 10, p_mb->p_u_data + 8 \
+ i_chrom_dct_offset
, I_CHROMA );
\
+ i_chrom_dct_offset
);
\
DECODE_NONINTRA_BLOCK( 11, p_mb->p_v_data + 8 \
DECODE_NONINTRA_BLOCK( 11, p_mb->p_v_data + 8 \
+ i_chrom_dct_offset
, I_CHROMA );
\
+ i_chrom_dct_offset
);
\
} \
} \
} \
} \
} \
} \
...
@@ -333,30 +307,28 @@ void PSZ_NAME ( vdec_thread_t *p_vdec, macroblock_t * p_mb ) \
...
@@ -333,30 +307,28 @@ void PSZ_NAME ( vdec_thread_t *p_vdec, macroblock_t * p_mb ) \
else \
else \
{ \
{ \
/* Intra macroblock */
\
/* Intra macroblock */
\
DECODE_INTRA_BLOCK( 0, p_mb->p_y_data, I_CHROMA ); \
DECODE_INTRA_BLOCK( 0, p_mb->p_y_data ); \
DECODE_INTRA_BLOCK( 1, p_mb->p_y_data + 8, I_CHROMA ); \
DECODE_INTRA_BLOCK( 1, p_mb->p_y_data + 8 ); \
DECODE_INTRA_BLOCK( 2, p_mb->p_y_data + i_lum_dct_offset, \
DECODE_INTRA_BLOCK( 2, p_mb->p_y_data + i_lum_dct_offset ); \
I_CHROMA ); \
DECODE_INTRA_BLOCK( 3, p_mb->p_y_data + i_lum_dct_offset + 8 ); \
DECODE_INTRA_BLOCK( 3, p_mb->p_y_data + i_lum_dct_offset + 8, \
I_CHROMA ); \
if( I_CHROMA != CHROMA_NONE ) \
if( I_CHROMA != CHROMA_NONE ) \
{ \
{ \
DECODE_INTRA_BLOCK( 4, p_mb->p_u_data
, I_CHROMA );
\
DECODE_INTRA_BLOCK( 4, p_mb->p_u_data
);
\
DECODE_INTRA_BLOCK( 5, p_mb->p_v_data
, I_CHROMA );
\
DECODE_INTRA_BLOCK( 5, p_mb->p_v_data
);
\
if( I_CHROMA != CHROMA_420 ) \
if( I_CHROMA != CHROMA_420 ) \
{ \
{ \
DECODE_INTRA_BLOCK( 6, p_mb->p_u_data \
DECODE_INTRA_BLOCK( 6, p_mb->p_u_data \
+ i_chrom_dct_offset
, I_CHROMA );
\
+ i_chrom_dct_offset
);
\
DECODE_INTRA_BLOCK( 7, p_mb->p_v_data \
DECODE_INTRA_BLOCK( 7, p_mb->p_v_data \
+ i_chrom_dct_offset
, I_CHROMA );
\
+ i_chrom_dct_offset
);
\
if( I_CHROMA == CHROMA_444 ) \
if( I_CHROMA == CHROMA_444 ) \
{ \
{ \
DECODE_INTRA_BLOCK( 8, p_mb->p_u_data + 8
, I_CHROMA );
\
DECODE_INTRA_BLOCK( 8, p_mb->p_u_data + 8
);
\
DECODE_INTRA_BLOCK( 9, p_mb->p_v_data + 8
, I_CHROMA );
\
DECODE_INTRA_BLOCK( 9, p_mb->p_v_data + 8
);
\
DECODE_INTRA_BLOCK( 10, p_mb->p_u_data + 8 \
DECODE_INTRA_BLOCK( 10, p_mb->p_u_data + 8 \
+ i_chrom_dct_offset
, I_CHROMA );
\
+ i_chrom_dct_offset
);
\
DECODE_INTRA_BLOCK( 11, p_mb->p_v_data + 8 \
DECODE_INTRA_BLOCK( 11, p_mb->p_v_data + 8 \
+ i_chrom_dct_offset
, I_CHROMA );
\
+ i_chrom_dct_offset
);
\
} \
} \
} \
} \
} \
} \
...
...
plugins/mpeg_vdec/video_parser.h
View file @
84821085
...
@@ -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
;
/*****************************************************************************
/*****************************************************************************
...
...
plugins/mpeg_vdec/vpar_blocks.c
View file @
84821085
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* vpar_blocks.c : blocks parsing
* vpar_blocks.c : blocks parsing
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* Copyright (C) 1999-2001 VideoLAN
* $Id: vpar_blocks.c,v 1.
7 2002/03/17 17:00:38 sam
Exp $
* $Id: vpar_blocks.c,v 1.
8 2002/04/15 23:04:08 massiot
Exp $
*
*
* Authors: Michel Lespinasse <walken@zoy.org>
* Authors: Michel Lespinasse <walken@zoy.org>
* Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
...
@@ -1160,7 +1160,7 @@ static void MotionMPEG1( vpar_thread_t * p_vpar,
...
@@ -1160,7 +1160,7 @@ static void MotionMPEG1( vpar_thread_t * p_vpar,
{
{
int
i_motion_x
,
i_motion_y
;
int
i_motion_x
,
i_motion_y
;
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_width
=
p_vpar
->
picture
.
i_
field_width
;
int
i_width
=
p_vpar
->
picture
.
i_
lum_stride
;
i_motion_x
=
p_motion
->
ppi_pmv
[
0
][
0
]
i_motion_x
=
p_motion
->
ppi_pmv
[
0
][
0
]
+
MotionDelta
(
p_vpar
,
p_motion
->
pi_f_code
[
0
]
);
+
MotionDelta
(
p_vpar
,
p_motion
->
pi_f_code
[
0
]
);
...
@@ -1189,7 +1189,7 @@ static void MotionMPEG1Reuse( vpar_thread_t * p_vpar,
...
@@ -1189,7 +1189,7 @@ static void MotionMPEG1Reuse( vpar_thread_t * p_vpar,
{
{
int
i_motion_x
,
i_motion_y
;
int
i_motion_x
,
i_motion_y
;
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_width
=
p_vpar
->
picture
.
i_
field_width
;
int
i_width
=
p_vpar
->
picture
.
i_
lum_stride
;
i_motion_x
=
p_motion
->
ppi_pmv
[
0
][
0
];
i_motion_x
=
p_motion
->
ppi_pmv
[
0
][
0
];
i_motion_y
=
p_motion
->
ppi_pmv
[
0
][
1
];
i_motion_y
=
p_motion
->
ppi_pmv
[
0
][
1
];
...
@@ -1213,7 +1213,7 @@ static void MotionFrameFrame( vpar_thread_t * p_vpar,
...
@@ -1213,7 +1213,7 @@ static void MotionFrameFrame( vpar_thread_t * p_vpar,
{
{
int
i_motion_x
,
i_motion_y
;
int
i_motion_x
,
i_motion_y
;
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_width
=
p_vpar
->
picture
.
i_
field_width
;
int
i_width
=
p_vpar
->
picture
.
i_
lum_stride
;
i_motion_x
=
p_motion
->
ppi_pmv
[
0
][
0
]
i_motion_x
=
p_motion
->
ppi_pmv
[
0
][
0
]
+
MotionDelta
(
p_vpar
,
p_motion
->
pi_f_code
[
0
]
);
+
MotionDelta
(
p_vpar
,
p_motion
->
pi_f_code
[
0
]
);
...
@@ -1236,7 +1236,7 @@ static void MotionFrameField( vpar_thread_t * p_vpar,
...
@@ -1236,7 +1236,7 @@ static void MotionFrameField( vpar_thread_t * p_vpar,
{
{
int
i_motion_x
,
i_motion_y
,
i_field_select
;
int
i_motion_x
,
i_motion_y
,
i_field_select
;
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_width
=
p_vpar
->
picture
.
i_
field_width
;
int
i_width
=
p_vpar
->
picture
.
i_
lum_stride
;
i_field_select
=
GetSignedBits
(
&
p_vpar
->
bit_stream
,
1
);
i_field_select
=
GetSignedBits
(
&
p_vpar
->
bit_stream
,
1
);
...
@@ -1284,7 +1284,7 @@ static void MotionFrameDMV( vpar_thread_t * p_vpar,
...
@@ -1284,7 +1284,7 @@ static void MotionFrameDMV( vpar_thread_t * p_vpar,
int
i_tmp_x
,
i_tmp_y
;
int
i_tmp_x
,
i_tmp_y
;
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_width
=
p_vpar
->
picture
.
i_
field_width
;
int
i_width
=
p_vpar
->
picture
.
i_
lum_stride
;
int
m
;
int
m
;
i_motion_x
=
p_motion
->
ppi_pmv
[
0
][
0
]
i_motion_x
=
p_motion
->
ppi_pmv
[
0
][
0
]
...
@@ -1326,7 +1326,7 @@ static void MotionFrameZero( vpar_thread_t * p_vpar,
...
@@ -1326,7 +1326,7 @@ static void MotionFrameZero( vpar_thread_t * p_vpar,
boolean_t
b_average
)
boolean_t
b_average
)
{
{
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_width
=
p_vpar
->
picture
.
i_
field_width
;
int
i_width
=
p_vpar
->
picture
.
i_
lum_stride
;
MOTION_BLOCK
(
b_average
,
0
,
0
,
i_offset
,
p_motion
->
pppi_ref
[
0
],
MOTION_BLOCK
(
b_average
,
0
,
0
,
i_offset
,
p_motion
->
pppi_ref
[
0
],
i_offset
,
i_width
,
16
,
0
);
i_offset
,
i_width
,
16
,
0
);
...
@@ -1338,7 +1338,7 @@ static void MotionFrameReuse( vpar_thread_t * p_vpar,
...
@@ -1338,7 +1338,7 @@ static void MotionFrameReuse( vpar_thread_t * p_vpar,
boolean_t
b_average
)
boolean_t
b_average
)
{
{
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_width
=
p_vpar
->
picture
.
i_
field_width
;
int
i_width
=
p_vpar
->
picture
.
i_
lum_stride
;
MOTION_BLOCK
(
b_average
,
p_motion
->
ppi_pmv
[
0
][
0
],
p_motion
->
ppi_pmv
[
0
][
1
],
MOTION_BLOCK
(
b_average
,
p_motion
->
ppi_pmv
[
0
][
0
],
p_motion
->
ppi_pmv
[
0
][
1
],
i_offset
,
p_motion
->
pppi_ref
[
0
],
i_offset
,
i_width
,
16
,
0
);
i_offset
,
p_motion
->
pppi_ref
[
0
],
i_offset
,
i_width
,
16
,
0
);
...
@@ -1354,7 +1354,7 @@ static void MotionFieldField( vpar_thread_t * p_vpar,
...
@@ -1354,7 +1354,7 @@ static void MotionFieldField( vpar_thread_t * p_vpar,
int
i_motion_x
,
i_motion_y
;
int
i_motion_x
,
i_motion_y
;
boolean_t
b_field_select
;
boolean_t
b_field_select
;
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_width
=
p_vpar
->
picture
.
i_
field_width
;
int
i_width
=
p_vpar
->
picture
.
i_
lum_stride
;
b_field_select
=
GetBits
(
&
p_vpar
->
bit_stream
,
1
);
b_field_select
=
GetBits
(
&
p_vpar
->
bit_stream
,
1
);
...
@@ -1380,7 +1380,7 @@ static void MotionField16x8( vpar_thread_t * p_vpar,
...
@@ -1380,7 +1380,7 @@ static void MotionField16x8( vpar_thread_t * p_vpar,
int
i_motion_x
,
i_motion_y
;
int
i_motion_x
,
i_motion_y
;
boolean_t
b_field_select
;
boolean_t
b_field_select
;
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_width
=
p_vpar
->
picture
.
i_
field_width
;
int
i_width
=
p_vpar
->
picture
.
i_
lum_stride
;
/* First half. */
/* First half. */
b_field_select
=
GetBits
(
&
p_vpar
->
bit_stream
,
1
);
b_field_select
=
GetBits
(
&
p_vpar
->
bit_stream
,
1
);
...
@@ -1423,7 +1423,7 @@ static void MotionFieldDMV( vpar_thread_t * p_vpar,
...
@@ -1423,7 +1423,7 @@ static void MotionFieldDMV( vpar_thread_t * p_vpar,
int
i_motion_x
,
i_motion_y
;
int
i_motion_x
,
i_motion_y
;
int
i_dmv_x
,
i_dmv_y
;
int
i_dmv_x
,
i_dmv_y
;
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_width
=
p_vpar
->
picture
.
i_
field_width
;
int
i_width
=
p_vpar
->
picture
.
i_
lum_stride
;
boolean_t
b_current_field
=
p_vpar
->
picture
.
b_current_field
;
boolean_t
b_current_field
=
p_vpar
->
picture
.
b_current_field
;
i_motion_x
=
p_motion
->
ppi_pmv
[
0
][
0
]
i_motion_x
=
p_motion
->
ppi_pmv
[
0
][
0
]
...
@@ -1458,7 +1458,7 @@ static void MotionFieldZero( vpar_thread_t * p_vpar,
...
@@ -1458,7 +1458,7 @@ static void MotionFieldZero( vpar_thread_t * p_vpar,
boolean_t
b_average
)
boolean_t
b_average
)
{
{
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_width
=
p_vpar
->
picture
.
i_
field_width
;
int
i_width
=
p_vpar
->
picture
.
i_
lum_stride
;
boolean_t
b_current_field
=
p_vpar
->
picture
.
b_current_field
;
boolean_t
b_current_field
=
p_vpar
->
picture
.
b_current_field
;
MOTION_BLOCK
(
b_average
,
0
,
0
,
i_offset
,
p_motion
->
pppi_ref
[
b_current_field
],
MOTION_BLOCK
(
b_average
,
0
,
0
,
i_offset
,
p_motion
->
pppi_ref
[
b_current_field
],
...
@@ -1471,7 +1471,7 @@ static void MotionFieldReuse( vpar_thread_t * p_vpar,
...
@@ -1471,7 +1471,7 @@ static void MotionFieldReuse( vpar_thread_t * p_vpar,
boolean_t
b_average
)
boolean_t
b_average
)
{
{
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_offset
=
p_vpar
->
mb
.
i_offset
;
int
i_width
=
p_vpar
->
picture
.
i_
field_width
;
int
i_width
=
p_vpar
->
picture
.
i_
lum_stride
;
boolean_t
b_current_field
=
p_vpar
->
picture
.
b_current_field
;
boolean_t
b_current_field
=
p_vpar
->
picture
.
b_current_field
;
MOTION_BLOCK
(
b_average
,
p_motion
->
ppi_pmv
[
0
][
0
],
p_motion
->
ppi_pmv
[
0
][
1
],
MOTION_BLOCK
(
b_average
,
p_motion
->
ppi_pmv
[
0
][
0
],
p_motion
->
ppi_pmv
[
0
][
1
],
...
@@ -1735,24 +1735,24 @@ mb_intra:
...
@@ -1735,24 +1735,24 @@ mb_intra:
#define CHECK_BOUNDARIES \
#define CHECK_BOUNDARIES \
i_offset = p_vpar->mb.i_offset; \
i_offset = p_vpar->mb.i_offset; \
if( i_offset ==
i_width )
\
if( i_offset ==
p_vpar->picture.i_field_width )
\
{ \
{ \
if( i_coding_type != I_CODING_TYPE || \
if( i_coding_type != I_CODING_TYPE || \
p_vpar->picture.b_concealment_mv ) \
p_vpar->picture.b_concealment_mv ) \
{ \
{ \
p_f_motion->pppi_ref[0][0] +=
16 * i_offset;
\
p_f_motion->pppi_ref[0][0] +=
i_lum_vsize;
\
p_f_motion->pppi_ref[0][1] += i_chrom
a_tmp;
\
p_f_motion->pppi_ref[0][1] += i_chrom
_vsize;
\
p_f_motion->pppi_ref[0][2] += i_chrom
a_tmp;
\
p_f_motion->pppi_ref[0][2] += i_chrom
_vsize;
\
} \
} \
if( i_coding_type == B_CODING_TYPE ) \
if( i_coding_type == B_CODING_TYPE ) \
{ \
{ \
p_b_motion->pppi_ref[0][0] +=
16 * i_offset;
\
p_b_motion->pppi_ref[0][0] +=
i_lum_vsize;
\
p_b_motion->pppi_ref[0][1] += i_chrom
a_tmp;
\
p_b_motion->pppi_ref[0][1] += i_chrom
_vsize;
\
p_b_motion->pppi_ref[0][2] += i_chrom
a_tmp;
\
p_b_motion->pppi_ref[0][2] += i_chrom
_vsize;
\
} \
} \
p_dest[0] +=
16 * i_offset;
\
p_dest[0] +=
i_lum_vsize;
\
p_dest[1] +=
4 * i_offset;
\
p_dest[1] +=
i_chrom_vsize;
\
p_dest[2] +=
4 * i_offset;
\
p_dest[2] +=
i_chrom_vsize;
\
i_offset = 0; \
i_offset = 0; \
} \
} \
p_vpar->mb.i_offset = i_offset;
p_vpar->mb.i_offset = i_offset;
...
@@ -1769,7 +1769,7 @@ static __inline__ void ParseSlice( vpar_thread_t * p_vpar,
...
@@ -1769,7 +1769,7 @@ static __inline__ void ParseSlice( vpar_thread_t * p_vpar,
u32
i_vert_code
,
boolean_t
b_mpeg2
,
u32
i_vert_code
,
boolean_t
b_mpeg2
,
int
i_coding_type
,
int
i_structure
)
int
i_coding_type
,
int
i_structure
)
{
{
int
i_
offset
,
i_width
,
i_chroma_tmp
;
int
i_
lum_offset
,
i_chrom_offset
,
i_offset
,
i_lum_vsize
,
i_chrom_vsize
;
picture_t
*
pp_forward_ref
[
2
];
picture_t
*
pp_forward_ref
[
2
];
yuv_data_t
*
p_dest
[
3
];
yuv_data_t
*
p_dest
[
3
];
...
@@ -1791,19 +1791,23 @@ static __inline__ void ParseSlice( vpar_thread_t * p_vpar,
...
@@ -1791,19 +1791,23 @@ static __inline__ void ParseSlice( vpar_thread_t * p_vpar,
}
}
/* Calculate the position of the macroblock. */
/* Calculate the position of the macroblock. */
i_width
=
p_vpar
->
sequence
.
i_width
;
i_lum_offset
=
(
i_vert_code
-
1
)
*
p_vpar
->
picture
.
p_picture
->
Y_PITCH
*
16
;
i_offset
=
(
i_vert_code
-
1
)
*
i_width
*
4
;
i_chrom_offset
=
(
i_vert_code
-
1
)
*
p_vpar
->
picture
.
p_picture
->
U_PITCH
*
8
*
(
2
-
p_vpar
->
sequence
.
b_chroma_v_subsampled
);
i_lum_vsize
=
16
*
p_vpar
->
picture
.
p_picture
->
Y_PITCH
;
i_chrom_vsize
=
8
*
(
2
-
p_vpar
->
sequence
.
b_chroma_v_subsampled
)
*
p_vpar
->
picture
.
p_picture
->
U_PITCH
;
/* Initialize motion context. */
/* Initialize motion context. */
pp_forward_ref
[
0
]
=
p_vpar
->
sequence
.
p_forward
;
pp_forward_ref
[
0
]
=
p_vpar
->
sequence
.
p_forward
;
if
(
i_structure
!=
FRAME_STRUCTURE
)
if
(
i_structure
!=
FRAME_STRUCTURE
)
{
{
i_offset
<<=
1
;
i_
lum_
offset
<<=
1
;
i_chrom
a_tmp
=
i_chrom
_offset
<<=
1
;
i_offset
*
(
2
-
p_vpar
->
sequence
.
b_chroma_v_subsampled
)
i_lum_vsize
<<=
1
;
*
(
2
-
p_vpar
->
sequence
.
b_chroma_h_subsampled
)
i_chrom_vsize
<<=
1
;
+
(
i_width
>>
p_vpar
->
sequence
.
b_chroma_h_subsampled
);
pp_forward_ref
[
1
]
=
p_vpar
->
sequence
.
p_forward
;
pp_forward_ref
[
1
]
=
p_vpar
->
sequence
.
p_forward
;
if
(
i_coding_type
!=
B_CODING_TYPE
&&
p_vpar
->
picture
.
b_second_field
)
if
(
i_coding_type
!=
B_CODING_TYPE
&&
p_vpar
->
picture
.
b_second_field
)
...
@@ -1813,32 +1817,34 @@ static __inline__ void ParseSlice( vpar_thread_t * p_vpar,
...
@@ -1813,32 +1817,34 @@ static __inline__ void ParseSlice( vpar_thread_t * p_vpar,
}
}
if
(
i_coding_type
!=
I_CODING_TYPE
||
p_vpar
->
picture
.
b_concealment_mv
)
if
(
i_coding_type
!=
I_CODING_TYPE
||
p_vpar
->
picture
.
b_concealment_mv
)
{
{
p_f_motion
->
pppi_ref
[
1
][
0
]
=
int
i_tmp
;
pp_forward_ref
[
1
]
->
Y_PIXELS
+
i_offset
*
4
+
i_width
;
p_f_motion
->
pppi_ref
[
1
][
0
]
=
pp_forward_ref
[
1
]
->
Y_PIXELS
+
p_f_motion
->
pppi_ref
[
1
][
1
]
=
i_lum_offset
+
pp_forward_ref
[
1
]
->
Y_PITCH
;
pp_forward_ref
[
1
]
->
U_PIXELS
+
i_chroma_tmp
;
p_f_motion
->
pppi_ref
[
1
][
1
]
=
pp_forward_ref
[
1
]
->
U_PIXELS
+
p_f_motion
->
pppi_ref
[
1
][
2
]
=
(
i_tmp
=
i_chrom_offset
+
pp_forward_ref
[
1
]
->
U_PITCH
);
pp_forward_ref
[
1
]
->
V_PIXELS
+
i_chroma_tmp
;
p_f_motion
->
pppi_ref
[
1
][
2
]
=
pp_forward_ref
[
1
]
->
V_PIXELS
+
i_tmp
;
}
}
if
(
i_coding_type
==
B_CODING_TYPE
)
if
(
i_coding_type
==
B_CODING_TYPE
)
{
{
p_b_motion
->
pppi_ref
[
1
][
0
]
=
int
i_tmp
;
p_vpar
->
sequence
.
p_backward
->
Y_PIXELS
+
i_offset
*
4
+
i_width
;
p_b_motion
->
pppi_ref
[
1
][
0
]
=
p_vpar
->
sequence
.
p_backward
->
Y_PIXELS
p_b_motion
->
pppi_ref
[
1
][
1
]
=
+
i_lum_offset
+
p_vpar
->
sequence
.
p_backward
->
Y_PITCH
;
p_vpar
->
sequence
.
p_backward
->
U_PIXELS
+
i_chroma_tmp
;
p_b_motion
->
pppi_ref
[
1
][
1
]
=
p_vpar
->
sequence
.
p_backward
->
U_PIXELS
p_b_motion
->
pppi_ref
[
1
][
2
]
=
+
(
i_tmp
=
i_chrom_offset
+
p_vpar
->
sequence
.
p_backward
->
U_PITCH
);
p_vpar
->
sequence
.
p_backward
->
V_PIXELS
+
i_chroma_tmp
;
p_b_motion
->
pppi_ref
[
1
][
2
]
=
p_vpar
->
sequence
.
p_backward
->
V_PIXELS
+
i_tmp
;
}
}
}
}
i_chroma_tmp
=
i_offset
*
(
2
-
p_vpar
->
sequence
.
b_chroma_v_subsampled
)
*
(
2
-
p_vpar
->
sequence
.
b_chroma_h_subsampled
);
if
(
i_coding_type
!=
I_CODING_TYPE
||
p_vpar
->
picture
.
b_concealment_mv
)
if
(
i_coding_type
!=
I_CODING_TYPE
||
p_vpar
->
picture
.
b_concealment_mv
)
{
{
p_f_motion
->
pppi_ref
[
0
][
0
]
=
pp_forward_ref
[
0
]
->
Y_PIXELS
+
i_offset
*
4
;
p_f_motion
->
pppi_ref
[
0
][
0
]
=
pp_forward_ref
[
0
]
->
Y_PIXELS
+
p_f_motion
->
pppi_ref
[
0
][
1
]
=
pp_forward_ref
[
0
]
->
U_PIXELS
+
i_chroma_tmp
;
i_lum_offset
;
p_f_motion
->
pppi_ref
[
0
][
2
]
=
pp_forward_ref
[
0
]
->
V_PIXELS
+
i_chroma_tmp
;
p_f_motion
->
pppi_ref
[
0
][
1
]
=
pp_forward_ref
[
0
]
->
U_PIXELS
+
i_chrom_offset
;
p_f_motion
->
pppi_ref
[
0
][
2
]
=
pp_forward_ref
[
0
]
->
V_PIXELS
+
i_chrom_offset
;
p_f_motion
->
pi_f_code
[
0
]
=
p_vpar
->
picture
.
ppi_f_code
[
0
][
0
];
p_f_motion
->
pi_f_code
[
0
]
=
p_vpar
->
picture
.
ppi_f_code
[
0
][
0
];
p_f_motion
->
pi_f_code
[
1
]
=
p_vpar
->
picture
.
ppi_f_code
[
0
][
1
];
p_f_motion
->
pi_f_code
[
1
]
=
p_vpar
->
picture
.
ppi_f_code
[
0
][
1
];
p_f_motion
->
ppi_pmv
[
0
][
0
]
=
p_f_motion
->
ppi_pmv
[
0
][
1
]
=
0
;
p_f_motion
->
ppi_pmv
[
0
][
0
]
=
p_f_motion
->
ppi_pmv
[
0
][
1
]
=
0
;
...
@@ -1847,12 +1853,12 @@ static __inline__ void ParseSlice( vpar_thread_t * p_vpar,
...
@@ -1847,12 +1853,12 @@ static __inline__ void ParseSlice( vpar_thread_t * p_vpar,
if
(
i_coding_type
==
B_CODING_TYPE
)
if
(
i_coding_type
==
B_CODING_TYPE
)
{
{
p_b_motion
->
pppi_ref
[
0
][
0
]
=
p_vpar
->
sequence
.
p_backward
->
Y_PIXELS
p_b_motion
->
pppi_ref
[
0
][
0
]
=
p_vpar
->
sequence
.
p_backward
->
Y_PIXELS
+
+
i_offset
*
4
;
i_lum_offset
;
p_b_motion
->
pppi_ref
[
0
][
1
]
=
p_vpar
->
sequence
.
p_backward
->
U_PIXELS
p_b_motion
->
pppi_ref
[
0
][
1
]
=
p_vpar
->
sequence
.
p_backward
->
U_PIXELS
+
+
i_chroma_tmp
;
i_chrom_offset
;
p_b_motion
->
pppi_ref
[
0
][
2
]
=
p_vpar
->
sequence
.
p_backward
->
V_PIXELS
p_b_motion
->
pppi_ref
[
0
][
2
]
=
p_vpar
->
sequence
.
p_backward
->
V_PIXELS
+
+
i_chroma_tmp
;
i_chrom_offset
;
p_b_motion
->
pi_f_code
[
0
]
=
p_vpar
->
picture
.
ppi_f_code
[
1
][
0
];
p_b_motion
->
pi_f_code
[
0
]
=
p_vpar
->
picture
.
ppi_f_code
[
1
][
0
];
p_b_motion
->
pi_f_code
[
1
]
=
p_vpar
->
picture
.
ppi_f_code
[
1
][
1
];
p_b_motion
->
pi_f_code
[
1
]
=
p_vpar
->
picture
.
ppi_f_code
[
1
][
1
];
p_b_motion
->
ppi_pmv
[
0
][
0
]
=
p_b_motion
->
ppi_pmv
[
0
][
1
]
=
0
;
p_b_motion
->
ppi_pmv
[
0
][
0
]
=
p_b_motion
->
ppi_pmv
[
0
][
1
]
=
0
;
...
@@ -1860,17 +1866,19 @@ static __inline__ void ParseSlice( vpar_thread_t * p_vpar,
...
@@ -1860,17 +1866,19 @@ static __inline__ void ParseSlice( vpar_thread_t * p_vpar,
}
}
/* Initialize destination pointers. */
/* Initialize destination pointers. */
p_dest
[
0
]
=
p_vpar
->
picture
.
p_picture
->
Y_PIXELS
+
i_offset
*
4
;
p_dest
[
0
]
=
p_vpar
->
picture
.
p_picture
->
Y_PIXELS
+
p_dest
[
1
]
=
p_vpar
->
picture
.
p_picture
->
U_PIXELS
+
i_chroma_tmp
;
i_lum_offset
;
p_dest
[
2
]
=
p_vpar
->
picture
.
p_picture
->
V_PIXELS
+
i_chroma_tmp
;
p_dest
[
1
]
=
p_vpar
->
picture
.
p_picture
->
U_PIXELS
+
i_chrom_offset
;
p_dest
[
2
]
=
p_vpar
->
picture
.
p_picture
->
V_PIXELS
+
i_chrom_offset
;
if
(
i_structure
==
BOTTOM_FIELD
)
if
(
i_structure
==
BOTTOM_FIELD
)
{
{
p_dest
[
0
]
+=
i_width
;
p_dest
[
0
]
+=
p_vpar
->
picture
.
p_picture
->
Y_PITCH
;
p_dest
[
1
]
+=
i_width
>>
p_vpar
->
sequence
.
b_chroma_h_subsampled
;
p_dest
[
1
]
+=
p_vpar
->
picture
.
p_picture
->
U_PITCH
;
p_dest
[
2
]
+=
i_width
>>
p_vpar
->
sequence
.
b_chroma_h_subsampled
;
p_dest
[
2
]
+=
p_vpar
->
picture
.
p_picture
->
U_PITCH
;
}
}
i_width
=
p_vpar
->
picture
.
i_field_width
;
/* Reset intra DC coefficients predictors (ISO/IEC 13818-2 7.2.1). */
/* Reset intra DC coefficients predictors (ISO/IEC 13818-2 7.2.1). */
p_vpar
->
mb
.
pi_dc_dct_pred
[
0
]
=
p_vpar
->
mb
.
pi_dc_dct_pred
[
1
]
p_vpar
->
mb
.
pi_dc_dct_pred
[
0
]
=
p_vpar
->
mb
.
pi_dc_dct_pred
[
1
]
...
@@ -1879,22 +1887,22 @@ static __inline__ void ParseSlice( vpar_thread_t * p_vpar,
...
@@ -1879,22 +1887,22 @@ static __inline__ void ParseSlice( vpar_thread_t * p_vpar,
p_vpar
->
mb
.
i_offset
=
MacroblockAddressIncrement
(
p_vpar
)
<<
4
;
p_vpar
->
mb
.
i_offset
=
MacroblockAddressIncrement
(
p_vpar
)
<<
4
;
i_chroma_tmp
=
i_width
*
4
*
(
2
-
p_vpar
->
sequence
.
b_chroma_v_subsampled
)
*
(
2
-
p_vpar
->
sequence
.
b_chroma_h_subsampled
);
while
(
(
int
)(
p_vpar
->
mb
.
i_offset
-
p_vpar
->
sequence
.
i_width
)
>=
0
)
while
(
(
int
)(
p_vpar
->
mb
.
i_offset
-
p_vpar
->
sequence
.
i_width
)
>=
0
)
{
{
/* Unusual construct at the start of some slices. Jump one line. */
/* Unusual construct at the start of some slices. Jump one line. */
p_vpar
->
mb
.
i_offset
-=
p_vpar
->
sequence
.
i_width
;
p_vpar
->
mb
.
i_offset
-=
p_vpar
->
sequence
.
i_width
;
p_dest
[
0
]
+=
i_width
*
16
;
p_dest
[
1
]
+=
i_chroma_tmp
;
p_dest
[
0
]
+=
i_lum_vsize
;
p_dest
[
2
]
+=
i_chroma_tmp
;
p_dest
[
1
]
+=
i_chrom_vsize
;
p_f_motion
->
pppi_ref
[
0
][
0
]
+=
i_width
*
16
;
p_dest
[
2
]
+=
i_chrom_vsize
;
p_f_motion
->
pppi_ref
[
0
][
1
]
+=
i_chroma_tmp
;
p_f_motion
->
pppi_ref
[
0
][
2
]
+=
i_chroma_tmp
;
p_f_motion
->
pppi_ref
[
0
][
0
]
+=
i_lum_vsize
;
p_f_motion
->
pppi_ref
[
1
][
0
]
+=
i_width
*
16
;
p_f_motion
->
pppi_ref
[
0
][
1
]
+=
i_chrom_vsize
;
p_f_motion
->
pppi_ref
[
1
][
1
]
+=
i_chroma_tmp
;
p_f_motion
->
pppi_ref
[
0
][
2
]
+=
i_chrom_vsize
;
p_f_motion
->
pppi_ref
[
1
][
2
]
+=
i_chroma_tmp
;
p_f_motion
->
pppi_ref
[
1
][
0
]
+=
i_lum_vsize
;
p_f_motion
->
pppi_ref
[
1
][
1
]
+=
i_chrom_vsize
;
p_f_motion
->
pppi_ref
[
1
][
2
]
+=
i_chrom_vsize
;
}
}
for
(
;
;
)
for
(
;
;
)
...
...
plugins/mpeg_vdec/vpar_headers.c
View file @
84821085
...
@@ -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.1
7 2002/03/17 17:00:38 sam
Exp $
* $Id: vpar_headers.c,v 1.1
8 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
)
{
{
...
...
src/video_output/vout_pictures.c
View file @
84821085
...
@@ -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.2
0 2002/04/05 01:05:22 gbazin
Exp $
* $Id: vout_pictures.c,v 1.2
1 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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment