michael@0: /* michael@0: * Copyright (c) 2010 The WebM project authors. All Rights Reserved. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license michael@0: * that can be found in the LICENSE file in the root of the source michael@0: * tree. An additional intellectual property rights grant can be found michael@0: * in the file PATENTS. All contributing project authors may michael@0: * be found in the AUTHORS file in the root of the source tree. michael@0: */ michael@0: michael@0: #ifndef YV12_CONFIG_H michael@0: #define YV12_CONFIG_H michael@0: michael@0: #ifdef __cplusplus michael@0: extern "C" { michael@0: #endif michael@0: michael@0: #include "vpx/vpx_integer.h" michael@0: michael@0: #define VP8BORDERINPIXELS 32 michael@0: #define VP9INNERBORDERINPIXELS 96 michael@0: #define VP9BORDERINPIXELS 160 michael@0: #define VP9_INTERP_EXTEND 4 michael@0: michael@0: typedef struct yv12_buffer_config { michael@0: int y_width; michael@0: int y_height; michael@0: int y_crop_width; michael@0: int y_crop_height; michael@0: int y_stride; michael@0: /* int yinternal_width; */ michael@0: michael@0: int uv_width; michael@0: int uv_height; michael@0: int uv_crop_width; michael@0: int uv_crop_height; michael@0: int uv_stride; michael@0: /* int uvinternal_width; */ michael@0: michael@0: int alpha_width; michael@0: int alpha_height; michael@0: int alpha_stride; michael@0: michael@0: uint8_t *y_buffer; michael@0: uint8_t *u_buffer; michael@0: uint8_t *v_buffer; michael@0: uint8_t *alpha_buffer; michael@0: michael@0: uint8_t *buffer_alloc; michael@0: int buffer_alloc_sz; michael@0: int border; michael@0: int frame_size; michael@0: michael@0: int corrupted; michael@0: int flags; michael@0: } YV12_BUFFER_CONFIG; michael@0: michael@0: int vp8_yv12_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, michael@0: int width, int height, int border); michael@0: int vp8_yv12_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, michael@0: int width, int height, int border); michael@0: int vp8_yv12_de_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf); michael@0: michael@0: int vp9_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, michael@0: int width, int height, int ss_x, int ss_y, michael@0: int border); michael@0: int vp9_realloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, michael@0: int width, int height, int ss_x, int ss_y, michael@0: int border); michael@0: int vp9_free_frame_buffer(YV12_BUFFER_CONFIG *ybf); michael@0: michael@0: #ifdef __cplusplus michael@0: } michael@0: #endif michael@0: michael@0: #endif // YV12_CONFIG_H