summaryrefslogtreecommitdiffstats
path: root/third_party/aom/aom_scale/generic/yv12config.c
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/aom/aom_scale/generic/yv12config.c')
-rw-r--r--third_party/aom/aom_scale/generic/yv12config.c37
1 files changed, 9 insertions, 28 deletions
diff --git a/third_party/aom/aom_scale/generic/yv12config.c b/third_party/aom/aom_scale/generic/yv12config.c
index fce719273..cce915165 100644
--- a/third_party/aom/aom_scale/generic/yv12config.c
+++ b/third_party/aom/aom_scale/generic/yv12config.c
@@ -16,8 +16,8 @@
#include "aom_scale/yv12config.h"
/****************************************************************************
-* Exports
-****************************************************************************/
+ * Exports
+ ****************************************************************************/
/****************************************************************************
*
@@ -25,7 +25,6 @@
#define yv12_align_addr(addr, align) \
(void *)(((size_t)(addr) + ((align)-1)) & (size_t) - (align))
-#if CONFIG_AV1
// TODO(jkoleszar): Maybe replace this with struct aom_image
int aom_free_frame_buffer(YV12_BUFFER_CONFIG *ybf) {
@@ -33,10 +32,7 @@ int aom_free_frame_buffer(YV12_BUFFER_CONFIG *ybf) {
if (ybf->buffer_alloc_sz > 0) {
aom_free(ybf->buffer_alloc);
}
-
-#if CONFIG_HIGHBITDEPTH && CONFIG_GLOBAL_MOTION
if (ybf->y_buffer_8bit) aom_free(ybf->y_buffer_8bit);
-#endif
/* buffer_alloc isn't accessed by most functions. Rather y_buffer,
u_buffer and v_buffer point to buffer_alloc and are used. Clear out
@@ -50,10 +46,7 @@ int aom_free_frame_buffer(YV12_BUFFER_CONFIG *ybf) {
}
int aom_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height,
- int ss_x, int ss_y,
-#if CONFIG_HIGHBITDEPTH
- int use_highbitdepth,
-#endif
+ int ss_x, int ss_y, int use_highbitdepth,
int border, int byte_alignment,
aom_codec_frame_buffer_t *fb,
aom_get_frame_buffer_cb_fn_t cb, void *cb_priv) {
@@ -72,12 +65,8 @@ int aom_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height,
const uint64_t uvplane_size =
(uv_height + 2 * uv_border_h) * (uint64_t)uv_stride + byte_alignment;
-#if CONFIG_HIGHBITDEPTH
const uint64_t frame_size =
(1 + use_highbitdepth) * (yplane_size + 2 * uvplane_size);
-#else
- const uint64_t frame_size = yplane_size + 2 * uvplane_size;
-#endif // CONFIG_HIGHBITDEPTH
uint8_t *buf = NULL;
@@ -147,7 +136,6 @@ int aom_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height,
ybf->subsampling_y = ss_y;
buf = ybf->buffer_alloc;
-#if CONFIG_HIGHBITDEPTH
if (use_highbitdepth) {
// Store uint16 addresses when using 16bit framebuffers
buf = CONVERT_TO_BYTEPTR(ybf->buffer_alloc);
@@ -155,7 +143,6 @@ int aom_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height,
} else {
ybf->flags = 0;
}
-#endif // CONFIG_HIGHBITDEPTH
ybf->y_buffer = (uint8_t *)yv12_align_addr(
buf + (border * y_stride) + border, aom_byte_align);
@@ -167,7 +154,8 @@ int aom_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height,
(uv_border_h * uv_stride) + uv_border_w,
aom_byte_align);
-#if CONFIG_HIGHBITDEPTH && CONFIG_GLOBAL_MOTION
+ ybf->use_external_refernce_buffers = 0;
+
if (use_highbitdepth) {
if (ybf->y_buffer_8bit) aom_free(ybf->y_buffer_8bit);
ybf->y_buffer_8bit = (uint8_t *)aom_memalign(32, (size_t)yplane_size);
@@ -175,7 +163,6 @@ int aom_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height,
} else {
assert(!ybf->y_buffer_8bit);
}
-#endif
ybf->corrupted = 0; /* assume not corrupted by errors */
return 0;
@@ -184,19 +171,13 @@ int aom_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height,
}
int aom_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height,
- int ss_x, int ss_y,
-#if CONFIG_HIGHBITDEPTH
- int use_highbitdepth,
-#endif
- int border, int byte_alignment) {
+ int ss_x, int ss_y, int use_highbitdepth, int border,
+ int byte_alignment) {
if (ybf) {
aom_free_frame_buffer(ybf);
return aom_realloc_frame_buffer(ybf, width, height, ss_x, ss_y,
-#if CONFIG_HIGHBITDEPTH
- use_highbitdepth,
-#endif
- border, byte_alignment, NULL, NULL, NULL);
+ use_highbitdepth, border, byte_alignment,
+ NULL, NULL, NULL);
}
return -2;
}
-#endif