summaryrefslogtreecommitdiffstats
path: root/libhb/internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'libhb/internal.h')
-rw-r--r--libhb/internal.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/libhb/internal.h b/libhb/internal.h
index 36d8de4ef..577f6671e 100644
--- a/libhb/internal.h
+++ b/libhb/internal.h
@@ -110,6 +110,7 @@ struct hb_buffer_s
int stride;
int width;
int height;
+ int height_stride;
int size;
} plane[4]; // 3 Color components + alpha
@@ -166,7 +167,9 @@ static inline int hb_image_stride( int pix_fmt, int width, int plane )
int linesize = av_image_get_linesize( pix_fmt, width, plane );
// Make buffer SIMD friendly.
- linesize = MULTIPLE_MOD_UP( linesize, 16 );
+ // Decomb requires stride aligned to 32 bytes
+ // TODO: eliminate extra buffer copies in decomb
+ linesize = MULTIPLE_MOD_UP( linesize, 32 );
return linesize;
}
@@ -183,6 +186,21 @@ static inline int hb_image_width( int pix_fmt, int width, int plane )
return width;
}
+static inline int hb_image_height_stride( int pix_fmt, int height, int plane )
+{
+ const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
+
+ // Decomb requires 6 extra lines and stride aligned to 32 bytes
+ // TODO: eliminate extra buffer copies in decomb
+ height = MULTIPLE_MOD_UP( height + 6, 32 );
+ if ( plane == 1 || plane == 2 )
+ {
+ height = height >> desc->log2_chroma_h;
+ }
+
+ return height;
+}
+
static inline int hb_image_height( int pix_fmt, int height, int plane )
{
const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];