WebM 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 VPX_VP8CX_H_
11 #define VPX_VP8CX_H_
12
18 #include "./vp8.h"
19 #include "./vpx_encoder.h"
20
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
35 extern vpx_codec_iface_t vpx_codec_vp8_cx_algo;
36 extern vpx_codec_iface_t *vpx_codec_vp8_cx(void);
44 extern vpx_codec_iface_t vpx_codec_vp9_cx_algo;
45 extern vpx_codec_iface_t *vpx_codec_vp9_cx(void);
49 /*
50 * Algorithm Flags
51 */
52
59 #define VP8_EFLAG_NO_REF_LAST (1<<16)
60
61
68 #define VP8_EFLAG_NO_REF_GF (1<<17)
69
70
77 #define VP8_EFLAG_NO_REF_ARF (1<<21)
78
79
85 #define VP8_EFLAG_NO_UPD_LAST (1<<18)
86
87
93 #define VP8_EFLAG_NO_UPD_GF (1<<22)
94
95
101 #define VP8_EFLAG_NO_UPD_ARF (1<<23)
102
103
109 #define VP8_EFLAG_FORCE_GF (1<<19)
110
111
117 #define VP8_EFLAG_FORCE_ARF (1<<24)
118
119
125 #define VP8_EFLAG_NO_UPD_ENTROPY (1<<20)
126
127
135 enum vp8e_enc_control_id {
140 VP8E_UPD_ENTROPY = 5,
141
146 VP8E_UPD_REFERENCE,
147
152 VP8E_USE_REFERENCE,
153
158 VP8E_SET_ROI_MAP,
159
164 VP8E_SET_ACTIVEMAP,
165
170 VP8E_SET_SCALEMODE = 11,
171
183 VP8E_SET_CPUUSED = 13,
184
189 VP8E_SET_ENABLEAUTOALTREF,
190
198 VP8E_SET_NOISE_SENSITIVITY,
199
204 VP8E_SET_SHARPNESS,
205
210 VP8E_SET_STATIC_THRESHOLD,
211
216 VP8E_SET_TOKEN_PARTITIONS,
217
224 VP8E_GET_LAST_QUANTIZER,
225
233 VP8E_GET_LAST_QUANTIZER_64,
234
239 VP8E_SET_ARNR_MAXFRAMES,
240
245 VP8E_SET_ARNR_STRENGTH,
246
248 VP8E_SET_ARNR_TYPE,
249
254 VP8E_SET_TUNING,
255
264 VP8E_SET_CQ_LEVEL,
265
279 VP8E_SET_MAX_INTRA_BITRATE_PCT,
280
285 VP8E_SET_FRAME_FLAGS,
286
300 VP9E_SET_MAX_INTER_BITRATE_PCT,
301
315 VP9E_SET_GF_CBR_BOOST_PCT,
316
326 VP8E_SET_TEMPORAL_LAYER_ID,
327
332 VP8E_SET_SCREEN_CONTENT_MODE,
333
347 VP9E_SET_LOSSLESS,
348
370 VP9E_SET_TILE_COLUMNS,
371
390 VP9E_SET_TILE_ROWS,
391
404 VP9E_SET_FRAME_PARALLEL_DECODING,
405
417 VP9E_SET_AQ_MODE,
418
432 VP9E_SET_FRAME_PERIODIC_BOOST,
433
440 VP9E_SET_NOISE_SENSITIVITY,
441
449 VP9E_SET_SVC,
450
451 #if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION)
452
458 VP9E_SET_SVC_PARAMETERS,
459 #endif
460
468 VP9E_SET_SVC_LAYER_ID,
469
477 VP9E_SET_TUNE_CONTENT,
478
479 #if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION)
480
486 VP9E_GET_SVC_LAYER_ID,
487
494 VP9E_REGISTER_CX_CALLBACK,
495 #endif
496
510 VP9E_SET_COLOR_SPACE,
511 };
512
517 typedef enum vpx_scaling_mode_1d {
518 VP8E_NORMAL = 0,
519 VP8E_FOURFIVE = 1,
520 VP8E_THREEFIVE = 2,
521 VP8E_ONETWO = 3
522 } VPX_SCALING_MODE;
523
524
531 typedef struct vpx_roi_map {
533 unsigned char *roi_map;
534 unsigned int rows;
535 unsigned int cols;
536 // TODO(paulwilkins): broken for VP9 which has 8 segments
537 // q and loop filter deltas for each segment
538 // (see MAX_MB_SEGMENTS)
539 int delta_q[4];
540 int delta_lf[4];
542 unsigned int static_threshold[4];
543 } vpx_roi_map_t;
544
552 typedef struct vpx_active_map {
553 unsigned char *active_map;
554 unsigned int rows;
555 unsigned int cols;
556 } vpx_active_map_t;
557
563 typedef struct vpx_scaling_mode {
564 VPX_SCALING_MODE h_scaling_mode;
565 VPX_SCALING_MODE v_scaling_mode;
566 } vpx_scaling_mode_t;
567
575 typedef enum {
576 VP8_ONE_TOKENPARTITION = 0,
577 VP8_TWO_TOKENPARTITION = 1,
578 VP8_FOUR_TOKENPARTITION = 2,
579 VP8_EIGHT_TOKENPARTITION = 3
580 } vp8e_token_partitions;
581
583 typedef enum {
584 VP9E_CONTENT_DEFAULT,
585 VP9E_CONTENT_SCREEN,
586 VP9E_CONTENT_INVALID
587 } vp9e_tune_content;
588
594 typedef enum {
595 VP8_TUNE_PSNR,
596 VP8_TUNE_SSIM
597 } vp8e_tuning;
598
599 #if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION)
600
607 typedef struct vpx_svc_layer_id {
608 int spatial_layer_id;
609 int temporal_layer_id;
610 } vpx_svc_layer_id_t;
611 #else
612
619 typedef struct vpx_svc_layer_id {
620 int temporal_layer_id;
621 } vpx_svc_layer_id_t;
622 #endif
623
632 /* These controls have been deprecated in favor of the flags parameter to
633 * vpx_codec_encode(). See the definition of VP8_EFLAG_* above.
634 */
635 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_UPD_ENTROPY, int)
636 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_UPD_REFERENCE, int)
637 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_USE_REFERENCE, int)
638
639 VPX_CTRL_USE_TYPE(VP8E_SET_FRAME_FLAGS, int)
640 VPX_CTRL_USE_TYPE(VP8E_SET_TEMPORAL_LAYER_ID, int)
641 VPX_CTRL_USE_TYPE(VP8E_SET_ROI_MAP, vpx_roi_map_t *)
642 VPX_CTRL_USE_TYPE(VP8E_SET_ACTIVEMAP, vpx_active_map_t *)
643 VPX_CTRL_USE_TYPE(VP8E_SET_SCALEMODE, vpx_scaling_mode_t *)
644
645 VPX_CTRL_USE_TYPE(VP9E_SET_SVC, int)
646 #if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION)
647 VPX_CTRL_USE_TYPE(VP9E_SET_SVC_PARAMETERS, void *)
648 VPX_CTRL_USE_TYPE(VP9E_REGISTER_CX_CALLBACK, void *)
649 #endif
650 VPX_CTRL_USE_TYPE(VP9E_SET_SVC_LAYER_ID, vpx_svc_layer_id_t *)
651
652 VPX_CTRL_USE_TYPE(VP8E_SET_CPUUSED, int)
653 VPX_CTRL_USE_TYPE(VP8E_SET_ENABLEAUTOALTREF, unsigned int)
654 VPX_CTRL_USE_TYPE(VP8E_SET_NOISE_SENSITIVITY, unsigned int)
655 VPX_CTRL_USE_TYPE(VP8E_SET_SHARPNESS, unsigned int)
656 VPX_CTRL_USE_TYPE(VP8E_SET_STATIC_THRESHOLD, unsigned int)
657 VPX_CTRL_USE_TYPE(VP8E_SET_TOKEN_PARTITIONS, int) /* vp8e_token_partitions */
658
659 VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_MAXFRAMES, unsigned int)
660 VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_STRENGTH, unsigned int)
661 VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_SET_ARNR_TYPE, unsigned int)
662 VPX_CTRL_USE_TYPE(VP8E_SET_TUNING, int) /* vp8e_tuning */
663 VPX_CTRL_USE_TYPE(VP8E_SET_CQ_LEVEL, unsigned int)
664
665 VPX_CTRL_USE_TYPE(VP9E_SET_TILE_COLUMNS, int)
666 VPX_CTRL_USE_TYPE(VP9E_SET_TILE_ROWS, int)
667
668 VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER, int *)
669 VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER_64, int *)
670 #if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION)
671 VPX_CTRL_USE_TYPE(VP9E_GET_SVC_LAYER_ID, vpx_svc_layer_id_t *)
672 #endif
673
674 VPX_CTRL_USE_TYPE(VP8E_SET_MAX_INTRA_BITRATE_PCT, unsigned int)
675 VPX_CTRL_USE_TYPE(VP8E_SET_MAX_INTER_BITRATE_PCT, unsigned int)
676
677 VPX_CTRL_USE_TYPE(VP8E_SET_SCREEN_CONTENT_MODE, unsigned int)
678
679 VPX_CTRL_USE_TYPE(VP9E_SET_GF_CBR_BOOST_PCT, unsigned int)
680
681 VPX_CTRL_USE_TYPE(VP9E_SET_LOSSLESS, unsigned int)
682
683 VPX_CTRL_USE_TYPE(VP9E_SET_FRAME_PARALLEL_DECODING, unsigned int)
684
685 VPX_CTRL_USE_TYPE(VP9E_SET_AQ_MODE, unsigned int)
686
687 VPX_CTRL_USE_TYPE(VP9E_SET_FRAME_PERIODIC_BOOST, unsigned int)
688
689 VPX_CTRL_USE_TYPE(VP9E_SET_NOISE_SENSITIVITY, unsigned int)
690
691 VPX_CTRL_USE_TYPE(VP9E_SET_TUNE_CONTENT, int) /* vp9e_tune_content */
692
693 VPX_CTRL_USE_TYPE(VP9E_SET_COLOR_SPACE, int)
695 #ifdef __cplusplus
696 } // extern "C"
697 #endif
698
699 #endif // VPX_VP8CX_H_
vpx_roi_map::roi_map
unsigned char * roi_map
Definition: vp8cx.h:533
VP8E_SET_CPUUSED
Codec control function to set encoder internal speed settings.
Definition: vp8cx.h:183
vpx_active_map_t
struct vpx_active_map vpx_active_map_t
vpx active region map
vpx_encoder.h
Describes the encoder algorithm interface to applications.
vpx_active_map::cols
unsigned int cols
Definition: vp8cx.h:555
vp8e_enc_control_id
vp8e_enc_control_id
VPx encoder control functions.
Definition: vp8cx.h:135
VP8E_UPD_REFERENCE
Codec control function to set reference update mode in encoder.
Definition: vp8cx.h:146
VP9E_SET_TUNE_CONTENT
Codec control function to set content type.
Definition: vp8cx.h:477
VP9E_SET_NOISE_SENSITIVITY
Codec control function to set noise sensitivity.
Definition: vp8cx.h:440
VPX_SCALING_MODE
enum vpx_scaling_mode_1d VPX_SCALING_MODE
vpx 1-D scaling mode
vpx_roi_map::cols
unsigned int cols
Definition: vp8cx.h:535
VP8E_SET_FRAME_FLAGS
Codec control function to set reference and update frame flags.
Definition: vp8cx.h:285
VP8E_SET_SCALEMODE
Codec control function to set encoder scaling mode.
Definition: vp8cx.h:170
vpx_scaling_mode::v_scaling_mode
VPX_SCALING_MODE v_scaling_mode
Definition: vp8cx.h:565
vp8e_token_partitions
vp8e_token_partitions
VP8 token partition mode.
Definition: vp8cx.h:575
VP8E_SET_ROI_MAP
Codec control function to pass an ROI map to encoder.
Definition: vp8cx.h:158
VP8E_SET_TUNING
Codec control function to set visual tuning.
Definition: vp8cx.h:254
VP8E_SET_CQ_LEVEL
Codec control function to set constrained quality level.
Definition: vp8cx.h:264
VP8E_SET_ARNR_TYPE
Definition: vp8cx.h:248
VP8E_SET_MAX_INTRA_BITRATE_PCT
Codec control function to set Max data rate for Intra frames.
Definition: vp8cx.h:279
VP9E_SET_TILE_COLUMNS
Codec control function to set number of tile columns.
Definition: vp8cx.h:370
VPX_CTRL_USE_TYPE
#define VPX_CTRL_USE_TYPE(id, typ)
vpx_codec_control type definition macro
Definition: vpx_codec.h:423
vpx_roi_map::static_threshold
unsigned int static_threshold[4]
Definition: vp8cx.h:542
VP9E_SET_AQ_MODE
Codec control function to set adaptive quantization mode.
Definition: vp8cx.h:417
VP9E_SET_COLOR_SPACE
Codec control function to set color space info.
Definition: vp8cx.h:510
VP9E_SET_LOSSLESS
Codec control function to set lossless encoding mode.
Definition: vp8cx.h:347
VP8E_GET_LAST_QUANTIZER_64
Codec control function to get last quantizer chosen by the encoder.
Definition: vp8cx.h:233
vpx_svc_layer_id
vp9 svc layer parameters
Definition: vp8cx.h:619
VP8E_SET_TEMPORAL_LAYER_ID
Codec control function to set the temporal layer id.
Definition: vp8cx.h:326
VP8E_SET_TOKEN_PARTITIONS
Codec control function to set the number of token partitions.
Definition: vp8cx.h:216
VP8E_SET_NOISE_SENSITIVITY
control function to set noise sensitivity
Definition: vp8cx.h:198
vpx_codec_iface_t
const struct vpx_codec_iface vpx_codec_iface_t
Codec interface structure.
Definition: vpx_codec.h:173
VP9E_SET_GF_CBR_BOOST_PCT
Boost percentage for Golden Frame in CBR mode.
Definition: vp8cx.h:315
vpx_roi_map::delta_lf
int delta_lf[4]
Definition: vp8cx.h:540
VPX_CTRL_USE_TYPE_DEPRECATED
#define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ)
vpx_codec_control deprecated type definition macro
Definition: vpx_codec.h:450
VP8E_USE_REFERENCE
Codec control function to set which reference frame encoder can use.
Definition: vp8cx.h:152
vpx_active_map::active_map
unsigned char * active_map
Definition: vp8cx.h:553
VP8E_SET_SCREEN_CONTENT_MODE
Codec control function to set encoder screen content mode.
Definition: vp8cx.h:332
vpx_active_map::rows
unsigned int rows
Definition: vp8cx.h:554
VP8E_SET_ARNR_MAXFRAMES
Codec control function to set the max no of frames to create arf.
Definition: vp8cx.h:239
vpx_svc_layer_id::temporal_layer_id
int temporal_layer_id
Definition: vp8cx.h:620
vpx_scaling_mode_t
struct vpx_scaling_mode vpx_scaling_mode_t
vpx image scaling mode
VP8E_SET_ARNR_STRENGTH
Codec control function to set the filter strength for the arf.
Definition: vp8cx.h:245
VP9E_SET_FRAME_PERIODIC_BOOST
Codec control function to enable/disable periodic Q boost.
Definition: vp8cx.h:432
vp8.h
Provides controls common to both the VP8 encoder and decoder.
VP8E_UPD_ENTROPY
Codec control function to set mode of entropy update in encoder.
Definition: vp8cx.h:140
vpx_svc_layer_id_t
struct vpx_svc_layer_id vpx_svc_layer_id_t
vp9 svc layer parameters
VP8E_GET_LAST_QUANTIZER
Codec control function to get last quantizer chosen by the encoder.
Definition: vp8cx.h:224
VP8E_SET_ENABLEAUTOALTREF
Codec control function to enable automatic set and use alf frames.
Definition: vp8cx.h:189
vpx_scaling_mode::h_scaling_mode
VPX_SCALING_MODE h_scaling_mode
Definition: vp8cx.h:564
VP9E_SET_SVC
Codec control function to turn on/off SVC in encoder.
Definition: vp8cx.h:449
vpx_active_map
vpx active region map
Definition: vp8cx.h:552
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:534
VP9E_SET_FRAME_PARALLEL_DECODING
Codec control function to enable frame parallel decoding feature.
Definition: vp8cx.h:404
VP9E_SET_MAX_INTER_BITRATE_PCT
Codec control function to set max data rate for Inter frames.
Definition: vp8cx.h:300
VP8E_SET_STATIC_THRESHOLD
Codec control function to set the threshold for MBs treated static.
Definition: vp8cx.h:210
vpx_scaling_mode_1d
vpx_scaling_mode_1d
vpx 1-D scaling mode
Definition: vp8cx.h:517
VP9E_SET_TILE_ROWS
Codec control function to set number of tile rows.
Definition: vp8cx.h:390
vp8e_tuning
vp8e_tuning
VP8 model tuning parameters.
Definition: vp8cx.h:594
VP8E_SET_SHARPNESS
Codec control function to set sharpness.
Definition: vp8cx.h:204
vpx_roi_map
vpx region of interest map
Definition: vp8cx.h:531
vpx_roi_map::delta_q
int delta_q[4]
Definition: vp8cx.h:539
vpx_scaling_mode
vpx image scaling mode
Definition: vp8cx.h:563
VP9E_SET_SVC_LAYER_ID
Codec control function to set svc layer for spatial and temporal.
Definition: vp8cx.h:468
VP8E_SET_ACTIVEMAP
Codec control function to pass an Active map to encoder.
Definition: vp8cx.h:164
vp9e_tune_content
vp9e_tune_content
Definition: vp8cx.h:583