Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
aom-rav1e
Commits
2c1785c0
Commit
2c1785c0
authored
Oct 01, 2017
by
Angie Chiang
Browse files
Let symbolrate accounts for coeff number as well
Change-Id: Ibdf1de139e8ce63b0be2d0cd1fd098f06739d8cc
parent
85e3b960
Changes
3
Hide whitespace changes
Inline
Side-by-side
av1/common/entropymode.h
View file @
2c1785c0
...
...
@@ -442,6 +442,7 @@ typedef struct FRAME_COUNTS {
#endif // CONFIG_LV_MAP
#if CONFIG_SYMBOLRATE
unsigned
int
coeff_num
[
2
];
// 0: zero coeff 1: non-zero coeff
unsigned
int
symbol_num
[
2
];
// 0: entropy symbol 1: non-entropy symbol
#endif
...
...
av1/decoder/decodetxb.c
View file @
2c1785c0
...
...
@@ -504,6 +504,9 @@ uint8_t av1_read_coeffs_txb(const AV1_COMMON *const cm, MACROBLOCKD *xd,
for
(
c
=
0
;
c
<
*
eob
;
++
c
)
{
int16_t
dqv
=
(
c
==
0
)
?
dequant
[
0
]
:
dequant
[
1
];
tran_low_t
*
v
=
&
tcoeffs
[
scan
[
c
]];
#if CONFIG_SYMBOLRATE
av1_record_coeff
(
counts
,
*
v
);
#endif
int
sign
=
(
*
v
)
<
0
;
*
v
=
(
abs
(
*
v
)
*
dqv
)
>>
shift
;
if
(
sign
)
*
v
=
-
(
*
v
);
...
...
av1/decoder/symbolrate.h
View file @
2c1785c0
...
...
@@ -17,7 +17,8 @@
#if CONFIG_SYMBOLRATE
static
INLINE
void
av1_dump_symbol_rate
(
struct
AV1Common
*
cm
)
{
const
FRAME_COUNTS
*
counts
=
&
cm
->
counts
;
printf
(
"%d %d
\n
"
,
counts
->
symbol_num
[
0
],
counts
->
symbol_num
[
1
]);
printf
(
"%d %d %d %d
\n
"
,
counts
->
coeff_num
[
0
],
counts
->
coeff_num
[
1
],
counts
->
symbol_num
[
0
],
counts
->
symbol_num
[
1
]);
}
static
INLINE
int
av1_read_record_symbol
(
FRAME_COUNTS
*
counts
,
aom_reader
*
r
,
aom_cdf_prob
*
cdf
,
int
nsymbs
,
...
...
@@ -33,6 +34,10 @@ static INLINE int av1_read_record_bit(FRAME_COUNTS *counts, aom_reader *r,
if
(
counts
)
++
counts
->
symbol_num
[
1
];
return
aom_read_bit
(
r
,
str
);
}
static
INLINE
void
av1_record_coeff
(
FRAME_COUNTS
*
counts
,
tran_low_t
qcoeff
)
{
if
(
counts
)
++
counts
->
coeff_num
[
qcoeff
!=
0
];
}
#else // CONFIG_SYMBOLRATE
#define av1_read_record_symbol(counts, r, cdf, nsymbs, ACCT_STR_NAME) \
...
...
Write
Preview
Supports
Markdown
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