Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
d1722014
Commit
d1722014
authored
Nov 05, 2013
by
Dmitry Kovalev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaning up read_mv_probs() function.
Change-Id: I7a1e88b5977076e22736c0d6af1d4dcc19d39a6a
parent
4f30cc27
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
29 deletions
+20
-29
vp9/decoder/vp9_decodframe.c
vp9/decoder/vp9_decodframe.c
+20
-29
No files found.
vp9/decoder/vp9_decodframe.c
View file @
d1722014
...
@@ -153,47 +153,38 @@ static void read_comp_pred(VP9_COMMON *cm, vp9_reader *r) {
...
@@ -153,47 +153,38 @@ static void read_comp_pred(VP9_COMMON *cm, vp9_reader *r) {
vp9_diff_update_prob
(
r
,
&
cm
->
fc
.
comp_ref_prob
[
i
]);
vp9_diff_update_prob
(
r
,
&
cm
->
fc
.
comp_ref_prob
[
i
]);
}
}
static
void
update_mv
(
vp9_reader
*
r
,
vp9_prob
*
p
)
{
static
void
update_mv_probs
(
vp9_prob
*
p
,
int
n
,
vp9_reader
*
r
)
{
if
(
vp9_read
(
r
,
NMV_UPDATE_PROB
))
int
i
;
*
p
=
(
vp9_read_literal
(
r
,
7
)
<<
1
)
|
1
;
for
(
i
=
0
;
i
<
n
;
++
i
)
if
(
vp9_read
(
r
,
NMV_UPDATE_PROB
))
p
[
i
]
=
(
vp9_read_literal
(
r
,
7
)
<<
1
)
|
1
;
}
}
static
void
read_mv_probs
(
vp9_reader
*
r
,
nmv_context
*
mvc
,
int
allow_hp
)
{
static
void
read_mv_probs
(
nmv_context
*
ctx
,
int
allow_hp
,
vp9_reader
*
r
)
{
int
i
,
j
,
k
;
int
i
,
j
;
for
(
j
=
0
;
j
<
MV_JOINTS
-
1
;
++
j
)
update_mv_probs
(
ctx
->
joints
,
MV_JOINTS
-
1
,
r
);
update_mv
(
r
,
&
mvc
->
joints
[
j
]);
for
(
i
=
0
;
i
<
2
;
++
i
)
{
for
(
i
=
0
;
i
<
2
;
++
i
)
{
nmv_component
*
const
comp
=
&
mvc
->
comps
[
i
];
nmv_component
*
const
comp_ctx
=
&
ctx
->
comps
[
i
];
update_mv_probs
(
&
comp_ctx
->
sign
,
1
,
r
);
update_mv
(
r
,
&
comp
->
sign
);
update_mv_probs
(
comp_ctx
->
classes
,
MV_CLASSES
-
1
,
r
);
update_mv_probs
(
comp_ctx
->
class0
,
CLASS0_SIZE
-
1
,
r
);
for
(
j
=
0
;
j
<
MV_CLASSES
-
1
;
++
j
)
update_mv_probs
(
comp_ctx
->
bits
,
MV_OFFSET_BITS
,
r
);
update_mv
(
r
,
&
comp
->
classes
[
j
]);
for
(
j
=
0
;
j
<
CLASS0_SIZE
-
1
;
++
j
)
update_mv
(
r
,
&
comp
->
class0
[
j
]);
for
(
j
=
0
;
j
<
MV_OFFSET_BITS
;
++
j
)
update_mv
(
r
,
&
comp
->
bits
[
j
]);
}
}
for
(
i
=
0
;
i
<
2
;
++
i
)
{
for
(
i
=
0
;
i
<
2
;
++
i
)
{
nmv_component
*
const
comp
=
&
mvc
->
comps
[
i
];
nmv_component
*
const
comp_ctx
=
&
ctx
->
comps
[
i
];
for
(
j
=
0
;
j
<
CLASS0_SIZE
;
++
j
)
for
(
j
=
0
;
j
<
CLASS0_SIZE
;
++
j
)
for
(
k
=
0
;
k
<
3
;
++
k
)
update_mv_probs
(
comp_ctx
->
class0_fp
[
j
],
3
,
r
);
update_mv
(
r
,
&
comp
->
class0_fp
[
j
][
k
]);
update_mv_probs
(
comp_ctx
->
fp
,
3
,
r
);
for
(
j
=
0
;
j
<
3
;
++
j
)
update_mv
(
r
,
&
comp
->
fp
[
j
]);
}
}
if
(
allow_hp
)
{
if
(
allow_hp
)
{
for
(
i
=
0
;
i
<
2
;
++
i
)
{
for
(
i
=
0
;
i
<
2
;
++
i
)
{
update_mv
(
r
,
&
mvc
->
comps
[
i
].
class0_hp
);
nmv_component
*
const
comp_ctx
=
&
ctx
->
comps
[
i
];
update_mv
(
r
,
&
mvc
->
comps
[
i
].
hp
);
update_mv_probs
(
&
comp_ctx
->
class0_hp
,
1
,
r
);
update_mv_probs
(
&
comp_ctx
->
hp
,
1
,
r
);
}
}
}
}
}
}
...
@@ -1227,7 +1218,7 @@ static int read_compressed_header(VP9D_COMP *pbi, const uint8_t *data,
...
@@ -1227,7 +1218,7 @@ static int read_compressed_header(VP9D_COMP *pbi, const uint8_t *data,
for
(
i
=
0
;
i
<
PARTITION_TYPES
-
1
;
++
i
)
for
(
i
=
0
;
i
<
PARTITION_TYPES
-
1
;
++
i
)
vp9_diff_update_prob
(
&
r
,
&
fc
->
partition_prob
[
j
][
i
]);
vp9_diff_update_prob
(
&
r
,
&
fc
->
partition_prob
[
j
][
i
]);
read_mv_probs
(
&
r
,
nmvc
,
cm
->
allow_high_precision_mv
);
read_mv_probs
(
nmvc
,
cm
->
allow_high_precision_mv
,
&
r
);
}
}
return
vp9_reader_has_error
(
&
r
);
return
vp9_reader_has_error
(
&
r
);
...
...
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