Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
aom-rav1e
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
aom-rav1e
Commits
3286abd8
Commit
3286abd8
authored
Aug 21, 2013
by
Dmitry Kovalev
Committed by
Gerrit Code Review
Aug 21, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Adding scale factor check."
parents
68789123
a3ae4c87
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
4 deletions
+22
-4
vp9/common/vp9_reconinter.c
vp9/common/vp9_reconinter.c
+1
-1
vp9/common/vp9_scale.c
vp9/common/vp9_scale.c
+16
-1
vp9/common/vp9_scale.h
vp9/common/vp9_scale.h
+4
-1
vp9/encoder/vp9_temporal_filter.c
vp9/encoder/vp9_temporal_filter.c
+1
-1
No files found.
vp9/common/vp9_reconinter.c
View file @
3286abd8
...
...
@@ -210,7 +210,7 @@ void vp9_setup_scale_factors(VP9_COMMON *cm, int i) {
vp9_zero
(
*
sf
);
}
else
{
YV12_BUFFER_CONFIG
*
const
fb
=
&
cm
->
yv12_fb
[
ref
];
vp9_setup_scale_factors_for_frame
(
sf
,
vp9_setup_scale_factors_for_frame
(
cm
,
sf
,
fb
->
y_crop_width
,
fb
->
y_crop_height
,
cm
->
width
,
cm
->
height
);
...
...
vp9/common/vp9_scale.c
View file @
3286abd8
...
...
@@ -10,6 +10,7 @@
#include "./vp9_rtcd.h"
#include "vp9/common/vp9_filter.h"
#include "vp9/common/vp9_onyxc_int.h"
#include "vp9/common/vp9_scale.h"
static
INLINE
int
scaled_x
(
int
val
,
const
struct
scale_factors
*
scale
)
{
...
...
@@ -61,9 +62,23 @@ static int get_fixed_point_scale_factor(int other_size, int this_size) {
return
(
other_size
<<
VP9_REF_SCALE_SHIFT
)
/
this_size
;
}
void
vp9_setup_scale_factors_for_frame
(
struct
scale_factors
*
scale
,
static
int
check_scale_factors
(
int
other_w
,
int
other_h
,
int
this_w
,
int
this_h
)
{
return
2
*
this_w
>=
other_w
&&
2
*
this_h
>=
other_h
&&
this_w
<=
16
*
other_w
&&
this_h
<=
16
*
other_h
;
}
void
vp9_setup_scale_factors_for_frame
(
struct
VP9Common
*
cm
,
struct
scale_factors
*
scale
,
int
other_w
,
int
other_h
,
int
this_w
,
int
this_h
)
{
if
(
!
check_scale_factors
(
other_w
,
other_h
,
this_w
,
this_h
))
vpx_internal_error
(
&
cm
->
error
,
VPX_CODEC_UNSUP_BITSTREAM
,
"Invalid scale factors"
);
scale
->
x_scale_fp
=
get_fixed_point_scale_factor
(
other_w
,
this_w
);
scale
->
x_offset_q4
=
0
;
// calculated per block
scale
->
x_step_q4
=
scaled_x
(
16
,
scale
);
...
...
vp9/common/vp9_scale.h
View file @
3286abd8
...
...
@@ -14,6 +14,8 @@
#include "vp9/common/vp9_mv.h"
#include "vp9/common/vp9_convolve.h"
struct
VP9Common
;
#define VP9_REF_SCALE_SHIFT 14
#define VP9_REF_NO_SCALE (1 << VP9_REF_SCALE_SHIFT)
...
...
@@ -33,7 +35,8 @@ struct scale_factors {
convolve_fn_t
predict
[
2
][
2
][
2
];
// horiz, vert, avg
};
void
vp9_setup_scale_factors_for_frame
(
struct
scale_factors
*
scale
,
void
vp9_setup_scale_factors_for_frame
(
struct
VP9Common
*
cm
,
struct
scale_factors
*
scale
,
int
other_w
,
int
other_h
,
int
this_w
,
int
this_h
);
...
...
vp9/encoder/vp9_temporal_filter.c
View file @
3286abd8
...
...
@@ -437,7 +437,7 @@ void vp9_temporal_filter_prepare(VP9_COMP *cpi, int distance) {
#endif
// Setup scaling factors. Scaling on each of the arnr frames is not supported
vp9_setup_scale_factors_for_frame
(
&
cpi
->
mb
.
e_mbd
.
scale_factor
[
0
],
vp9_setup_scale_factors_for_frame
(
cm
,
&
cpi
->
mb
.
e_mbd
.
scale_factor
[
0
],
cm
->
yv12_fb
[
cm
->
new_fb_idx
].
y_crop_width
,
cm
->
yv12_fb
[
cm
->
new_fb_idx
].
y_crop_height
,
cm
->
width
,
cm
->
height
);
...
...
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