Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
b9ea6a84
Commit
b9ea6a84
authored
May 21, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/huffman: use named identifer for the bits constant
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
1d7e6a6b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
4 deletions
+5
-4
fraps.c
libavcodec/fraps.c
+1
-1
huffman.c
libavcodec/huffman.c
+1
-1
huffman.h
libavcodec/huffman.h
+1
-0
vp6.c
libavcodec/vp6.c
+2
-2
No files found.
libavcodec/fraps.c
View file @
b9ea6a84
...
@@ -105,7 +105,7 @@ static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w,
...
@@ -105,7 +105,7 @@ static int fraps2_decode_plane(FrapsContext *s, uint8_t *dst, int stride, int w,
init_get_bits
(
&
gb
,
s
->
tmpbuf
,
size
*
8
);
init_get_bits
(
&
gb
,
s
->
tmpbuf
,
size
*
8
);
for
(
j
=
0
;
j
<
h
;
j
++
)
{
for
(
j
=
0
;
j
<
h
;
j
++
)
{
for
(
i
=
0
;
i
<
w
*
step
;
i
+=
step
)
{
for
(
i
=
0
;
i
<
w
*
step
;
i
+=
step
)
{
dst
[
i
]
=
get_vlc2
(
&
gb
,
vlc
.
table
,
9
,
3
);
dst
[
i
]
=
get_vlc2
(
&
gb
,
vlc
.
table
,
FF_HUFFMAN_BITS
,
3
);
/* lines are stored as deltas between previous lines
/* lines are stored as deltas between previous lines
* and we need to add 0x80 to the first lines of chroma planes
* and we need to add 0x80 to the first lines of chroma planes
*/
*/
...
...
libavcodec/huffman.c
View file @
b9ea6a84
...
@@ -122,7 +122,7 @@ static int build_huff_tree(VLC *vlc, Node *nodes, int head, int flags)
...
@@ -122,7 +122,7 @@ static int build_huff_tree(VLC *vlc, Node *nodes, int head, int flags)
get_tree_codes
(
bits
,
lens
,
xlat
,
nodes
,
head
,
0
,
0
,
get_tree_codes
(
bits
,
lens
,
xlat
,
nodes
,
head
,
0
,
0
,
&
pos
,
no_zero_count
);
&
pos
,
no_zero_count
);
return
ff_init_vlc_sparse
(
vlc
,
9
,
pos
,
lens
,
2
,
2
,
bits
,
4
,
4
,
xlat
,
1
,
1
,
0
);
return
ff_init_vlc_sparse
(
vlc
,
FF_HUFFMAN_BITS
,
pos
,
lens
,
2
,
2
,
bits
,
4
,
4
,
xlat
,
1
,
1
,
0
);
}
}
...
...
libavcodec/huffman.h
View file @
b9ea6a84
...
@@ -37,6 +37,7 @@ typedef struct Node {
...
@@ -37,6 +37,7 @@ typedef struct Node {
#define FF_HUFFMAN_FLAG_HNODE_FIRST 0x01
#define FF_HUFFMAN_FLAG_HNODE_FIRST 0x01
#define FF_HUFFMAN_FLAG_ZERO_COUNT 0x02
#define FF_HUFFMAN_FLAG_ZERO_COUNT 0x02
#define FF_HUFFMAN_BITS 9
typedef
int
(
*
HuffCmp
)(
const
void
*
va
,
const
void
*
vb
);
typedef
int
(
*
HuffCmp
)(
const
void
*
va
,
const
void
*
vb
);
int
ff_huff_build_tree
(
AVCodecContext
*
avctx
,
VLC
*
vlc
,
int
nb_codes
,
int
ff_huff_build_tree
(
AVCodecContext
*
avctx
,
VLC
*
vlc
,
int
nb_codes
,
...
...
libavcodec/vp6.c
View file @
b9ea6a84
...
@@ -388,11 +388,11 @@ static void vp6_parse_coeff_huffman(VP56Context *s)
...
@@ -388,11 +388,11 @@ static void vp6_parse_coeff_huffman(VP56Context *s)
}
else
{
}
else
{
if
(
get_bits_left
(
&
s
->
gb
)
<=
0
)
if
(
get_bits_left
(
&
s
->
gb
)
<=
0
)
return
;
return
;
coeff
=
get_vlc2
(
&
s
->
gb
,
vlc_coeff
->
table
,
9
,
3
);
coeff
=
get_vlc2
(
&
s
->
gb
,
vlc_coeff
->
table
,
FF_HUFFMAN_BITS
,
3
);
if
(
coeff
==
0
)
{
if
(
coeff
==
0
)
{
if
(
coeff_idx
)
{
if
(
coeff_idx
)
{
int
pt
=
(
coeff_idx
>=
6
);
int
pt
=
(
coeff_idx
>=
6
);
run
+=
get_vlc2
(
&
s
->
gb
,
s
->
runv_vlc
[
pt
].
table
,
9
,
3
);
run
+=
get_vlc2
(
&
s
->
gb
,
s
->
runv_vlc
[
pt
].
table
,
FF_HUFFMAN_BITS
,
3
);
if
(
run
>=
9
)
if
(
run
>=
9
)
run
+=
get_bits
(
&
s
->
gb
,
6
);
run
+=
get_bits
(
&
s
->
gb
,
6
);
}
else
}
else
...
...
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