Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
c751bb66
Commit
c751bb66
authored
Mar 06, 2001
by
Christophe Massiot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Fixed an alignment problem in UnalignedShowBits().
parent
19676f4f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
7 deletions
+49
-7
include/input_ext-dec.h
include/input_ext-dec.h
+6
-3
src/input/input_ext-dec.c
src/input/input_ext-dec.c
+43
-4
No files found.
include/input_ext-dec.h
View file @
c751bb66
...
...
@@ -2,7 +2,7 @@
* input_ext-dec.h: structures exported to the VideoLAN decoders
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-dec.h,v 1.2
4 2001/03/02 13:20:2
8 massiot Exp $
* $Id: input_ext-dec.h,v 1.2
5 2001/03/06 19:33:5
8 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Kaempf <maxx@via.ecp.fr>
...
...
@@ -164,10 +164,13 @@ typedef struct bit_stream_s
*/
/* Current data packet (in the current PES packet of the PES stream) */
data_packet_t
*
p_data
;
/* Pointer to the next byte that is to be read (in the current
TS
packet) */
/* Pointer to the next byte that is to be read (in the current packet) */
byte_t
*
p_byte
;
/* Pointer to the last byte that is to be read (in the current
TS
packet */
/* Pointer to the last byte that is to be read (in the current packet */
byte_t
*
p_end
;
/* Temporary buffer in case we're not aligned when changing data packets. */
WORD_TYPE
i_showbits_buffer
;
data_packet_t
showbits_data
;
}
bit_stream_t
;
/*****************************************************************************
...
...
src/input/input_ext-dec.c
View file @
c751bb66
...
...
@@ -156,10 +156,49 @@ u32 UnalignedShowBits( bit_stream_t * p_bit_stream, unsigned int i_bits )
else
{
p_bit_stream
->
pf_next_data_packet
(
p_bit_stream
);
p_bit_stream
->
fifo
.
buffer
|=
*
(
p_bit_stream
->
p_byte
++
)
<<
(
8
*
sizeof
(
WORD_TYPE
)
-
8
-
p_bit_stream
->
fifo
.
i_available
);
p_bit_stream
->
fifo
.
i_available
+=
8
;
if
(
(
ptrdiff_t
)
p_bit_stream
->
p_byte
&
(
sizeof
(
WORD_TYPE
)
-
1
)
)
{
/* We are not aligned anymore. */
if
(
((
ptrdiff_t
)
p_bit_stream
->
p_byte
&
(
sizeof
(
WORD_TYPE
)
-
1
))
*
8
<
p_bit_stream
->
fifo
.
i_available
)
{
/* We are not aligned, and won't be. Copy the first word
* of the packet in a temporary buffer, and we'll see
* later. */
int
i
;
p_bit_stream
->
i_showbits_buffer
=
0
;
for
(
i
=
0
;
i
<
sizeof
(
WORD_TYPE
)
;
i
++
)
{
if
(
p_bit_stream
->
p_byte
>=
p_bit_stream
->
p_end
)
{
p_bit_stream
->
pf_next_data_packet
(
p_bit_stream
);
}
((
byte_t
*
)
&
p_bit_stream
->
i_showbits_buffer
)[
i
]
=
*
p_bit_stream
->
p_byte
;
p_bit_stream
->
p_byte
++
;
}
/* This is kind of kludgy. */
p_bit_stream
->
p_data
->
p_payload_start
+=
sizeof
(
WORD_TYPE
);
p_bit_stream
->
p_byte
=
(
byte_t
*
)
&
p_bit_stream
->
i_showbits_buffer
;
p_bit_stream
->
p_end
=
(
byte_t
*
)
&
p_bit_stream
->
i_showbits_buffer
+
sizeof
(
WORD_TYPE
);
p_bit_stream
->
showbits_data
.
p_next
=
p_bit_stream
->
p_data
;
p_bit_stream
->
p_data
=
&
p_bit_stream
->
showbits_data
;
}
else
{
/* We are not aligned, but we can be. */
AlignWord
(
p_bit_stream
);
}
}
return
(
ShowBits
(
p_bit_stream
,
i_bits
)
);
}
}
return
(
p_bit_stream
->
fifo
.
buffer
>>
(
8
*
sizeof
(
WORD_TYPE
)
-
i_bits
)
);
...
...
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