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 VPX_VP8CX_H_
11 #define VPX_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 
45 /*
46  * Algorithm Flags
47  */
48 
55 #define VP8_EFLAG_NO_REF_LAST (1<<16)
56 
57 
64 #define VP8_EFLAG_NO_REF_GF (1<<17)
65 
66 
73 #define VP8_EFLAG_NO_REF_ARF (1<<21)
74 
75 
81 #define VP8_EFLAG_NO_UPD_LAST (1<<18)
82 
83 
89 #define VP8_EFLAG_NO_UPD_GF (1<<22)
90 
91 
97 #define VP8_EFLAG_NO_UPD_ARF (1<<23)
98 
99 
105 #define VP8_EFLAG_FORCE_GF (1<<19)
106 
107 
113 #define VP8_EFLAG_FORCE_ARF (1<<24)
114 
115 
121 #define VP8_EFLAG_NO_UPD_ENTROPY (1<<20)
122 
123 
164 
168 
177 
191 
192 
193  /* TODO(jkoleszar): Move to vp9cx.h */
194  VP9E_SET_LOSSLESS,
195  VP9E_SET_TILE_COLUMNS,
196  VP9E_SET_TILE_ROWS,
197  VP9E_SET_FRAME_PARALLEL_DECODING,
198  VP9E_SET_AQ_MODE,
199  VP9E_SET_FRAME_PERIODIC_BOOST,
200 
201  VP9E_SET_SVC,
202  VP9E_SET_SVC_PARAMETERS,
209  VP9E_SET_TUNE_CONTENT
210 };
211 
216 typedef enum vpx_scaling_mode_1d {
217  VP8E_NORMAL = 0,
218  VP8E_FOURFIVE = 1,
219  VP8E_THREEFIVE = 2,
220  VP8E_ONETWO = 3
222 
223 
230 typedef struct vpx_roi_map {
232  unsigned char *roi_map;
233  unsigned int rows;
234  unsigned int cols;
235  // TODO(paulwilkins): broken for VP9 which has 8 segments
236  // q and loop filter deltas for each segment
237  // (see MAX_MB_SEGMENTS)
238  int delta_q[4];
239  int delta_lf[4];
241  unsigned int static_threshold[4];
242 } vpx_roi_map_t;
243 
251 typedef struct vpx_active_map {
252  unsigned char *active_map;
253  unsigned int rows;
254  unsigned int cols;
256 
262 typedef struct vpx_scaling_mode {
266 
274 typedef enum {
275  VP8_ONE_TOKENPARTITION = 0,
276  VP8_TWO_TOKENPARTITION = 1,
277  VP8_FOUR_TOKENPARTITION = 2,
278  VP8_EIGHT_TOKENPARTITION = 3
280 
282 typedef enum {
283  VP9E_CONTENT_DEFAULT,
284  VP9E_CONTENT_SCREEN,
285  VP9E_CONTENT_INVALID
287 
293 typedef enum {
294  VP8_TUNE_PSNR,
295  VP8_TUNE_SSIM
296 } vp8e_tuning;
297 
303 typedef struct vpx_svc_parameters {
304  unsigned int width;
305  unsigned int height;
315 
323 typedef struct vpx_svc_layer_id {
327 
336 /* These controls have been deprecated in favor of the flags parameter to
337  * vpx_codec_encode(). See the definition of VP8_EFLAG_* above.
338  */
342 
346 
347 VPX_CTRL_USE_TYPE(VP9E_SET_SVC, int)
348 VPX_CTRL_USE_TYPE(VP9E_SET_SVC_PARAMETERS, vpx_svc_parameters_t *)
350 
356 VPX_CTRL_USE_TYPE(VP8E_SET_TOKEN_PARTITIONS, int) /* vp8e_token_partitions */
357 
361 VPX_CTRL_USE_TYPE(VP8E_SET_TUNING, int) /* vp8e_tuning */
363 
364 VPX_CTRL_USE_TYPE(VP9E_SET_TILE_COLUMNS, int)
365 VPX_CTRL_USE_TYPE(VP9E_SET_TILE_ROWS, int)
366 
369 
371 
372 VPX_CTRL_USE_TYPE(VP9E_SET_LOSSLESS, unsigned int)
373 
374 VPX_CTRL_USE_TYPE(VP9E_SET_FRAME_PARALLEL_DECODING, unsigned int)
375 
376 VPX_CTRL_USE_TYPE(VP9E_SET_AQ_MODE, unsigned int)
377 
378 VPX_CTRL_USE_TYPE(VP9E_SET_FRAME_PERIODIC_BOOST, unsigned int)
379 
380 VPX_CTRL_USE_TYPE(VP9E_SET_TUNE_CONTENT, int) /* vp9e_tune_content */
382 #ifdef __cplusplus
383 } // extern "C"
384 #endif
385 
386 #endif // VPX_VP8CX_H_
struct vpx_codec_iface vpx_codec_iface_t
Codec interface structure.
Definition: vpx_codec.h:173
unsigned char * roi_map
Definition: vp8cx.h:232
control function to set vp8 encoder cpuused
Definition: vp8cx.h:149
struct vpx_active_map vpx_active_map_t
vpx active region map
unsigned int cols
Definition: vp8cx.h:254
vp8e_enc_control_id
VP8 encoder control functions.
Definition: vp8cx.h:131
Definition: vp8cx.h:133
int gld_fb_idx
Definition: vp8cx.h:312
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:234
Definition: vp8cx.h:137
VPX_SCALING_MODE v_scaling_mode
Definition: vp8cx.h:264
vp8e_token_partitions
VP8 token partition mode.
Definition: vp8cx.h:274
Definition: vp8cx.h:135
int max_quantizer
Definition: vp8cx.h:308
Definition: vp8cx.h:169
control function to set constrained quality level
Definition: vp8cx.h:176
Definition: vp8cx.h:167
int spatial_layer_id
Definition: vp8cx.h:324
Max data rate for Intra frames.
Definition: vp8cx.h:190
unsigned int width
Definition: vp8cx.h:304
int alt_fb_idx
Definition: vp8cx.h:313
#define VPX_CTRL_USE_TYPE(id, typ)
vpx_codec_control type definition macro
Definition: vpx_codec.h:421
unsigned int static_threshold[4]
Definition: vp8cx.h:241
Definition: vp8cx.h:158
int distance_from_i_frame
Definition: vp8cx.h:310
vp9 svc layer parameters
Definition: vp8cx.h:323
Definition: vp8cx.h:154
Definition: vp8cx.h:151
unsigned int height
Definition: vp8cx.h:305
int delta_lf[4]
Definition: vp8cx.h:239
int min_quantizer
Definition: vp8cx.h:309
#define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ)
vpx_codec_control deprecated type definition macro
Definition: vpx_codec.h:448
Definition: vp8cx.h:134
unsigned char * active_map
Definition: vp8cx.h:252
unsigned int rows
Definition: vp8cx.h:253
Definition: vp8cx.h:162
int temporal_layer_id
Definition: vp8cx.h:325
struct vpx_scaling_mode vpx_scaling_mode_t
vpx image scaling mode
Definition: vp8cx.h:163
Provides controls common to both the VP8 encoder and decoder.
Definition: vp8cx.h:132
struct vpx_svc_layer_id vpx_svc_layer_id_t
vp9 svc layer parameters
Definition: vp8cx.h:155
Definition: vp8cx.h:150
VPX_SCALING_MODE h_scaling_mode
Definition: vp8cx.h:263
int lst_fb_idx
Definition: vp8cx.h:311
int temporal_layer
Definition: vp8cx.h:307
vpx active region map
Definition: vp8cx.h:251
struct vpx_roi_map vpx_roi_map_t
vpx region of interest map
unsigned int rows
Definition: vp8cx.h:233
Definition: vp8cx.h:153
vpx_scaling_mode_1d
vpx 1-D scaling mode
Definition: vp8cx.h:216
vp8e_tuning
VP8 model tuning parameters.
Definition: vp8cx.h:293
Definition: vp8cx.h:152
int spatial_layer
Definition: vp8cx.h:306
vpx region of interest map
Definition: vp8cx.h:230
int delta_q[4]
Definition: vp8cx.h:238
vp9 svc parameters
Definition: vp8cx.h:303
vpx image scaling mode
Definition: vp8cx.h:262
control function to set svc layer for spatial and temporal.
Definition: vp8cx.h:208
Definition: vp8cx.h:136
vp9e_tune_content
Definition: vp8cx.h:282