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
667b4eb4
Commit
667b4eb4
authored
Jan 04, 2000
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correction de 1242 fautes de frappe et includes foireux. Presque tout
compile presque.
parent
ea23960c
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
80 additions
and
51 deletions
+80
-51
include/vdec_idct.h
include/vdec_idct.h
+3
-0
include/vdec_motion.h
include/vdec_motion.h
+2
-0
include/video_decoder.h.new
include/video_decoder.h.new
+4
-7
include/vpar_blocks.h
include/vpar_blocks.h
+3
-3
src/video_decoder/vdec_idct.c
src/video_decoder/vdec_idct.c
+7
-3
src/video_decoder/vdec_motion.c
src/video_decoder/vdec_motion.c
+8
-4
src/video_decoder/video_decoder.c
src/video_decoder/video_decoder.c
+16
-12
src/video_parser/vpar_blocks.c
src/video_parser/vpar_blocks.c
+29
-20
src/video_parser/vpar_headers.c
src/video_parser/vpar_headers.c
+1
-0
src/video_parser/vpar_motion.c
src/video_parser/vpar_motion.c
+7
-2
No files found.
include/vdec_idct.h
View file @
667b4eb4
...
...
@@ -23,3 +23,6 @@ typedef void (*f_idct_t)( elem_t*, int );
/*****************************************************************************
* Prototypes
*****************************************************************************/
void
vdec_DummyIDCT
(
elem_t
*
,
int
);
void
vdec_SparseIDCT
(
elem_t
*
,
int
);
void
vdec_IDCT
(
elem_t
*
,
int
);
include/vdec_motion.h
View file @
667b4eb4
...
...
@@ -23,3 +23,5 @@ typedef void (*f_chroma_motion_t)( struct macroblock_s* );
/*****************************************************************************
* Prototypes
*****************************************************************************/
void
vdec_MotionField
(
struct
macroblock_s
*
);
void
vdec_MotionFrame
(
struct
macroblock_s
*
);
include/video_decoder.h.new
View file @
667b4eb4
...
...
@@ -35,7 +35,7 @@ typedef struct vdec_thread_s
/* Input properties */
struct v
ideo_parser_s * p_vpar;
/* video_parser thread */
struct v
par_thread_s * p_vpar;
/* video_parser thread */
#ifdef STATS
/* Statistics */
...
...
@@ -64,9 +64,6 @@ struct vpar_thread_s;
/* Thread management functions */
vdec_thread_t * vdec_CreateThread ( struct vpar_thread_s *p_vpar /*, int *pi_status */ );
void vdec_DestroyThread ( vdec_thread_t *p_vdec /*, int *pi_status */ );
/* Time management functions */
/* ?? */
/* Dynamic thread settings */
/* ?? */
void vdec_AddBlock( elem_t*, data_t*, int );
void vdec_CopyBlock( elem_t*, data_t*, int );
void vdec_DummyBlock( elem_t*, data_t*, int );
include/vpar_blocks.h
View file @
667b4eb4
...
...
@@ -81,9 +81,9 @@ typedef struct
/*****************************************************************************
* Prototypes
*****************************************************************************/
void
vpar_CodedPattern420
(
struct
vpar_thread_s
*
p_vpar
);
void
vpar_CodedPattern422
(
struct
vpar_thread_s
*
p_vpar
);
void
vpar_CodedPattern444
(
struct
vpar_thread_s
*
p_vpar
);
int
vpar_CodedPattern420
(
struct
vpar_thread_s
*
p_vpar
);
int
vpar_CodedPattern422
(
struct
vpar_thread_s
*
p_vpar
);
int
vpar_CodedPattern444
(
struct
vpar_thread_s
*
p_vpar
);
int
vpar_IMBType
(
struct
vpar_thread_s
*
p_vpar
);
int
vpar_PMBType
(
struct
vpar_thread_s
*
p_vpar
);
int
vpar_BMBType
(
struct
vpar_thread_s
*
p_vpar
);
...
...
src/video_decoder/vdec_idct.c
View file @
667b4eb4
...
...
@@ -28,11 +28,15 @@
#include "decoder_fifo.h"
#include "video.h"
#include "video_output.h"
#include "video_parser.h"
#include "undec_picture.h"
#include "video_fifo.h"
#include "vdec_idct.h"
#include "video_decoder.h"
#include "vdec_motion.h"
#include "vpar_blocks.h"
#include "vpar_headers.h"
#include "video_fifo.h"
#include "video_parser.h"
/*
* Local prototypes
...
...
src/video_decoder/vdec_motion.c
View file @
667b4eb4
...
...
@@ -28,17 +28,21 @@
#include "decoder_fifo.h"
#include "video.h"
#include "video_output.h"
#include "video_parser.h"
#include "undec_picture.h"
#include "video_fifo.h"
#include "vdec_idct.h"
#include "video_decoder.h"
#include "vdec_motion.h"
#include "vpar_blocks.h"
#include "vpar_headers.h"
#include "video_fifo.h"
#include "video_parser.h"
/*
* Local prototypes
*/
typedef
(
void
*
)
f_motion_c_t
(
coeff_t
*
,
pel_lookup_table_t
*
,
typedef
void
(
*
f_motion_c_t
)
(
coeff_t
*
,
pel_lookup_table_t
*
,
int
,
coeff_t
*
,
int
,
int
,
int
,
int
,
int
,
int
,
int
);
...
...
src/video_decoder/video_decoder.c
View file @
667b4eb4
...
...
@@ -30,11 +30,15 @@
#include "decoder_fifo.h"
#include "video.h"
#include "video_output.h"
#include "video_parser.h"
#include "undec_picture.h"
#include "video_fifo.h"
#include "vdec_idct.h"
#include "video_decoder.h"
#include "vdec_motion.h"
#include "vpar_blocks.h"
#include "vpar_headers.h"
#include "video_fifo.h"
#include "video_parser.h"
/*
* Local prototypes
...
...
@@ -167,7 +171,7 @@ static void RunThread( vdec_thread_t *p_vdec )
{
macroblock_t
*
p_mb
;
if
(
(
p_mb
=
GetMacroblock
(
&
p_vdec
->
p_vpar
.
vfifo
))
!=
NULL
)
if
(
(
p_mb
=
vpar_GetMacroblock
(
&
p_vdec
->
p_vpar
->
vfifo
))
!=
NULL
)
{
DecodeMacroblock
(
p_vdec
,
p_mb
);
}
...
...
@@ -195,13 +199,13 @@ static void RunThread( vdec_thread_t *p_vdec )
*******************************************************************************/
static
void
ErrorThread
(
vdec_thread_t
*
p_vdec
)
{
undec_picture_t
*
p_undec_p
;
macroblock_t
*
p_mb
;
/* Wait until a `die' order */
while
(
!
p_vdec
->
b_die
)
{
p_
undec_p
=
GetPicture
(
p_vdec
->
p_vpar
.
vfifo
);
DestroyPicture
(
p_vdec
->
p_vpar
.
vfifo
,
p_undec_p
);
p_
mb
=
vpar_GetMacroblock
(
&
p_vdec
->
p_vpar
->
vfifo
);
vpar_DestroyMacroblock
(
&
p_vdec
->
p_vpar
->
vfifo
,
p_mb
);
/* Sleep a while */
msleep
(
VDEC_IDLE_SLEEP
);
...
...
@@ -237,12 +241,12 @@ static void DecodeMacroblock( vdec_thread_t *p_vdec, macroblock_t * p_mb )
/*
* Inverse DCT (ISO/IEC 13818-2 section Annex A)
*/
(
*
p_mb
->
pf_idct
[
i_b
])(
p_mb
,
p_mb
->
ppi_blocks
[
i_b
],
p_mb
->
pi_sparse_pos
[
i_b
]
);
(
p_mb
->
pf_idct
[
i_b
])(
p_mb
->
ppi_blocks
[
i_b
],
p_mb
->
pi_sparse_pos
[
i_b
]
);
/*
* Adding prediction and coefficient data (ISO/IEC 13818-2 section 7.6.8)
*/
(
*
p_mb
->
pf_addb
[
i_b
])(
p_mb
->
ppi_blocks
[
i_b
],
(
p_mb
->
pf_addb
[
i_b
])(
p_mb
->
ppi_blocks
[
i_b
],
p_mb
->
p_data
[
i_b
],
p_mb
->
i_lum_incr
);
}
...
...
@@ -252,12 +256,12 @@ static void DecodeMacroblock( vdec_thread_t *p_vdec, macroblock_t * p_mb )
/*
* Inverse DCT (ISO/IEC 13818-2 section Annex A)
*/
(
*
p_mb
->
pf_idct
[
i_b
])(
p_mb
,
p_mb
->
ppi_blocks
[
i_b
],
p_mb
->
pi_sparse_pos
[
i_b
]
);
(
p_mb
->
pf_idct
[
i_b
])(
p_mb
->
ppi_blocks
[
i_b
],
p_mb
->
pi_sparse_pos
[
i_b
]
);
/*
* Adding prediction and coefficient data (ISO/IEC 13818-2 section 7.6.8)
*/
(
*
p_mb
->
pf_addb
[
i_b
])(
p_mb
->
ppi_blocks
[
i_b
],
(
p_mb
->
pf_addb
[
i_b
])(
p_mb
->
ppi_blocks
[
i_b
],
p_mb
->
p_data
[
i_b
],
p_mb
->
i_chroma_incr
);
}
...
...
@@ -265,7 +269,7 @@ static void DecodeMacroblock( vdec_thread_t *p_vdec, macroblock_t * p_mb )
* Decoding is finished, release the macroblock and free
* unneeded memory.
*/
vpar_ReleaseMacroblock
(
&
p_vdec
->
p_vpar
.
vfifo
,
p_mb
);
vpar_ReleaseMacroblock
(
&
p_vdec
->
p_vpar
->
vfifo
,
p_mb
);
}
/*******************************************************************************
...
...
src/video_parser/vpar_blocks.c
View file @
667b4eb4
...
...
@@ -28,10 +28,15 @@
#include "decoder_fifo.h"
#include "video.h"
#include "video_output.h"
#include "video_parser.h"
#include "v
ideo_fifo
.h"
#include "v
dec_idct
.h"
#include "video_decoder.h"
#include "vdec_motion.h"
#include "vpar_blocks.h"
#include "vpar_headers.h"
#include "video_fifo.h"
#include "video_parser.h"
/*
* Local prototypes
...
...
@@ -41,8 +46,12 @@ static __inline__ void InitMacroblock( vpar_thread_t * p_vpar,
static
__inline__
int
MacroblockAddressIncrement
(
vpar_thread_t
*
p_vpar
);
static
__inline__
void
MacroblockModes
(
vpar_thread_t
*
p_vpar
,
macroblock_t
*
p_mb
);
static
void
vpar_DecodeMPEG1Non
(
vpar_thread_t
*
p_vpar
,
macroblock_t
*
p_mb
,
int
i_b
);
static
void
vpar_DecodeMPEG1Intra
(
vpar_thread_t
*
p_vpar
,
macroblock_t
*
p_mb
,
int
i_b
);
static
void
vpar_DecodeMPEG2Non
(
vpar_thread_t
*
p_vpar
,
macroblock_t
*
p_mb
,
int
i_b
);
static
void
vpar_DecodeMPEG2Intra
(
vpar_thread_t
*
p_vpar
,
macroblock_t
*
p_mb
,
int
i_b
);
typedef
(
void
*
)
f_decode_block_t
(
vpar_thread_t
*
,
macroblock_t
*
,
int
);
typedef
void
(
*
f_decode_block_t
)
(
vpar_thread_t
*
,
macroblock_t
*
,
int
);
/*****************************************************************************
* vpar_ParseMacroblock : Parse the next macroblock
...
...
@@ -66,8 +75,8 @@ void vpar_ParseMacroblock( vpar_thread_t * p_vpar, int * pi_mb_address,
vdec_MotionField
,
vdec_MotionFrame
};
/* Reset DC predictors (7.2.1). */
p_vpar
->
slice
.
pi_dc
t_pred
[
0
]
=
p_vpar
->
slice
.
pi
_dct_pred
[
1
]
=
p_vpar
->
slice
.
pi_dct_pred
[
2
]
p_vpar
->
slice
.
pi_dc
_dct_pred
[
0
]
=
p_vpar
->
slice
.
pi_dc
_dct_pred
[
1
]
=
p_vpar
->
slice
.
pi_dc
_dc
t_pred
[
2
]
=
pi_dc_dct_reinit
[
p_vpar
->
picture
.
i_intra_dc_precision
];
if
(
p_vpar
->
picture
.
i_coding_type
==
P_CODING_TYPE
)
...
...
@@ -79,7 +88,7 @@ void vpar_ParseMacroblock( vpar_thread_t * p_vpar, int * pi_mb_address,
if
(
(
p_mb
=
p_vpar
->
picture
.
pp_mb
[
i_mb_base
+
i_mb
]
=
vpar_NewMacroblock
(
&
p_vpar
->
vfifo
))
==
NULL
)
{
p_vpar
->
picture
.
b_error
=
TRUE
;
p_vpar
->
picture
.
b_error
=
1
;
intf_ErrMsg
(
"vpar error: macroblock list is empty !"
);
return
;
}
...
...
@@ -104,7 +113,7 @@ void vpar_ParseMacroblock( vpar_thread_t * p_vpar, int * pi_mb_address,
if
(
(
p_mb
=
p_vpar
->
picture
.
pp_mb
[
i_mb_base
+
*
pi_mb_address
]
=
vpar_NewMacroblock
(
&
p_vpar
->
vfifo
))
==
NULL
)
{
p_vpar
->
picture
.
b_error
=
TRUE
;
p_vpar
->
picture
.
b_error
=
1
;
intf_ErrMsg
(
"vpar error: macroblock list is empty !"
);
return
;
}
...
...
@@ -196,7 +205,7 @@ void vpar_ParseMacroblock( vpar_thread_t * p_vpar, int * pi_mb_address,
/* Calculate block coordinates. */
p_mb
->
p_data
[
i_b
]
=
pi_data
[
i_b
]
+
pi_pos
[
i_b
>>
2
]
+
pi_y
[
i_b
]
*
pi_width
[
i_b
>>
2
]
+
(
p_vpar
->
mb
.
b_dct_type
&
((
i_b
&
2
)
>>
1
))
+
(
p_vpar
->
mb
.
b_dct_type
&
((
i_b
&
2
)
>>
1
))
;
/* INACHEV parce que trop pourri ! */
}
else
...
...
@@ -212,8 +221,8 @@ void vpar_ParseMacroblock( vpar_thread_t * p_vpar, int * pi_mb_address,
static
int
pi_dc_dct_reinit
[
4
]
=
{
128
,
256
,
512
,
1024
};
/* Reset DC predictors (7.2.1). */
p_vpar
->
slice
.
pi_dc
t_pred
[
0
]
=
p_vpar
->
slice
.
pi
_dct_pred
[
1
]
=
p_vpar
->
slice
.
pi_dct_pred
[
2
]
p_vpar
->
slice
.
pi_dc
_dct_pred
[
0
]
=
p_vpar
->
slice
.
pi_dc
_dct_pred
[
1
]
=
p_vpar
->
slice
.
pi_dc
_dc
t_pred
[
2
]
=
pi_dc_dct_reinit
[
p_vpar
->
picture
.
i_intra_dc_precision
];
}
else
if
(
!
p_vpar
->
picture
.
b_concealment_mv
)
...
...
@@ -271,14 +280,14 @@ static __inline__ void MacroblockModes( vpar_thread_t * p_vpar,
static
int
ppi_mv_format
[
2
][
4
]
=
{
{
0
,
1
,
1
,
1
},
{
0
,
1
,
2
,
1
}
};
/* Get macroblock_type. */
p_vpar
->
mb
.
i_mb_type
=
(
*
p_vpar
->
picture
.
pf_macroblock_type
)
p_vpar
->
mb
.
i_mb_type
=
(
p_vpar
->
picture
.
pf_macroblock_type
)
(
vpar_thread_t
*
p_vpar
);
/* SCALABILITY : warning, we don't know if spatial_temporal_weight_code
* has to be dropped, take care if you use scalable streams. */
/* DumpBits( &p_vpar->bit_stream, 2 ); */
if
(
!
(
p_vpar
->
mb
.
i_mb_type
&
(
MB_MOTION_FORWARD
|
MB_MOTION_BACKWARD
))
if
(
!
(
p_vpar
->
mb
.
i_mb_type
&
(
MB_MOTION_FORWARD
|
|
MB_MOTION_BACKWARD
))
||
p_vpar
->
picture
.
b_frame_pred_frame_dct
)
{
/* If mb_type has neither MOTION_FORWARD nor MOTION_BACKWARD, this
...
...
@@ -290,7 +299,7 @@ static __inline__ void MacroblockModes( vpar_thread_t * p_vpar,
p_vpar
->
mb
.
i_motion_type
=
GetBits
(
&
p_vpar
->
bit_stream
,
2
);
}
p_mb
->
f_motion
=
pf_motion
[
p_vpar
->
picture
.
b_frame_structure
]
p_mb
->
p
f_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
];
...
...
@@ -299,7 +308,7 @@ static __inline__ void MacroblockModes( vpar_thread_t * p_vpar,
if
(
(
p_vpar
->
picture
.
i_structure
==
FRAME_STRUCTURE
)
&&
(
!
p_vpar
->
picture
.
b_frame_pred_frame_dct
)
&&
(
p_var
->
mb
.
i_mb_type
&
(
MB_PATTERN
|
MB_INTRA
))
)
(
p_v
p
ar
->
mb
.
i_mb_type
&
(
MB_PATTERN
|
MB_INTRA
))
)
{
p_vpar
->
mb
.
b_dct_type
=
GetBits
(
&
p_vpar
->
bit_stream
,
1
);
}
...
...
@@ -368,7 +377,7 @@ int vpar_CodedPattern444( vpar_thread_t * p_vpar )
/*****************************************************************************
* vpar_DecodeMPEG1Non : decode MPEG-1 non-intra blocks
*****************************************************************************/
void
vpar_DecodeMPEG1Non
(
vpar_thread_t
*
p_vpar
,
macroblock_t
*
p_mb
,
int
i_b
)
static
void
vpar_DecodeMPEG1Non
(
vpar_thread_t
*
p_vpar
,
macroblock_t
*
p_mb
,
int
i_b
)
{
/* pomper dans Berkeley. Pour toutes ces fonctions, il faut mettre
p_mb->pf_idct[i_b] :
...
...
@@ -381,14 +390,14 @@ void vpar_DecodeMPEG1Non( vpar_thread_t * p_vpar, macroblock_t * p_mb, int i_b )
{
/* Remove end_of_macroblock (always 1, prevents startcode emulation)
* ISO/IEC 11172-2 section 2.4.2.7 and 2.4.3.6 */
DumpBits
(
&
p_vpar
->
fifo
,
1
);
DumpBits
(
&
p_vpar
->
bit_stream
,
1
);
}
}
/*****************************************************************************
* vpar_DecodeMPEG1Intra : decode MPEG-1 intra blocks
*****************************************************************************/
void
vpar_DecodeMPEG1Intra
(
vpar_thread_t
*
p_vpar
,
macroblock_t
*
p_mb
,
int
i_b
)
static
void
vpar_DecodeMPEG1Intra
(
vpar_thread_t
*
p_vpar
,
macroblock_t
*
p_mb
,
int
i_b
)
{
/* pomper dans Berkeley. */
...
...
@@ -396,14 +405,14 @@ void vpar_DecodeMPEG1Intra( vpar_thread_t * p_vpar, macroblock_t * p_mb, int i_b
{
/* Remove end_of_macroblock (always 1, prevents startcode emulation)
* ISO/IEC 11172-2 section 2.4.2.7 and 2.4.3.6 */
DumpBits
(
&
p_vpar
->
fifo
,
1
);
DumpBits
(
&
p_vpar
->
bit_stream
,
1
);
}
}
/*****************************************************************************
* vpar_DecodeMPEG2Non : decode MPEG-2 non-intra blocks
*****************************************************************************/
void
vpar_DecodeMPEG2Non
(
vpar_thread_t
*
p_vpar
,
macroblock_t
*
p_mb
,
int
i_b
)
static
void
vpar_DecodeMPEG2Non
(
vpar_thread_t
*
p_vpar
,
macroblock_t
*
p_mb
,
int
i_b
)
{
/* pomper dans Berkeley. Bien sr les matrices seront diffrentes... */
}
...
...
@@ -411,7 +420,7 @@ void vpar_DecodeMPEG2Non( vpar_thread_t * p_vpar, macroblock_t * p_mb, int i_b )
/*****************************************************************************
* vpar_DecodeMPEG2Intra : decode MPEG-2 intra blocks
*****************************************************************************/
void
vpar_DecodeMPEG2Intra
(
vpar_thread_t
*
p_vpar
,
macroblock_t
*
p_mb
,
int
i_b
)
static
void
vpar_DecodeMPEG2Intra
(
vpar_thread_t
*
p_vpar
,
macroblock_t
*
p_mb
,
int
i_b
)
{
/* pomper dans Berkeley. */
}
src/video_parser/vpar_headers.c
View file @
667b4eb4
...
...
@@ -543,6 +543,7 @@ static void PictureHeader( vpar_thread_t * p_vpar )
else
if
(
p_vpar
->
picture
.
i_current_structure
==
FRAME_STRUCTURE
)
{
/* Frame completely parsed. */
P_picture
.
i_deccount
=
p_vpar
->
sequence
.
i_mb_size
;
for
(
i_mb
=
0
;
i_mb
<
p_vpar
->
sequence
.
i_mb_size
;
i_mb
++
)
{
vpar_DecodeMacroblock
(
&
p_vpar
->
vfifo
,
p_vpar
->
picture
.
pp_mb
[
i_mb
]
);
...
...
src/video_parser/vpar_motion.c
View file @
667b4eb4
...
...
@@ -28,10 +28,15 @@
#include "decoder_fifo.h"
#include "video.h"
#include "video_output.h"
#include "video_parser.h"
#include "v
ideo_fifo
.h"
#include "v
dec_idct
.h"
#include "video_decoder.h"
#include "vdec_motion.h"
#include "vpar_blocks.h"
#include "vpar_headers.h"
#include "video_fifo.h"
#include "video_parser.h"
/*
* Local prototypes
...
...
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