/media/libvpx/vpx_scale/yv12config.h

http://github.com/zpao/v8monkey · C Header · 73 lines · 38 code · 13 blank · 22 comment · 0 complexity · 640feb1e2a3babd663268d55e5c46f6f MD5 · raw file

  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. #ifndef YV12_CONFIG_H
  11. #define YV12_CONFIG_H
  12. #ifdef __cplusplus
  13. extern "C"
  14. {
  15. #endif
  16. #define VP7BORDERINPIXELS 48
  17. #define VP8BORDERINPIXELS 32
  18. /*************************************
  19. For INT_YUV:
  20. Y = (R+G*2+B)/4;
  21. U = (R-B)/2;
  22. V = (G*2 - R - B)/4;
  23. And
  24. R = Y+U-V;
  25. G = Y+V;
  26. B = Y-U-V;
  27. ************************************/
  28. typedef enum
  29. {
  30. REG_YUV = 0, /* Regular yuv */
  31. INT_YUV = 1 /* The type of yuv that can be tranfer to and from RGB through integer transform */
  32. }
  33. YUV_TYPE;
  34. typedef struct
  35. {
  36. int y_width;
  37. int y_height;
  38. int y_stride;
  39. /* int yinternal_width; */
  40. int uv_width;
  41. int uv_height;
  42. int uv_stride;
  43. /* int uvinternal_width; */
  44. unsigned char *y_buffer;
  45. unsigned char *u_buffer;
  46. unsigned char *v_buffer;
  47. unsigned char *buffer_alloc;
  48. int border;
  49. int frame_size;
  50. YUV_TYPE clrtype;
  51. int corrupted;
  52. int flags;
  53. } YV12_BUFFER_CONFIG;
  54. int vp8_yv12_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf, int width, int height, int border);
  55. int vp8_yv12_de_alloc_frame_buffer(YV12_BUFFER_CONFIG *ybf);
  56. #ifdef __cplusplus
  57. }
  58. #endif
  59. #endif /*YV12_CONFIG_H*/