Home | History | Annotate | Download | only in vpx_scale
      1 /*
      2  *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
      3  *
      4  *  Use of this source code is governed by a BSD-style license
      5  *  that can be found in the LICENSE file in the root of the source
      6  *  tree. An additional intellectual property rights grant can be found
      7  *  in the file PATENTS.  All contributing project authors may
      8  *  be found in the AUTHORS file in the root of the source tree.
      9  */
     10 
     11 
     12 #ifndef YV12_CONFIG_H
     13 #define YV12_CONFIG_H
     14 #ifdef __cplusplus
     15 extern "C"
     16 {
     17 #endif
     18 
     19 #define VP8BORDERINPIXELS       32
     20 #define VP9BORDERINPIXELS       64
     21 #define VP9_INTERP_EXTEND        4
     22 
     23   /*************************************
     24    For INT_YUV:
     25 
     26    Y = (R+G*2+B)/4;
     27    U = (R-B)/2;
     28    V =  (G*2 - R - B)/4;
     29   And
     30    R = Y+U-V;
     31    G = Y+V;
     32    B = Y-U-V;
     33   ************************************/
     34   typedef enum
     35   {
     36     REG_YUV = 0,    /* Regular yuv */
     37     INT_YUV = 1     /* The type of yuv that can be tranfer to and from RGB through integer transform */
     38   }
     39             YUV_TYPE;
     40 
     41   typedef struct yv12_buffer_config {
     42     int   y_width;
     43     int   y_height;
     44     int   y_stride;
     45     /*    int   yinternal_width; */
     46 
     47     int   uv_width;
     48     int   uv_height;
     49     int   uv_stride;
     50     /*    int   uvinternal_width; */
     51 
     52     unsigned char *y_buffer;
     53     unsigned char *u_buffer;
     54     unsigned char *v_buffer;
     55 
     56     unsigned char *buffer_alloc;
     57     int border;
     58     int frame_size;
     59     YUV_TYPE clrtype;
     60 
     61     int corrupted;
     62     int flags;
     63   } YV12_BUFFER_CONFIG;
     64 
     65   int vp8_yv12_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height, int border);
     66   int vp8_yv12_de_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf);
     67 
     68 #ifdef __cplusplus
     69 }
     70 #endif
     71 
     72 
     73 #endif /*YV12_CONFIG_H*/
     74