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