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
8b71f3e0
Commit
8b71f3e0
authored
13 years ago
by
Yaowu Xu
Committed by
On2 (Google) Code Review
13 years ago
Browse files
Options
Download
Plain Diff
Merge "revised the rate distortion computation for UV" into experimental
parents
bc3dd313
f90983e1
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
vp9-preview
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
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vp8/encoder/rdopt.c
+65
-12
vp8/encoder/rdopt.c
with
65 additions
and
12 deletions
vp8/encoder/rdopt.c
+
65
−
12
View file @
8b71f3e0
...
...
@@ -739,7 +739,7 @@ static int vp8_rdcost_mby_8x8(MACROBLOCK *mb)
for
(
b
=
0
;
b
<
16
;
b
+=
4
)
cost
+=
cost_coeffs_8x8
(
mb
,
x
->
block
+
b
,
PLANE_TYPE_Y_NO_DC
,
ta
+
vp8_block2above
[
b
],
tl
+
vp8_block2left
[
b
],
ta
+
vp8_block2above
[
b
+
4
],
tl
+
vp8_block2left
[
b
+
4
]);
ta
+
vp8_block2above
[
b
+
1
],
tl
+
vp8_block2left
[
b
+
4
]);
cost
+=
cost_coeffs_2x2
(
mb
,
x
->
block
+
24
,
PLANE_TYPE_Y2
,
ta
+
vp8_block2above
[
24
],
tl
+
vp8_block2left
[
24
]);
...
...
@@ -1175,18 +1175,9 @@ static int rd_cost_mbuv(MACROBLOCK *mb)
static
int
rd_inter16x16_uv
(
VP8_COMP
*
cpi
,
MACROBLOCK
*
x
,
int
*
rate
,
int
*
distortion
,
int
fullpixel
)
{
#if CONFIG_T8X8
int
tx_type
=
x
->
e_mbd
.
mode_info_context
->
mbmi
.
txfm_size
;
#endif
ENCODEMB_INVOKE
(
IF_RTCD
(
&
cpi
->
rtcd
.
encodemb
),
submbuv
)(
x
->
src_diff
,
x
->
src
.
u_buffer
,
x
->
src
.
v_buffer
,
x
->
e_mbd
.
predictor
,
x
->
src
.
uv_stride
);
#if CONFIG_T8X8
if
(
tx_type
==
TX_8X8
)
vp8_transform_mbuv_8x8
(
x
);
else
#endif
vp8_transform_mbuv
(
x
);
vp8_quantize_mbuv
(
x
);
...
...
@@ -1195,6 +1186,49 @@ static int rd_inter16x16_uv(VP8_COMP *cpi, MACROBLOCK *x, int *rate,
return
RDCOST
(
x
->
rdmult
,
x
->
rddiv
,
*
rate
,
*
distortion
);
}
#if CONFIG_T8X8
static
int
rd_cost_mbuv_8x8
(
MACROBLOCK
*
mb
)
{
int
b
;
int
cost
=
0
;
MACROBLOCKD
*
x
=
&
mb
->
e_mbd
;
ENTROPY_CONTEXT_PLANES
t_above
,
t_left
;
ENTROPY_CONTEXT
*
ta
;
ENTROPY_CONTEXT
*
tl
;
vpx_memcpy
(
&
t_above
,
mb
->
e_mbd
.
above_context
,
sizeof
(
ENTROPY_CONTEXT_PLANES
));
vpx_memcpy
(
&
t_left
,
mb
->
e_mbd
.
left_context
,
sizeof
(
ENTROPY_CONTEXT_PLANES
));
ta
=
(
ENTROPY_CONTEXT
*
)
&
t_above
;
tl
=
(
ENTROPY_CONTEXT
*
)
&
t_left
;
for
(
b
=
16
;
b
<
24
;
b
+=
4
)
cost
+=
cost_coeffs_8x8
(
mb
,
x
->
block
+
b
,
PLANE_TYPE_UV
,
ta
+
vp8_block2above
[
b
],
tl
+
vp8_block2left
[
b
],
ta
+
vp8_block2above
[
b
+
1
],
tl
+
vp8_block2left
[
b
+
2
]);
return
cost
;
}
static
int
rd_inter16x16_uv_8x8
(
VP8_COMP
*
cpi
,
MACROBLOCK
*
x
,
int
*
rate
,
int
*
distortion
,
int
fullpixel
)
{
ENCODEMB_INVOKE
(
IF_RTCD
(
&
cpi
->
rtcd
.
encodemb
),
submbuv
)(
x
->
src_diff
,
x
->
src
.
u_buffer
,
x
->
src
.
v_buffer
,
x
->
e_mbd
.
predictor
,
x
->
src
.
uv_stride
);
vp8_transform_mbuv_8x8
(
x
);
vp8_quantize_mbuv_8x8
(
x
);
*
rate
=
rd_cost_mbuv_8x8
(
x
);
*
distortion
=
ENCODEMB_INVOKE
(
&
cpi
->
rtcd
.
encodemb
,
mbuverr
)(
x
)
/
4
;
return
RDCOST
(
x
->
rdmult
,
x
->
rddiv
,
*
rate
,
*
distortion
);
}
#endif
static
int
rd_inter4x4_uv
(
VP8_COMP
*
cpi
,
MACROBLOCK
*
x
,
int
*
rate
,
int
*
distortion
,
int
fullpixel
)
...
...
@@ -2776,7 +2810,17 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
// UV cost and distortion
vp8_build_inter16x16_predictors_mbuv
(
&
x
->
e_mbd
);
rd_inter16x16_uv
(
cpi
,
x
,
&
rate_uv
,
&
distortion_uv
,
cpi
->
common
.
full_pixel
);
#if CONFIG_T8X8
if
(
cpi
->
common
.
txfm_mode
==
ALLOW_8X8
)
rd_inter16x16_uv_8x8
(
cpi
,
x
,
&
rate_uv
,
&
distortion_uv
,
cpi
->
common
.
full_pixel
);
else
#endif
rd_inter16x16_uv
(
cpi
,
x
,
&
rate_uv
,
&
distortion_uv
,
cpi
->
common
.
full_pixel
);
rate2
+=
rate_uv
;
distortion2
+=
distortion_uv
;
mode_excluded
=
cpi
->
common
.
dual_pred_mode
==
DUAL_PREDICTION_ONLY
;
...
...
@@ -2864,7 +2908,16 @@ void vp8_rd_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset, int
distortion2
+=
distortion
;
/* UV cost and distortion */
rd_inter16x16_uv
(
cpi
,
x
,
&
rate_uv
,
&
distortion_uv
,
cpi
->
common
.
full_pixel
);
#if CONFIG_T8X8
if
(
cpi
->
common
.
txfm_mode
==
ALLOW_8X8
)
rd_inter16x16_uv_8x8
(
cpi
,
x
,
&
rate_uv
,
&
distortion_uv
,
cpi
->
common
.
full_pixel
);
else
#endif
rd_inter16x16_uv
(
cpi
,
x
,
&
rate_uv
,
&
distortion_uv
,
cpi
->
common
.
full_pixel
);
rate2
+=
rate_uv
;
distortion2
+=
distortion_uv
;
...
...
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