WebM VP8 Codec SDK
vpx/vp8cx.h
Go to the documentation of this file.
00001 /*
00002  *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
00003  *
00004  *  Use of this source code is governed by a BSD-style license
00005  *  that can be found in the LICENSE file in the root of the source
00006  *  tree. An additional intellectual property rights grant can be found
00007  *  in the file PATENTS.  All contributing project authors may
00008  *  be found in the AUTHORS file in the root of the source tree.
00009  */
00010 
00011 
00017 #include "vp8.h"
00018 
00023 #ifndef VP8CX_H
00024 #define VP8CX_H
00025 #include "vpx/vpx_codec_impl_top.h"
00026 
00033 extern vpx_codec_iface_t  vpx_codec_vp8_cx_algo;
00034 extern vpx_codec_iface_t* vpx_codec_vp8_cx(void);
00038 /*
00039  * Algorithm Flags
00040  */
00041 
00048 #define VP8_EFLAG_NO_REF_LAST      (1<<16)
00049 
00050 
00057 #define VP8_EFLAG_NO_REF_GF        (1<<17)
00058 
00059 
00066 #define VP8_EFLAG_NO_REF_ARF       (1<<21)
00067 
00068 
00074 #define VP8_EFLAG_NO_UPD_LAST      (1<<18)
00075 
00076 
00082 #define VP8_EFLAG_NO_UPD_GF        (1<<22)
00083 
00084 
00090 #define VP8_EFLAG_NO_UPD_ARF       (1<<23)
00091 
00092 
00098 #define VP8_EFLAG_FORCE_GF         (1<<19)
00099 
00100 
00106 #define VP8_EFLAG_FORCE_ARF        (1<<24)
00107 
00108 
00114 #define VP8_EFLAG_NO_UPD_ENTROPY   (1<<20)
00115 
00116 
00124 enum vp8e_enc_control_id
00125 {
00126     VP8E_UPD_ENTROPY           = 5,  
00127     VP8E_UPD_REFERENCE,              
00128     VP8E_USE_REFERENCE,              
00129     VP8E_SET_ROI_MAP,                
00130     VP8E_SET_ACTIVEMAP,              
00131     VP8E_SET_SCALEMODE         = 11, 
00143     VP8E_SET_CPUUSED           = 13,
00144     VP8E_SET_ENABLEAUTOALTREF,       
00145     VP8E_SET_NOISE_SENSITIVITY,      
00146     VP8E_SET_SHARPNESS,              
00147     VP8E_SET_STATIC_THRESHOLD,       
00148     VP8E_SET_TOKEN_PARTITIONS,       
00149     VP8E_GET_LAST_QUANTIZER,         
00152     VP8E_GET_LAST_QUANTIZER_64,      
00156     VP8E_SET_ARNR_MAXFRAMES,         
00157     VP8E_SET_ARNR_STRENGTH ,         
00158     VP8E_SET_ARNR_TYPE     ,         
00159     VP8E_SET_TUNING,                 
00166     VP8E_SET_CQ_LEVEL,
00167 };
00168 
00173 typedef enum vpx_scaling_mode_1d
00174 {
00175     VP8E_NORMAL      = 0,
00176     VP8E_FOURFIVE    = 1,
00177     VP8E_THREEFIVE   = 2,
00178     VP8E_ONETWO      = 3
00179 } VPX_SCALING_MODE;
00180 
00181 
00188 typedef struct vpx_roi_map
00189 {
00190     unsigned char *roi_map;      
00191     unsigned int   rows;         
00192     unsigned int   cols;         
00193     int     delta_q[4];          
00194     int     delta_lf[4];         
00195     unsigned int   static_threshold[4];
00196 } vpx_roi_map_t;
00197 
00205 typedef struct vpx_active_map
00206 {
00207     unsigned char  *active_map; 
00208     unsigned int    rows;       
00209     unsigned int    cols;       
00210 } vpx_active_map_t;
00211 
00217 typedef struct vpx_scaling_mode
00218 {
00219     VPX_SCALING_MODE    h_scaling_mode;  
00220     VPX_SCALING_MODE    v_scaling_mode;  
00221 } vpx_scaling_mode_t;
00222 
00228 typedef enum
00229 {
00230     VP8_BEST_QUALITY_ENCODING,
00231     VP8_GOOD_QUALITY_ENCODING,
00232     VP8_REAL_TIME_ENCODING
00233 } vp8e_encoding_mode;
00234 
00242 typedef enum
00243 {
00244     VP8_ONE_TOKENPARTITION   = 0,
00245     VP8_TWO_TOKENPARTITION   = 1,
00246     VP8_FOUR_TOKENPARTITION  = 2,
00247     VP8_EIGHT_TOKENPARTITION = 3,
00248 } vp8e_token_partitions;
00249 
00250 
00256 typedef enum
00257 {
00258     VP8_TUNE_PSNR,
00259     VP8_TUNE_SSIM
00260 } vp8e_tuning;
00261 
00262 
00271 /* These controls have been deprecated in favor of the flags parameter to
00272  * vpx_codec_encode(). See the definition of VP8_EFLAG_* above.
00273  */
00274 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_UPD_ENTROPY,            int)
00275 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_UPD_REFERENCE,          int)
00276 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_USE_REFERENCE,          int)
00277 
00278 VPX_CTRL_USE_TYPE(VP8E_SET_ROI_MAP,            vpx_roi_map_t *)
00279 VPX_CTRL_USE_TYPE(VP8E_SET_ACTIVEMAP,          vpx_active_map_t *)
00280 VPX_CTRL_USE_TYPE(VP8E_SET_SCALEMODE,          vpx_scaling_mode_t *)
00281 
00282 VPX_CTRL_USE_TYPE(VP8E_SET_CPUUSED,            int)
00283 VPX_CTRL_USE_TYPE(VP8E_SET_ENABLEAUTOALTREF,   unsigned int)
00284 VPX_CTRL_USE_TYPE(VP8E_SET_NOISE_SENSITIVITY,  unsigned int)
00285 VPX_CTRL_USE_TYPE(VP8E_SET_SHARPNESS,          unsigned int)
00286 VPX_CTRL_USE_TYPE(VP8E_SET_STATIC_THRESHOLD,   unsigned int)
00287 VPX_CTRL_USE_TYPE(VP8E_SET_TOKEN_PARTITIONS,   vp8e_token_partitions)
00288 
00289 VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_MAXFRAMES,     unsigned int)
00290 VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_STRENGTH ,     unsigned int)
00291 VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_TYPE     ,     unsigned int)
00292 VPX_CTRL_USE_TYPE(VP8E_SET_TUNING,             vp8e_tuning)
00293 VPX_CTRL_USE_TYPE(VP8E_SET_CQ_LEVEL     ,      unsigned int)
00294 
00295 VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER,     int *)
00296 VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER_64,  int *)
00297 
00299 #include "vpx/vpx_codec_impl_bottom.h"
00300 #endif