WebM VP8 Codec SDK

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

vp8cx.h
Go to the documentation of this 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 VP8CX_H
11 #define VP8CX_H
12
18 #include "vp8.h"
19
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28
35 extern vpx_codec_iface_t vpx_codec_vp8_cx_algo;
36 extern vpx_codec_iface_t *vpx_codec_vp8_cx(void);
37
38 /* TODO(jkoleszar): These move to VP9 in a later patch set. */
39 extern vpx_codec_iface_t vpx_codec_vp9_cx_algo;
40 extern vpx_codec_iface_t *vpx_codec_vp9_cx(void);
41 extern vpx_codec_iface_t vpx_codec_vp9x_cx_algo;
42 extern vpx_codec_iface_t *vpx_codec_vp9x_cx(void);
43
47 /*
48 * Algorithm Flags
49 */
50
57 #define VP8_EFLAG_NO_REF_LAST (1<<16)
58
59
66 #define VP8_EFLAG_NO_REF_GF (1<<17)
67
68
75 #define VP8_EFLAG_NO_REF_ARF (1<<21)
76
77
83 #define VP8_EFLAG_NO_UPD_LAST (1<<18)
84
85
91 #define VP8_EFLAG_NO_UPD_GF (1<<22)
92
93
99 #define VP8_EFLAG_NO_UPD_ARF (1<<23)
100
101
107 #define VP8_EFLAG_FORCE_GF (1<<19)
108
109
115 #define VP8_EFLAG_FORCE_ARF (1<<24)
116
117
123 #define VP8_EFLAG_NO_UPD_ENTROPY (1<<20)
124
125
133 enum vp8e_enc_control_id {
134 VP8E_UPD_ENTROPY = 5,
135 VP8E_UPD_REFERENCE,
136 VP8E_USE_REFERENCE,
137 VP8E_SET_ROI_MAP,
138 VP8E_SET_ACTIVEMAP,
139 VP8E_SET_SCALEMODE = 11,
151 VP8E_SET_CPUUSED = 13,
152 VP8E_SET_ENABLEAUTOALTREF,
153 VP8E_SET_NOISE_SENSITIVITY,
154 VP8E_SET_SHARPNESS,
155 VP8E_SET_STATIC_THRESHOLD,
156 VP8E_SET_TOKEN_PARTITIONS,
157 VP8E_GET_LAST_QUANTIZER,
160 VP8E_GET_LAST_QUANTIZER_64,
164 VP8E_SET_ARNR_MAXFRAMES,
165 VP8E_SET_ARNR_STRENGTH,
166 VP8E_SET_ARNR_TYPE,
167 VP8E_SET_TUNING,
174 VP8E_SET_CQ_LEVEL,
175
188 VP8E_SET_MAX_INTRA_BITRATE_PCT,
189
190
191 /* TODO(jkoleszar): Move to vp9cx.h */
192 VP9E_SET_LOSSLESS,
193 VP9E_SET_TILE_COLUMNS,
194 VP9E_SET_TILE_ROWS,
195 VP9E_SET_FRAME_PARALLEL_DECODING,
196 VP9E_SET_AQ_MODE,
197
198 VP9E_SET_SVC,
199 VP9E_SET_SVC_PARAMETERS
200 };
201
206 typedef enum vpx_scaling_mode_1d {
207 VP8E_NORMAL = 0,
208 VP8E_FOURFIVE = 1,
209 VP8E_THREEFIVE = 2,
210 VP8E_ONETWO = 3
211 } VPX_SCALING_MODE;
212
213
220 typedef struct vpx_roi_map {
222 unsigned char *roi_map;
223 unsigned int rows;
224 unsigned int cols;
225 // TODO(paulwilkins): broken for VP9 which has 8 segments
226 // q and loop filter deltas for each segment
227 // (see MAX_MB_SEGMENTS)
228 int delta_q[4];
229 int delta_lf[4];
231 unsigned int static_threshold[4];
232 } vpx_roi_map_t;
233
241 typedef struct vpx_active_map {
242 unsigned char *active_map;
243 unsigned int rows;
244 unsigned int cols;
245 } vpx_active_map_t;
246
252 typedef struct vpx_scaling_mode {
253 VPX_SCALING_MODE h_scaling_mode;
254 VPX_SCALING_MODE v_scaling_mode;
255 } vpx_scaling_mode_t;
256
264 typedef enum {
265 VP8_ONE_TOKENPARTITION = 0,
266 VP8_TWO_TOKENPARTITION = 1,
267 VP8_FOUR_TOKENPARTITION = 2,
268 VP8_EIGHT_TOKENPARTITION = 3
269 } vp8e_token_partitions;
270
271
277 typedef enum {
278 VP8_TUNE_PSNR,
279 VP8_TUNE_SSIM
280 } vp8e_tuning;
281
287 typedef struct vpx_svc_parameters {
288 unsigned int width;
289 unsigned int height;
290 int layer;
291 int flags;
292 int max_quantizer;
293 int min_quantizer;
294 int distance_from_i_frame;
295 int lst_fb_idx;
296 int gld_fb_idx;
297 int alt_fb_idx;
298 } vpx_svc_parameters_t;
299
308 /* These controls have been deprecated in favor of the flags parameter to
309 * vpx_codec_encode(). See the definition of VP8_EFLAG_* above.
310 */
311 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_UPD_ENTROPY, int)
312 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_UPD_REFERENCE, int)
313 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_USE_REFERENCE, int)
314
315 VPX_CTRL_USE_TYPE(VP8E_SET_ROI_MAP, vpx_roi_map_t *)
316 VPX_CTRL_USE_TYPE(VP8E_SET_ACTIVEMAP, vpx_active_map_t *)
317 VPX_CTRL_USE_TYPE(VP8E_SET_SCALEMODE, vpx_scaling_mode_t *)
318
319 VPX_CTRL_USE_TYPE(VP9E_SET_SVC, int)
320 VPX_CTRL_USE_TYPE(VP9E_SET_SVC_PARAMETERS, vpx_svc_parameters_t *)
321
322 VPX_CTRL_USE_TYPE(VP8E_SET_CPUUSED, int)
323 VPX_CTRL_USE_TYPE(VP8E_SET_ENABLEAUTOALTREF, unsigned int)
324 VPX_CTRL_USE_TYPE(VP8E_SET_NOISE_SENSITIVITY, unsigned int)
325 VPX_CTRL_USE_TYPE(VP8E_SET_SHARPNESS, unsigned int)
326 VPX_CTRL_USE_TYPE(VP8E_SET_STATIC_THRESHOLD, unsigned int)
327 VPX_CTRL_USE_TYPE(VP8E_SET_TOKEN_PARTITIONS, int) /* vp8e_token_partitions */
328
329 VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_MAXFRAMES, unsigned int)
330 VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_STRENGTH, unsigned int)
331 VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_TYPE, unsigned int)
332 VPX_CTRL_USE_TYPE(VP8E_SET_TUNING, int) /* vp8e_tuning */
333 VPX_CTRL_USE_TYPE(VP8E_SET_CQ_LEVEL, unsigned int)
334
335 VPX_CTRL_USE_TYPE(VP9E_SET_TILE_COLUMNS, int)
336 VPX_CTRL_USE_TYPE(VP9E_SET_TILE_ROWS, int)
337
338 VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER, int *)
339 VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER_64, int *)
340
341 VPX_CTRL_USE_TYPE(VP8E_SET_MAX_INTRA_BITRATE_PCT, unsigned int)
342
343 VPX_CTRL_USE_TYPE(VP9E_SET_LOSSLESS, unsigned int)
344
345 VPX_CTRL_USE_TYPE(VP9E_SET_FRAME_PARALLEL_DECODING, unsigned int)
346
347 VPX_CTRL_USE_TYPE(VP9E_SET_AQ_MODE, unsigned int)
348
350 #ifdef __cplusplus
351 } // extern "C"
352 #endif
353
354 #endif
vpx_codec_iface_t
struct vpx_codec_iface vpx_codec_iface_t
Codec interface structure.
Definition: vpx_codec.h:175
vpx_roi_map::roi_map
unsigned char * roi_map
Definition: vp8cx.h:222
VP8E_SET_CPUUSED
control function to set vp8 encoder cpuused
Definition: vp8cx.h:151
vpx_active_map_t
struct vpx_active_map vpx_active_map_t
vpx active region map
vpx_active_map::cols
unsigned int cols
Definition: vp8cx.h:244
vp8e_enc_control_id
vp8e_enc_control_id
VP8 encoder control functions.
Definition: vp8cx.h:133
vpx_svc_parameters::flags
int flags
Definition: vp8cx.h:291
VP8E_UPD_REFERENCE
Definition: vp8cx.h:135
vpx_svc_parameters::gld_fb_idx
int gld_fb_idx
Definition: vp8cx.h:296
VPX_SCALING_MODE
enum vpx_scaling_mode_1d VPX_SCALING_MODE
vpx 1-D scaling mode
vpx_svc_parameters_t
struct vpx_svc_parameters vpx_svc_parameters_t
vp9 svc parameters
vpx_roi_map::cols
unsigned int cols
Definition: vp8cx.h:224
VP8E_SET_SCALEMODE
Definition: vp8cx.h:139
vpx_scaling_mode::v_scaling_mode
VPX_SCALING_MODE v_scaling_mode
Definition: vp8cx.h:254
vp8e_token_partitions
vp8e_token_partitions
VP8 token partition mode.
Definition: vp8cx.h:264
VP8E_SET_ROI_MAP
Definition: vp8cx.h:137
vpx_svc_parameters::max_quantizer
int max_quantizer
Definition: vp8cx.h:292
VP8E_SET_TUNING
Definition: vp8cx.h:167
VP8E_SET_CQ_LEVEL
control function to set constrained quality level
Definition: vp8cx.h:174
VP8E_SET_ARNR_TYPE
Definition: vp8cx.h:166
VP8E_SET_MAX_INTRA_BITRATE_PCT
Max data rate for Intra frames.
Definition: vp8cx.h:188
vpx_svc_parameters::width
unsigned int width
Definition: vp8cx.h:288
vpx_svc_parameters::alt_fb_idx
int alt_fb_idx
Definition: vp8cx.h:297
VPX_CTRL_USE_TYPE
#define VPX_CTRL_USE_TYPE(id, typ)
vpx_codec_control type definition macro
Definition: vpx_codec.h:414
vpx_roi_map::static_threshold
unsigned int static_threshold[4]
Definition: vp8cx.h:231
VP8E_GET_LAST_QUANTIZER_64
Definition: vp8cx.h:160
vpx_svc_parameters::distance_from_i_frame
int distance_from_i_frame
Definition: vp8cx.h:294
VP8E_SET_TOKEN_PARTITIONS
Definition: vp8cx.h:156
VP8E_SET_NOISE_SENSITIVITY
Definition: vp8cx.h:153
vpx_svc_parameters::height
unsigned int height
Definition: vp8cx.h:289
vpx_roi_map::delta_lf
int delta_lf[4]
Definition: vp8cx.h:229
vpx_svc_parameters::min_quantizer
int min_quantizer
Definition: vp8cx.h:293
VPX_CTRL_USE_TYPE_DEPRECATED
#define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ)
vpx_codec_control deprecated type definition macro
Definition: vpx_codec.h:441
VP8E_USE_REFERENCE
Definition: vp8cx.h:136
vpx_active_map::active_map
unsigned char * active_map
Definition: vp8cx.h:242
vpx_svc_parameters::layer
int layer
Definition: vp8cx.h:290
vpx_active_map::rows
unsigned int rows
Definition: vp8cx.h:243
VP8E_SET_ARNR_MAXFRAMES
Definition: vp8cx.h:164
vpx_scaling_mode_t
struct vpx_scaling_mode vpx_scaling_mode_t
vpx image scaling mode
VP8E_SET_ARNR_STRENGTH
Definition: vp8cx.h:165
vp8.h
Provides controls common to both the VP8 encoder and decoder.
VP8E_UPD_ENTROPY
Definition: vp8cx.h:134
VP8E_GET_LAST_QUANTIZER
Definition: vp8cx.h:157
VP8E_SET_ENABLEAUTOALTREF
Definition: vp8cx.h:152
vpx_scaling_mode::h_scaling_mode
VPX_SCALING_MODE h_scaling_mode
Definition: vp8cx.h:253
vpx_svc_parameters::lst_fb_idx
int lst_fb_idx
Definition: vp8cx.h:295
vpx_active_map
vpx active region map
Definition: vp8cx.h:241
vpx_roi_map_t
struct vpx_roi_map vpx_roi_map_t
vpx region of interest map
vpx_roi_map::rows
unsigned int rows
Definition: vp8cx.h:223
VP8E_SET_STATIC_THRESHOLD
Definition: vp8cx.h:155
vpx_scaling_mode_1d
vpx_scaling_mode_1d
vpx 1-D scaling mode
Definition: vp8cx.h:206
vp8e_tuning
vp8e_tuning
VP8 model tuning parameters.
Definition: vp8cx.h:277
VP8E_SET_SHARPNESS
Definition: vp8cx.h:154
vpx_roi_map
vpx region of interest map
Definition: vp8cx.h:220
vpx_roi_map::delta_q
int delta_q[4]
Definition: vp8cx.h:228
vpx_svc_parameters
vp9 svc parameters
Definition: vp8cx.h:287
vpx_scaling_mode
vpx image scaling mode
Definition: vp8cx.h:252
VP8E_SET_ACTIVEMAP
Definition: vp8cx.h:138