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
5c558224
Commit
5c558224
authored
May 14, 2013
by
Dmitry Kovalev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moving the same code to new function vp9_setup_scale_factors.
Change-Id: I2408ad22717784a40e23701ccb9d978265440e4f
parent
cd16fe91
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
23 deletions
+22
-23
vp9/common/vp9_reconinter.c
vp9/common/vp9_reconinter.c
+15
-0
vp9/common/vp9_reconinter.h
vp9/common/vp9_reconinter.h
+2
-0
vp9/decoder/vp9_decodframe.c
vp9/decoder/vp9_decodframe.c
+3
-13
vp9/encoder/vp9_onyx_if.c
vp9/encoder/vp9_onyx_if.c
+2
-10
No files found.
vp9/common/vp9_reconinter.c
View file @
5c558224
...
...
@@ -492,3 +492,18 @@ void vp9_build_inter4x4_predictors_mbuv(MACROBLOCKD *xd,
vp9_build_inter_predictors_sbuv
(
xd
,
mb_row
,
mb_col
,
BLOCK_SIZE_MB16X16
);
}
// TODO(dkovalev: find better place for this function)
void
vp9_setup_scale_factors
(
VP9_COMMON
*
cm
,
int
i
)
{
const
int
ref
=
cm
->
active_ref_idx
[
i
];
struct
scale_factors
*
const
sf
=
&
cm
->
active_ref_scale
[
i
];
if
(
ref
>=
NUM_YV12_BUFFERS
)
{
memset
(
sf
,
0
,
sizeof
(
*
sf
));
}
else
{
YV12_BUFFER_CONFIG
*
const
fb
=
&
cm
->
yv12_fb
[
ref
];
vp9_setup_scale_factors_for_frame
(
sf
,
fb
->
y_crop_width
,
fb
->
y_crop_height
,
cm
->
width
,
cm
->
height
);
}
}
vp9/common/vp9_reconinter.h
View file @
5c558224
...
...
@@ -122,4 +122,6 @@ static void set_scale_factors(MACROBLOCKD *xd,
xd
->
scale_factor_uv
[
1
]
=
xd
->
scale_factor
[
1
];
}
void
vp9_setup_scale_factors
(
VP9_COMMON
*
cm
,
int
i
);
#endif // VP9_COMMON_VP9_RECONINTER_H_
vp9/decoder/vp9_decodframe.c
View file @
5c558224
...
...
@@ -1021,23 +1021,13 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) {
// Select active reference frames and calculate scaling factors
for
(
i
=
0
;
i
<
ALLOWED_REFS_PER_FRAME
;
++
i
)
{
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
->
y_crop_width
,
fb
->
y_crop_height
,
pc
->
width
,
pc
->
height
);
pc
->
active_ref_idx
[
i
]
=
pc
->
ref_frame_map
[
ref
];
vp9_setup_scale_factors
(
pc
,
i
);
}
// Read the sign bias for each reference frame buffer.
for
(
i
=
0
;
i
<
ALLOWED_REFS_PER_FRAME
;
++
i
)
{
for
(
i
=
0
;
i
<
ALLOWED_REFS_PER_FRAME
;
++
i
)
pc
->
ref_frame_sign_bias
[
i
+
1
]
=
vp9_read_bit
(
&
header_bc
);
}
xd
->
allow_high_precision_mv
=
vp9_read_bit
(
&
header_bc
);
pc
->
mcomp_filter_type
=
read_mcomp_filter_type
(
&
header_bc
);
...
...
vp9/encoder/vp9_onyx_if.c
View file @
5c558224
...
...
@@ -3860,16 +3860,8 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags,
VP9BORDERINPIXELS
);
// Calculate scaling factors for each of the 3 available references
for
(
i
=
0
;
i
<
ALLOWED_REFS_PER_FRAME
;
++
i
)
{
if
(
cm
->
active_ref_idx
[
i
]
>=
NUM_YV12_BUFFERS
)
{
memset
(
&
cm
->
active_ref_scale
[
i
],
0
,
sizeof
(
cm
->
active_ref_scale
[
i
]));
}
else
{
YV12_BUFFER_CONFIG
*
fb
=
&
cm
->
yv12_fb
[
cm
->
active_ref_idx
[
i
]];
vp9_setup_scale_factors_for_frame
(
&
cm
->
active_ref_scale
[
i
],
fb
->
y_crop_width
,
fb
->
y_crop_height
,
cm
->
width
,
cm
->
height
);
}
}
for
(
i
=
0
;
i
<
ALLOWED_REFS_PER_FRAME
;
++
i
)
vp9_setup_scale_factors
(
cm
,
i
);
vp9_setup_interp_filters
(
&
cpi
->
mb
.
e_mbd
,
DEFAULT_INTERP_FILTER
,
cm
);
...
...
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