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
d53492bb
Commit
d53492bb
authored
14 years ago
by
Scott LaVarnway
Committed by
Code Review
14 years ago
Browse files
Options
Download
Plain Diff
Merge "Revisited rd_pick_intra4x4block"
parents
b862c108
658454a0
v1.14.0-linphone
1.4.X
bali
cayuga
eider
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/atna/dec_sem_sync
sandbox/awatry/initial_opencl_implementation
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/jkoleszar/cached-multibit
sandbox/jkoleszar/new-rate-control
sandbox/jkoleszar/new-rtcd
sandbox/jkoleszar/reuse-modemv
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
v1.2.0
v1.1.0
v1.0.0
v0.9.7
v0.9.7-p1
v0.9.6
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vp8/encoder/rdopt.c
+23
-42
vp8/encoder/rdopt.c
with
23 additions
and
42 deletions
vp8/encoder/rdopt.c
+
23
−
42
View file @
d53492bb
...
...
@@ -584,33 +584,14 @@ static void macro_block_yrd( MACROBLOCK *mb,
*
Rate
=
vp8_rdcost_mby
(
mb
);
}
static
void
save
_predictor
(
unsigned
char
*
predictor
,
unsigned
char
*
dst
)
static
void
copy
_predictor
(
unsigned
char
*
dst
,
const
unsigned
char
*
predictor
)
{
int
r
,
c
;
for
(
r
=
0
;
r
<
4
;
r
++
)
{
for
(
c
=
0
;
c
<
4
;
c
++
)
{
*
dst
=
predictor
[
c
];
dst
++
;
}
predictor
+=
16
;
}
}
static
void
restore_predictor
(
unsigned
char
*
predictor
,
unsigned
char
*
dst
)
{
int
r
,
c
;
for
(
r
=
0
;
r
<
4
;
r
++
)
{
for
(
c
=
0
;
c
<
4
;
c
++
)
{
predictor
[
c
]
=
*
dst
;
dst
++
;
}
predictor
+=
16
;
}
const
unsigned
int
*
p
=
(
const
unsigned
int
*
)
predictor
;
unsigned
int
*
d
=
(
unsigned
int
*
)
dst
;
d
[
0
]
=
p
[
0
];
d
[
4
]
=
p
[
4
];
d
[
8
]
=
p
[
8
];
d
[
12
]
=
p
[
12
];
}
static
int
rd_pick_intra4x4block
(
VP8_COMP
*
cpi
,
...
...
@@ -633,9 +614,13 @@ static int rd_pick_intra4x4block(
ENTROPY_CONTEXT
ta
=
*
a
,
tempa
=
*
a
;
ENTROPY_CONTEXT
tl
=
*
l
,
templ
=
*
l
;
DECLARE_ALIGNED_ARRAY
(
16
,
unsigned
char
,
predictor
,
16
);
DECLARE_ALIGNED_ARRAY
(
16
,
short
,
dqcoeff
,
16
);
/*
* The predictor buffer is a 2d buffer with a stride of 16. Create
* a temp buffer that meets the stride requirements, but we are only
* interested in the left 4x4 block
* */
DECLARE_ALIGNED_ARRAY
(
16
,
unsigned
char
,
best_predictor
,
16
*
4
);
DECLARE_ALIGNED_ARRAY
(
16
,
short
,
best_dqcoeff
,
16
);
for
(
mode
=
B_DC_PRED
;
mode
<=
B_HU_PRED
;
mode
++
)
{
...
...
@@ -667,21 +652,17 @@ static int rd_pick_intra4x4block(
*
best_mode
=
mode
;
*
a
=
tempa
;
*
l
=
templ
;
save
_predictor
(
b
->
predictor
,
predictor
);
vpx_memcpy
(
dqcoeff
,
b
->
dqcoeff
,
32
);
copy
_predictor
(
b
est_
predictor
,
b
->
predictor
);
vpx_memcpy
(
best_
dqcoeff
,
b
->
dqcoeff
,
32
);
}
}
b
->
bmi
.
mode
=
(
B_PREDICTION_MODE
)(
*
best_mode
);
restore_predictor
(
b
->
predictor
,
predictor
);
vpx_memcpy
(
b
->
dqcoeff
,
dqcoeff
,
32
);
IDCT_INVOKE
(
IF_RTCD
(
&
cpi
->
rtcd
.
common
->
idct
),
idct16
)(
b
->
dqcoeff
,
b
->
diff
,
32
);
RECON_INVOKE
(
IF_RTCD
(
&
cpi
->
rtcd
.
common
->
recon
),
recon
)(
b
->
predictor
,
b
->
diff
,
*
(
b
->
base_dst
)
+
b
->
dst
,
b
->
dst_stride
);
IDCT_INVOKE
(
IF_RTCD
(
&
cpi
->
rtcd
.
common
->
idct
),
idct16
)(
best_dqcoeff
,
b
->
diff
,
32
);
RECON_INVOKE
(
IF_RTCD
(
&
cpi
->
rtcd
.
common
->
recon
),
recon
)(
best_predictor
,
b
->
diff
,
*
(
b
->
base_dst
)
+
b
->
dst
,
b
->
dst_stride
);
return
best_rd
;
}
int
vp8_rd_pick_intra4x4mby_modes
(
VP8_COMP
*
cpi
,
MACROBLOCK
*
mb
,
int
*
Rate
,
...
...
@@ -692,7 +673,7 @@ int vp8_rd_pick_intra4x4mby_modes(VP8_COMP *cpi, MACROBLOCK *mb, int *Rate,
int
cost
=
mb
->
mbmode_cost
[
xd
->
frame_type
]
[
B_PRED
];
int
distortion
=
0
;
int
tot_rate_y
=
0
;
int
total_rd
=
0
;
long
long
total_rd
=
0
;
ENTROPY_CONTEXT_PLANES
t_above
,
t_left
;
ENTROPY_CONTEXT
*
ta
;
ENTROPY_CONTEXT
*
tl
;
...
...
@@ -733,12 +714,12 @@ int vp8_rd_pick_intra4x4mby_modes(VP8_COMP *cpi, MACROBLOCK *mb, int *Rate,
tot_rate_y
+=
ry
;
mic
->
bmi
[
i
].
mode
=
xd
->
block
[
i
].
bmi
.
mode
=
best_mode
;
if
(
total_rd
>=
best_rd
)
break
;
if
(
total_rd
>=
(
long
long
)
best_rd
)
break
;
}
if
(
total_rd
>=
best_rd
)
return
INT_MAX
;
if
(
total_rd
>=
(
long
long
)
best_rd
)
return
INT_MAX
;
*
Rate
=
cost
;
*
rate_y
+=
tot_rate_y
;
...
...
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