WebM 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_VPX_VP8CX_H_
11#define VPX_VPX_VP8CX_H_
12
18#include "./vp8.h"
19#include "./vpx_encoder.h"
20#include "./vpx_ext_ratectrl.h"
21
27#ifdef __cplusplus
28extern "C" {
29#endif
30
36extern vpx_codec_iface_t vpx_codec_vp8_cx_algo;
37extern vpx_codec_iface_t *vpx_codec_vp8_cx(void);
45extern vpx_codec_iface_t vpx_codec_vp9_cx_algo;
46extern 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
67#define VP8_EFLAG_NO_REF_GF (1 << 17)
68
75#define VP8_EFLAG_NO_REF_ARF (1 << 21)
76
82#define VP8_EFLAG_NO_UPD_LAST (1 << 18)
83
89#define VP8_EFLAG_NO_UPD_GF (1 << 22)
90
96#define VP8_EFLAG_NO_UPD_ARF (1 << 23)
97
103#define VP8_EFLAG_FORCE_GF (1 << 19)
104
110#define VP8_EFLAG_FORCE_ARF (1 << 24)
111
117#define VP8_EFLAG_NO_UPD_ENTROPY (1 << 20)
118
132
138
144
157
166
175
184
190
196
204
213
219
225
228
234
244
259
265
280
295
306
314
329
353
373
387
400
415
423
432
438
446
455
465
473
481
496
508
516
524
530
539
547
555
564
572
578
588
603
612
621
630
637
647
662
670
680
688
696
705
715
729
735
745};
746
752 VP8E_NORMAL = 0,
753 VP8E_FOURFIVE = 1,
754 VP8E_THREEFIVE = 2,
755 VP8E_ONETWO = 3
757
769
775
779
784
791typedef struct vpx_roi_map {
793 uint8_t enabled;
796 unsigned char *roi_map;
797 unsigned int rows;
798 unsigned int cols;
800 int delta_q[8];
801 int delta_lf[8];
803 int skip[8];
804 int ref_frame[8];
806 unsigned int static_threshold[4];
808
815typedef struct vpx_active_map {
817 unsigned char *active_map;
818 unsigned int rows;
819 unsigned int cols;
821
827typedef struct vpx_scaling_mode {
831
839typedef enum {
840 VP8_ONE_TOKENPARTITION = 0,
841 VP8_TWO_TOKENPARTITION = 1,
842 VP8_FOUR_TOKENPARTITION = 2,
843 VP8_EIGHT_TOKENPARTITION = 3
845
847typedef enum {
848 VP9E_CONTENT_DEFAULT,
849 VP9E_CONTENT_SCREEN,
850 VP9E_CONTENT_FILM,
851 VP9E_CONTENT_INVALID
853
859typedef enum { VP8_TUNE_PSNR, VP8_TUNE_SSIM } vp8e_tuning;
860
868typedef struct vpx_svc_layer_id {
870 // TODO(jianj): Deprecated, to be removed.
874
888 // TODO(jianj): Remove update_last/golden/alt_ref, these are deprecated.
897
903typedef enum {
911
919typedef struct vpx_svc_frame_drop {
925
935
945#define VPX_CTRL_VP8E_SET_FRAME_FLAGS
947#define VPX_CTRL_VP8E_SET_TEMPORAL_LAYER_ID
949#define VPX_CTRL_VP8E_SET_ROI_MAP
951#define VPX_CTRL_VP9E_SET_ROI_MAP
953#define VPX_CTRL_VP8E_SET_ACTIVEMAP
955#define VPX_CTRL_VP8E_SET_SCALEMODE
956
958#define VPX_CTRL_VP9E_SET_SVC
960#define VPX_CTRL_VP9E_SET_SVC_PARAMETERS
962#define VPX_CTRL_VP9E_REGISTER_CX_CALLBACK
964#define VPX_CTRL_VP9E_SET_SVC_LAYER_ID
965
967#define VPX_CTRL_VP8E_SET_CPUUSED
969#define VPX_CTRL_VP8E_SET_ENABLEAUTOALTREF
971#define VPX_CTRL_VP8E_SET_NOISE_SENSITIVITY
973#define VPX_CTRL_VP8E_SET_SHARPNESS
975#define VPX_CTRL_VP8E_SET_STATIC_THRESHOLD
976VPX_CTRL_USE_TYPE(VP8E_SET_TOKEN_PARTITIONS, int) /* vp8e_token_partitions */
977#define VPX_CTRL_VP8E_SET_TOKEN_PARTITIONS
978
980#define VPX_CTRL_VP8E_SET_ARNR_MAXFRAMES
982#define VPX_CTRL_VP8E_SET_ARNR_STRENGTH
984#define VPX_CTRL_VP8E_SET_ARNR_TYPE
985VPX_CTRL_USE_TYPE(VP8E_SET_TUNING, int) /* vp8e_tuning */
986#define VPX_CTRL_VP8E_SET_TUNING
988#define VPX_CTRL_VP8E_SET_CQ_LEVEL
989
991#define VPX_CTRL_VP9E_SET_TILE_COLUMNS
993#define VPX_CTRL_VP9E_SET_TILE_ROWS
994
996#define VPX_CTRL_VP9E_SET_TPL
997
999#define VPX_CTRL_VP8E_GET_LAST_QUANTIZER
1001#define VPX_CTRL_VP8E_GET_LAST_QUANTIZER_64
1003#define VPX_CTRL_VP9E_GET_LAST_QUANTIZER_SVC_LAYERS
1004
1006#define VPX_CTRL_VP9E_GET_SVC_LAYER_ID
1007
1009#define VPX_CTRL_VP8E_SET_MAX_INTRA_BITRATE_PCT
1011#define VPX_CTRL_VP9E_SET_MAX_INTER_BITRATE_PCT
1012
1014#define VPX_CTRL_VP8E_SET_GF_CBR_BOOST_PCT
1015
1017#define VPX_CTRL_VP8E_SET_SCREEN_CONTENT_MODE
1018
1020#define VPX_CTRL_VP9E_SET_GF_CBR_BOOST_PCT
1021
1023#define VPX_CTRL_VP9E_SET_LOSSLESS
1024
1026#define VPX_CTRL_VP9E_SET_FRAME_PARALLEL_DECODING
1027
1029#define VPX_CTRL_VP9E_SET_AQ_MODE
1030
1032#define VPX_CTRL_VP9E_SET_ALT_REF_AQ
1033
1035#define VPX_CTRL_VP9E_SET_FRAME_PERIODIC_BOOST
1036
1038#define VPX_CTRL_VP9E_SET_NOISE_SENSITIVITY
1039
1040VPX_CTRL_USE_TYPE(VP9E_SET_TUNE_CONTENT, int) /* vp9e_tune_content */
1041#define VPX_CTRL_VP9E_SET_TUNE_CONTENT
1042
1044#define VPX_CTRL_VP9E_SET_COLOR_SPACE
1045
1047#define VPX_CTRL_VP9E_SET_MIN_GF_INTERVAL
1048
1050#define VPX_CTRL_VP9E_SET_MAX_GF_INTERVAL
1051
1053#define VPX_CTRL_VP9E_GET_ACTIVEMAP
1054
1056#define VPX_CTRL_VP9E_SET_COLOR_RANGE
1057
1059#define VPX_CTRL_VP9E_SET_SVC_REF_FRAME_CONFIG
1060
1062#define VPX_CTRL_VP9E_SET_RENDER_SIZE
1063
1065#define VPX_CTRL_VP9E_SET_TARGET_LEVEL
1066
1068#define VPX_CTRL_VP9E_SET_ROW_MT
1069
1071#define VPX_CTRL_VP9E_GET_LEVEL
1072
1074#define VPX_CTRL_VP9E_GET_LOOPFILTER_LEVEL
1075
1077#define VPX_CTRL_VP9E_ENABLE_MOTION_VECTOR_UNIT_TEST
1078
1080#define VPX_CTRL_VP9E_SET_SVC_INTER_LAYER_PRED
1081
1083#define VPX_CTRL_VP9E_SET_SVC_FRAME_DROP_LAYER
1084
1086#define VPX_CTRL_VP9E_GET_SVC_REF_FRAME_CONFIG
1087
1089#define VPX_CTRL_VP9E_SET_SVC_GF_TEMPORAL_REF
1090
1093#define VPX_CTRL_VP9E_SET_SVC_SPATIAL_LAYER_SYNC
1094
1096#define VPX_CTRL_VP9E_SET_POSTENCODE_DROP
1097
1099#define VPX_CTRL_VP9E_SET_DELTA_Q_UV
1100
1102#define VPX_CTRL_VP9E_SET_DISABLE_OVERSHOOT_MAXQ_CBR
1103
1105#define VPX_CTRL_VP9E_SET_DISABLE_LOOPFILTER
1106
1108#define VPX_CTRL_VP9E_SET_RTC_EXTERNAL_RATECTRL
1109
1111#define VPX_CTRL_VP9E_SET_EXTERNAL_RATE_CONTROL
1112
1115#ifdef __cplusplus
1116} // extern "C"
1117#endif
1118
1119#endif // VPX_VPX_VP8CX_H_
#define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ)
vpx_codec_control deprecated type definition macro
Definition vpx_codec.h:448
#define VPX_CTRL_USE_TYPE(id, typ)
vpx_codec_control type definition macro
Definition vpx_codec.h:422
const struct vpx_codec_iface vpx_codec_iface_t
Codec interface structure.
Definition vpx_codec.h:177
#define VPX_SS_MAX_LAYERS
Definition vpx_encoder.h:47
struct vpx_active_map vpx_active_map_t
vpx active region map
struct vpx_svc_layer_id vpx_svc_layer_id_t
vp9 svc layer parameters
SVC_LAYER_DROP_MODE
VP9 svc frame dropping mode.
Definition vp8cx.h:903
vp8e_tuning
VP8 model tuning parameters.
Definition vp8cx.h:859
enum vp9e_temporal_layering_mode VP9E_TEMPORAL_LAYERING_MODE
Temporal layering mode enum for VP9 SVC.
struct vpx_scaling_mode vpx_scaling_mode_t
vpx image scaling mode
vp8e_token_partitions
VP8 token partition mode.
Definition vp8cx.h:839
vp8e_enc_control_id
VPx encoder control functions.
Definition vp8cx.h:126
vpx_scaling_mode_1d
vpx 1-D scaling mode
Definition vp8cx.h:751
vp9e_tune_content
Definition vp8cx.h:847
struct vpx_roi_map vpx_roi_map_t
vpx region of interest map
struct vpx_svc_ref_frame_config vpx_svc_ref_frame_config_t
vp9 svc frame flag parameters.
vp9e_temporal_layering_mode
Temporal layering mode enum for VP9 SVC.
Definition vp8cx.h:764
struct vpx_svc_frame_drop vpx_svc_frame_drop_t
vp9 svc frame dropping parameters.
enum vpx_scaling_mode_1d VPX_SCALING_MODE
vpx 1-D scaling mode
struct vpx_svc_spatial_layer_sync vpx_svc_spatial_layer_sync_t
vp9 svc spatial layer sync parameters.
@ CONSTRAINED_FROM_ABOVE_DROP
Definition vp8cx.h:908
@ FULL_SUPERFRAME_DROP
Definition vp8cx.h:907
@ CONSTRAINED_LAYER_DROP
Definition vp8cx.h:904
@ LAYER_DROP
Definition vp8cx.h:906
@ VP9E_SET_MIN_GF_INTERVAL
Codec control function to set minimum interval between GF/ARF frames.
Definition vp8cx.h:515
@ VP9E_SET_MAX_INTER_BITRATE_PCT
Codec control function to set max data rate for Inter frames.
Definition vp8cx.h:279
@ VP9E_SET_FRAME_PERIODIC_BOOST
Codec control function to enable/disable periodic Q boost.
Definition vp8cx.h:414
@ VP9E_SET_SVC_LAYER_ID
Codec control function to set svc layer for spatial and temporal.
Definition vp8cx.h:454
@ VP8E_SET_MAX_INTRA_BITRATE_PCT
Codec control function to set Max data rate for Intra frames.
Definition vp8cx.h:258
@ VP8E_SET_ARNR_STRENGTH
Codec control function to set the filter strength for the arf.
Definition vp8cx.h:224
@ VP8E_SET_TUNING
Codec control function to set visual tuning.
Definition vp8cx.h:233
@ VP9E_SET_SVC_INTER_LAYER_PRED
Codec control function to constrain the inter-layer prediction (prediction of lower spatial resolutio...
Definition vp8cx.h:620
@ VP9E_SET_ROI_MAP
Codec control function to pass an ROI map to encoder.
Definition vp8cx.h:437
@ VP9E_GET_LOOPFILTER_LEVEL
Codec control function to get loopfilter level in the encoder.
Definition vp8cx.h:734
@ VP8E_SET_ENABLEAUTOALTREF
Codec control function to enable automatic use of arf frames.
Definition vp8cx.h:165
@ VP8E_SET_ROI_MAP
Codec control function to pass an ROI map to encoder.
Definition vp8cx.h:131
@ VP9E_SET_TARGET_LEVEL
Codec control function to set target level.
Definition vp8cx.h:563
@ VP9E_GET_LEVEL
Codec control function to get bitstream level.
Definition vp8cx.h:577
@ VP9E_ENABLE_MOTION_VECTOR_UNIT_TEST
Codec control function to enable the extreme motion vector unit test in VP9. Please note that this is...
Definition vp8cx.h:611
@ VP9E_SET_TEMPORAL_LAYERING_MODE
Codec control function to set temporal layering mode.
Definition vp8cx.h:507
@ VP9E_SET_AQ_MODE
Codec control function to set adaptive quantization mode.
Definition vp8cx.h:399
@ VP9E_GET_SVC_REF_FRAME_CONFIG
Codec control function to get the refresh and reference flags and the buffer indices,...
Definition vp8cx.h:636
@ VP9E_SET_SVC_GF_TEMPORAL_REF
Codec control function to enable/disable use of golden reference as a second temporal reference for S...
Definition vp8cx.h:646
@ VP8E_SET_NOISE_SENSITIVITY
control function to set noise sensitivity
Definition vp8cx.h:174
@ VP8E_SET_TOKEN_PARTITIONS
Codec control function to set the number of token partitions.
Definition vp8cx.h:195
@ VP9E_SET_POSTENCODE_DROP
Codec control function to enable postencode frame drop.
Definition vp8cx.h:679
@ VP9E_REGISTER_CX_CALLBACK
Codec control function to register callback to get per layer packet.
Definition vp8cx.h:480
@ VP8E_SET_ARNR_TYPE
Definition vp8cx.h:227
@ VP9E_SET_COLOR_RANGE
Codec control function to set color range bit.
Definition vp8cx.h:538
@ VP8E_GET_LAST_QUANTIZER
Codec control function to get last quantizer chosen by the encoder.
Definition vp8cx.h:203
@ VP9E_SET_TILE_ROWS
Codec control function to set number of tile rows.
Definition vp8cx.h:372
@ VP8E_SET_ARNR_MAXFRAMES
Codec control function to set the max no of frames to create arf.
Definition vp8cx.h:218
@ VP8E_SET_ACTIVEMAP
Codec control function to pass an Active map to encoder.
Definition vp8cx.h:137
@ VP9E_SET_LOSSLESS
Codec control function to set lossless encoding mode.
Definition vp8cx.h:328
@ VP9E_SET_DISABLE_OVERSHOOT_MAXQ_CBR
Codec control function to disable increase Q on overshoot in CBR.
Definition vp8cx.h:695
@ VP9E_SET_SVC_SPATIAL_LAYER_SYNC
Codec control function to enable spatial layer sync frame, for any spatial layer. Enabling it for lay...
Definition vp8cx.h:661
@ VP9E_SET_SVC_PARAMETERS
Codec control function to set parameters for SVC.
Definition vp8cx.h:445
@ VP8E_SET_SCALEMODE
Codec control function to set encoder scaling mode.
Definition vp8cx.h:143
@ VP9E_SET_FRAME_PARALLEL_DECODING
Codec control function to enable frame parallel decoding feature.
Definition vp8cx.h:386
@ VP8E_SET_SHARPNESS
Codec control function to set higher sharpness at the expense of a lower PSNR.
Definition vp8cx.h:183
@ VP8E_SET_GF_CBR_BOOST_PCT
Boost percentage for Golden Frame in CBR mode.
Definition vp8cx.h:602
@ VP9E_SET_TUNE_CONTENT
Codec control function to set content type.
Definition vp8cx.h:464
@ VP9E_SET_SVC
Codec control function to turn on/off SVC in encoder.
Definition vp8cx.h:431
@ VP9E_SET_TPL
Codec control function to enable temporal dependency model.
Definition vp8cx.h:669
@ VP9E_SET_ROW_MT
Codec control function to set row level multi-threading.
Definition vp8cx.h:571
@ VP8E_SET_CPUUSED
Codec control function to set encoder internal speed settings.
Definition vp8cx.h:156
@ VP8E_SET_TEMPORAL_LAYER_ID
Codec control function to set the temporal layer id.
Definition vp8cx.h:305
@ VP9E_SET_TILE_COLUMNS
Codec control function to set number of tile columns.
Definition vp8cx.h:352
@ VP9E_SET_SVC_FRAME_DROP_LAYER
Codec control function to set mode and thresholds for frame dropping in SVC. Drop frame thresholds ar...
Definition vp8cx.h:629
@ VP9E_SET_SVC_REF_FRAME_CONFIG
Codec control function to set the frame flags and buffer indices for spatial layers....
Definition vp8cx.h:546
@ VP8E_SET_STATIC_THRESHOLD
Codec control function to set the threshold for MBs treated static.
Definition vp8cx.h:189
@ VP9E_SET_COLOR_SPACE
Codec control function to set color space info.
Definition vp8cx.h:495
@ VP9E_GET_LAST_QUANTIZER_SVC_LAYERS
Codec control to get last quantizers for all spatial layers.
Definition vp8cx.h:744
@ VP9E_SET_RENDER_SIZE
Codec control function to set intended rendering image size.
Definition vp8cx.h:554
@ VP8E_SET_SCREEN_CONTENT_MODE
Codec control function to set encoder screen content mode.
Definition vp8cx.h:313
@ VP9E_SET_DISABLE_LOOPFILTER
Codec control function to disable loopfilter.
Definition vp8cx.h:704
@ VP8E_SET_CQ_LEVEL
Codec control function to set constrained / constant quality level.
Definition vp8cx.h:243
@ VP9E_SET_NOISE_SENSITIVITY
Codec control function to set noise sensitivity.
Definition vp8cx.h:422
@ VP8E_GET_LAST_QUANTIZER_64
Codec control function to get last quantizer chosen by the encoder.
Definition vp8cx.h:212
@ VP8E_SET_FRAME_FLAGS
Codec control function to set reference and update frame flags.
Definition vp8cx.h:264
@ VP9E_GET_ACTIVEMAP
Codec control function to get an Active map back from the encoder.
Definition vp8cx.h:529
@ VP9E_SET_GF_CBR_BOOST_PCT
Boost percentage for Golden Frame in CBR mode.
Definition vp8cx.h:294
@ VP9E_SET_RTC_EXTERNAL_RATECTRL
Codec control to disable internal features in rate control.
Definition vp8cx.h:728
@ VP9E_GET_SVC_LAYER_ID
Codec control function to get svc layer ID.
Definition vp8cx.h:472
@ VP9E_SET_EXTERNAL_RATE_CONTROL
Codec control function to enable external rate control library.
Definition vp8cx.h:714
@ VP9E_SET_MAX_GF_INTERVAL
Codec control function to set minimum interval between GF/ARF frames.
Definition vp8cx.h:523
@ VP9E_SET_ALT_REF_AQ
Codec control function to enable/disable special mode for altref adaptive quantization....
Definition vp8cx.h:587
@ VP9E_SET_DELTA_Q_UV
Codec control function to set delta q for uv.
Definition vp8cx.h:687
@ VP9E_TEMPORAL_LAYERING_MODE_BYPASS
Bypass mode. Used when application needs to control temporal layering. This will only work when the n...
Definition vp8cx.h:774
@ VP9E_TEMPORAL_LAYERING_MODE_0101
0-1-0-1... temporal layering scheme with two temporal layers.
Definition vp8cx.h:778
@ VP9E_TEMPORAL_LAYERING_MODE_NOLAYERING
No temporal layering. Used when only spatial layering is used.
Definition vp8cx.h:768
@ VP9E_TEMPORAL_LAYERING_MODE_0212
0-2-1-2... temporal layering scheme with three temporal layers.
Definition vp8cx.h:782
vpx active region map
Definition vp8cx.h:815
unsigned int rows
Definition vp8cx.h:818
unsigned int cols
Definition vp8cx.h:819
unsigned char * active_map
specify an on (1) or off (0) each 16x16 region within a frame
Definition vp8cx.h:817
Callback function set for external rate control.
Definition vpx_ext_ratectrl.h:329
vpx region of interest map
Definition vp8cx.h:791
uint8_t enabled
Definition vp8cx.h:793
int skip[8]
Definition vp8cx.h:803
unsigned int static_threshold[4]
Definition vp8cx.h:806
unsigned int rows
Definition vp8cx.h:797
unsigned int cols
Definition vp8cx.h:798
int ref_frame[8]
Definition vp8cx.h:804
int delta_q[8]
Definition vp8cx.h:800
unsigned char * roi_map
Definition vp8cx.h:796
int delta_lf[8]
Definition vp8cx.h:801
vpx image scaling mode
Definition vp8cx.h:827
VPX_SCALING_MODE v_scaling_mode
Definition vp8cx.h:829
VPX_SCALING_MODE h_scaling_mode
Definition vp8cx.h:828
vp9 svc frame dropping parameters.
Definition vp8cx.h:919
int framedrop_thresh[5]
Definition vp8cx.h:920
SVC_LAYER_DROP_MODE framedrop_mode
Definition vp8cx.h:922
int max_consec_drop
Definition vp8cx.h:923
vp9 svc layer parameters
Definition vp8cx.h:868
int temporal_layer_id
Definition vp8cx.h:871
int temporal_layer_id_per_spatial[5]
Definition vp8cx.h:872
int spatial_layer_id
Definition vp8cx.h:869
vp9 svc frame flag parameters.
Definition vp8cx.h:883
int lst_fb_idx[5]
Definition vp8cx.h:884
int update_alt_ref[5]
Definition vp8cx.h:891
int update_buffer_slot[5]
Definition vp8cx.h:887
int gld_fb_idx[5]
Definition vp8cx.h:885
int reference_last[5]
Definition vp8cx.h:892
int reference_golden[5]
Definition vp8cx.h:893
int update_last[5]
Definition vp8cx.h:889
int reference_alt_ref[5]
Definition vp8cx.h:894
int64_t duration[5]
Definition vp8cx.h:895
int alt_fb_idx[5]
Definition vp8cx.h:886
int update_golden[5]
Definition vp8cx.h:890
vp9 svc spatial layer sync parameters.
Definition vp8cx.h:931
int spatial_layer_sync[5]
Definition vp8cx.h:932
int base_layer_intra_only
Definition vp8cx.h:933
Provides controls common to both the VP8 encoder and decoder.
Describes the encoder algorithm interface to applications.