Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
2188df96
Commit
2188df96
authored
Nov 16, 2014
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/xbr: refactor alpha blending macros
parent
8706910c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
20 deletions
+6
-20
vf_xbr.c
libavfilter/vf_xbr.c
+6
-20
No files found.
libavfilter/vf_xbr.c
View file @
2188df96
...
...
@@ -76,26 +76,12 @@ static uint32_t pixel_diff(uint32_t x, uint32_t y, const uint32_t *r2y)
}
#define ALPHA_BLEND_128_W(dst, src) dst = ((src & LB_MASK) >> 1) + ((dst & LB_MASK) >> 1)
#define ALPHA_BLEND_32_W(dst, src) \
dst = ((RED_BLUE_MASK & ((dst & RED_BLUE_MASK) + ((((src & RED_BLUE_MASK) - \
(dst & RED_BLUE_MASK))) >> 3))) | (GREEN_MASK & ((dst & GREEN_MASK) + \
((((src & GREEN_MASK) - (dst & GREEN_MASK))) >> 3))))
#define ALPHA_BLEND_64_W(dst, src) \
dst = ((RED_BLUE_MASK & ((dst & RED_BLUE_MASK) + ((((src & RED_BLUE_MASK) - \
(dst & RED_BLUE_MASK))) >> 2))) | (GREEN_MASK & ((dst & GREEN_MASK) + \
((((src & GREEN_MASK) - (dst & GREEN_MASK))) >> 2))))
#define ALPHA_BLEND_192_W(dst, src) \
dst = ((RED_BLUE_MASK & ((dst & RED_BLUE_MASK) + ((((src & RED_BLUE_MASK) - \
(dst & RED_BLUE_MASK)) * 3) >> 2))) | (GREEN_MASK & ((dst & GREEN_MASK) + \
((((src & GREEN_MASK) - (dst & GREEN_MASK)) * 3) >> 2))))
#define ALPHA_BLEND_224_W(dst, src) \
dst = ((RED_BLUE_MASK & ((dst & RED_BLUE_MASK) + ((((src & RED_BLUE_MASK) - \
(dst & RED_BLUE_MASK)) * 7) >> 3))) | (GREEN_MASK & ((dst & GREEN_MASK) + \
((((src & GREEN_MASK) - (dst & GREEN_MASK)) * 7) >> 3))))
#define ALPHA_BLEND_BASE(a, b, m, s) ( (RED_BLUE_MASK & (((a) & RED_BLUE_MASK) + (((((b) & RED_BLUE_MASK) - ((a) & RED_BLUE_MASK)) * (m)) >> (s)))) \
| (GREEN_MASK & (((a) & GREEN_MASK) + (((((b) & GREEN_MASK) - ((a) & GREEN_MASK)) * (m)) >> (s)))))
#define ALPHA_BLEND_32_W(dst, src) dst = ALPHA_BLEND_BASE(dst, src, 1, 3)
#define ALPHA_BLEND_64_W(dst, src) dst = ALPHA_BLEND_BASE(dst, src, 1, 2)
#define ALPHA_BLEND_192_W(dst, src) dst = ALPHA_BLEND_BASE(dst, src, 3, 2)
#define ALPHA_BLEND_224_W(dst, src) dst = ALPHA_BLEND_BASE(dst, src, 7, 3)
#define df(A, B) pixel_diff(A, B, r2y)
#define eq(A, B) (df(A, B) < 155)
...
...
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