Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
9e3a2736
Commit
9e3a2736
authored
Jan 30, 2012
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
golomb-test: K&R formatting cosmetics
parent
631f96f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
19 deletions
+16
-19
golomb-test.c
libavcodec/golomb-test.c
+16
-19
No files found.
libavcodec/golomb-test.c
View file @
9e3a2736
...
...
@@ -27,9 +27,10 @@
#undef printf
#define COUNT 8000
#define SIZE (COUNT
*
40)
#define SIZE (COUNT
*
40)
int
main
(
void
){
int
main
(
void
)
{
int
i
;
uint8_t
temp
[
SIZE
];
PutBitContext
pb
;
...
...
@@ -37,36 +38,32 @@ int main(void){
init_put_bits
(
&
pb
,
temp
,
SIZE
);
printf
(
"testing unsigned exp golomb
\n
"
);
for
(
i
=
0
;
i
<
COUNT
;
i
++
){
for
(
i
=
0
;
i
<
COUNT
;
i
++
)
set_ue_golomb
(
&
pb
,
i
);
}
flush_put_bits
(
&
pb
);
init_get_bits
(
&
gb
,
temp
,
8
*
SIZE
);
for
(
i
=
0
;
i
<
COUNT
;
i
++
)
{
init_get_bits
(
&
gb
,
temp
,
8
*
SIZE
);
for
(
i
=
0
;
i
<
COUNT
;
i
++
)
{
int
j
,
s
=
show_bits
(
&
gb
,
24
);
j
=
get_ue_golomb
(
&
gb
);
if
(
j
!=
i
){
printf
(
"mismatch! at %d (%d should be %d) bits:%6X
\n
"
,
i
,
j
,
i
,
s
);
}
j
=
get_ue_golomb
(
&
gb
);
if
(
j
!=
i
)
printf
(
"mismatch at %d (%d should be %d) bits: %6X
\n
"
,
i
,
j
,
i
,
s
);
}
init_put_bits
(
&
pb
,
temp
,
SIZE
);
printf
(
"testing signed exp golomb
\n
"
);
for
(
i
=
0
;
i
<
COUNT
;
i
++
){
set_se_golomb
(
&
pb
,
i
-
COUNT
/
2
);
}
for
(
i
=
0
;
i
<
COUNT
;
i
++
)
set_se_golomb
(
&
pb
,
i
-
COUNT
/
2
);
flush_put_bits
(
&
pb
);
init_get_bits
(
&
gb
,
temp
,
8
*
SIZE
);
for
(
i
=
0
;
i
<
COUNT
;
i
++
)
{
init_get_bits
(
&
gb
,
temp
,
8
*
SIZE
);
for
(
i
=
0
;
i
<
COUNT
;
i
++
)
{
int
j
,
s
=
show_bits
(
&
gb
,
24
);
j
=
get_se_golomb
(
&
gb
);
if
(
j
!=
i
-
COUNT
/
2
){
printf
(
"mismatch! at %d (%d should be %d) bits:%6X
\n
"
,
i
,
j
,
i
,
s
);
}
j
=
get_se_golomb
(
&
gb
);
if
(
j
!=
i
-
COUNT
/
2
)
printf
(
"mismatch at %d (%d should be %d) bits: %6X
\n
"
,
i
,
j
,
i
,
s
);
}
return
0
;
...
...
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