Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
aom-rav1e
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
aom-rav1e
Commits
e97b5ea6
Commit
e97b5ea6
authored
Aug 15, 2017
by
Angie Chiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace stride by bwl in get_level_count()
Change-Id: Id191159a851513b6eb3f2ddd104a1299eed59292
parent
defa7bf1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
11 deletions
+10
-11
av1/common/txb_common.h
av1/common/txb_common.h
+4
-3
av1/encoder/encodetxb.c
av1/encoder/encodetxb.c
+6
-8
No files found.
av1/common/txb_common.h
View file @
e97b5ea6
...
...
@@ -36,16 +36,17 @@ static int base_ref_offset[BASE_CONTEXT_POSITION_NUM][2] = {
/* clang-format on*/
};
static
INLINE
int
get_level_count
(
const
tran_low_t
*
tcoeffs
,
int
stride
,
static
INLINE
int
get_level_count
(
const
tran_low_t
*
tcoeffs
,
int
bwl
,
int
height
,
int
row
,
int
col
,
int
level
,
int
(
*
nb_offset
)[
2
],
int
nb_num
)
{
int
count
=
0
;
for
(
int
idx
=
0
;
idx
<
nb_num
;
++
idx
)
{
const
int
ref_row
=
row
+
nb_offset
[
idx
][
0
];
const
int
ref_col
=
col
+
nb_offset
[
idx
][
1
];
const
int
pos
=
ref_row
*
stride
+
ref_col
;
if
(
ref_row
<
0
||
ref_col
<
0
||
ref_row
>=
height
||
ref_col
>=
stride
)
if
(
ref_row
<
0
||
ref_col
<
0
||
ref_row
>=
height
||
ref_col
>=
(
1
<<
bwl
)
)
continue
;
const
int
pos
=
(
ref_row
<<
bwl
)
+
ref_col
;
tran_low_t
abs_coeff
=
abs
(
tcoeffs
[
pos
]);
count
+=
abs_coeff
>
level
;
}
...
...
av1/encoder/encodetxb.c
View file @
e97b5ea6
...
...
@@ -412,19 +412,18 @@ static void gen_base_count_mag_arr(int (*base_count_arr)[MAX_TX_SQUARE],
int
(
*
base_mag_arr
)[
2
],
const
tran_low_t
*
qcoeff
,
int
bwl
,
int
height
,
int
eob
,
const
int16_t
*
scan
)
{
const
int
stride
=
1
<<
bwl
;
for
(
int
c
=
0
;
c
<
eob
;
++
c
)
{
const
int
coeff_idx
=
scan
[
c
];
// raster order
if
(
!
has_base
(
qcoeff
[
coeff_idx
],
0
))
continue
;
const
int
row
=
coeff_idx
/
stride
;
const
int
col
=
coeff_idx
%
stride
;
const
int
row
=
coeff_idx
>>
bwl
;
const
int
col
=
coeff_idx
-
(
row
<<
bwl
)
;
int
*
mag
=
base_mag_arr
[
coeff_idx
];
get_mag
(
mag
,
qcoeff
,
bwl
,
height
,
row
,
col
,
base_ref_offset
,
BASE_CONTEXT_POSITION_NUM
);
for
(
int
i
=
0
;
i
<
NUM_BASE_LEVELS
;
++
i
)
{
if
(
!
has_base
(
qcoeff
[
coeff_idx
],
i
))
continue
;
int
*
count
=
base_count_arr
[
i
]
+
coeff_idx
;
*
count
=
get_level_count
(
qcoeff
,
stride
,
height
,
row
,
col
,
i
,
*
count
=
get_level_count
(
qcoeff
,
bwl
,
height
,
row
,
col
,
i
,
base_ref_offset
,
BASE_CONTEXT_POSITION_NUM
);
}
}
...
...
@@ -484,15 +483,14 @@ static INLINE int has_br(tran_low_t qc) {
static
void
gen_br_count_mag_arr
(
int
*
br_count_arr
,
int
(
*
br_mag_arr
)[
2
],
const
tran_low_t
*
qcoeff
,
int
bwl
,
int
height
,
int
eob
,
const
int16_t
*
scan
)
{
const
int
stride
=
1
<<
bwl
;
for
(
int
c
=
0
;
c
<
eob
;
++
c
)
{
const
int
coeff_idx
=
scan
[
c
];
// raster order
if
(
!
has_br
(
qcoeff
[
coeff_idx
]))
continue
;
const
int
row
=
coeff_idx
/
stride
;
const
int
col
=
coeff_idx
%
stride
;
const
int
row
=
coeff_idx
>>
bwl
;
const
int
col
=
coeff_idx
-
(
row
<<
bwl
)
;
int
*
count
=
br_count_arr
+
coeff_idx
;
int
*
mag
=
br_mag_arr
[
coeff_idx
];
*
count
=
get_level_count
(
qcoeff
,
stride
,
height
,
row
,
col
,
NUM_BASE_LEVELS
,
*
count
=
get_level_count
(
qcoeff
,
bwl
,
height
,
row
,
col
,
NUM_BASE_LEVELS
,
br_ref_offset
,
BR_CONTEXT_POSITION_NUM
);
get_mag
(
mag
,
qcoeff
,
bwl
,
height
,
row
,
col
,
br_ref_offset
,
BR_CONTEXT_POSITION_NUM
);
...
...
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