• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 VP7BORDERINPIXELS       48
20 #define VP8BORDERINPIXELS       32
21 
22     /*************************************
23      For INT_YUV:
24 
25      Y = (R+G*2+B)/4;
26      U = (R-B)/2;
27      V =  (G*2 - R - B)/4;
28     And
29      R = Y+U-V;
30      G = Y+V;
31      B = Y-U-V;
32     ************************************/
33     typedef enum
34     {
35         REG_YUV = 0,    /* Regular yuv */
36         INT_YUV = 1     /* The type of yuv that can be tranfer to and from RGB through integer transform */
37               }
38               YUV_TYPE;
39 
40     typedef struct
41     {
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     } YV12_BUFFER_CONFIG;
63 
64     int vp8_yv12_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height, int border);
65     int vp8_yv12_de_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf);
66 
67 #ifdef __cplusplus
68 }
69 #endif
70 
71 
72 #endif /*YV12_CONFIG_H*/
73