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
231cba45
Commit
231cba45
authored
Sep 27, 2017
by
Angie Chiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow one-sided scan count down sampling
Change-Id: I164add43e9d75af82312b464a176cdf0045ef9e1
parent
1a4bae1f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
88 additions
and
25 deletions
+88
-25
av1/common/scan.c
av1/common/scan.c
+88
-25
No files found.
av1/common/scan.c
View file @
231cba45
...
...
@@ -6620,18 +6620,47 @@ void av1_down_sample_scan_count(uint32_t *non_zero_count_ds,
TX_SIZE tx_size) {
const int tx_w = tx_size_wide[tx_size];
const int tx_h = tx_size_high[tx_size];
const int tx_w_ds = tx_w >> 1;
const int tx_h_ds = tx_h >> 1;
for (int r_ds = 0; r_ds < tx_h_ds; ++r_ds) {
for (int c_ds = 0; c_ds < tx_w_ds; ++c_ds) {
const int ci_ds = r_ds * tx_w_ds + c_ds;
const int r = r_ds << 1;
const int c = c_ds << 1;
const int ci = r * tx_w + c;
non_zero_count_ds[ci_ds] = non_zero_count[ci] + non_zero_count[ci + 1] +
non_zero_count[ci + tx_w] +
non_zero_count[ci + 1 + tx_w];
if (tx_w > 8 && tx_h > 8) {
const int tx_w_ds = tx_w >> 1;
const int tx_h_ds = tx_h >> 1;
for (int r_ds = 0; r_ds < tx_h_ds; ++r_ds) {
for (int c_ds = 0; c_ds < tx_w_ds; ++c_ds) {
const int ci_ds = r_ds * tx_w_ds + c_ds;
const int r = r_ds << 1;
const int c = c_ds << 1;
const int ci = r * tx_w + c;
non_zero_count_ds[ci_ds] = non_zero_count[ci] + non_zero_count[ci + 1] +
non_zero_count[ci + tx_w] +
non_zero_count[ci + 1 + tx_w];
}
}
} else if (tx_w > 8 && tx_h <= 8) {
const int tx_w_ds = tx_w >> 1;
const int tx_h_ds = tx_h;
for (int r_ds = 0; r_ds < tx_h_ds; ++r_ds) {
for (int c_ds = 0; c_ds < tx_w_ds; ++c_ds) {
const int ci_ds = r_ds * tx_w_ds + c_ds;
const int r = r_ds;
const int c = c_ds << 1;
const int ci = r * tx_w + c;
non_zero_count_ds[ci_ds] = non_zero_count[ci] + non_zero_count[ci + 1];
}
}
} else if (tx_w <= 8 && tx_h > 8) {
const int tx_w_ds = tx_w;
const int tx_h_ds = tx_h >> 1;
for (int r_ds = 0; r_ds < tx_h_ds; ++r_ds) {
for (int c_ds = 0; c_ds < tx_w_ds; ++c_ds) {
const int ci_ds = r_ds * tx_w_ds + c_ds;
const int r = r_ds << 1;
const int c = c_ds;
const int ci = r * tx_w + c;
non_zero_count_ds[ci_ds] =
non_zero_count[ci] + non_zero_count[ci + tx_w];
}
}
} else {
assert(0);
}
}
...
...
@@ -6640,21 +6669,55 @@ void av1_up_sample_scan_count(uint32_t *non_zero_count,
TX_SIZE tx_size, unsigned int block_num) {
const int tx_w = tx_size_wide[tx_size];
const int tx_h = tx_size_high[tx_size];
const int tx_w_ds = tx_w >> 1;
const int tx_h_ds = tx_h >> 1;
for (int r_ds = 0; r_ds < tx_h_ds; ++r_ds) {
for (int c_ds = 0; c_ds < tx_w_ds; ++c_ds) {
const int ci_ds = r_ds * tx_w_ds + c_ds;
const int r = r_ds << 1;
const int c = c_ds << 1;
const int ci = r * tx_w + c;
uint32_t count = ROUND_POWER_OF_TWO(non_zero_count_ds[ci_ds], 2);
clamp64(count, 0, block_num);
non_zero_count[ci] = count;
non_zero_count[ci + 1] = count;
non_zero_count[ci + tx_w] = count;
non_zero_count[ci + tx_w + 1] = count;
if (tx_w > 8 && tx_h > 8) {
const int tx_w_ds = tx_w >> 1;
const int tx_h_ds = tx_h >> 1;
for (int r_ds = 0; r_ds < tx_h_ds; ++r_ds) {
for (int c_ds = 0; c_ds < tx_w_ds; ++c_ds) {
const int ci_ds = r_ds * tx_w_ds + c_ds;
const int r = r_ds << 1;
const int c = c_ds << 1;
const int ci = r * tx_w + c;
uint32_t count = ROUND_POWER_OF_TWO(non_zero_count_ds[ci_ds], 2);
count = clamp64(count, 0, block_num);
non_zero_count[ci] = count;
non_zero_count[ci + 1] = count;
non_zero_count[ci + tx_w] = count;
non_zero_count[ci + tx_w + 1] = count;
}
}
} else if (tx_w > 8 && tx_h <= 8) {
const int tx_w_ds = tx_w >> 1;
const int tx_h_ds = tx_h;
for (int r_ds = 0; r_ds < tx_h_ds; ++r_ds) {
for (int c_ds = 0; c_ds < tx_w_ds; ++c_ds) {
const int ci_ds = r_ds * tx_w_ds + c_ds;
const int r = r_ds;
const int c = c_ds << 1;
const int ci = r * tx_w + c;
uint32_t count = ROUND_POWER_OF_TWO(non_zero_count_ds[ci_ds], 1);
count = clamp64(count, 0, block_num);
non_zero_count[ci] = count;
non_zero_count[ci + 1] = count;
}
}
} else if (tx_w <= 8 && tx_h > 8) {
const int tx_w_ds = tx_w;
const int tx_h_ds = tx_h >> 1;
for (int r_ds = 0; r_ds < tx_h_ds; ++r_ds) {
for (int c_ds = 0; c_ds < tx_w_ds; ++c_ds) {
const int ci_ds = r_ds * tx_w_ds + c_ds;
const int r = r_ds << 1;
const int c = c_ds;
const int ci = r * tx_w + c;
uint32_t count = ROUND_POWER_OF_TWO(non_zero_count_ds[ci_ds], 1);
count = clamp64(count, 0, block_num);
non_zero_count[ci] = count;
non_zero_count[ci + tx_w] = count;
}
}
} else {
assert(0);
}
}
#endif
...
...
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