Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
bd161f9f
Commit
bd161f9f
authored
Oct 22, 2016
by
Jingning Han
Committed by
Gerrit Code Review
Oct 22, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Refactor decoder side qcoeff reset" into nextgenv2
parents
a1a753c7
1be18785
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
41 deletions
+43
-41
av1/decoder/decodeframe.c
av1/decoder/decodeframe.c
+32
-34
av1/decoder/detokenize.c
av1/decoder/detokenize.c
+10
-6
av1/decoder/detokenize.h
av1/decoder/detokenize.h
+1
-1
No files found.
av1/decoder/decodeframe.c
View file @
bd161f9f
...
...
@@ -251,34 +251,26 @@ static void read_mv_probs(nmv_context *ctx, int allow_hp, aom_reader *r) {
static
void
inverse_transform_block
(
MACROBLOCKD
*
xd
,
int
plane
,
const
TX_TYPE
tx_type
,
const
TX_SIZE
tx_size
,
uint8_t
*
dst
,
int
stride
,
int
eob
)
{
int
stride
,
int16_t
scan_line
,
int
eob
)
{
struct
macroblockd_plane
*
const
pd
=
&
xd
->
plane
[
plane
];
if
(
eob
>
0
)
{
tran_low_t
*
const
dqcoeff
=
pd
->
dqcoeff
;
INV_TXFM_PARAM
inv_txfm_param
;
inv_txfm_param
.
tx_type
=
tx_type
;
inv_txfm_param
.
tx_size
=
tx_size
;
inv_txfm_param
.
eob
=
eob
;
inv_txfm_param
.
lossless
=
xd
->
lossless
[
xd
->
mi
[
0
]
->
mbmi
.
segment_id
];
tran_low_t
*
const
dqcoeff
=
pd
->
dqcoeff
;
INV_TXFM_PARAM
inv_txfm_param
;
inv_txfm_param
.
tx_type
=
tx_type
;
inv_txfm_param
.
tx_size
=
tx_size
;
inv_txfm_param
.
eob
=
eob
;
inv_txfm_param
.
lossless
=
xd
->
lossless
[
xd
->
mi
[
0
]
->
mbmi
.
segment_id
];
#if CONFIG_AOM_HIGHBITDEPTH
if
(
xd
->
cur_buf
->
flags
&
YV12_FLAG_HIGHBITDEPTH
)
{
inv_txfm_param
.
bd
=
xd
->
bd
;
highbd_inv_txfm_add
(
dqcoeff
,
dst
,
stride
,
&
inv_txfm_param
);
}
else
{
if
(
xd
->
cur_buf
->
flags
&
YV12_FLAG_HIGHBITDEPTH
)
{
inv_txfm_param
.
bd
=
xd
->
bd
;
highbd_inv_txfm_add
(
dqcoeff
,
dst
,
stride
,
&
inv_txfm_param
);
}
else
{
#endif // CONFIG_AOM_HIGHBITDEPTH
inv_txfm_add
(
dqcoeff
,
dst
,
stride
,
&
inv_txfm_param
);
inv_txfm_add
(
dqcoeff
,
dst
,
stride
,
&
inv_txfm_param
);
#if CONFIG_AOM_HIGHBITDEPTH
}
#endif // CONFIG_AOM_HIGHBITDEPTH
// TODO(jingning): This cleans up different reset requests from various
// experiments, but incurs unnecessary memset size.
if
(
eob
==
1
)
dqcoeff
[
0
]
=
0
;
else
memset
(
dqcoeff
,
0
,
tx_size_2d
[
tx_size
]
*
sizeof
(
dqcoeff
[
0
]));
}
#endif // CONFIG_AOM_HIGHBITDEPTH
memset
(
dqcoeff
,
0
,
(
scan_line
+
1
)
*
sizeof
(
dqcoeff
[
0
]));
}
static
void
predict_and_reconstruct_intra_block
(
AV1_COMMON
*
cm
,
...
...
@@ -307,10 +299,13 @@ static void predict_and_reconstruct_intra_block(AV1_COMMON *cm,
if
(
!
mbmi
->
skip
)
{
TX_TYPE
tx_type
=
get_tx_type
(
plane_type
,
xd
,
block_idx
,
tx_size
);
const
SCAN_ORDER
*
scan_order
=
get_scan
(
cm
,
tx_size
,
tx_type
,
0
);
const
int
eob
=
av1_decode_block_tokens
(
xd
,
plane
,
scan_order
,
col
,
row
,
tx_size
,
tx_type
,
r
,
mbmi
->
segment_id
);
inverse_transform_block
(
xd
,
plane
,
tx_type
,
tx_size
,
dst
,
pd
->
dst
.
stride
,
eob
);
int16_t
max_scan_line
=
0
;
const
int
eob
=
av1_decode_block_tokens
(
xd
,
plane
,
scan_order
,
col
,
row
,
tx_size
,
tx_type
,
&
max_scan_line
,
r
,
mbmi
->
segment_id
);
if
(
eob
)
inverse_transform_block
(
xd
,
plane
,
tx_type
,
tx_size
,
dst
,
pd
->
dst
.
stride
,
max_scan_line
,
eob
);
}
}
...
...
@@ -341,13 +336,14 @@ static void decode_reconstruct_tx(AV1_COMMON *cm, MACROBLOCKD *const xd,
PLANE_TYPE
plane_type
=
(
plane
==
0
)
?
PLANE_TYPE_Y
:
PLANE_TYPE_UV
;
TX_TYPE
tx_type
=
get_tx_type
(
plane_type
,
xd
,
block
,
plane_tx_size
);
const
SCAN_ORDER
*
sc
=
get_scan
(
cm
,
plane_tx_size
,
tx_type
,
1
);
int16_t
max_scan_line
=
0
;
const
int
eob
=
av1_decode_block_tokens
(
xd
,
plane
,
sc
,
blk_col
,
blk_row
,
plane_tx_size
,
tx_type
,
r
,
mbmi
->
segment_id
);
tx_type
,
&
max_scan_line
,
r
,
mbmi
->
segment_id
);
inverse_transform_block
(
xd
,
plane
,
tx_type
,
plane_tx_size
,
&
pd
->
dst
.
buf
[
4
*
blk_row
*
pd
->
dst
.
stride
+
4
*
blk_col
],
pd
->
dst
.
stride
,
eob
);
pd
->
dst
.
stride
,
max_scan_line
,
eob
);
*
eob_total
+=
eob
;
}
else
{
int
bsl
=
b_width_log2_lookup
[
bsize
];
...
...
@@ -385,12 +381,14 @@ static int reconstruct_inter_block(AV1_COMMON *cm, MACROBLOCKD *const xd,
int
block_idx
=
(
row
<<
1
)
+
col
;
TX_TYPE
tx_type
=
get_tx_type
(
plane_type
,
xd
,
block_idx
,
tx_size
);
const
SCAN_ORDER
*
scan_order
=
get_scan
(
cm
,
tx_size
,
tx_type
,
1
);
const
int
eob
=
av1_decode_block_tokens
(
xd
,
plane
,
scan_order
,
col
,
row
,
tx_size
,
tx_type
,
r
,
segment_id
);
inverse_transform_block
(
xd
,
plane
,
tx_type
,
tx_size
,
&
pd
->
dst
.
buf
[
4
*
row
*
pd
->
dst
.
stride
+
4
*
col
],
pd
->
dst
.
stride
,
eob
);
int16_t
max_scan_line
=
0
;
const
int
eob
=
av1_decode_block_tokens
(
xd
,
plane
,
scan_order
,
col
,
row
,
tx_size
,
tx_type
,
&
max_scan_line
,
r
,
segment_id
);
if
(
eob
)
inverse_transform_block
(
xd
,
plane
,
tx_type
,
tx_size
,
&
pd
->
dst
.
buf
[
4
*
row
*
pd
->
dst
.
stride
+
4
*
col
],
pd
->
dst
.
stride
,
max_scan_line
,
eob
);
return
eob
;
}
#endif // !CONFIG_VAR_TX || CONFIG_SUPER_TX
...
...
av1/decoder/detokenize.c
View file @
bd161f9f
...
...
@@ -61,7 +61,7 @@ static int decode_coefs(const MACROBLOCKD *xd, PLANE_TYPE type,
dequant_val_type_nuq
*
dq_val
,
#endif // CONFIG_NEW_QUANT
int
ctx
,
const
int16_t
*
scan
,
const
int16_t
*
nb
,
aom_reader
*
r
)
int16_t
*
max_scan_line
,
aom_reader
*
r
)
#endif
{
FRAME_COUNTS
*
counts
=
xd
->
counts
;
...
...
@@ -166,6 +166,9 @@ static int decode_coefs(const MACROBLOCKD *xd, PLANE_TYPE type,
dqv_val
=
&
dq_val
[
band
][
0
];
#endif // CONFIG_NEW_QUANT
}
*
max_scan_line
=
AOMMAX
(
*
max_scan_line
,
scan
[
c
]);
#if CONFIG_RANS
cdf
=
&
coef_cdfs
[
band
][
ctx
];
token
=
ONE_TOKEN
+
...
...
@@ -327,7 +330,8 @@ void av1_decode_palette_tokens(MACROBLOCKD *const xd, int plane,
int
av1_decode_block_tokens
(
MACROBLOCKD
*
const
xd
,
int
plane
,
const
SCAN_ORDER
*
sc
,
int
x
,
int
y
,
TX_SIZE
tx_size
,
TX_TYPE
tx_type
,
aom_reader
*
r
,
int
seg_id
)
{
TX_TYPE
tx_type
,
int16_t
*
max_scan_line
,
aom_reader
*
r
,
int
seg_id
)
{
struct
macroblockd_plane
*
const
pd
=
&
xd
->
plane
[
plane
];
const
int16_t
*
const
dequant
=
pd
->
seg_dequant
[
seg_id
];
const
int
ctx
=
...
...
@@ -339,16 +343,16 @@ int av1_decode_block_tokens(MACROBLOCKD *const xd, int plane,
#endif // CONFIG_NEW_QUANT
#if CONFIG_AOM_QM
const
int
eob
=
decode_coefs
(
xd
,
pd
->
plane_type
,
pd
->
dqcoeff
,
tx_size
,
tx_type
,
dequant
,
ctx
,
sc
->
scan
,
sc
->
neighbors
,
r
,
pd
->
seg_iqmatrix
[
seg_id
]);
const
int
eob
=
decode_coefs
(
xd
,
pd
->
plane_type
,
pd
->
dqcoeff
,
tx_size
,
tx_type
,
dequant
,
ctx
,
sc
->
scan
,
sc
->
neighbors
,
&
sc
->
max_scan_line
,
r
,
pd
->
seg_iqmatrix
[
seg_id
]);
#else
const
int
eob
=
decode_coefs
(
xd
,
pd
->
plane_type
,
pd
->
dqcoeff
,
tx_size
,
tx_type
,
dequant
,
#if CONFIG_NEW_QUANT
pd
->
seg_dequant_nuq
[
seg_id
][
dq
],
#endif // CONFIG_NEW_QUANT
ctx
,
sc
->
scan
,
sc
->
neighbors
,
r
);
ctx
,
sc
->
scan
,
sc
->
neighbors
,
max_scan_line
,
r
);
#endif // CONFIG_AOM_QM
av1_set_contexts
(
xd
,
pd
,
tx_size
,
eob
>
0
,
x
,
y
);
return
eob
;
...
...
av1/decoder/detokenize.h
View file @
bd161f9f
...
...
@@ -28,7 +28,7 @@ void av1_decode_palette_tokens(MACROBLOCKD *const xd, int plane, aom_reader *r);
int
av1_decode_block_tokens
(
MACROBLOCKD
*
const
xd
,
int
plane
,
const
SCAN_ORDER
*
sc
,
int
x
,
int
y
,
TX_SIZE
tx_size
,
TX_TYPE
tx_type
,
TX_TYPE
tx_type
,
int16_t
*
max_scan_line
,
#if CONFIG_ANS
struct
AnsDecoder
*
const
r
,
#else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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