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
6706e674
Commit
6706e674
authored
11 years ago
by
Dmitry Kovalev
Browse files
Options
Download
Patches
Plain Diff
Moving several static functions from vp9_reconinter.h to vp9_reconinter.c.
Change-Id: I5da9c16bab26f6ff0c9d3a2a29ef6c84f5093161
parent
2cf0d4be
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_reconinter.c
+76
-8
vp9/common/vp9_reconinter.c
vp9/common/vp9_reconinter.h
+0
-77
vp9/common/vp9_reconinter.h
with
76 additions
and
85 deletions
vp9/common/vp9_reconinter.c
+
76
−
8
View file @
6706e674
...
@@ -17,6 +17,78 @@
...
@@ -17,6 +17,78 @@
#include
"vp9/common/vp9_reconinter.h"
#include
"vp9/common/vp9_reconinter.h"
#include
"vp9/common/vp9_reconintra.h"
#include
"vp9/common/vp9_reconintra.h"
static
int
scale_value_x_with_scaling
(
int
val
,
const
struct
scale_factors
*
scale
)
{
return
val
*
scale
->
x_num
/
scale
->
x_den
;
}
static
int
scale_value_y_with_scaling
(
int
val
,
const
struct
scale_factors
*
scale
)
{
return
val
*
scale
->
y_num
/
scale
->
y_den
;
}
static
int
unscaled_value
(
int
val
,
const
struct
scale_factors
*
scale
)
{
(
void
)
scale
;
return
val
;
}
static
int_mv32
mv_q3_to_q4_with_scaling
(
const
int_mv
*
src_mv
,
const
struct
scale_factors
*
scale
)
{
// returns mv * scale + offset
int_mv32
result
;
const
int32_t
mv_row_q4
=
src_mv
->
as_mv
.
row
<<
1
;
const
int32_t
mv_col_q4
=
src_mv
->
as_mv
.
col
<<
1
;
/* TODO(jkoleszar): make fixed point, or as a second multiply? */
result
.
as_mv
.
row
=
mv_row_q4
*
scale
->
y_num
/
scale
->
y_den
+
scale
->
y_offset_q4
;
result
.
as_mv
.
col
=
mv_col_q4
*
scale
->
x_num
/
scale
->
x_den
+
scale
->
x_offset_q4
;
return
result
;
}
static
int_mv32
mv_q3_to_q4_without_scaling
(
const
int_mv
*
src_mv
,
const
struct
scale_factors
*
scale
)
{
// returns mv * scale + offset
int_mv32
result
;
result
.
as_mv
.
row
=
src_mv
->
as_mv
.
row
<<
1
;
result
.
as_mv
.
col
=
src_mv
->
as_mv
.
col
<<
1
;
return
result
;
}
static
int32_t
mv_component_q4_with_scaling
(
int
mv_q4
,
int
num
,
int
den
,
int
offset_q4
)
{
// returns the scaled and offset value of the mv component.
/* TODO(jkoleszar): make fixed point, or as a second multiply? */
return
mv_q4
*
num
/
den
+
offset_q4
;
}
static
int32_t
mv_component_q4_without_scaling
(
int
mv_q4
,
int
num
,
int
den
,
int
offset_q4
)
{
// returns the scaled and offset value of the mv component.
(
void
)
num
;
(
void
)
den
;
(
void
)
offset_q4
;
return
mv_q4
;
}
static
void
set_offsets_with_scaling
(
struct
scale_factors
*
scale
,
int
row
,
int
col
)
{
const
int
x_q4
=
16
*
col
;
const
int
y_q4
=
16
*
row
;
scale
->
x_offset_q4
=
(
x_q4
*
scale
->
x_num
/
scale
->
x_den
)
&
0xf
;
scale
->
y_offset_q4
=
(
y_q4
*
scale
->
y_num
/
scale
->
y_den
)
&
0xf
;
}
static
void
set_offsets_without_scaling
(
struct
scale_factors
*
scale
,
int
row
,
int
col
)
{
scale
->
x_offset_q4
=
0
;
scale
->
y_offset_q4
=
0
;
}
void
vp9_setup_scale_factors_for_frame
(
struct
scale_factors
*
scale
,
void
vp9_setup_scale_factors_for_frame
(
struct
scale_factors
*
scale
,
int
other_w
,
int
other_h
,
int
other_w
,
int
other_h
,
int
this_w
,
int
this_h
)
{
int
this_w
,
int
this_h
)
{
...
@@ -34,18 +106,14 @@ void vp9_setup_scale_factors_for_frame(struct scale_factors *scale,
...
@@ -34,18 +106,14 @@ void vp9_setup_scale_factors_for_frame(struct scale_factors *scale,
scale
->
scale_value_x
=
unscaled_value
;
scale
->
scale_value_x
=
unscaled_value
;
scale
->
scale_value_y
=
unscaled_value
;
scale
->
scale_value_y
=
unscaled_value
;
scale
->
set_scaled_offsets
=
set_offsets_without_scaling
;
scale
->
set_scaled_offsets
=
set_offsets_without_scaling
;
scale
->
scale_motion_vector_q3_to_q4
=
scale
->
scale_motion_vector_q3_to_q4
=
mv_q3_to_q4_without_scaling
;
motion_vector_q3_to_q4_without_scaling
;
scale
->
scale_motion_vector_component_q4
=
mv_component_q4_without_scaling
;
scale
->
scale_motion_vector_component_q4
=
motion_vector_component_q4_without_scaling
;
}
else
{
}
else
{
scale
->
scale_value_x
=
scale_value_x_with_scaling
;
scale
->
scale_value_x
=
scale_value_x_with_scaling
;
scale
->
scale_value_y
=
scale_value_y_with_scaling
;
scale
->
scale_value_y
=
scale_value_y_with_scaling
;
scale
->
set_scaled_offsets
=
set_offsets_with_scaling
;
scale
->
set_scaled_offsets
=
set_offsets_with_scaling
;
scale
->
scale_motion_vector_q3_to_q4
=
scale
->
scale_motion_vector_q3_to_q4
=
mv_q3_to_q4_with_scaling
;
motion_vector_q3_to_q4_with_scaling
;
scale
->
scale_motion_vector_component_q4
=
mv_component_q4_with_scaling
;
scale
->
scale_motion_vector_component_q4
=
motion_vector_component_q4_with_scaling
;
}
}
// TODO(agrange): Investigate the best choice of functions to use here
// TODO(agrange): Investigate the best choice of functions to use here
...
...
This diff is collapsed.
Click to expand it.
vp9/common/vp9_reconinter.h
+
0
−
77
View file @
6706e674
...
@@ -52,21 +52,6 @@ void vp9_build_inter_predictor_q4(const uint8_t *src, int src_stride,
...
@@ -52,21 +52,6 @@ void vp9_build_inter_predictor_q4(const uint8_t *src, int src_stride,
int
w
,
int
h
,
int
do_avg
,
int
w
,
int
h
,
int
do_avg
,
const
struct
subpix_fn_table
*
subpix
);
const
struct
subpix_fn_table
*
subpix
);
static
int
scale_value_x_with_scaling
(
int
val
,
const
struct
scale_factors
*
scale
)
{
return
val
*
scale
->
x_num
/
scale
->
x_den
;
}
static
int
scale_value_y_with_scaling
(
int
val
,
const
struct
scale_factors
*
scale
)
{
return
val
*
scale
->
y_num
/
scale
->
y_den
;
}
static
int
unscaled_value
(
int
val
,
const
struct
scale_factors
*
scale
)
{
(
void
)
scale
;
return
val
;
}
static
int
scaled_buffer_offset
(
int
x_offset
,
int
y_offset
,
int
stride
,
static
int
scaled_buffer_offset
(
int
x_offset
,
int
y_offset
,
int
stride
,
const
struct
scale_factors
*
scale
)
{
const
struct
scale_factors
*
scale
)
{
const
int
x
=
scale
?
scale
->
scale_value_x
(
x_offset
,
scale
)
:
x_offset
;
const
int
x
=
scale
?
scale
->
scale_value_x
(
x_offset
,
scale
)
:
x_offset
;
...
@@ -137,66 +122,4 @@ static void set_scale_factors(MACROBLOCKD *xd,
...
@@ -137,66 +122,4 @@ static void set_scale_factors(MACROBLOCKD *xd,
xd
->
scale_factor_uv
[
1
]
=
xd
->
scale_factor
[
1
];
xd
->
scale_factor_uv
[
1
]
=
xd
->
scale_factor
[
1
];
}
}
static
void
set_offsets_with_scaling
(
struct
scale_factors
*
scale
,
int
row
,
int
col
)
{
const
int
x_q4
=
16
*
col
;
const
int
y_q4
=
16
*
row
;
scale
->
x_offset_q4
=
(
x_q4
*
scale
->
x_num
/
scale
->
x_den
)
&
0xf
;
scale
->
y_offset_q4
=
(
y_q4
*
scale
->
y_num
/
scale
->
y_den
)
&
0xf
;
}
static
void
set_offsets_without_scaling
(
struct
scale_factors
*
scale
,
int
row
,
int
col
)
{
scale
->
x_offset_q4
=
0
;
scale
->
y_offset_q4
=
0
;
}
static
int_mv32
motion_vector_q3_to_q4_with_scaling
(
const
int_mv
*
src_mv
,
const
struct
scale_factors
*
scale
)
{
// returns mv * scale + offset
int_mv32
result
;
const
int32_t
mv_row_q4
=
src_mv
->
as_mv
.
row
<<
1
;
const
int32_t
mv_col_q4
=
src_mv
->
as_mv
.
col
<<
1
;
/* TODO(jkoleszar): make fixed point, or as a second multiply? */
result
.
as_mv
.
row
=
mv_row_q4
*
scale
->
y_num
/
scale
->
y_den
+
scale
->
y_offset_q4
;
result
.
as_mv
.
col
=
mv_col_q4
*
scale
->
x_num
/
scale
->
x_den
+
scale
->
x_offset_q4
;
return
result
;
}
static
int_mv32
motion_vector_q3_to_q4_without_scaling
(
const
int_mv
*
src_mv
,
const
struct
scale_factors
*
scale
)
{
// returns mv * scale + offset
int_mv32
result
;
result
.
as_mv
.
row
=
src_mv
->
as_mv
.
row
<<
1
;
result
.
as_mv
.
col
=
src_mv
->
as_mv
.
col
<<
1
;
return
result
;
}
static
int32_t
motion_vector_component_q4_with_scaling
(
int
mv_q4
,
int
num
,
int
den
,
int
offset_q4
)
{
// returns the scaled and offset value of the mv component.
/* TODO(jkoleszar): make fixed point, or as a second multiply? */
return
mv_q4
*
num
/
den
+
offset_q4
;
}
static
int32_t
motion_vector_component_q4_without_scaling
(
int
mv_q4
,
int
num
,
int
den
,
int
offset_q4
)
{
// returns the scaled and offset value of the mv component.
(
void
)
num
;
(
void
)
den
;
(
void
)
offset_q4
;
return
mv_q4
;
}
#endif // VP9_COMMON_VP9_RECONINTER_H_
#endif // VP9_COMMON_VP9_RECONINTER_H_
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