mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 22:28:22 +01:00
make ALIGN_xxx naming consistent
(potentially for future factorization between enc/ and dec/) Change-Id: Ibf6670e21433a6a6a7202dcbe76f7efc8493b8cf
This commit is contained in:
parent
57606047ec
commit
432e5b550e
@ -15,7 +15,8 @@
|
|||||||
#include "./vp8i.h"
|
#include "./vp8i.h"
|
||||||
#include "../utils/utils.h"
|
#include "../utils/utils.h"
|
||||||
|
|
||||||
#define ALIGN_MASK (32 - 1)
|
#define ALIGN_CST (32 - 1)
|
||||||
|
#define DO_ALIGN(PTR) ((uintptr_t)((PTR) + ALIGN_CST) & ~ALIGN_CST)
|
||||||
|
|
||||||
static void ReconstructRow(const VP8Decoder* const dec,
|
static void ReconstructRow(const VP8Decoder* const dec,
|
||||||
const VP8ThreadContext* ctx); // TODO(skal): remove
|
const VP8ThreadContext* ctx); // TODO(skal): remove
|
||||||
@ -552,7 +553,7 @@ static int AllocateMemory(VP8Decoder* const dec) {
|
|||||||
const uint64_t needed = (uint64_t)intra_pred_mode_size
|
const uint64_t needed = (uint64_t)intra_pred_mode_size
|
||||||
+ top_size + mb_info_size + f_info_size
|
+ top_size + mb_info_size + f_info_size
|
||||||
+ yuv_size + mb_data_size
|
+ yuv_size + mb_data_size
|
||||||
+ cache_size + alpha_size + ALIGN_MASK;
|
+ cache_size + alpha_size + ALIGN_CST;
|
||||||
uint8_t* mem;
|
uint8_t* mem;
|
||||||
|
|
||||||
if (needed != (size_t)needed) return 0; // check for overflow
|
if (needed != (size_t)needed) return 0; // check for overflow
|
||||||
@ -589,8 +590,8 @@ static int AllocateMemory(VP8Decoder* const dec) {
|
|||||||
dec->thread_ctx_.f_info_ += mb_w;
|
dec->thread_ctx_.f_info_ += mb_w;
|
||||||
}
|
}
|
||||||
|
|
||||||
mem = (uint8_t*)((uintptr_t)(mem + ALIGN_MASK) & ~ALIGN_MASK);
|
mem = (uint8_t*)DO_ALIGN(mem);
|
||||||
assert((yuv_size & ALIGN_MASK) == 0);
|
assert((yuv_size & ALIGN_CST) == 0);
|
||||||
dec->yuv_b_ = (uint8_t*)mem;
|
dec->yuv_b_ = (uint8_t*)mem;
|
||||||
mem += yuv_size;
|
mem += yuv_size;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user