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
28 extern "C" {
29 #endif
30 
42 
59 
65 /*
66  * Algorithm Flags
67  */
68 
75 #define VP8_EFLAG_NO_REF_LAST (1 << 16)
76 
83 #define VP8_EFLAG_NO_REF_GF (1 << 17)
84 
91 #define VP8_EFLAG_NO_REF_ARF (1 << 21)
92 
98 #define VP8_EFLAG_NO_UPD_LAST (1 << 18)
99 
105 #define VP8_EFLAG_NO_UPD_GF (1 << 22)
106 
112 #define VP8_EFLAG_NO_UPD_ARF (1 << 23)
113 
119 #define VP8_EFLAG_FORCE_GF (1 << 19)
120 
126 #define VP8_EFLAG_FORCE_ARF (1 << 24)
127 
133 #define VP8_EFLAG_NO_UPD_ENTROPY (1 << 20)
134 
148 
154 
160 
174 
183 
192 
201 
207 
213 
221 
230 
236 
242 
245 
251 
261 
276 
282 
297 
312 
323 
331 
346 
370 
390 
404 
417 
432 
440 
449 
455 
463 
472 
482 
490 
498 
513 
521 
529 
535 
544 
552 
560 
569 
577 
583 
593 
608 
617 
626 
635 
642 
652 
667 
675 
685 
693 
701 
710 
720 
734 
740 
750 
761 
771 
779 
789 };
790 
795 typedef enum vpx_scaling_mode_1d {
796  VP8E_NORMAL = 0,
797  VP8E_FOURFIVE = 1,
798  VP8E_THREEFIVE = 2,
799  VP8E_ONETWO = 3
801 
813 
818 
822 
827 
834 typedef struct vpx_roi_map {
836  uint8_t enabled;
839  unsigned char *roi_map;
840  unsigned int rows;
841  unsigned int cols;
843  int delta_q[8];
844  int delta_lf[8];
846  int skip[8];
847  int ref_frame[8];
849  unsigned int static_threshold[4];
850 } vpx_roi_map_t;
851 
858 typedef struct vpx_active_map {
860  unsigned char *active_map;
861  unsigned int rows;
862  unsigned int cols;
864 
870 typedef struct vpx_scaling_mode {
874 
882 typedef enum {
883  VP8_ONE_TOKENPARTITION = 0,
884  VP8_TWO_TOKENPARTITION = 1,
885  VP8_FOUR_TOKENPARTITION = 2,
886  VP8_EIGHT_TOKENPARTITION = 3
888 
890 typedef enum {
891  VP9E_CONTENT_DEFAULT,
892  VP9E_CONTENT_SCREEN,
893  VP9E_CONTENT_FILM,
894  VP9E_CONTENT_INVALID
896 
902 typedef enum { VP8_TUNE_PSNR, VP8_TUNE_SSIM } vp8e_tuning;
903 
911 typedef struct vpx_svc_layer_id {
913  // TODO(jianj): Deprecated, to be removed.
917 
926 typedef struct vpx_svc_ref_frame_config {
931  // TODO(jianj): Remove update_last/golden/alt_ref, these are deprecated.
940 
946 typedef enum {
954 
962 typedef struct vpx_svc_frame_drop {
968 
978 
988 #define VPX_CTRL_VP8E_SET_ROI_MAP
990 #define VPX_CTRL_VP8E_SET_ACTIVEMAP
992 #define VPX_CTRL_VP8E_SET_SCALEMODE
994 #define VPX_CTRL_VP8E_SET_CPUUSED
996 #define VPX_CTRL_VP8E_SET_ENABLEAUTOALTREF
998 #define VPX_CTRL_VP8E_SET_NOISE_SENSITIVITY
1000 #define VPX_CTRL_VP8E_SET_SHARPNESS
1002 #define VPX_CTRL_VP8E_SET_STATIC_THRESHOLD
1003 VPX_CTRL_USE_TYPE(VP8E_SET_TOKEN_PARTITIONS, int) /* vp8e_token_partitions */
1004 #define VPX_CTRL_VP8E_SET_TOKEN_PARTITIONS
1006 #define VPX_CTRL_VP8E_GET_LAST_QUANTIZER
1008 #define VPX_CTRL_VP8E_GET_LAST_QUANTIZER_64
1010 #define VPX_CTRL_VP8E_SET_ARNR_MAXFRAMES
1012 #define VPX_CTRL_VP8E_SET_ARNR_STRENGTH
1014 #define VPX_CTRL_VP8E_SET_ARNR_TYPE
1015 VPX_CTRL_USE_TYPE(VP8E_SET_TUNING, int) /* vp8e_tuning */
1016 #define VPX_CTRL_VP8E_SET_TUNING
1017 VPX_CTRL_USE_TYPE(VP8E_SET_CQ_LEVEL, unsigned int)
1018 #define VPX_CTRL_VP8E_SET_CQ_LEVEL
1020 #define VPX_CTRL_VP8E_SET_MAX_INTRA_BITRATE_PCT
1022 #define VPX_CTRL_VP8E_SET_FRAME_FLAGS
1024 #define VPX_CTRL_VP9E_SET_MAX_INTER_BITRATE_PCT
1026 #define VPX_CTRL_VP9E_SET_GF_CBR_BOOST_PCT
1028 #define VPX_CTRL_VP8E_SET_TEMPORAL_LAYER_ID
1030 #define VPX_CTRL_VP8E_SET_SCREEN_CONTENT_MODE
1031 VPX_CTRL_USE_TYPE(VP9E_SET_LOSSLESS, unsigned int)
1032 #define VPX_CTRL_VP9E_SET_LOSSLESS
1034 #define VPX_CTRL_VP9E_SET_TILE_COLUMNS
1036 #define VPX_CTRL_VP9E_SET_TILE_ROWS
1038 #define VPX_CTRL_VP9E_SET_FRAME_PARALLEL_DECODING
1039 VPX_CTRL_USE_TYPE(VP9E_SET_AQ_MODE, unsigned int)
1040 #define VPX_CTRL_VP9E_SET_AQ_MODE
1042 #define VPX_CTRL_VP9E_SET_FRAME_PERIODIC_BOOST
1044 #define VPX_CTRL_VP9E_SET_NOISE_SENSITIVITY
1046 #define VPX_CTRL_VP9E_SET_SVC
1048 #define VPX_CTRL_VP9E_SET_ROI_MAP
1050 #define VPX_CTRL_VP9E_SET_SVC_PARAMETERS
1052 #define VPX_CTRL_VP9E_SET_SVC_LAYER_ID
1053 VPX_CTRL_USE_TYPE(VP9E_SET_TUNE_CONTENT, int) /* vp9e_tune_content */
1054 #define VPX_CTRL_VP9E_SET_TUNE_CONTENT
1056 #define VPX_CTRL_VP9E_GET_SVC_LAYER_ID
1058 #define VPX_CTRL_VP9E_REGISTER_CX_CALLBACK
1060 #define VPX_CTRL_VP9E_SET_COLOR_SPACE
1062 #define VPX_CTRL_VP9E_SET_MIN_GF_INTERVAL
1064 #define VPX_CTRL_VP9E_SET_MAX_GF_INTERVAL
1066 #define VPX_CTRL_VP9E_GET_ACTIVEMAP
1068 #define VPX_CTRL_VP9E_SET_COLOR_RANGE
1070 #define VPX_CTRL_VP9E_SET_SVC_REF_FRAME_CONFIG
1072 #define VPX_CTRL_VP9E_SET_RENDER_SIZE
1074 #define VPX_CTRL_VP9E_SET_TARGET_LEVEL
1075 VPX_CTRL_USE_TYPE(VP9E_SET_ROW_MT, unsigned int)
1076 #define VPX_CTRL_VP9E_SET_ROW_MT
1078 #define VPX_CTRL_VP9E_GET_LEVEL
1080 #define VPX_CTRL_VP9E_SET_ALT_REF_AQ
1082 #define VPX_CTRL_VP8E_SET_GF_CBR_BOOST_PCT
1084 #define VPX_CTRL_VP9E_ENABLE_MOTION_VECTOR_UNIT_TEST
1086 #define VPX_CTRL_VP9E_SET_SVC_INTER_LAYER_PRED
1088 #define VPX_CTRL_VP9E_SET_SVC_FRAME_DROP_LAYER
1090 #define VPX_CTRL_VP9E_GET_SVC_REF_FRAME_CONFIG
1092 #define VPX_CTRL_VP9E_SET_SVC_GF_TEMPORAL_REF
1095 #define VPX_CTRL_VP9E_SET_SVC_SPATIAL_LAYER_SYNC
1097 #define VPX_CTRL_VP9E_SET_TPL
1099 #define VPX_CTRL_VP9E_SET_POSTENCODE_DROP
1101 #define VPX_CTRL_VP9E_SET_DELTA_Q_UV
1103 #define VPX_CTRL_VP9E_SET_DISABLE_OVERSHOOT_MAXQ_CBR
1105 #define VPX_CTRL_VP9E_SET_DISABLE_LOOPFILTER
1107 #define VPX_CTRL_VP9E_SET_EXTERNAL_RATE_CONTROL
1109 #define VPX_CTRL_VP9E_SET_RTC_EXTERNAL_RATECTRL
1111 #define VPX_CTRL_VP9E_GET_LOOPFILTER_LEVEL
1113 #define VPX_CTRL_VP9E_GET_LAST_QUANTIZER_SVC_LAYERS
1115 #define VPX_CTRL_VP8E_SET_RTC_EXTERNAL_RATECTRL
1117 #define VPX_CTRL_VP9E_SET_QUANTIZER_ONE_PASS
1119 #define VPX_CTRL_VP9E_SET_KEY_FRAME_FILTERING
1121 #define VPX_CTRL_VP9E_SET_VALIDATE_HBD_INPUT
1122 
1125 #ifdef __cplusplus
1126 } // extern "C"
1127 #endif
1128 
1129 #endif // VPX_VPX_VP8CX_H_
Codec control function to validate HBD input.
Definition: vp8cx.h:788
unsigned char * roi_map
Definition: vp8cx.h:839
int base_layer_intra_only
Definition: vp8cx.h:976
Codec control function to disable increase Q on overshoot in CBR.
Definition: vp8cx.h:700
Codec control function to set encoder internal speed settings.
Definition: vp8cx.h:173
int reference_alt_ref[5]
Definition: vp8cx.h:937
struct vpx_active_map vpx_active_map_t
vpx active region map
Describes the encoder algorithm interface to applications.
unsigned int cols
Definition: vp8cx.h:862
vp8e_enc_control_id
VPx encoder control functions.
Definition: vp8cx.h:142
Codec control function to constrain the inter-layer prediction (prediction of lower spatial resolutio...
Definition: vp8cx.h:625
Codec control function to enable temporal dependency model.
Definition: vp8cx.h:674
int delta_q[8]
Definition: vp8cx.h:843
int lst_fb_idx[5]
Definition: vp8cx.h:927
Codec control function to set content type.
Definition: vp8cx.h:481
Codec control function to set noise sensitivity.
Definition: vp8cx.h:439
enum vpx_scaling_mode_1d VPX_SCALING_MODE
vpx 1-D scaling mode
unsigned int cols
Definition: vp8cx.h:841
SVC_LAYER_DROP_MODE framedrop_mode
Definition: vp8cx.h:965
Codec control function to get bitstream level.
Definition: vp8cx.h:582
Codec control function to set reference and update frame flags.
Definition: vp8cx.h:281
Codec control function to set encoder scaling mode.
Definition: vp8cx.h:159
VPX_SCALING_MODE v_scaling_mode
Definition: vp8cx.h:872
vp8e_token_partitions
VP8 token partition mode.
Definition: vp8cx.h:882
enum vp9e_temporal_layering_mode VP9E_TEMPORAL_LAYERING_MODE
Temporal layering mode enum for VP9 SVC.
Codec control function to pass an ROI map to encoder.
Definition: vp8cx.h:147
int framedrop_thresh[5]
Definition: vp8cx.h:963
int reference_golden[5]
Definition: vp8cx.h:936
Codec control function to enable spatial layer sync frame, for any spatial layer. Enabling it for lay...
Definition: vp8cx.h:666
Codec control function to set visual tuning.
Definition: vp8cx.h:250
Codec control function to set constrained / constant quality level.
Definition: vp8cx.h:260
Definition: vp8cx.h:244
Callback function set for external rate control.
Definition: vpx_ext_ratectrl.h:549
int update_alt_ref[5]
Definition: vp8cx.h:934
Codec control function to set row level multi-threading.
Definition: vp8cx.h:576
vpx_codec_iface_t * vpx_codec_vp8_cx(void)
The interface to the VP8 encoder.
Codec control function to disable loopfilter.
Definition: vp8cx.h:709
int spatial_layer_id
Definition: vp8cx.h:912
Codec control function to set Max data rate for Intra frames.
Definition: vp8cx.h:275
Codec control function to set parameters for SVC.
Definition: vp8cx.h:462
vp9 svc frame dropping parameters.
Definition: vp8cx.h:962
int temporal_layer_id_per_spatial[5]
Definition: vp8cx.h:915
Codec control function to set number of tile columns.
Definition: vp8cx.h:369
Codec control to set quantizer for the next frame.
Definition: vp8cx.h:770
#define VPX_SS_MAX_LAYERS
Definition: vpx_encoder.h:47
Codec control to disable internal features in rate control.
Definition: vp8cx.h:760
Codec control to disable internal features in rate control.
Definition: vp8cx.h:733
#define VPX_CTRL_USE_TYPE(id, typ)
vpx_codec_control type definition macro
Definition: vpx_codec.h:426
Codec control function to set target level.
Definition: vp8cx.h:568
int reference_last[5]
Definition: vp8cx.h:935
unsigned int static_threshold[4]
Definition: vp8cx.h:849
int update_buffer_slot[5]
Definition: vp8cx.h:930
Codec control function to set adaptive quantization mode.
Definition: vp8cx.h:416
int skip[8]
Definition: vp8cx.h:846
Codec control function to set color space info.
Definition: vp8cx.h:512
Codec control function to get svc layer ID.
Definition: vp8cx.h:489
Codec control function to set delta q for uv.
Definition: vp8cx.h:692
int delta_lf[8]
Definition: vp8cx.h:844
Codec control function to set lossless encoding mode.
Definition: vp8cx.h:345
Codec control function to get last quantizer chosen by the encoder.
Definition: vp8cx.h:229
Boost percentage for Golden Frame in CBR mode.
Definition: vp8cx.h:607
vp9 svc layer parameters
Definition: vp8cx.h:911
Codec control function to enable key frame temporal filtering.
Definition: vp8cx.h:778
Codec control function to set the temporal layer id.
Definition: vp8cx.h:322
0-1-0-1... temporal layering scheme with two temporal layers.
Definition: vp8cx.h:821
Codec control function to enable post encode frame drop.
Definition: vp8cx.h:684
Codec control function to set the number of token partitions.
Definition: vp8cx.h:212
control function to set noise sensitivity
Definition: vp8cx.h:191
const struct vpx_codec_iface vpx_codec_iface_t
Codec interface structure.
Definition: vpx_codec.h:177
struct vpx_svc_frame_drop vpx_svc_frame_drop_t
vp9 svc frame dropping parameters.
int ref_frame[8]
Definition: vp8cx.h:847
Definition: vp8cx.h:949
struct vpx_svc_spatial_layer_sync vpx_svc_spatial_layer_sync_t
vp9 svc spatial layer sync parameters.
Boost percentage for Golden Frame in CBR mode.
Definition: vp8cx.h:311
Codec control function to get the refresh and reference flags and the buffer indices, up to the last encoded spatial layer.
Definition: vp8cx.h:641
uint8_t enabled
Definition: vp8cx.h:836
Codec control function to set the frame flags and buffer indices for spatial layers. The frame flags and buffer indices are set using the struct vpx_svc_ref_frame_config defined below.
Definition: vp8cx.h:551
vp9e_temporal_layering_mode
Temporal layering mode enum for VP9 SVC.
Definition: vp8cx.h:808
Codec control function to set mode and thresholds for frame dropping in SVC. Drop frame thresholds ar...
Definition: vp8cx.h:634
vpx_codec_iface_t vpx_codec_vp9_cx_algo
A single instance of the VP9 encoder.
Codec control function to set intended rendering image size.
Definition: vp8cx.h:559
struct vpx_svc_ref_frame_config vpx_svc_ref_frame_config_t
vp9 svc frame flag parameters.
Codec control function to get loopfilter level in the encoder.
Definition: vp8cx.h:739
0-2-1-2... temporal layering scheme with three temporal layers.
Definition: vp8cx.h:825
No temporal layering. Used when only spatial layering is used.
Definition: vp8cx.h:812
#define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ)
vpx_codec_control deprecated type definition macro
Definition: vpx_codec.h:452
Codec control to get last quantizers for all spatial layers.
Definition: vp8cx.h:749
Codec control function to enable the extreme motion vector unit test in VP9. Please note that this is...
Definition: vp8cx.h:616
Definition: vp8cx.h:947
Codec control function to pass an ROI map to encoder.
Definition: vp8cx.h:454
unsigned char * active_map
specify an on (1) or off (0) each 16x16 region within a frame
Definition: vp8cx.h:860
Definition: vp8cx.h:951
Codec control function to set encoder screen content mode.
Definition: vp8cx.h:330
Bypass mode. Used when application needs to control spatial and temporal layering.
Definition: vp8cx.h:817
Definition: vp8cx.h:950
unsigned int rows
Definition: vp8cx.h:861
Codec control function to set the max no of frames to create arf.
Definition: vp8cx.h:235
Codec control function to enable external rate control library.
Definition: vp8cx.h:719
int temporal_layer_id
Definition: vp8cx.h:914
struct vpx_scaling_mode vpx_scaling_mode_t
vpx image scaling mode
Codec control function to register callback to get per layer packet.
Definition: vp8cx.h:497
Codec control function to set the filter strength for the arf.
Definition: vp8cx.h:241
Codec control function to enable/disable periodic Q boost.
Definition: vp8cx.h:431
Codec control function to get an Active map back from the encoder.
Definition: vp8cx.h:534
vp9 svc spatial layer sync parameters.
Definition: vp8cx.h:974
Codec control function to enable/disable use of golden reference as a second temporal reference for S...
Definition: vp8cx.h:651
Provides controls common to both the VP8 encoder and decoder.
Codec control function to set color range bit.
Definition: vp8cx.h:543
vpx_codec_iface_t * vpx_codec_vp9_cx(void)
The interface to the VP9 encoder.
Defines structs and callbacks needed for external rate control.
struct vpx_svc_layer_id vpx_svc_layer_id_t
vp9 svc layer parameters
Codec control function to get last quantizer chosen by the encoder.
Definition: vp8cx.h:220
Codec control function to enable automatic use of arf frames.
Definition: vp8cx.h:182
int max_consec_drop
Definition: vp8cx.h:966
Codec control function to set minimum interval between GF/ARF frames.
Definition: vp8cx.h:520
VPX_SCALING_MODE h_scaling_mode
Definition: vp8cx.h:871
Codec control function to set minimum interval between GF/ARF frames.
Definition: vp8cx.h:528
int update_golden[5]
Definition: vp8cx.h:933
Codec control function to turn on/off SVC in encoder.
Definition: vp8cx.h:448
int spatial_layer_sync[5]
Definition: vp8cx.h:975
vpx active region map
Definition: vp8cx.h:858
struct vpx_roi_map vpx_roi_map_t
vpx region of interest map
unsigned int rows
Definition: vp8cx.h:840
Codec control function to enable frame parallel decoding feature.
Definition: vp8cx.h:403
Codec control function to set max data rate for Inter frames.
Definition: vp8cx.h:296
int update_last[5]
Definition: vp8cx.h:932
vp9 svc frame flag parameters.
Definition: vp8cx.h:926
Codec control function to set the threshold for MBs treated static.
Definition: vp8cx.h:206
vpx_codec_iface_t vpx_codec_vp8_cx_algo
A single instance of the VP8 encoder.
int64_t duration[5]
Definition: vp8cx.h:938
vpx_scaling_mode_1d
vpx 1-D scaling mode
Definition: vp8cx.h:795
int alt_fb_idx[5]
Definition: vp8cx.h:929
Codec control function to set number of tile rows.
Definition: vp8cx.h:389
vp8e_tuning
VP8 model tuning parameters.
Definition: vp8cx.h:902
Codec control function to set higher sharpness at the expense of a lower PSNR.
Definition: vp8cx.h:200
vpx region of interest map
Definition: vp8cx.h:834
Codec control function to enable/disable special mode for altref adaptive quantization. You can use it with –aq-mode concurrently.
Definition: vp8cx.h:592
SVC_LAYER_DROP_MODE
VP9 svc frame dropping mode.
Definition: vp8cx.h:946
int gld_fb_idx[5]
Definition: vp8cx.h:928
vpx image scaling mode
Definition: vp8cx.h:870
Codec control function to set svc layer for spatial and temporal.
Definition: vp8cx.h:471
Codec control function to pass an Active map to encoder.
Definition: vp8cx.h:153
vp9e_tune_content
VP9 encoder content type.
Definition: vp8cx.h:890