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
d571af76
Commit
d571af76
authored
11 years ago
by
Jingning Han
Committed by
Gerrit Code Review
11 years ago
Browse files
Options
Download
Plain Diff
Merge "Make coeff_optimize initialized per-plane"
parents
f7ece831
2f58faff
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
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/encoder/vp9_encodemb.c
+55
-34
vp9/encoder/vp9_encodemb.c
vp9/encoder/vp9_encodemb.h
+0
-2
vp9/encoder/vp9_encodemb.h
with
55 additions
and
36 deletions
vp9/encoder/vp9_encodemb.c
+
55
−
34
View file @
d571af76
...
...
@@ -370,40 +370,51 @@ static void optimize_block(int plane, int block, BLOCK_SIZE_TYPE bsize,
args
->
ctx
);
}
void
vp9_optimize_init
(
MACROBLOCKD
*
xd
,
BLOCK_SIZE_TYPE
bsize
,
struct
optimize_ctx
*
ctx
)
{
int
p
;
for
(
p
=
0
;
p
<
MAX_MB_PLANE
;
p
++
)
{
const
struct
macroblockd_plane
*
const
plane
=
&
xd
->
plane
[
p
];
const
int
bwl
=
b_width_log2
(
bsize
)
-
plane
->
subsampling_x
;
const
int
bhl
=
b_height_log2
(
bsize
)
-
plane
->
subsampling_y
;
const
MB_MODE_INFO
*
mbmi
=
&
xd
->
mode_info_context
->
mbmi
;
const
TX_SIZE
tx_size
=
p
?
get_uv_tx_size
(
mbmi
)
:
mbmi
->
txfm_size
;
int
i
,
j
;
for
(
i
=
0
;
i
<
1
<<
bwl
;
i
+=
1
<<
tx_size
)
{
int
c
=
0
;
ctx
->
ta
[
p
][
i
]
=
0
;
for
(
j
=
0
;
j
<
1
<<
tx_size
&&
!
c
;
j
++
)
{
c
=
ctx
->
ta
[
p
][
i
]
|=
plane
->
above_context
[
i
+
j
];
}
}
for
(
i
=
0
;
i
<
1
<<
bhl
;
i
+=
1
<<
tx_size
)
{
int
c
=
0
;
ctx
->
tl
[
p
][
i
]
=
0
;
for
(
j
=
0
;
j
<
1
<<
tx_size
&&
!
c
;
j
++
)
{
c
=
ctx
->
tl
[
p
][
i
]
|=
plane
->
left_context
[
i
+
j
];
}
}
void
optimize_init_b
(
int
plane
,
BLOCK_SIZE_TYPE
bsize
,
void
*
arg
)
{
const
struct
encode_b_args
*
const
args
=
arg
;
const
MACROBLOCKD
*
xd
=
&
args
->
x
->
e_mbd
;
const
struct
macroblockd_plane
*
const
pd
=
&
xd
->
plane
[
plane
];
const
int
bwl
=
b_width_log2
(
bsize
)
-
pd
->
subsampling_x
;
const
int
bhl
=
b_height_log2
(
bsize
)
-
pd
->
subsampling_y
;
const
int
bw
=
1
<<
bwl
,
bh
=
1
<<
bhl
;
const
MB_MODE_INFO
*
mbmi
=
&
xd
->
mode_info_context
->
mbmi
;
const
TX_SIZE
tx_size
=
plane
?
get_uv_tx_size
(
mbmi
)
:
mbmi
->
txfm_size
;
int
i
;
switch
(
tx_size
)
{
case
TX_4X4
:
vpx_memcpy
(
args
->
ctx
->
ta
[
plane
],
pd
->
above_context
,
sizeof
(
ENTROPY_CONTEXT
)
*
bw
);
vpx_memcpy
(
args
->
ctx
->
tl
[
plane
],
pd
->
left_context
,
sizeof
(
ENTROPY_CONTEXT
)
*
bh
);
break
;
case
TX_8X8
:
for
(
i
=
0
;
i
<
bw
;
i
+=
2
)
args
->
ctx
->
ta
[
plane
][
i
]
=
!!*
(
uint16_t
*
)
&
pd
->
above_context
[
i
];
for
(
i
=
0
;
i
<
bh
;
i
+=
2
)
args
->
ctx
->
tl
[
plane
][
i
]
=
!!*
(
uint16_t
*
)
&
pd
->
left_context
[
i
];
break
;
case
TX_16X16
:
for
(
i
=
0
;
i
<
bw
;
i
+=
4
)
args
->
ctx
->
ta
[
plane
][
i
]
=
!!*
(
uint32_t
*
)
&
pd
->
above_context
[
i
];
for
(
i
=
0
;
i
<
bh
;
i
+=
4
)
args
->
ctx
->
tl
[
plane
][
i
]
=
!!*
(
uint32_t
*
)
&
pd
->
left_context
[
i
];
break
;
case
TX_32X32
:
for
(
i
=
0
;
i
<
bw
;
i
+=
8
)
args
->
ctx
->
ta
[
plane
][
i
]
=
!!*
(
uint64_t
*
)
&
pd
->
above_context
[
i
];
for
(
i
=
0
;
i
<
bh
;
i
+=
8
)
args
->
ctx
->
tl
[
plane
][
i
]
=
!!*
(
uint64_t
*
)
&
pd
->
left_context
[
i
];
break
;
default:
assert
(
0
);
}
}
void
vp9_optimize_sby
(
VP9_COMMON
*
cm
,
MACROBLOCK
*
x
,
BLOCK_SIZE_TYPE
bsize
)
{
struct
optimize_ctx
ctx
;
struct
encode_b_args
arg
=
{
cm
,
x
,
&
ctx
};
vp9_
optimize_init
(
&
x
->
e_mbd
,
bsize
,
&
ctx
);
optimize_init
_b
(
0
,
bsize
,
&
arg
);
foreach_transformed_block_in_plane
(
&
x
->
e_mbd
,
bsize
,
0
,
optimize_block
,
&
arg
);
}
...
...
@@ -411,7 +422,10 @@ void vp9_optimize_sbuv(VP9_COMMON *const cm, MACROBLOCK *x,
BLOCK_SIZE_TYPE
bsize
)
{
struct
optimize_ctx
ctx
;
struct
encode_b_args
arg
=
{
cm
,
x
,
&
ctx
};
vp9_optimize_init
(
&
x
->
e_mbd
,
bsize
,
&
ctx
);
int
i
;
for
(
i
=
1
;
i
<
MAX_MB_PLANE
;
++
i
)
optimize_init_b
(
i
,
bsize
,
&
arg
);
foreach_transformed_block_uv
(
&
x
->
e_mbd
,
bsize
,
optimize_block
,
&
arg
);
}
...
...
@@ -553,7 +567,7 @@ void vp9_encode_sby(VP9_COMMON *cm, MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
vp9_subtract_sby
(
x
,
bsize
);
if
(
x
->
optimize
)
vp9_
optimize_init
(
xd
,
bsize
,
&
ctx
);
optimize_init
_b
(
0
,
bsize
,
&
arg
);
foreach_transformed_block_in_plane
(
xd
,
bsize
,
0
,
encode_block
,
&
arg
);
}
...
...
@@ -564,8 +578,11 @@ void vp9_encode_sbuv(VP9_COMMON *cm, MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
struct
encode_b_args
arg
=
{
cm
,
x
,
&
ctx
};
vp9_subtract_sbuv
(
x
,
bsize
);
if
(
x
->
optimize
)
vp9_optimize_init
(
xd
,
bsize
,
&
ctx
);
if
(
x
->
optimize
)
{
int
i
;
for
(
i
=
1
;
i
<
MAX_MB_PLANE
;
++
i
)
optimize_init_b
(
i
,
bsize
,
&
arg
);
}
foreach_transformed_block_uv
(
xd
,
bsize
,
encode_block
,
&
arg
);
}
...
...
@@ -576,8 +593,12 @@ void vp9_encode_sb(VP9_COMMON *cm, MACROBLOCK *x, BLOCK_SIZE_TYPE bsize) {
struct
encode_b_args
arg
=
{
cm
,
x
,
&
ctx
};
vp9_subtract_sb
(
x
,
bsize
);
if
(
x
->
optimize
)
vp9_optimize_init
(
xd
,
bsize
,
&
ctx
);
if
(
x
->
optimize
)
{
int
i
;
for
(
i
=
0
;
i
<
MAX_MB_PLANE
;
++
i
)
optimize_init_b
(
i
,
bsize
,
&
arg
);
}
foreach_transformed_block
(
xd
,
bsize
,
encode_block
,
&
arg
);
}
...
...
This diff is collapsed.
Click to expand it.
vp9/encoder/vp9_encodemb.h
+
0
−
2
View file @
d571af76
...
...
@@ -33,8 +33,6 @@ struct encode_b_args {
struct
optimize_ctx
*
ctx
;
};
void
vp9_optimize_init
(
MACROBLOCKD
*
xd
,
BLOCK_SIZE_TYPE
bsize
,
struct
optimize_ctx
*
ctx
);
void
vp9_optimize_b
(
int
plane
,
int
block
,
BLOCK_SIZE_TYPE
bsize
,
int
ss_txfrm_size
,
VP9_COMMON
*
cm
,
MACROBLOCK
*
x
,
struct
optimize_ctx
*
ctx
);
...
...
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