WebM VP8 Codec SDK
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 
175 
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
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;
246 
252 typedef struct vpx_scaling_mode {
256 
264 typedef enum {
265  VP8_ONE_TOKENPARTITION = 0,
266  VP8_TWO_TOKENPARTITION = 1,
267  VP8_FOUR_TOKENPARTITION = 2,
268  VP8_EIGHT_TOKENPARTITION = 3
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;
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  */
314 
318 
319 VPX_CTRL_USE_TYPE(VP9E_SET_SVC, int)
320 VPX_CTRL_USE_TYPE(VP9E_SET_SVC_PARAMETERS, vpx_svc_parameters_t *)
321 
327 VPX_CTRL_USE_TYPE(VP8E_SET_TOKEN_PARTITIONS, int) /* vp8e_token_partitions */
328 
332 VPX_CTRL_USE_TYPE(VP8E_SET_TUNING, int) /* vp8e_tuning */
334 
335 VPX_CTRL_USE_TYPE(VP9E_SET_TILE_COLUMNS, int)
336 VPX_CTRL_USE_TYPE(VP9E_SET_TILE_ROWS, int)
337 
340 
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
struct vpx_codec_iface vpx_codec_iface_t
Codec interface structure.
Definition: vpx_codec.h:175
unsigned char * roi_map
Definition: vp8cx.h:222
control function to set vp8 encoder cpuused
Definition: vp8cx.h:151
struct vpx_active_map vpx_active_map_t
vpx active region map
unsigned int cols
Definition: vp8cx.h:244
vp8e_enc_control_id
VP8 encoder control functions.
Definition: vp8cx.h:133
int flags
Definition: vp8cx.h:291
Definition: vp8cx.h:135
int gld_fb_idx
Definition: vp8cx.h:296
enum vpx_scaling_mode_1d VPX_SCALING_MODE
vpx 1-D scaling mode
struct vpx_svc_parameters vpx_svc_parameters_t
vp9 svc parameters
unsigned int cols
Definition: vp8cx.h:224
Definition: vp8cx.h:139
VPX_SCALING_MODE v_scaling_mode
Definition: vp8cx.h:254
vp8e_token_partitions
VP8 token partition mode.
Definition: vp8cx.h:264
Definition: vp8cx.h:137
int max_quantizer
Definition: vp8cx.h:292
Definition: vp8cx.h:167
control function to set constrained quality level
Definition: vp8cx.h:174
Definition: vp8cx.h:166
Max data rate for Intra frames.
Definition: vp8cx.h:188
unsigned int width
Definition: vp8cx.h:288
int alt_fb_idx
Definition: vp8cx.h:297
#define VPX_CTRL_USE_TYPE(id, typ)
vpx_codec_control type definition macro
Definition: vpx_codec.h:414
unsigned int static_threshold[4]
Definition: vp8cx.h:231
Definition: vp8cx.h:160
int distance_from_i_frame
Definition: vp8cx.h:294
Definition: vp8cx.h:156
Definition: vp8cx.h:153
unsigned int height
Definition: vp8cx.h:289
int delta_lf[4]
Definition: vp8cx.h:229
int min_quantizer
Definition: vp8cx.h:293
#define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ)
vpx_codec_control deprecated type definition macro
Definition: vpx_codec.h:441
Definition: vp8cx.h:136
unsigned char * active_map
Definition: vp8cx.h:242
int layer
Definition: vp8cx.h:290
unsigned int rows
Definition: vp8cx.h:243
Definition: vp8cx.h:164
struct vpx_scaling_mode vpx_scaling_mode_t
vpx image scaling mode
Definition: vp8cx.h:165
Provides controls common to both the VP8 encoder and decoder.
Definition: vp8cx.h:134
Definition: vp8cx.h:157
Definition: vp8cx.h:152
VPX_SCALING_MODE h_scaling_mode
Definition: vp8cx.h:253
int lst_fb_idx
Definition: vp8cx.h:295
vpx active region map
Definition: vp8cx.h:241
struct vpx_roi_map vpx_roi_map_t
vpx region of interest map
unsigned int rows
Definition: vp8cx.h:223
Definition: vp8cx.h:155
vpx_scaling_mode_1d
vpx 1-D scaling mode
Definition: vp8cx.h:206
vp8e_tuning
VP8 model tuning parameters.
Definition: vp8cx.h:277
Definition: vp8cx.h:154
vpx region of interest map
Definition: vp8cx.h:220
int delta_q[4]
Definition: vp8cx.h:228
vp9 svc parameters
Definition: vp8cx.h:287
vpx image scaling mode
Definition: vp8cx.h:252
Definition: vp8cx.h:138