Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VLC
Manage
Activity
Members
Labels
Plan
Issues
4k
Issue boards
Milestones
Code
Merge requests
451
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VideoLAN
VLC
Commits
ad3713cb
Commit
ad3713cb
authored
21 years ago
by
Laurent Aimar
Browse files
Options
Downloads
Patches
Plain Diff
* bits.h: clean up
parent
8d98b9f5
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/mux/mpeg/bits.h
+10
-13
10 additions, 13 deletions
modules/mux/mpeg/bits.h
with
10 additions
and
13 deletions
modules/mux/mpeg/bits.h
+
10
−
13
View file @
ad3713cb
...
...
@@ -2,7 +2,7 @@
* bits.h
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* $Id: bits.h,v 1.
3
2003/0
1
/0
8
1
0:34:58
fenrir Exp $
* $Id: bits.h,v 1.
4
2003/0
5
/0
5
1
5:52:13
fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Eric Petit <titer@videolan.org>
...
...
@@ -31,8 +31,8 @@ typedef struct bits_buffer_s
uint8_t
*
p_data
;
}
bits_buffer_t
;
static
inline
int
bits_initwrite
(
bits_buffer_t
*
p_buffer
,
static
inline
int
bits_initwrite
(
bits_buffer_t
*
p_buffer
,
int
i_size
,
void
*
p_data
)
{
p_buffer
->
i_size
=
i_size
;
...
...
@@ -41,9 +41,9 @@ static inline int bits_initwrite( bits_buffer_t *p_buffer,
p_buffer
->
p_data
=
p_data
;
p_buffer
->
p_data
[
0
]
=
0
;
if
(
!
p_buffer
->
p_data
)
{
{
if
(
!
(
p_buffer
->
p_data
=
malloc
(
i_size
)
)
)
{
{
return
(
-
1
);
}
else
...
...
@@ -67,12 +67,14 @@ static inline void bits_align( bits_buffer_t *p_buffer )
}
}
static
inline
void
bits_write
(
bits_buffer_t
*
p_buffer
,
static
inline
void
bits_write
(
bits_buffer_t
*
p_buffer
,
int
i_count
,
uint64_t
i_bits
)
{
while
(
i_count
>
0
)
{
if
(
(
i_bits
>>
(
i_count
-
1
)
)
&
0x01
)
i_count
--
;
if
(
(
i_bits
>>
i_count
)
&
0x01
)
{
p_buffer
->
p_data
[
p_buffer
->
i_data
]
|=
p_buffer
->
i_mask
;
}
...
...
@@ -84,13 +86,8 @@ static inline void bits_write( bits_buffer_t *p_buffer,
if
(
p_buffer
->
i_mask
==
0
)
{
p_buffer
->
i_data
++
;
if
(
p_buffer
->
i_data
<
p_buffer
->
i_size
)
{
// p_buffer->p_data[p_buffer->i_data] = 0;
p_buffer
->
i_mask
=
0x80
;
}
p_buffer
->
i_mask
=
0x80
;
}
i_count
--
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment