diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2019-02-21 01:15:55 +0300 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2019-02-21 01:15:55 +0300 |
commit | 466b524bff228e0096c2a835d3c2abfbf92b825c (patch) | |
tree | daf94b8c06ccd15f1f013aa9730729a48609745b /include/dav1d | |
parent | 07f818fb12abb444651af71eaedf48da01131bba (diff) |
Slightly over-allocate picture buffers
Allows simplified SIMD function implementations that don't exactly
respect picture boundaries when reading picture data. Fixes #251 and
#250.
Diffstat (limited to 'include/dav1d')
-rw-r--r-- | include/dav1d/picture.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/include/dav1d/picture.h b/include/dav1d/picture.h index 7ce2f1f..fee0ec8 100644 --- a/include/dav1d/picture.h +++ b/include/dav1d/picture.h @@ -34,6 +34,11 @@ #include "common.h" #include "headers.h" +/* Number of bytes to align AND pad picture memory buffers by, so that SIMD + * implementations can over-read by a few bytes, and use aligned read/write + * instructions. */ +#define DAV1D_PICTURE_ALIGNMENT 32 + typedef struct Dav1dPictureParameters { int w; ///< width (in pixels) int h; ///< height (in pixels) @@ -85,8 +90,10 @@ typedef struct Dav1dPicAllocator { /** * Allocate the picture buffer based on the Dav1dPictureParameters. * - * The data[0], data[1] and data[2] must be 32 byte aligned and with a - * pixel width/height multiple of 128 pixels. + * The data[0], data[1] and data[2] must be DAV1D_PICTURE_ALIGNMENT byte + * aligned and with a pixel width/height multiple of 128 pixels. Any + * allocated memory area should also be padded by DAV1D_PICTURE_ALIGNMENT + * bytes. * data[1] and data[2] must share the same stride[1]. * * This function will be called on the main thread (the thread which calls |