WebM VP8 Codec SDK
|
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); 00035 00036 /* TODO(jkoleszar): These move to VP9 in a later patch set. */ 00037 extern vpx_codec_iface_t vpx_codec_vp9_cx_algo; 00038 extern vpx_codec_iface_t *vpx_codec_vp9_cx(void); 00039 extern vpx_codec_iface_t vpx_codec_vp9x_cx_algo; 00040 extern vpx_codec_iface_t *vpx_codec_vp9x_cx(void); 00041 00045 /* 00046 * Algorithm Flags 00047 */ 00048 00055 #define VP8_EFLAG_NO_REF_LAST (1<<16) 00056 00057 00064 #define VP8_EFLAG_NO_REF_GF (1<<17) 00065 00066 00073 #define VP8_EFLAG_NO_REF_ARF (1<<21) 00074 00075 00081 #define VP8_EFLAG_NO_UPD_LAST (1<<18) 00082 00083 00089 #define VP8_EFLAG_NO_UPD_GF (1<<22) 00090 00091 00097 #define VP8_EFLAG_NO_UPD_ARF (1<<23) 00098 00099 00105 #define VP8_EFLAG_FORCE_GF (1<<19) 00106 00107 00113 #define VP8_EFLAG_FORCE_ARF (1<<24) 00114 00115 00121 #define VP8_EFLAG_NO_UPD_ENTROPY (1<<20) 00122 00123 00131 enum vp8e_enc_control_id { 00132 VP8E_UPD_ENTROPY = 5, 00133 VP8E_UPD_REFERENCE, 00134 VP8E_USE_REFERENCE, 00135 VP8E_SET_ROI_MAP, 00136 VP8E_SET_ACTIVEMAP, 00137 VP8E_SET_SCALEMODE = 11, 00149 VP8E_SET_CPUUSED = 13, 00150 VP8E_SET_ENABLEAUTOALTREF, 00151 VP8E_SET_NOISE_SENSITIVITY, 00152 VP8E_SET_SHARPNESS, 00153 VP8E_SET_STATIC_THRESHOLD, 00154 VP8E_SET_TOKEN_PARTITIONS, 00155 VP8E_GET_LAST_QUANTIZER, 00158 VP8E_GET_LAST_QUANTIZER_64, 00162 VP8E_SET_ARNR_MAXFRAMES, 00163 VP8E_SET_ARNR_STRENGTH, 00164 VP8E_SET_ARNR_TYPE, 00165 VP8E_SET_TUNING, 00172 VP8E_SET_CQ_LEVEL, 00173 00186 VP8E_SET_MAX_INTRA_BITRATE_PCT, 00187 00188 00189 /* TODO(jkoleszar): Move to vp9cx.h */ 00190 VP9E_SET_LOSSLESS, 00191 VP9E_SET_TILE_COLUMNS, 00192 VP9E_SET_TILE_ROWS, 00193 VP9E_SET_FRAME_PARALLEL_DECODING 00194 }; 00195 00200 typedef enum vpx_scaling_mode_1d { 00201 VP8E_NORMAL = 0, 00202 VP8E_FOURFIVE = 1, 00203 VP8E_THREEFIVE = 2, 00204 VP8E_ONETWO = 3 00205 } VPX_SCALING_MODE; 00206 00207 00214 typedef struct vpx_roi_map { 00215 unsigned char *roi_map; 00216 unsigned int rows; 00217 unsigned int cols; 00218 int delta_q[4]; 00219 int delta_lf[4]; 00220 unsigned int static_threshold[4]; 00221 } vpx_roi_map_t; 00222 00230 typedef struct vpx_active_map { 00231 unsigned char *active_map; 00232 unsigned int rows; 00233 unsigned int cols; 00234 } vpx_active_map_t; 00235 00241 typedef struct vpx_scaling_mode { 00242 VPX_SCALING_MODE h_scaling_mode; 00243 VPX_SCALING_MODE v_scaling_mode; 00244 } vpx_scaling_mode_t; 00245 00253 typedef enum { 00254 VP8_ONE_TOKENPARTITION = 0, 00255 VP8_TWO_TOKENPARTITION = 1, 00256 VP8_FOUR_TOKENPARTITION = 2, 00257 VP8_EIGHT_TOKENPARTITION = 3 00258 } vp8e_token_partitions; 00259 00260 00266 typedef enum { 00267 VP8_TUNE_PSNR, 00268 VP8_TUNE_SSIM 00269 } vp8e_tuning; 00270 00271 00280 /* These controls have been deprecated in favor of the flags parameter to 00281 * vpx_codec_encode(). See the definition of VP8_EFLAG_* above. 00282 */ 00283 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_UPD_ENTROPY, int) 00284 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_UPD_REFERENCE, int) 00285 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_USE_REFERENCE, int) 00286 00287 VPX_CTRL_USE_TYPE(VP8E_SET_ROI_MAP, vpx_roi_map_t *) 00288 VPX_CTRL_USE_TYPE(VP8E_SET_ACTIVEMAP, vpx_active_map_t *) 00289 VPX_CTRL_USE_TYPE(VP8E_SET_SCALEMODE, vpx_scaling_mode_t *) 00290 00291 VPX_CTRL_USE_TYPE(VP8E_SET_CPUUSED, int) 00292 VPX_CTRL_USE_TYPE(VP8E_SET_ENABLEAUTOALTREF, unsigned int) 00293 VPX_CTRL_USE_TYPE(VP8E_SET_NOISE_SENSITIVITY, unsigned int) 00294 VPX_CTRL_USE_TYPE(VP8E_SET_SHARPNESS, unsigned int) 00295 VPX_CTRL_USE_TYPE(VP8E_SET_STATIC_THRESHOLD, unsigned int) 00296 VPX_CTRL_USE_TYPE(VP8E_SET_TOKEN_PARTITIONS, int) /* vp8e_token_partitions */ 00297 00298 VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_MAXFRAMES, unsigned int) 00299 VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_STRENGTH, unsigned int) 00300 VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_TYPE, unsigned int) 00301 VPX_CTRL_USE_TYPE(VP8E_SET_TUNING, int) /* vp8e_tuning */ 00302 VPX_CTRL_USE_TYPE(VP8E_SET_CQ_LEVEL, unsigned int) 00303 00304 VPX_CTRL_USE_TYPE(VP9E_SET_TILE_COLUMNS, int) 00305 VPX_CTRL_USE_TYPE(VP9E_SET_TILE_ROWS, int) 00306 00307 VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER, int *) 00308 VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER_64, int *) 00309 00310 VPX_CTRL_USE_TYPE(VP8E_SET_MAX_INTRA_BITRATE_PCT, unsigned int) 00311 00312 VPX_CTRL_USE_TYPE(VP9E_SET_LOSSLESS, unsigned int) 00313 00314 VPX_CTRL_USE_TYPE(VP9E_SET_FRAME_PARALLEL_DECODING, unsigned int) 00316 #include "vpx_codec_impl_bottom.h" 00317 #endif