Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

copybit: Use correct alignment in get_size()

get_size() is used to get the size required by c2d. It's alignment
should be 32 and not 16.

(cherry picked from commit 35d45d0cff5f6fe866fcb5df71444824a45e046e)

Change-Id: Iace771104ce8cea8b1672d15b2d46b6de9283868
  • Loading branch information...
commit 4e8759472cda3972ace5b6415645513f9b83ff2d 1 parent 572406f
Naomi Luis authored committed
Showing with 3 additions and 3 deletions.
  1. +3 −3 libcopybit/copybit_c2d.cpp
View
6 libcopybit/copybit_c2d.cpp
@@ -895,20 +895,20 @@ static size_t get_size(const bufferInfo& info)
size_t size = 0;
int w = info.width;
int h = info.height;
- int aligned_w = ALIGN(w, 16);
+ int aligned_w = ALIGN(w, 32);
switch(info.format) {
case HAL_PIXEL_FORMAT_NV12_ENCODEABLE:
{
// Chroma for this format is aligned to 2K.
size = ALIGN((aligned_w*h), 2048) +
- ALIGN(aligned_w/2, 16) * (h/2) *2;
+ ALIGN(aligned_w/2, 32) * (h/2) *2;
size = ALIGN(size, 4096);
} break;
case HAL_PIXEL_FORMAT_YCbCr_420_SP:
case HAL_PIXEL_FORMAT_YCrCb_420_SP:
{
size = aligned_w * h +
- ALIGN(aligned_w/2, 16) * (h/2) * 2;
+ ALIGN(aligned_w/2, 32) * (h/2) * 2;
size = ALIGN(size, 4096);
} break;
default: break;

2 comments on commit 4e87594

@Albinoman887

how do you know this is 32? i'm not 2nd quessing you just trying to learn

@arco
Owner
Please sign in to comment.
Something went wrong with that request. Please try again.