Merge "configure: support --enable-pic for generic-gnu"
[profile/ivi/libvpx.git] / vpx / vp8.h
1 /*
2  *  Copyright (c) 2010 The VP8 project authors. All Rights Reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license and patent
5  *  grant that can be found in the LICENSE file in the root of the source
6  *  tree. All contributing project authors may be found in the AUTHORS
7  *  file in the root of the source tree.
8  */
9
10
11 /*!\defgroup vp8 VP8
12  * \ingroup codecs
13  * VP8 is vpx's newest video compression algorithm that uses motion
14  * compensated prediction, Discrete Cosine Transform (DCT) coding of the
15  * prediction error signal and context dependent entropy coding techniques
16  * based on arithmatic principles. It features:
17  *  - YUV 4:2:0 image format
18  *  - Macro-block based coding (16x16 luma plus two 8x8 chroma)
19  *  - 1/4 (1/8) pixel accuracy motion compensated prediction
20  *  - 4x4 DCT transform
21  *  - 128 level linear quantizer
22  *  - In loop deblocking filter
23  *  - Context-based entropy coding
24  *
25  * @{
26  */
27 /*!\file vp8.h
28  * \brief Provides controls common to both the VP8 encoder and decoder.
29  */
30 #ifndef VP8_H
31 #define VP8_H
32 #include "vpx/vpx_codec_impl_top.h"
33
34 /*!\brief Control functions
35  *
36  * The set of macros define the control functions of VP8 interface
37  */
38 enum vp8_dec_control_id
39 {
40     VP8_SET_REFERENCE       = 1,    /**< pass in an external frame into decoder to be used as reference frame */
41     VP8_COPY_REFERENCE      = 2,    /**< get a copy of reference frame from the decoder */
42     VP8_SET_POSTPROC        = 3,    /**< set decoder's the post processing settings  */
43     VP8_COMMON_CTRL_ID_MAX
44 };
45
46 /*!\brief post process flags
47  *
48  * The set of macros define VP8 decoder post processing flags
49  */
50 enum vp8_postproc_level
51 {
52     VP8_NOFILTERING    = 0,
53     VP8_DEBLOCK        = 1,
54     VP8_DEMACROBLOCK   = 2,
55     VP8_ADDNOISE       = 4,
56 };
57
58 /*!\brief post process flags
59  *
60  * This define a structure that describe the post processing settings. For
61  * the best objective measure (using thet PSNR metric) set post_proc_flag
62  * to VP8_DEBLOCK and deblocking_level to 1.
63  */
64
65 typedef struct vp8_postproc_cfg
66 {
67     int post_proc_flag;           /**< the types of post processing to be done, should be combination of "vp8_postproc_level" */
68     int deblocking_level;        /**< the strength of deblocking, valid range [0, 16] */
69     int noise_level;             /**< the strength of additive noise, valid range [0, 16] */
70 } vp8_postproc_cfg_t;
71
72 /*!\brief reference frame type
73  *
74  * The set of macros define the type of VP8 reference frames
75  */
76 typedef enum vpx_ref_frame_type
77 {
78     VP8_LAST_FRAME = 1,
79     VP8_GOLD_FRAME = 2,
80     VP8_ALTR_FRAME = 4
81 } vpx_ref_frame_type_t;
82
83 /*!\brief reference frame data struct
84  *
85  * define the data struct to access vp8 reference frames
86  */
87
88 typedef struct vpx_ref_frame
89 {
90     vpx_ref_frame_type_t  frame_type;   /**< which reference frame */
91     vpx_image_t           img;          /**< reference frame data in image format */
92 } vpx_ref_frame_t;
93
94
95 /*!\brief vp8 decoder control funciton parameter type
96  *
97  * defines the data type for each of VP8 decoder control funciton requires
98  */
99
100 VPX_CTRL_USE_TYPE(VP8_SET_REFERENCE,           vpx_ref_frame_t *)
101 VPX_CTRL_USE_TYPE(VP8_COPY_REFERENCE,          vpx_ref_frame_t *)
102 VPX_CTRL_USE_TYPE(VP8_SET_POSTPROC,            vp8_postproc_cfg_t *)
103
104
105 /*! @} - end defgroup vp8 */
106
107 #if !defined(VPX_CODEC_DISABLE_COMPAT) || !VPX_CODEC_DISABLE_COMPAT
108 /* The following definitions are provided for backward compatibility with
109  * the VP8 1.0.x SDK. USE IN PRODUCTION CODE IS NOT RECOMMENDED.
110  */
111
112 DECLSPEC_DEPRECATED extern vpx_codec_iface_t vpx_codec_vp8_algo DEPRECATED;
113 #endif
114
115 #include "vpx/vpx_codec_impl_bottom.h"
116 #endif