mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 16:47:28 +01:00
Change pixel_subsampling from shift to divide
This commit is contained in:
1 parent
721678ed75
commit
3923bb9637
4 files changed
+63
-39
No files matched your search
@@ -1545,9 +1545,9 @@ typedef uint32_t wuffs_base__pixel_subsampling;
|
||||
#define WUFFS_BASE__PIXEL_SUBSAMPLING__420 \
|
||||
((wuffs_base__pixel_subsampling)0x111100)
|
||||
#define WUFFS_BASE__PIXEL_SUBSAMPLING__411 \
|
||||
((wuffs_base__pixel_subsampling)0x202000)
|
||||
((wuffs_base__pixel_subsampling)0x303000)
|
||||
#define WUFFS_BASE__PIXEL_SUBSAMPLING__410 \
|
||||
((wuffs_base__pixel_subsampling)0x212100)
|
||||
((wuffs_base__pixel_subsampling)0x313100)
|
||||
|
||||
static inline uint32_t //
|
||||
wuffs_base__pixel_subsampling__bias_x(wuffs_base__pixel_subsampling s,
|
||||
@@ -1557,10 +1557,10 @@ wuffs_base__pixel_subsampling__bias_x(wuffs_base__pixel_subsampling s,
|
||||
}
|
||||
|
||||
static inline uint32_t //
|
||||
wuffs_base__pixel_subsampling__shift_x(wuffs_base__pixel_subsampling s,
|
||||
uint32_t plane) {
|
||||
wuffs_base__pixel_subsampling__denominator_x(wuffs_base__pixel_subsampling s,
|
||||
uint32_t plane) {
|
||||
uint32_t shift = ((plane & 0x03) * 8) + 4;
|
||||
return (s >> shift) & 0x03;
|
||||
return ((s >> shift) & 0x03) + 1;
|
||||
}
|
||||
|
||||
static inline uint32_t //
|
||||
@@ -1571,10 +1571,10 @@ wuffs_base__pixel_subsampling__bias_y(wuffs_base__pixel_subsampling s,
|
||||
}
|
||||
|
||||
static inline uint32_t //
|
||||
wuffs_base__pixel_subsampling__shift_y(wuffs_base__pixel_subsampling s,
|
||||
uint32_t plane) {
|
||||
wuffs_base__pixel_subsampling__denominator_y(wuffs_base__pixel_subsampling s,
|
||||
uint32_t plane) {
|
||||
uint32_t shift = ((plane & 0x03) * 8) + 0;
|
||||
return (s >> shift) & 0x03;
|
||||
return ((s >> shift) & 0x03) + 1;
|
||||
}
|
||||
|
||||
// --------
|
||||
|
||||
Reference in new issue
Block a user