Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guillaume Martres
aom-rav1e
Commits
209c6cbf
Commit
209c6cbf
authored
Sep 27, 2013
by
Dmitry Kovalev
Browse files
Removing vp9_get_coef_neighbors_handle function.
Change-Id: I6be72c8b048d1ccc7ef43764cf84c32360098970
parent
db60c02c
Changes
6
Hide whitespace changes
Inline
Side-by-side
vp9/common/vp9_entropy.c
View file @
209c6cbf
...
...
@@ -569,31 +569,6 @@ void vp9_init_neighbors() {
vp9_default_scan_32x32_neighbors
);
}
const
int16_t
*
vp9_get_coef_neighbors_handle
(
const
int16_t
*
scan
)
{
if
(
scan
==
vp9_default_scan_4x4
)
{
return
vp9_default_scan_4x4_neighbors
;
}
else
if
(
scan
==
vp9_row_scan_4x4
)
{
return
vp9_row_scan_4x4_neighbors
;
}
else
if
(
scan
==
vp9_col_scan_4x4
)
{
return
vp9_col_scan_4x4_neighbors
;
}
else
if
(
scan
==
vp9_default_scan_8x8
)
{
return
vp9_default_scan_8x8_neighbors
;
}
else
if
(
scan
==
vp9_row_scan_8x8
)
{
return
vp9_row_scan_8x8_neighbors
;
}
else
if
(
scan
==
vp9_col_scan_8x8
)
{
return
vp9_col_scan_8x8_neighbors
;
}
else
if
(
scan
==
vp9_default_scan_16x16
)
{
return
vp9_default_scan_16x16_neighbors
;
}
else
if
(
scan
==
vp9_row_scan_16x16
)
{
return
vp9_row_scan_16x16_neighbors
;
}
else
if
(
scan
==
vp9_col_scan_16x16
)
{
return
vp9_col_scan_16x16_neighbors
;
}
else
{
assert
(
scan
==
vp9_default_scan_32x32
);
return
vp9_default_scan_32x32_neighbors
;
}
}
void
vp9_coef_tree_initialize
()
{
vp9_init_neighbors
();
init_bit_trees
();
...
...
vp9/common/vp9_entropy.h
View file @
209c6cbf
...
...
@@ -190,9 +190,6 @@ static INLINE int get_coef_context(const int16_t *neighbors,
token_cache
[
neighbors
[
MAX_NEIGHBORS
*
c
+
1
]])
>>
1
;
}
const
int16_t
*
vp9_get_coef_neighbors_handle
(
const
int16_t
*
scan
);
// 128 lists of probabilities are stored for the following ONE node probs:
// 1, 3, 5, 7, ..., 253, 255
// In between probabilities are interpolated linearly
...
...
@@ -367,22 +364,24 @@ static int get_entropy_context(TX_SIZE tx_size,
static
void
get_scan_and_band
(
const
MACROBLOCKD
*
xd
,
TX_SIZE
tx_size
,
PLANE_TYPE
type
,
int
block_idx
,
const
int16_t
**
scan
,
const
int16_t
**
scan_nb
,
const
uint8_t
**
band_translate
)
{
switch
(
tx_size
)
{
case
TX_4X4
:
*
scan
=
get_scan_4x4
(
get_tx_type_4x4
(
type
,
xd
,
block_idx
));
get_scan_
nb_
4x4
(
get_tx_type_4x4
(
type
,
xd
,
block_idx
)
,
scan
,
scan_nb
);
*
band_translate
=
vp9_coefband_trans_4x4
;
break
;
case
TX_8X8
:
*
scan
=
get_scan_8x8
(
get_tx_type_8x8
(
type
,
xd
));
get_scan_
nb_
8x8
(
get_tx_type_8x8
(
type
,
xd
)
,
scan
,
scan_nb
);
*
band_translate
=
vp9_coefband_trans_8x8plus
;
break
;
case
TX_16X16
:
*
scan
=
get_scan_16x16
(
get_tx_type_16x16
(
type
,
xd
));
get_scan_
nb_
16x16
(
get_tx_type_16x16
(
type
,
xd
)
,
scan
,
scan_nb
);
*
band_translate
=
vp9_coefband_trans_8x8plus
;
break
;
case
TX_32X32
:
*
scan
=
vp9_default_scan_32x32
;
*
scan_nb
=
vp9_default_scan_32x32_neighbors
;
*
band_translate
=
vp9_coefband_trans_8x8plus
;
break
;
default:
...
...
vp9/decoder/vp9_detokenize.c
View file @
209c6cbf
...
...
@@ -106,8 +106,7 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
const
uint8_t
*
band_translate
;
uint8_t
token_cache
[
1024
];
int
pt
=
get_entropy_context
(
tx_size
,
A
,
L
);
get_scan_and_band
(
xd
,
tx_size
,
type
,
block_idx
,
&
scan
,
&
band_translate
);
nb
=
vp9_get_coef_neighbors_handle
(
scan
);
get_scan_and_band
(
xd
,
tx_size
,
type
,
block_idx
,
&
scan
,
&
nb
,
&
band_translate
);
while
(
1
)
{
int
val
;
...
...
vp9/encoder/vp9_encodemb.c
View file @
209c6cbf
...
...
@@ -172,7 +172,7 @@ static void optimize_b(MACROBLOCK *mb,
assert
((
!
type
&&
!
plane
)
||
(
type
&&
plane
));
dqcoeff_ptr
=
BLOCK_OFFSET
(
pd
->
dqcoeff
,
block
);
qcoeff_ptr
=
BLOCK_OFFSET
(
pd
->
qcoeff
,
block
);
get_scan_and_band
(
xd
,
tx_size
,
type
,
ib
,
&
scan
,
&
band_translate
);
get_scan_and_band
(
xd
,
tx_size
,
type
,
ib
,
&
scan
,
&
nb
,
&
band_translate
);
assert
(
eob
<=
default_eob
);
/* Now set up a Viterbi trellis to evaluate alternative roundings. */
...
...
@@ -191,7 +191,6 @@ static void optimize_b(MACROBLOCK *mb,
for
(
i
=
0
;
i
<
eob
;
i
++
)
token_cache
[
scan
[
i
]]
=
vp9_pt_energy_class
[
vp9_dct_value_tokens_ptr
[
qcoeff_ptr
[
scan
[
i
]]].
token
];
nb
=
vp9_get_coef_neighbors_handle
(
scan
);
for
(
i
=
eob
;
i
--
>
i0
;)
{
int
base_bits
,
d2
,
dx
;
...
...
vp9/encoder/vp9_rdopt.c
View file @
209c6cbf
...
...
@@ -1097,6 +1097,7 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
for
(
idx
=
0
;
idx
<
num_4x4_blocks_wide
;
++
idx
)
{
int64_t
ssz
;
const
int16_t
*
scan
;
const
int16_t
*
nb
;
uint8_t
*
src
=
src_init
+
idx
*
4
+
idy
*
4
*
src_stride
;
uint8_t
*
dst
=
dst_init
+
idx
*
4
+
idy
*
4
*
dst_stride
;
...
...
@@ -1122,10 +1123,10 @@ static int64_t rd_pick_intra4x4block(VP9_COMP *cpi, MACROBLOCK *x, int ib,
x
->
quantize_b_4x4
(
x
,
block
,
tx_type
,
16
);
}
scan
=
get_scan_4x4
(
get_tx_type_4x4
(
PLANE_TYPE_Y_WITH_DC
,
xd
,
block
));
get_scan_nb_4x4
(
get_tx_type_4x4
(
PLANE_TYPE_Y_WITH_DC
,
xd
,
block
),
&
scan
,
&
nb
);
ratey
+=
cost_coeffs
(
x
,
0
,
block
,
tempa
+
idx
,
templ
+
idy
,
TX_4X4
,
scan
,
vp9_get_coef_neighbors_handle
(
scan
));
tempa
+
idx
,
templ
+
idy
,
TX_4X4
,
scan
,
nb
);
distortion
+=
vp9_block_error
(
coeff
,
BLOCK_OFFSET
(
pd
->
dqcoeff
,
block
),
16
,
&
ssz
)
>>
2
;
if
(
RDCOST
(
x
->
rdmult
,
x
->
rddiv
,
ratey
,
distortion
)
>=
best_rd
)
...
...
vp9/encoder/vp9_tokenize.c
View file @
209c6cbf
...
...
@@ -137,8 +137,7 @@ static void tokenize_b(int plane, int block, BLOCK_SIZE plane_bsize,
pt
=
get_entropy_context
(
tx_size
,
pd
->
above_context
+
aoff
,
pd
->
left_context
+
loff
);
get_scan_and_band
(
xd
,
tx_size
,
type
,
block
,
&
scan
,
&
band_translate
);
nb
=
vp9_get_coef_neighbors_handle
(
scan
);
get_scan_and_band
(
xd
,
tx_size
,
type
,
block
,
&
scan
,
&
nb
,
&
band_translate
);
c
=
0
;
do
{
const
int
band
=
get_coef_band
(
band_translate
,
c
);
...
...
Write
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!
Cancel
Please
register
or
sign in
to comment