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_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 
00180     VP8E_SET_MAX_INTRA_BITRATE_PCT
00181 };
00182 
00187 typedef enum vpx_scaling_mode_1d
00188 {
00189     VP8E_NORMAL      = 0,
00190     VP8E_FOURFIVE    = 1,
00191     VP8E_THREEFIVE   = 2,
00192     VP8E_ONETWO      = 3
00193 } VPX_SCALING_MODE;
00194 
00195 
00202 typedef struct vpx_roi_map
00203 {
00204     unsigned char *roi_map;      
00205     unsigned int   rows;         
00206     unsigned int   cols;         
00207     int     delta_q[4];          
00208     int     delta_lf[4];         
00209     unsigned int   static_threshold[4];
00210 } vpx_roi_map_t;
00211 
00219 typedef struct vpx_active_map
00220 {
00221     unsigned char  *active_map; 
00222     unsigned int    rows;       
00223     unsigned int    cols;       
00224 } vpx_active_map_t;
00225 
00231 typedef struct vpx_scaling_mode
00232 {
00233     VPX_SCALING_MODE    h_scaling_mode;  
00234     VPX_SCALING_MODE    v_scaling_mode;  
00235 } vpx_scaling_mode_t;
00236 
00242 typedef enum
00243 {
00244     VP8_BEST_QUALITY_ENCODING,
00245     VP8_GOOD_QUALITY_ENCODING,
00246     VP8_REAL_TIME_ENCODING
00247 } vp8e_encoding_mode;
00248 
00256 typedef enum
00257 {
00258     VP8_ONE_TOKENPARTITION   = 0,
00259     VP8_TWO_TOKENPARTITION   = 1,
00260     VP8_FOUR_TOKENPARTITION  = 2,
00261     VP8_EIGHT_TOKENPARTITION = 3
00262 } vp8e_token_partitions;
00263 
00264 
00270 typedef enum
00271 {
00272     VP8_TUNE_PSNR,
00273     VP8_TUNE_SSIM
00274 } vp8e_tuning;
00275 
00276 
00285 /* These controls have been deprecated in favor of the flags parameter to
00286  * vpx_codec_encode(). See the definition of VP8_EFLAG_* above.
00287  */
00288 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_UPD_ENTROPY,            int)
00289 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_UPD_REFERENCE,          int)
00290 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_USE_REFERENCE,          int)
00291 
00292 VPX_CTRL_USE_TYPE(VP8E_SET_ROI_MAP,            vpx_roi_map_t *)
00293 VPX_CTRL_USE_TYPE(VP8E_SET_ACTIVEMAP,          vpx_active_map_t *)
00294 VPX_CTRL_USE_TYPE(VP8E_SET_SCALEMODE,          vpx_scaling_mode_t *)
00295 
00296 VPX_CTRL_USE_TYPE(VP8E_SET_CPUUSED,            int)
00297 VPX_CTRL_USE_TYPE(VP8E_SET_ENABLEAUTOALTREF,   unsigned int)
00298 VPX_CTRL_USE_TYPE(VP8E_SET_NOISE_SENSITIVITY,  unsigned int)
00299 VPX_CTRL_USE_TYPE(VP8E_SET_SHARPNESS,          unsigned int)
00300 VPX_CTRL_USE_TYPE(VP8E_SET_STATIC_THRESHOLD,   unsigned int)
00301 VPX_CTRL_USE_TYPE(VP8E_SET_TOKEN_PARTITIONS,   vp8e_token_partitions)
00302 
00303 VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_MAXFRAMES,     unsigned int)
00304 VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_STRENGTH ,     unsigned int)
00305 VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_TYPE     ,     unsigned int)
00306 VPX_CTRL_USE_TYPE(VP8E_SET_TUNING,             vp8e_tuning)
00307 VPX_CTRL_USE_TYPE(VP8E_SET_CQ_LEVEL     ,      unsigned int)
00308 
00309 VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER,     int *)
00310 VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER_64,  int *)
00311 
00312 VPX_CTRL_USE_TYPE(VP8E_SET_MAX_INTRA_BITRATE_PCT, unsigned int)
00313 
00314 
00316 #include "vpx_codec_impl_bottom.h"
00317 #endif