Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
external
libvpx
Commits
22c6ce03
Commit
22c6ce03
authored
11 years ago
by
Dmitry Kovalev
Committed by
Gerrit Code Review
11 years ago
Browse files
Options
Download
Plain Diff
Merge "Handling frame references and scale factors in one for loop." into experimental
parents
b42b41c8
994c79cc
v1.14.0-linphone
1.4.X
experimental
feature/update_to_v1.9.0-linphone
feature/uwp_nuget
forest
frame_parallel
highbitdepth
indianrunnerduck
javanwhistlingduck
khakicampbell
linphone
linphone-android
linphone-old
longtailedduck
m29-baseline
m31-baseline
m49-2623
m52-2743
m54-2840
m56-2924
m66-3359
m68-3440
mandarinduck
mcw
mcw2
nextgen
nextgenv2
pcs-2013
playground
sandbox/Jingning/experimental
sandbox/Jingning/transcode
sandbox/Jingning/vpx
sandbox/aconverse@google.com/ansbench
sandbox/debargha/playground
sandbox/hkuang/frame_parallel
sandbox/hkuang@google.com/decode
sandbox/jimbankoski@google.com/proposed-aom
sandbox/jingning@google.com/decoder_test_suite
sandbox/jingning@google.com/experimental
sandbox/jzern@google.com/test
sandbox/wangch@google.com/vp9
sandbox/yaowu@google.com/mergeaom
stable-vp9-decoder
v1.12.0-linphone
v1.6.1_linphone
v1.7.0-linphone
v1.9.0-linphone
v1.9.0
v1.9.0-rc1
v1.8.2
v1.8.1
v1.8.0
v1.7.0
v1.6.1
v1.6.0
v1.5.0
v1.4.0
v1.3.0
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
vp9/common/vp9_onyxc_int.h
+7
-5
vp9/common/vp9_onyxc_int.h
vp9/decoder/vp9_decodframe.c
+14
-20
vp9/decoder/vp9_decodframe.c
with
21 additions
and
25 deletions
vp9/common/vp9_onyxc_int.h
+
7
−
5
View file @
22c6ce03
...
...
@@ -181,12 +181,14 @@ typedef struct VP9Common {
int
fb_idx_ref_cnt
[
NUM_YV12_BUFFERS
];
/* reference counts */
int
ref_frame_map
[
NUM_REF_FRAMES
];
/* maps fb_idx to reference slot */
/* TODO(jkoleszar): could expand active_ref_idx to 4, with 0 as intra, and
* roll new_fb_idx into it.
*/
int
active_ref_idx
[
3
];
/* each frame can reference 3 buffers */
// TODO(jkoleszar): could expand active_ref_idx to 4, with 0 as intra, and
// roll new_fb_idx into it.
// Each frame can reference ALLOWED_REFS_PER_FRAME buffers
int
active_ref_idx
[
ALLOWED_REFS_PER_FRAME
];
struct
scale_factors
active_ref_scale
[
ALLOWED_REFS_PER_FRAME
];
int
new_fb_idx
;
struct
scale_factors
active_ref_scale
[
3
];
YV12_BUFFER_CONFIG
post_proc_buffer
;
YV12_BUFFER_CONFIG
temp_scale_frame
;
...
...
This diff is collapsed.
Click to expand it.
vp9/decoder/vp9_decodframe.c
+
14
−
20
View file @
22c6ce03
...
...
@@ -1479,10 +1479,18 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) {
// Should the GF or ARF be updated from the current frame
pbi
->
refresh_frame_flags
=
vp9_read_literal
(
&
header_bc
,
NUM_REF_FRAMES
);
// Select active reference frames
// Select active reference frames
and calculate scaling factors
for
(
i
=
0
;
i
<
ALLOWED_REFS_PER_FRAME
;
++
i
)
{
int
ref_frame_num
=
vp9_read_literal
(
&
header_bc
,
NUM_REF_FRAMES_LG2
);
pc
->
active_ref_idx
[
i
]
=
pc
->
ref_frame_map
[
ref_frame_num
];
const
int
ref
=
vp9_read_literal
(
&
header_bc
,
NUM_REF_FRAMES_LG2
);
const
int
mapped_ref
=
pc
->
ref_frame_map
[
ref
];
YV12_BUFFER_CONFIG
*
const
fb
=
&
pc
->
yv12_fb
[
mapped_ref
];
struct
scale_factors
*
const
sf
=
&
pc
->
active_ref_scale
[
i
];
pc
->
active_ref_idx
[
i
]
=
mapped_ref
;
if
(
mapped_ref
>=
NUM_YV12_BUFFERS
)
memset
(
sf
,
0
,
sizeof
(
*
sf
));
else
vp9_setup_scale_factors_for_frame
(
sf
,
fb
,
pc
->
width
,
pc
->
height
);
}
pc
->
ref_frame_sign_bias
[
GOLDEN_FRAME
]
=
vp9_read_bit
(
&
header_bc
);
...
...
@@ -1494,17 +1502,6 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) {
pc
->
use_interintra
=
vp9_read_bit
(
&
header_bc
);
#endif
// Calculate scaling factors for each of the 3 available references
for
(
i
=
0
;
i
<
ALLOWED_REFS_PER_FRAME
;
++
i
)
{
const
int
idx
=
pc
->
active_ref_idx
[
i
];
struct
scale_factors
*
sf
=
&
pc
->
active_ref_scale
[
i
];
if
(
idx
>=
NUM_YV12_BUFFERS
)
memset
(
sf
,
0
,
sizeof
(
*
sf
));
else
vp9_setup_scale_factors_for_frame
(
sf
,
&
pc
->
yv12_fb
[
idx
],
pc
->
width
,
pc
->
height
);
}
// To enable choice of different interpolation filters
vp9_setup_interp_filters
(
xd
,
pc
->
mcomp_filter_type
,
pc
);
}
...
...
@@ -1518,8 +1515,7 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) {
}
pc
->
frame_context_idx
=
vp9_read_literal
(
&
header_bc
,
NUM_FRAME_CONTEXTS_LG2
);
vpx_memcpy
(
&
pc
->
fc
,
&
pc
->
frame_contexts
[
pc
->
frame_context_idx
],
sizeof
(
pc
->
fc
));
pc
->
fc
=
pc
->
frame_contexts
[
pc
->
frame_context_idx
];
setup_segmentation
(
pc
,
xd
,
&
header_bc
);
...
...
@@ -1607,10 +1603,8 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) {
}
#endif
if
(
pc
->
refresh_entropy_probs
)
{
vpx_memcpy
(
&
pc
->
frame_contexts
[
pc
->
frame_context_idx
],
&
pc
->
fc
,
sizeof
(
pc
->
fc
));
}
if
(
pc
->
refresh_entropy_probs
)
pc
->
frame_contexts
[
pc
->
frame_context_idx
]
=
pc
->
fc
;
*
p_data_end
=
vp9_reader_find_end
(
&
residual_bc
);
return
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
Supports
Markdown
0%
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
Menu
Explore
Projects
Groups
Topics
Snippets