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
6a8fb63a
Commit
6a8fb63a
authored
Jan 05, 2000
by
Stéphane Borel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Ajout de la fonction MacroBlockAddressIncrement dans vpar_blocks.c
parent
7190bee5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
120 additions
and
3 deletions
+120
-3
include/video_parser.h
include/video_parser.h
+3
-0
include/vpar_blocks.h
include/vpar_blocks.h
+6
-1
include/vpar_headers.h
include/vpar_headers.h
+12
-0
src/video_parser/video_parser.c
src/video_parser/video_parser.c
+3
-0
src/video_parser/vpar_blocks.c
src/video_parser/vpar_blocks.c
+96
-2
No files found.
include/video_parser.h
View file @
6a8fb63a
...
...
@@ -58,6 +58,9 @@ typedef struct vpar_thread_s
macroblock_parsing_t
mb
;
video_synchro_t
synchro
;
/* Lookup table for Macroblock_Address_Increment */
mb_addr_inc_t
mb_addr_inc
[
2048
];
#ifdef STATS
/* Statistics */
count_t
c_loops
;
/* number of loops */
...
...
include/vpar_blocks.h
View file @
6a8fb63a
...
...
@@ -60,6 +60,8 @@ typedef struct macroblock_s
typedef
struct
{
int
i_mb_type
,
i_motion_type
,
i_mv_count
,
i_mv_format
;
/* AddressIncrement information */
int
i_addr_inc
;
int
i_coded_block_pattern
;
boolean_t
b_dct_type
;
...
...
@@ -82,6 +84,10 @@ typedef struct
#define MOTION_16X8 2
#define MOTION_DMV 3
/* Macroblock Address Increment types */
#define MACROBLOCK_ESCAPE 8
#define MACROBLOCK_STUFFING 15
/*****************************************************************************
* Prototypes
*****************************************************************************/
...
...
@@ -92,4 +98,3 @@ 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
);
int
vpar_DMBType
(
struct
vpar_thread_s
*
p_vpar
);
include/vpar_headers.h
View file @
6a8fb63a
...
...
@@ -115,6 +115,18 @@ typedef struct slice_parsing_s
int
pppi_pmv
[
2
][
2
][
2
];
/* Motion vect predictors, 7.6.3 */
}
slice_parsing_t
;
/*****************************************************************************
* mb_addr_inc_t : entry type for MacroblockAddressIncrement lookup table *
*****************************************************************************/
typedef
struct
mb_addr_inc_s
{
int
i_value
;
int
i_length
;
}
mb_addr_inc_t
;
/*****************************************************************************
* Standard codes
*****************************************************************************/
...
...
src/video_parser/video_parser.c
View file @
6a8fb63a
...
...
@@ -220,6 +220,9 @@ static int InitThread( vpar_thread_t *p_vpar )
}
}
/* Initialize lookup tables */
InitMbAddrInc
(
p_vpar
);
/* Mark thread as running and return */
intf_DbgMsg
(
"vpar debug: InitThread(%p) succeeded
\n
"
,
p_vpar
);
return
(
0
);
...
...
src/video_parser/vpar_blocks.c
View file @
6a8fb63a
...
...
@@ -47,12 +47,93 @@ 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
);
typedef
(
void
*
)
f_decode_block_t
(
vpar_thread_t
*
,
macroblock_t
*
,
int
);
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
);
/*****************************************************************************
* InitMbAddrInc : Initialize the lookup table for mb_addr_inc *
*****************************************************************************/
void
InitMbAddrInc
(
vpar_thread_t
*
p_vpar
)
{
bzero
(
&
p_vpar
->
mb_addr_inc
,
4096
*
sizeof
(
int
)
);
p_vpar
->
mb_addr_inc
[
8
].
i_value
=
MACROBLOCK_ESCAPE
;
p_vpar
->
mb_addr_inc
[
15
].
i_value
=
MACROBLOCK_STUFFING
;
p_vpar
->
mb_addr_inc
[
24
].
i_value
=
33
;
p_vpar
->
mb_addr_inc
[
25
].
i_value
=
32
;
p_vpar
->
mb_addr_inc
[
26
].
i_value
=
31
;
p_vpar
->
mb_addr_inc
[
27
].
i_value
=
30
;
p_vpar
->
mb_addr_inc
[
28
].
i_value
=
29
;
p_vpar
->
mb_addr_inc
[
29
].
i_value
=
28
;
p_vpar
->
mb_addr_inc
[
30
].
i_value
=
27
;
p_vpar
->
mb_addr_inc
[
31
].
i_value
=
26
;
p_vpar
->
mb_addr_inc
[
32
].
i_value
=
25
;
p_vpar
->
mb_addr_inc
[
33
].
i_value
=
24
;
p_vpar
->
mb_addr_inc
[
34
].
i_value
=
23
;
p_vpar
->
mb_addr_inc
[
35
].
i_value
=
22
;
p_vpar
->
mb_addr_inc
[
36
].
i_value
=
21
;
p_vpar
->
mb_addr_inc
[
38
].
i_value
=
20
;
p_vpar
->
mb_addr_inc
[
40
].
i_value
=
19
;
p_vpar
->
mb_addr_inc
[
42
].
i_value
=
18
;
p_vpar
->
mb_addr_inc
[
44
].
i_value
=
17
;
p_vpar
->
mb_addr_inc
[
46
].
i_value
=
16
;
p_vpar
->
mb_addr_inc
[
48
].
i_value
=
15
;
p_vpar
->
mb_addr_inc
[
56
].
i_value
=
14
;
p_vpar
->
mb_addr_inc
[
64
].
i_value
=
13
;
p_vpar
->
mb_addr_inc
[
72
].
i_value
=
12
;
p_vpar
->
mb_addr_inc
[
80
].
i_value
=
11
;
p_vpar
->
mb_addr_inc
[
88
].
i_value
=
10
;
p_vpar
->
mb_addr_inc
[
96
].
i_value
=
9
;
p_vpar
->
mb_addr_inc
[
112
].
i_value
=
8
;
p_vpar
->
mb_addr_inc
[
128
].
i_value
=
7
;
p_vpar
->
mb_addr_inc
[
192
].
i_value
=
6
;
p_vpar
->
mb_addr_inc
[
256
].
i_value
=
5
;
p_vpar
->
mb_addr_inc
[
384
].
i_value
=
4
;
p_vpar
->
mb_addr_inc
[
512
].
i_value
=
3
;
p_vpar
->
mb_addr_inc
[
768
].
i_value
=
2
;
p_vpar
->
mb_addr_inc
[
1024
].
i_value
=
1
;
/* Length of the variable length code */
p_vpar
->
mb_addr_inc
[
8
].
i_length
=
11
;
p_vpar
->
mb_addr_inc
[
15
].
i_length
=
11
;
p_vpar
->
mb_addr_inc
[
24
].
i_length
=
11
;
p_vpar
->
mb_addr_inc
[
25
].
i_length
=
11
;
p_vpar
->
mb_addr_inc
[
26
].
i_length
=
11
;
p_vpar
->
mb_addr_inc
[
27
].
i_length
=
11
;
p_vpar
->
mb_addr_inc
[
28
].
i_length
=
11
;
p_vpar
->
mb_addr_inc
[
29
].
i_length
=
11
;
p_vpar
->
mb_addr_inc
[
30
].
i_length
=
11
;
p_vpar
->
mb_addr_inc
[
31
].
i_length
=
11
;
p_vpar
->
mb_addr_inc
[
32
].
i_length
=
11
;
p_vpar
->
mb_addr_inc
[
33
].
i_length
=
11
;
p_vpar
->
mb_addr_inc
[
34
].
i_length
=
11
;
p_vpar
->
mb_addr_inc
[
35
].
i_length
=
11
;
p_vpar
->
mb_addr_inc
[
36
].
i_length
=
10
;
p_vpar
->
mb_addr_inc
[
38
].
i_length
=
10
;
p_vpar
->
mb_addr_inc
[
40
].
i_length
=
10
;
p_vpar
->
mb_addr_inc
[
42
].
i_length
=
10
;
p_vpar
->
mb_addr_inc
[
44
].
i_length
=
10
;
p_vpar
->
mb_addr_inc
[
46
].
i_length
=
10
;
p_vpar
->
mb_addr_inc
[
48
].
i_length
=
8
;
p_vpar
->
mb_addr_inc
[
56
].
i_length
=
8
;
p_vpar
->
mb_addr_inc
[
64
].
i_length
=
8
;
p_vpar
->
mb_addr_inc
[
72
].
i_length
=
8
;
p_vpar
->
mb_addr_inc
[
80
].
i_length
=
8
;
p_vpar
->
mb_addr_inc
[
88
].
i_length
=
8
;
p_vpar
->
mb_addr_inc
[
96
].
i_length
=
7
;
p_vpar
->
mb_addr_inc
[
112
].
i_length
=
7
;
p_vpar
->
mb_addr_inc
[
128
].
i_length
=
5
;
p_vpar
->
mb_addr_inc
[
192
].
i_length
=
5
;
p_vpar
->
mb_addr_inc
[
256
].
i_length
=
4
;
p_vpar
->
mb_addr_inc
[
384
].
i_length
=
4
;
p_vpar
->
mb_addr_inc
[
512
].
i_length
=
3
;
p_vpar
->
mb_addr_inc
[
768
].
i_length
=
3
;
p_vpar
->
mb_addr_inc
[
1024
].
i_length
=
1
;
}
/*****************************************************************************
* vpar_ParseMacroblock : Parse the next macroblock
...
...
@@ -303,7 +384,20 @@ static __inline__ void InitMacroblock( vpar_thread_t * p_vpar,
*****************************************************************************/
static
__inline__
int
MacroblockAddressIncrement
(
vpar_thread_t
*
p_vpar
)
{
/* pomper dans Berkeley */
/* Index in the lookup table mb_addr_inc */
int
i_index
=
ShowBits
(
&
p_vpar
->
bit_stream
,
11
);
p_vpar
->
mb
.
i_addr_inc
=
0
;
/* Test the presence of the escape character */
while
(
i_index
==
8
)
{
DumpBits
(
&
p_vpar
->
bit_stream
,
11
);
p_vpar
->
mb
.
i_addr_inc
+=
33
;
i_index
=
ShowBits
(
&
p_vpar
->
bit_stream
,
11
);
}
/* Affect the value from the lookup table */
p_vpar
->
mb
.
i_addr_inc
+=
p_vpar
->
mb_addr_inc
[
i_index
].
i_value
;
/* Dump the good number of bits */
DumpBits
(
&
p_vpar
->
bit_stream
,
p_vpar
->
mb_addr_inc
[
i_index
].
i_length
);
}
/*****************************************************************************
...
...
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