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
da519166
Commit
da519166
authored
11 years ago
by
Dmitry Kovalev
Committed by
Gerrit Code Review
11 years ago
Browse files
Options
Download
Plain Diff
Merge "Cleaning up vp9_detokenize.c file."
parents
f7396f33
934e10d0
v1.14.0-linphone
1.4.X
feature/update_to_v1.9.0-linphone
feature/uwp_nuget
frame_parallel
highbitdepth
indianrunnerduck
javanwhistlingduck
khakicampbell
linphone
linphone-android
linphone-old
longtailedduck
m49-2623
m52-2743
m54-2840
m56-2924
m66-3359
m68-3440
mandarinduck
mcw
mcw2
nextgen
nextgenv2
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
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
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vp9/decoder/vp9_detokenize.c
+18
-25
vp9/decoder/vp9_detokenize.c
with
18 additions
and
25 deletions
vp9/decoder/vp9_detokenize.c
+
18
−
25
View file @
da519166
...
@@ -13,11 +13,8 @@
...
@@ -13,11 +13,8 @@
#include
"vp9/common/vp9_blockd.h"
#include
"vp9/common/vp9_blockd.h"
#include
"vp9/common/vp9_common.h"
#include
"vp9/common/vp9_common.h"
#include
"vp9/common/vp9_seg_common.h"
#include
"vp9/decoder/vp9_dboolhuff.h"
#include
"vp9/decoder/vp9_detokenize.h"
#include
"vp9/decoder/vp9_detokenize.h"
#include
"vp9/decoder/vp9_onyxd_int.h"
#define EOB_CONTEXT_NODE 0
#define EOB_CONTEXT_NODE 0
#define ZERO_CONTEXT_NODE 1
#define ZERO_CONTEXT_NODE 1
...
@@ -63,31 +60,29 @@ static const vp9_prob cat6_prob[15] = {
...
@@ -63,31 +60,29 @@ static const vp9_prob cat6_prob[15] = {
#define INCREMENT_COUNT(token) \
#define INCREMENT_COUNT(token) \
do { \
do { \
if (!cm->frame_parallel_decoding_mode) \
if (!cm->frame_parallel_decoding_mode) \
++coef_counts[band][
pt
][token];
\
++coef_counts[band][
ctx
][token]; \
} while (0)
} while (0)
#define WRITE_COEF_CONTINUE(val, token) \
#define WRITE_COEF_CONTINUE(val, token) \
{ \
{ \
v = (val * dqv) >> dq_shift; \
v = (val * dqv) >> dq_shift;
\
dqcoeff
_ptr
[scan[c]] =
(
vp9_read_bit(r) ? -v : v
)
; \
dqcoeff[scan[c]] = vp9_read_bit(r) ? -v : v;
\
token_cache[scan[c]] = vp9_pt_energy_class[token]; \
token_cache[scan[c]] = vp9_pt_energy_class[token]; \
++c; \
++c; \
pt
= get_coef_context(nb, token_cache, c);
\
ctx
= get_coef_context(nb, token_cache, c); \
dqv = dq[1];
\
dqv = dq[1]; \
continue; \
continue; \
}
}
#define ADJUST_COEF(prob, bits_count) \
#define ADJUST_COEF(prob, bits_count) \
do { \
do { \
val += (vp9_read(r, prob) << bits_count); \
val += (vp9_read(r, prob) << bits_count); \
} while (0)
} while (0)
static
int
decode_coefs
(
VP9_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
,
static
int
decode_coefs
(
VP9_COMMON
*
cm
,
const
MACROBLOCKD
*
xd
,
int
block
,
vp9_reader
*
r
,
int
block_idx
,
PLANE_TYPE
type
,
int16_t
*
dqcoeff
,
TX_SIZE
tx_size
,
PLANE_TYPE
type
,
int
max_eob
,
int16_t
*
dqcoeff_ptr
,
const
int16_t
*
dq
,
int
ctx
,
vp9_reader
*
r
)
{
TX_SIZE
tx_size
,
const
int16_t
*
dq
,
int
pt
)
{
const
int
max_eob
=
16
<<
(
tx_size
<<
1
);
const
FRAME_CONTEXT
*
const
fc
=
&
cm
->
fc
;
const
FRAME_CONTEXT
*
const
fc
=
&
cm
->
fc
;
FRAME_COUNTS
*
const
counts
=
&
cm
->
counts
;
FRAME_COUNTS
*
const
counts
=
&
cm
->
counts
;
const
int
ref
=
is_inter_block
(
&
xd
->
mi_8x8
[
0
]
->
mbmi
);
const
int
ref
=
is_inter_block
(
&
xd
->
mi_8x8
[
0
]
->
mbmi
);
...
@@ -103,7 +98,7 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
...
@@ -103,7 +98,7 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
const
uint8_t
*
cat6
;
const
uint8_t
*
cat6
;
const
uint8_t
*
band_translate
=
get_band_translate
(
tx_size
);
const
uint8_t
*
band_translate
=
get_band_translate
(
tx_size
);
const
int
dq_shift
=
(
tx_size
==
TX_32X32
);
const
int
dq_shift
=
(
tx_size
==
TX_32X32
);
const
scan_order
*
so
=
get_scan
(
xd
,
tx_size
,
type
,
block
_idx
);
const
scan_order
*
so
=
get_scan
(
xd
,
tx_size
,
type
,
block
);
const
int16_t
*
scan
=
so
->
scan
;
const
int16_t
*
scan
=
so
->
scan
;
const
int16_t
*
nb
=
so
->
neighbors
;
const
int16_t
*
nb
=
so
->
neighbors
;
int
v
;
int
v
;
...
@@ -112,9 +107,9 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
...
@@ -112,9 +107,9 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
while
(
c
<
max_eob
)
{
while
(
c
<
max_eob
)
{
int
val
;
int
val
;
band
=
*
band_translate
++
;
band
=
*
band_translate
++
;
prob
=
coef_probs
[
band
][
pt
];
prob
=
coef_probs
[
band
][
ctx
];
if
(
!
cm
->
frame_parallel_decoding_mode
)
if
(
!
cm
->
frame_parallel_decoding_mode
)
++
eob_branch_count
[
band
][
pt
];
++
eob_branch_count
[
band
][
ctx
];
if
(
!
vp9_read
(
r
,
prob
[
EOB_CONTEXT_NODE
]))
{
if
(
!
vp9_read
(
r
,
prob
[
EOB_CONTEXT_NODE
]))
{
INCREMENT_COUNT
(
EOB_MODEL_TOKEN
);
INCREMENT_COUNT
(
EOB_MODEL_TOKEN
);
break
;
break
;
...
@@ -127,9 +122,9 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
...
@@ -127,9 +122,9 @@ static int decode_coefs(VP9_COMMON *cm, const MACROBLOCKD *xd,
++
c
;
++
c
;
if
(
c
>=
max_eob
)
if
(
c
>=
max_eob
)
return
c
;
// zero tokens at the end (no eob token)
return
c
;
// zero tokens at the end (no eob token)
pt
=
get_coef_context
(
nb
,
token_cache
,
c
);
ctx
=
get_coef_context
(
nb
,
token_cache
,
c
);
band
=
*
band_translate
++
;
band
=
*
band_translate
++
;
prob
=
coef_probs
[
band
][
pt
];
prob
=
coef_probs
[
band
][
ctx
];
}
}
// ONE_CONTEXT_NODE_0_
// ONE_CONTEXT_NODE_0_
...
@@ -205,13 +200,11 @@ int vp9_decode_block_tokens(VP9_COMMON *cm, MACROBLOCKD *xd,
...
@@ -205,13 +200,11 @@ int vp9_decode_block_tokens(VP9_COMMON *cm, MACROBLOCKD *xd,
int
plane
,
int
block
,
BLOCK_SIZE
plane_bsize
,
int
plane
,
int
block
,
BLOCK_SIZE
plane_bsize
,
int
x
,
int
y
,
TX_SIZE
tx_size
,
vp9_reader
*
r
)
{
int
x
,
int
y
,
TX_SIZE
tx_size
,
vp9_reader
*
r
)
{
struct
macroblockd_plane
*
const
pd
=
&
xd
->
plane
[
plane
];
struct
macroblockd_plane
*
const
pd
=
&
xd
->
plane
[
plane
];
const
int
seg_eob
=
get_tx_eob
(
&
cm
->
seg
,
xd
->
mi_8x8
[
0
]
->
mbmi
.
segment_id
,
const
int
ctx
=
get_entropy_context
(
tx_size
,
pd
->
above_context
+
x
,
tx_size
);
pd
->
left_context
+
y
);
const
int
pt
=
get_entropy_context
(
tx_size
,
pd
->
above_context
+
x
,
const
int
eob
=
decode_coefs
(
cm
,
xd
,
block
,
pd
->
plane_type
,
pd
->
left_context
+
y
);
const
int
eob
=
decode_coefs
(
cm
,
xd
,
r
,
block
,
pd
->
plane_type
,
seg_eob
,
BLOCK_OFFSET
(
pd
->
dqcoeff
,
block
),
tx_size
,
BLOCK_OFFSET
(
pd
->
dqcoeff
,
block
),
tx_size
,
pd
->
dequant
,
pt
);
pd
->
dequant
,
ctx
,
r
);
set_contexts
(
xd
,
pd
,
plane_bsize
,
tx_size
,
eob
>
0
,
x
,
y
);
set_contexts
(
xd
,
pd
,
plane_bsize
,
tx_size
,
eob
>
0
,
x
,
y
);
return
eob
;
return
eob
;
}
}
...
...
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