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 
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);
48 /*
49  * Algorithm Flags
50  */
51 
58 #define VP8_EFLAG_NO_REF_LAST (1 << 16)
59 
66 #define VP8_EFLAG_NO_REF_GF (1 << 17)
67 
74 #define VP8_EFLAG_NO_REF_ARF (1 << 21)
75 
81 #define VP8_EFLAG_NO_UPD_LAST (1 << 18)
82 
88 #define VP8_EFLAG_NO_UPD_GF (1 << 22)
89 
95 #define VP8_EFLAG_NO_UPD_ARF (1 << 23)
96 
102 #define VP8_EFLAG_FORCE_GF (1 << 19)
103 
109 #define VP8_EFLAG_FORCE_ARF (1 << 24)
110 
116 #define VP8_EFLAG_NO_UPD_ENTROPY (1 << 20)
117 
131 
137 
143 
156 
165 
174 
183 
189 
195 
203 
212 
218 
224 
227 
233 
243 
258 
264 
279 
294 
305 
313 
328 
352 
372 
386 
399 
414 
422 
431 
437 
445 
454 
464 
472 
480 
495 
507 
515 
523 
529 
538 
546 
554 
563 
571 
577 
587 
602 
611 
620 
629 
636 
646 
661 
669 
679 };
680 
685 typedef enum vpx_scaling_mode_1d {
686  VP8E_NORMAL = 0,
687  VP8E_FOURFIVE = 1,
688  VP8E_THREEFIVE = 2,
689  VP8E_ONETWO = 3
691 
703 
709 
713 
718 
725 typedef struct vpx_roi_map {
727  uint8_t enabled;
730  unsigned char *roi_map;
731  unsigned int rows;
732  unsigned int cols;
734  int delta_q[8];
735  int delta_lf[8];
737  int skip[8];
738  int ref_frame[8];
740  unsigned int static_threshold[4];
742 
749 typedef struct vpx_active_map {
751  unsigned char *active_map;
752  unsigned int rows;
753  unsigned int cols;
755 
761 typedef struct vpx_scaling_mode {
765 
773 typedef enum {
774  VP8_ONE_TOKENPARTITION = 0,
775  VP8_TWO_TOKENPARTITION = 1,
776  VP8_FOUR_TOKENPARTITION = 2,
777  VP8_EIGHT_TOKENPARTITION = 3
779 
781 typedef enum {
782  VP9E_CONTENT_DEFAULT,
783  VP9E_CONTENT_SCREEN,
784  VP9E_CONTENT_FILM,
785  VP9E_CONTENT_INVALID
787 
793 typedef enum { VP8_TUNE_PSNR, VP8_TUNE_SSIM } vp8e_tuning;
794 
802 typedef struct vpx_svc_layer_id {
804  // TODO(jianj): Deprecated, to be removed.
808 
817 typedef struct vpx_svc_ref_frame_config {
822  // TODO(jianj): Remove update_last/golden/alt_ref, these are deprecated.
831 
837 typedef enum {
843 
851 typedef struct vpx_svc_frame_drop {
857 
867 
877 #define VPX_CTRL_VP8E_SET_FRAME_FLAGS
879 #define VPX_CTRL_VP8E_SET_TEMPORAL_LAYER_ID
881 #define VPX_CTRL_VP8E_SET_ROI_MAP
883 #define VPX_CTRL_VP9E_SET_ROI_MAP
885 #define VPX_CTRL_VP8E_SET_ACTIVEMAP
887 #define VPX_CTRL_VP8E_SET_SCALEMODE
888 
890 #define VPX_CTRL_VP9E_SET_SVC
892 #define VPX_CTRL_VP9E_SET_SVC_PARAMETERS
894 #define VPX_CTRL_VP9E_REGISTER_CX_CALLBACK
896 #define VPX_CTRL_VP9E_SET_SVC_LAYER_ID
897 
899 #define VPX_CTRL_VP8E_SET_CPUUSED
901 #define VPX_CTRL_VP8E_SET_ENABLEAUTOALTREF
903 #define VPX_CTRL_VP8E_SET_NOISE_SENSITIVITY
905 #define VPX_CTRL_VP8E_SET_SHARPNESS
907 #define VPX_CTRL_VP8E_SET_STATIC_THRESHOLD
908 VPX_CTRL_USE_TYPE(VP8E_SET_TOKEN_PARTITIONS, int) /* vp8e_token_partitions */
909 #define VPX_CTRL_VP8E_SET_TOKEN_PARTITIONS
910 
912 #define VPX_CTRL_VP8E_SET_ARNR_MAXFRAMES
914 #define VPX_CTRL_VP8E_SET_ARNR_STRENGTH
916 #define VPX_CTRL_VP8E_SET_ARNR_TYPE
917 VPX_CTRL_USE_TYPE(VP8E_SET_TUNING, int) /* vp8e_tuning */
918 #define VPX_CTRL_VP8E_SET_TUNING
920 #define VPX_CTRL_VP8E_SET_CQ_LEVEL
921 
923 #define VPX_CTRL_VP9E_SET_TILE_COLUMNS
925 #define VPX_CTRL_VP9E_SET_TILE_ROWS
926 
928 #define VPX_CTRL_VP9E_SET_TPL
929 
931 #define VPX_CTRL_VP8E_GET_LAST_QUANTIZER
933 #define VPX_CTRL_VP8E_GET_LAST_QUANTIZER_64
935 #define VPX_CTRL_VP9E_GET_SVC_LAYER_ID
936 
938 #define VPX_CTRL_VP8E_SET_MAX_INTRA_BITRATE_PCT
940 #define VPX_CTRL_VP9E_SET_MAX_INTER_BITRATE_PCT
941 
943 #define VPX_CTRL_VP8E_SET_GF_CBR_BOOST_PCT
944 
946 #define VPX_CTRL_VP8E_SET_SCREEN_CONTENT_MODE
947 
949 #define VPX_CTRL_VP9E_SET_GF_CBR_BOOST_PCT
950 
952 #define VPX_CTRL_VP9E_SET_LOSSLESS
953 
955 #define VPX_CTRL_VP9E_SET_FRAME_PARALLEL_DECODING
956 
957 VPX_CTRL_USE_TYPE(VP9E_SET_AQ_MODE, unsigned int)
958 #define VPX_CTRL_VP9E_SET_AQ_MODE
959 
961 #define VPX_CTRL_VP9E_SET_ALT_REF_AQ
962 
964 #define VPX_CTRL_VP9E_SET_FRAME_PERIODIC_BOOST
965 
967 #define VPX_CTRL_VP9E_SET_NOISE_SENSITIVITY
968 
969 VPX_CTRL_USE_TYPE(VP9E_SET_TUNE_CONTENT, int) /* vp9e_tune_content */
970 #define VPX_CTRL_VP9E_SET_TUNE_CONTENT
971 
973 #define VPX_CTRL_VP9E_SET_COLOR_SPACE
974 
976 #define VPX_CTRL_VP9E_SET_MIN_GF_INTERVAL
977 
979 #define VPX_CTRL_VP9E_SET_MAX_GF_INTERVAL
980 
982 #define VPX_CTRL_VP9E_GET_ACTIVEMAP
983 
985 #define VPX_CTRL_VP9E_SET_COLOR_RANGE
986 
988 #define VPX_CTRL_VP9E_SET_SVC_REF_FRAME_CONFIG
989 
991 #define VPX_CTRL_VP9E_SET_RENDER_SIZE
992 
994 #define VPX_CTRL_VP9E_SET_TARGET_LEVEL
995 
996 VPX_CTRL_USE_TYPE(VP9E_SET_ROW_MT, unsigned int)
997 #define VPX_CTRL_VP9E_SET_ROW_MT
998 
1000 #define VPX_CTRL_VP9E_GET_LEVEL
1001 
1003 #define VPX_CTRL_VP9E_ENABLE_MOTION_VECTOR_UNIT_TEST
1004 
1006 #define VPX_CTRL_VP9E_SET_SVC_INTER_LAYER_PRED
1007 
1009 #define VPX_CTRL_VP9E_SET_SVC_FRAME_DROP_LAYER
1010 
1012 #define VPX_CTRL_VP9E_GET_SVC_REF_FRAME_CONFIG
1013 
1015 #define VPX_CTRL_VP9E_SET_SVC_GF_TEMPORAL_REF
1016 
1019 #define VPX_CTRL_VP9E_SET_SVC_SPATIAL_LAYER_SYNC
1020 
1022 #define VPX_CTRL_VP9E_SET_POSTENCODE_DROP
1023 
1026 #ifdef __cplusplus
1027 } // extern "C"
1028 #endif
1029 
1030 #endif // VPX_VPX_VP8CX_H_
#define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ)
vpx_codec_control deprecated type definition macro
Definition: vpx_codec.h:445
#define VPX_CTRL_USE_TYPE(id, typ)
vpx_codec_control type definition macro
Definition: vpx_codec.h:419
const struct vpx_codec_iface vpx_codec_iface_t
Codec interface structure.
Definition: vpx_codec.h:174
#define VPX_SS_MAX_LAYERS
Definition: vpx_encoder.h:46
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:837
vp8e_tuning
VP8 model tuning parameters.
Definition: vp8cx.h:793
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:773
vp8e_enc_control_id
VPx encoder control functions.
Definition: vp8cx.h:125
vpx_scaling_mode_1d
vpx 1-D scaling mode
Definition: vp8cx.h:685
vp9e_tune_content
Definition: vp8cx.h:781
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:698
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.
@ FULL_SUPERFRAME_DROP
Definition: vp8cx.h:841
@ CONSTRAINED_LAYER_DROP
Definition: vp8cx.h:838
@ LAYER_DROP
Definition: vp8cx.h:840
@ VP9E_SET_MIN_GF_INTERVAL
Codec control function to set minimum interval between GF/ARF frames.
Definition: vp8cx.h:514
@ VP9E_SET_MAX_INTER_BITRATE_PCT
Codec control function to set max data rate for Inter frames.
Definition: vp8cx.h:278
@ VP9E_SET_FRAME_PERIODIC_BOOST
Codec control function to enable/disable periodic Q boost.
Definition: vp8cx.h:413
@ VP9E_SET_SVC_LAYER_ID
Codec control function to set svc layer for spatial and temporal.
Definition: vp8cx.h:453
@ VP8E_SET_MAX_INTRA_BITRATE_PCT
Codec control function to set Max data rate for Intra frames.
Definition: vp8cx.h:257
@ VP8E_SET_ARNR_STRENGTH
Codec control function to set the filter strength for the arf.
Definition: vp8cx.h:223
@ VP8E_SET_TUNING
Codec control function to set visual tuning.
Definition: vp8cx.h:232
@ VP9E_SET_SVC_INTER_LAYER_PRED
Codec control function to constrain the inter-layer prediction (prediction of lower spatial resolutio...
Definition: vp8cx.h:619
@ VP9E_SET_ROI_MAP
Codec control function to pass an ROI map to encoder.
Definition: vp8cx.h:436
@ VP8E_SET_ENABLEAUTOALTREF
Codec control function to enable automatic use of arf frames.
Definition: vp8cx.h:164
@ VP8E_SET_ROI_MAP
Codec control function to pass an ROI map to encoder.
Definition: vp8cx.h:130
@ VP9E_SET_TARGET_LEVEL
Codec control function to set target level.
Definition: vp8cx.h:562
@ VP9E_GET_LEVEL
Codec control function to get bitstream level.
Definition: vp8cx.h:576
@ 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:610
@ VP9E_SET_TEMPORAL_LAYERING_MODE
Codec control function to set temporal layering mode.
Definition: vp8cx.h:506
@ VP9E_SET_AQ_MODE
Codec control function to set adaptive quantization mode.
Definition: vp8cx.h:398
@ VP9E_GET_SVC_REF_FRAME_CONFIG
Codec control function to get the refresh and reference flags and the buffer indices,...
Definition: vp8cx.h:635
@ 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:645
@ VP8E_SET_NOISE_SENSITIVITY
control function to set noise sensitivity
Definition: vp8cx.h:173
@ VP8E_SET_TOKEN_PARTITIONS
Codec control function to set the number of token partitions.
Definition: vp8cx.h:194
@ VP9E_SET_POSTENCODE_DROP
Codec control function to enable postencode frame drop.
Definition: vp8cx.h:678
@ VP9E_REGISTER_CX_CALLBACK
Codec control function to register callback to get per layer packet.
Definition: vp8cx.h:479
@ VP8E_SET_ARNR_TYPE
Definition: vp8cx.h:226
@ VP9E_SET_COLOR_RANGE
Codec control function to set color range bit.
Definition: vp8cx.h:537
@ VP8E_GET_LAST_QUANTIZER
Codec control function to get last quantizer chosen by the encoder.
Definition: vp8cx.h:202
@ VP9E_SET_TILE_ROWS
Codec control function to set number of tile rows.
Definition: vp8cx.h:371
@ VP8E_SET_ARNR_MAXFRAMES
Codec control function to set the max no of frames to create arf.
Definition: vp8cx.h:217
@ VP8E_SET_ACTIVEMAP
Codec control function to pass an Active map to encoder.
Definition: vp8cx.h:136
@ VP9E_SET_LOSSLESS
Codec control function to set lossless encoding mode.
Definition: vp8cx.h:327
@ 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:660
@ VP9E_SET_SVC_PARAMETERS
Codec control function to set parameters for SVC.
Definition: vp8cx.h:444
@ VP8E_SET_SCALEMODE
Codec control function to set encoder scaling mode.
Definition: vp8cx.h:142
@ VP9E_SET_FRAME_PARALLEL_DECODING
Codec control function to enable frame parallel decoding feature.
Definition: vp8cx.h:385
@ VP8E_SET_SHARPNESS
Codec control function to set higher sharpness at the expense of a lower PSNR.
Definition: vp8cx.h:182
@ VP8E_SET_GF_CBR_BOOST_PCT
Boost percentage for Golden Frame in CBR mode.
Definition: vp8cx.h:601
@ VP9E_SET_TUNE_CONTENT
Codec control function to set content type.
Definition: vp8cx.h:463
@ VP9E_SET_SVC
Codec control function to turn on/off SVC in encoder.
Definition: vp8cx.h:430
@ VP9E_SET_TPL
Codec control function to enable temporal dependency model.
Definition: vp8cx.h:668
@ VP9E_SET_ROW_MT
Codec control function to set row level multi-threading.
Definition: vp8cx.h:570
@ VP8E_SET_CPUUSED
Codec control function to set encoder internal speed settings.
Definition: vp8cx.h:155
@ VP8E_SET_TEMPORAL_LAYER_ID
Codec control function to set the temporal layer id.
Definition: vp8cx.h:304
@ VP9E_SET_TILE_COLUMNS
Codec control function to set number of tile columns.
Definition: vp8cx.h:351
@ 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:628
@ VP9E_SET_SVC_REF_FRAME_CONFIG
Codec control function to set the frame flags and buffer indices for spatial layers....
Definition: vp8cx.h:545
@ VP8E_SET_STATIC_THRESHOLD
Codec control function to set the threshold for MBs treated static.
Definition: vp8cx.h:188
@ VP9E_SET_COLOR_SPACE
Codec control function to set color space info.
Definition: vp8cx.h:494
@ VP9E_SET_RENDER_SIZE
Codec control function to set intended rendering image size.
Definition: vp8cx.h:553
@ VP8E_SET_SCREEN_CONTENT_MODE
Codec control function to set encoder screen content mode.
Definition: vp8cx.h:312
@ VP8E_SET_CQ_LEVEL
Codec control function to set constrained quality level.
Definition: vp8cx.h:242
@ VP9E_SET_NOISE_SENSITIVITY
Codec control function to set noise sensitivity.
Definition: vp8cx.h:421
@ VP8E_GET_LAST_QUANTIZER_64
Codec control function to get last quantizer chosen by the encoder.
Definition: vp8cx.h:211
@ VP8E_SET_FRAME_FLAGS
Codec control function to set reference and update frame flags.
Definition: vp8cx.h:263
@ VP9E_GET_ACTIVEMAP
Codec control function to get an Active map back from the encoder.
Definition: vp8cx.h:528
@ VP9E_SET_GF_CBR_BOOST_PCT
Boost percentage for Golden Frame in CBR mode.
Definition: vp8cx.h:293
@ VP9E_GET_SVC_LAYER_ID
Codec control function to get svc layer ID.
Definition: vp8cx.h:471
@ VP9E_SET_MAX_GF_INTERVAL
Codec control function to set minimum interval between GF/ARF frames.
Definition: vp8cx.h:522
@ VP9E_SET_ALT_REF_AQ
Codec control function to enable/disable special mode for altref adaptive quantization....
Definition: vp8cx.h:586
@ 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:708
@ VP9E_TEMPORAL_LAYERING_MODE_0101
0-1-0-1... temporal layering scheme with two temporal layers.
Definition: vp8cx.h:712
@ VP9E_TEMPORAL_LAYERING_MODE_NOLAYERING
No temporal layering. Used when only spatial layering is used.
Definition: vp8cx.h:702
@ VP9E_TEMPORAL_LAYERING_MODE_0212
0-2-1-2... temporal layering scheme with three temporal layers.
Definition: vp8cx.h:716
vpx active region map
Definition: vp8cx.h:749
unsigned int rows
Definition: vp8cx.h:752
unsigned int cols
Definition: vp8cx.h:753
unsigned char * active_map
specify an on (1) or off (0) each 16x16 region within a frame
Definition: vp8cx.h:751
vpx region of interest map
Definition: vp8cx.h:725
uint8_t enabled
Definition: vp8cx.h:727
int skip[8]
Definition: vp8cx.h:737
unsigned int static_threshold[4]
Definition: vp8cx.h:740
unsigned int rows
Definition: vp8cx.h:731
unsigned int cols
Definition: vp8cx.h:732
int ref_frame[8]
Definition: vp8cx.h:738
int delta_q[8]
Definition: vp8cx.h:734
unsigned char * roi_map
Definition: vp8cx.h:730
int delta_lf[8]
Definition: vp8cx.h:735
vpx image scaling mode
Definition: vp8cx.h:761
VPX_SCALING_MODE v_scaling_mode
Definition: vp8cx.h:763
VPX_SCALING_MODE h_scaling_mode
Definition: vp8cx.h:762
vp9 svc frame dropping parameters.
Definition: vp8cx.h:851
int framedrop_thresh[5]
Definition: vp8cx.h:852
SVC_LAYER_DROP_MODE framedrop_mode
Definition: vp8cx.h:854
int max_consec_drop
Definition: vp8cx.h:855
vp9 svc layer parameters
Definition: vp8cx.h:802
int temporal_layer_id
Definition: vp8cx.h:805
int temporal_layer_id_per_spatial[5]
Definition: vp8cx.h:806
int spatial_layer_id
Definition: vp8cx.h:803
vp9 svc frame flag parameters.
Definition: vp8cx.h:817
int lst_fb_idx[5]
Definition: vp8cx.h:818
int update_alt_ref[5]
Definition: vp8cx.h:825
int update_buffer_slot[5]
Definition: vp8cx.h:821
int gld_fb_idx[5]
Definition: vp8cx.h:819
int reference_last[5]
Definition: vp8cx.h:826
int reference_golden[5]
Definition: vp8cx.h:827
int update_last[5]
Definition: vp8cx.h:823
int reference_alt_ref[5]
Definition: vp8cx.h:828
int64_t duration[5]
Definition: vp8cx.h:829
int alt_fb_idx[5]
Definition: vp8cx.h:820
int update_golden[5]
Definition: vp8cx.h:824
vp9 svc spatial layer sync parameters.
Definition: vp8cx.h:863
int spatial_layer_sync[5]
Definition: vp8cx.h:864
int base_layer_intra_only
Definition: vp8cx.h:865
Provides controls common to both the VP8 encoder and decoder.
Describes the encoder algorithm interface to applications.