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 
162 
171 
177 
183 
189 
197 
206 
212 
218 
221 
227 
237 
252 
258 
273 
288 
299 
307 
322 
346 
366 
380 
393 
408 
416 
425 
431 
439 
448 
458 
466 
474 
489 
501 
509 
517 
523 
532 
540 
548 
557 
565 
571 
581 
596 
605 
614 
623 
630 
640 
655 
663 };
664 
669 typedef enum vpx_scaling_mode_1d {
670  VP8E_NORMAL = 0,
671  VP8E_FOURFIVE = 1,
672  VP8E_THREEFIVE = 2,
673  VP8E_ONETWO = 3
675 
687 
693 
697 
702 
709 typedef struct vpx_roi_map {
711  uint8_t enabled;
714  unsigned char *roi_map;
715  unsigned int rows;
716  unsigned int cols;
718  int delta_q[8];
719  int delta_lf[8];
721  int skip[8];
722  int ref_frame[8];
724  unsigned int static_threshold[4];
725 } vpx_roi_map_t;
726 
733 typedef struct vpx_active_map {
735  unsigned char *active_map;
736  unsigned int rows;
737  unsigned int cols;
739 
745 typedef struct vpx_scaling_mode {
749 
757 typedef enum {
758  VP8_ONE_TOKENPARTITION = 0,
759  VP8_TWO_TOKENPARTITION = 1,
760  VP8_FOUR_TOKENPARTITION = 2,
761  VP8_EIGHT_TOKENPARTITION = 3
763 
765 typedef enum {
766  VP9E_CONTENT_DEFAULT,
767  VP9E_CONTENT_SCREEN,
768  VP9E_CONTENT_FILM,
769  VP9E_CONTENT_INVALID
771 
777 typedef enum { VP8_TUNE_PSNR, VP8_TUNE_SSIM } vp8e_tuning;
778 
786 typedef struct vpx_svc_layer_id {
788  // TODO(jianj): Deprecated, to be removed.
790  int temporal_layer_id_per_spatial[VPX_SS_MAX_LAYERS];
792 
801 typedef struct vpx_svc_ref_frame_config {
802  int lst_fb_idx[VPX_SS_MAX_LAYERS];
803  int gld_fb_idx[VPX_SS_MAX_LAYERS];
804  int alt_fb_idx[VPX_SS_MAX_LAYERS];
805  int update_buffer_slot[VPX_SS_MAX_LAYERS];
806  // TODO(jianj): Remove update_last/golden/alt_ref, these are deprecated.
807  int update_last[VPX_SS_MAX_LAYERS];
808  int update_golden[VPX_SS_MAX_LAYERS];
809  int update_alt_ref[VPX_SS_MAX_LAYERS];
810  int reference_last[VPX_SS_MAX_LAYERS];
811  int reference_golden[VPX_SS_MAX_LAYERS];
812  int reference_alt_ref[VPX_SS_MAX_LAYERS];
813  int64_t duration[VPX_SS_MAX_LAYERS];
815 
821 typedef enum {
827 
835 typedef struct vpx_svc_frame_drop {
836  int framedrop_thresh[VPX_SS_MAX_LAYERS];
837  SVC_LAYER_DROP_MODE
841 
848  int spatial_layer_sync[VPX_SS_MAX_LAYERS];
851 
861 #define VPX_CTRL_VP8E_SET_FRAME_FLAGS
863 #define VPX_CTRL_VP8E_SET_TEMPORAL_LAYER_ID
865 #define VPX_CTRL_VP8E_SET_ROI_MAP
867 #define VPX_CTRL_VP9E_SET_ROI_MAP
869 #define VPX_CTRL_VP8E_SET_ACTIVEMAP
871 #define VPX_CTRL_VP8E_SET_SCALEMODE
872 
874 #define VPX_CTRL_VP9E_SET_SVC
876 #define VPX_CTRL_VP9E_SET_SVC_PARAMETERS
878 #define VPX_CTRL_VP9E_REGISTER_CX_CALLBACK
880 #define VPX_CTRL_VP9E_SET_SVC_LAYER_ID
881 
883 #define VPX_CTRL_VP8E_SET_CPUUSED
885 #define VPX_CTRL_VP8E_SET_ENABLEAUTOALTREF
887 #define VPX_CTRL_VP8E_SET_NOISE_SENSITIVITY
889 #define VPX_CTRL_VP8E_SET_SHARPNESS
891 #define VPX_CTRL_VP8E_SET_STATIC_THRESHOLD
892 VPX_CTRL_USE_TYPE(VP8E_SET_TOKEN_PARTITIONS, int) /* vp8e_token_partitions */
893 #define VPX_CTRL_VP8E_SET_TOKEN_PARTITIONS
894 
896 #define VPX_CTRL_VP8E_SET_ARNR_MAXFRAMES
898 #define VPX_CTRL_VP8E_SET_ARNR_STRENGTH
900 #define VPX_CTRL_VP8E_SET_ARNR_TYPE
901 VPX_CTRL_USE_TYPE(VP8E_SET_TUNING, int) /* vp8e_tuning */
902 #define VPX_CTRL_VP8E_SET_TUNING
904 #define VPX_CTRL_VP8E_SET_CQ_LEVEL
905 
907 #define VPX_CTRL_VP9E_SET_TILE_COLUMNS
909 #define VPX_CTRL_VP9E_SET_TILE_ROWS
910 
912 #define VPX_CTRL_VP9E_SET_TPL
913 
915 #define VPX_CTRL_VP8E_GET_LAST_QUANTIZER
917 #define VPX_CTRL_VP8E_GET_LAST_QUANTIZER_64
919 #define VPX_CTRL_VP9E_GET_SVC_LAYER_ID
920 
922 #define VPX_CTRL_VP8E_SET_MAX_INTRA_BITRATE_PCT
923 VPX_CTRL_USE_TYPE(VP8E_SET_MAX_INTER_BITRATE_PCT, unsigned int)
924 #define VPX_CTRL_VP8E_SET_MAX_INTER_BITRATE_PCT
925 
927 #define VPX_CTRL_VP8E_SET_GF_CBR_BOOST_PCT
928 
930 #define VPX_CTRL_VP8E_SET_SCREEN_CONTENT_MODE
931 
933 #define VPX_CTRL_VP9E_SET_GF_CBR_BOOST_PCT
934 
936 #define VPX_CTRL_VP9E_SET_LOSSLESS
937 
939 #define VPX_CTRL_VP9E_SET_FRAME_PARALLEL_DECODING
940 
941 VPX_CTRL_USE_TYPE(VP9E_SET_AQ_MODE, unsigned int)
942 #define VPX_CTRL_VP9E_SET_AQ_MODE
943 
945 #define VPX_CTRL_VP9E_SET_ALT_REF_AQ
946 
948 #define VPX_CTRL_VP9E_SET_FRAME_PERIODIC_BOOST
949 
951 #define VPX_CTRL_VP9E_SET_NOISE_SENSITIVITY
952 
953 VPX_CTRL_USE_TYPE(VP9E_SET_TUNE_CONTENT, int) /* vp9e_tune_content */
954 #define VPX_CTRL_VP9E_SET_TUNE_CONTENT
955 
957 #define VPX_CTRL_VP9E_SET_COLOR_SPACE
958 
960 #define VPX_CTRL_VP9E_SET_MIN_GF_INTERVAL
961 
963 #define VPX_CTRL_VP9E_SET_MAX_GF_INTERVAL
964 
966 #define VPX_CTRL_VP9E_GET_ACTIVEMAP
967 
969 #define VPX_CTRL_VP9E_SET_COLOR_RANGE
970 
972 #define VPX_CTRL_VP9E_SET_SVC_REF_FRAME_CONFIG
973 
975 #define VPX_CTRL_VP9E_SET_RENDER_SIZE
976 
978 #define VPX_CTRL_VP9E_SET_TARGET_LEVEL
979 
980 VPX_CTRL_USE_TYPE(VP9E_SET_ROW_MT, unsigned int)
981 #define VPX_CTRL_VP9E_SET_ROW_MT
982 
984 #define VPX_CTRL_VP9E_GET_LEVEL
985 
987 #define VPX_CTRL_VP9E_ENABLE_MOTION_VECTOR_UNIT_TEST
988 
990 #define VPX_CTRL_VP9E_SET_SVC_INTER_LAYER_PRED
991 
993 #define VPX_CTRL_VP9E_SET_SVC_FRAME_DROP_LAYER
994 
996 #define VPX_CTRL_VP9E_GET_SVC_REF_FRAME_CONFIG
997 
999 #define VPX_CTRL_VP9E_SET_SVC_GF_TEMPORAL_REF
1000 
1003 #define VPX_CTRL_VP9E_SET_SVC_SPATIAL_LAYER_SYNC
1004 
1007 #ifdef __cplusplus
1008 } // extern "C"
1009 #endif
1010 
1011 #endif // VPX_VPX_VP8CX_H_
unsigned char * roi_map
Definition: vp8cx.h:714
int base_layer_intra_only
Definition: vp8cx.h:849
Codec control function to set encoder internal speed settings.
Definition: vp8cx.h:155
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:737
vp8e_enc_control_id
VPx encoder control functions.
Definition: vp8cx.h:125
Codec control function to constrain the inter-layer prediction (prediction of lower spatial resolutio...
Definition: vp8cx.h:613
Codec control function to enable temporal dependency model.
Definition: vp8cx.h:662
int delta_q[8]
Definition: vp8cx.h:718
Codec control function to set content type.
Definition: vp8cx.h:457
Codec control function to set noise sensitivity.
Definition: vp8cx.h:415
enum vpx_scaling_mode_1d VPX_SCALING_MODE
vpx 1-D scaling mode
unsigned int cols
Definition: vp8cx.h:716
SVC_LAYER_DROP_MODE framedrop_mode
Definition: vp8cx.h:838
Codec control function to get bitstream level.
Definition: vp8cx.h:570
Codec control function to set reference and update frame flags.
Definition: vp8cx.h:257
Codec control function to set encoder scaling mode.
Definition: vp8cx.h:142
VPX_SCALING_MODE v_scaling_mode
Definition: vp8cx.h:747
vp8e_token_partitions
VP8 token partition mode.
Definition: vp8cx.h:757
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:130
Codec control function to enable spatial layer sync frame, for any spatial layer. Enabling it for lay...
Definition: vp8cx.h:654
Codec control function to set visual tuning.
Definition: vp8cx.h:226
Codec control function to set constrained quality level.
Definition: vp8cx.h:236
Definition: vp8cx.h:220
Codec control function to set row level multi-threading.
Definition: vp8cx.h:564
int spatial_layer_id
Definition: vp8cx.h:787
Codec control function to set Max data rate for Intra frames.
Definition: vp8cx.h:251
Codec control function to set parameters for SVC.
Definition: vp8cx.h:438
vp9 svc frame dropping parameters.
Definition: vp8cx.h:835
Codec control function to set number of tile columns.
Definition: vp8cx.h:345
#define VPX_SS_MAX_LAYERS
Definition: vpx_encoder.h:52
#define VPX_CTRL_USE_TYPE(id, typ)
vpx_codec_control type definition macro
Definition: vpx_codec.h:419
Codec control function to set target level.
Definition: vp8cx.h:556
unsigned int static_threshold[4]
Definition: vp8cx.h:724
Codec control function to set adaptive quantization mode.
Definition: vp8cx.h:392
int skip[8]
Definition: vp8cx.h:721
Codec control function to set color space info.
Definition: vp8cx.h:488
Codec control function to get svc layer ID.
Definition: vp8cx.h:465
int delta_lf[8]
Definition: vp8cx.h:719
Codec control function to set lossless encoding mode.
Definition: vp8cx.h:321
Codec control function to get last quantizer chosen by the encoder.
Definition: vp8cx.h:205
Boost percentage for Golden Frame in CBR mode.
Definition: vp8cx.h:595
vp9 svc layer parameters
Definition: vp8cx.h:786
Codec control function to set the temporal layer id.
Definition: vp8cx.h:298
0-1-0-1... temporal layering scheme with two temporal layers.
Definition: vp8cx.h:696
Codec control function to set the number of token partitions.
Definition: vp8cx.h:188
control function to set noise sensitivity
Definition: vp8cx.h:170
const struct vpx_codec_iface vpx_codec_iface_t
Codec interface structure.
Definition: vpx_codec.h:174
struct vpx_svc_frame_drop vpx_svc_frame_drop_t
vp9 svc frame dropping parameters.
int ref_frame[8]
Definition: vp8cx.h:722
Definition: vp8cx.h:824
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:287
Codec control function to get the refresh and reference flags and the buffer indices, up to the last encoded spatial layer.
Definition: vp8cx.h:629
uint8_t enabled
Definition: vp8cx.h:711
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:539
vp9e_temporal_layering_mode
Temporal layering mode enum for VP9 SVC.
Definition: vp8cx.h:682
Codec control function to set mode and thresholds for frame dropping in SVC. Drop frame thresholds ar...
Definition: vp8cx.h:622
Codec control function to set intended rendering image size.
Definition: vp8cx.h:547
struct vpx_svc_ref_frame_config vpx_svc_ref_frame_config_t
vp9 svc frame flag parameters.
0-2-1-2... temporal layering scheme with three temporal layers.
Definition: vp8cx.h:700
No temporal layering. Used when only spatial layering is used.
Definition: vp8cx.h:686
#define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ)
vpx_codec_control deprecated type definition macro
Definition: vpx_codec.h:445
Codec control function to enable the extreme motion vector unit test in VP9. Please note that this is...
Definition: vp8cx.h:604
Definition: vp8cx.h:822
Codec control function to pass an ROI map to encoder.
Definition: vp8cx.h:430
unsigned char * active_map
specify an on (1) or off (0) each 16x16 region within a frame
Definition: vp8cx.h:735
Codec control function to set encoder screen content mode.
Definition: vp8cx.h:306
Bypass mode. Used when application needs to control temporal layering. This will only work when the n...
Definition: vp8cx.h:692
Definition: vp8cx.h:825
unsigned int rows
Definition: vp8cx.h:736
Codec control function to set the max no of frames to create arf.
Definition: vp8cx.h:211
int temporal_layer_id
Definition: vp8cx.h:789
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:473
Codec control function to set the filter strength for the arf.
Definition: vp8cx.h:217
Codec control function to enable/disable periodic Q boost.
Definition: vp8cx.h:407
Codec control function to get an Active map back from the encoder.
Definition: vp8cx.h:522
vp9 svc spatial layer sync parameters.
Definition: vp8cx.h:847
Codec control function to enable/disable use of golden reference as a second temporal reference for S...
Definition: vp8cx.h:639
Provides controls common to both the VP8 encoder and decoder.
Codec control function to set color range bit.
Definition: vp8cx.h:531
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:196
Codec control function to enable automatic set and use alf frames.
Definition: vp8cx.h:161
int max_consec_drop
Definition: vp8cx.h:839
Codec control function to set minimum interval between GF/ARF frames.
Definition: vp8cx.h:508
Codec control function to set temporal layering mode.
Definition: vp8cx.h:500
VPX_SCALING_MODE h_scaling_mode
Definition: vp8cx.h:746
Codec control function to set minimum interval between GF/ARF frames.
Definition: vp8cx.h:516
Codec control function to turn on/off SVC in encoder.
Definition: vp8cx.h:424
vpx active region map
Definition: vp8cx.h:733
struct vpx_roi_map vpx_roi_map_t
vpx region of interest map
unsigned int rows
Definition: vp8cx.h:715
Codec control function to enable frame parallel decoding feature.
Definition: vp8cx.h:379
Codec control function to set max data rate for Inter frames.
Definition: vp8cx.h:272
vp9 svc frame flag parameters.
Definition: vp8cx.h:801
Codec control function to set the threshold for MBs treated static.
Definition: vp8cx.h:182
vpx_scaling_mode_1d
vpx 1-D scaling mode
Definition: vp8cx.h:669
Codec control function to set number of tile rows.
Definition: vp8cx.h:365
vp8e_tuning
VP8 model tuning parameters.
Definition: vp8cx.h:777
Codec control function to set sharpness.
Definition: vp8cx.h:176
vpx region of interest map
Definition: vp8cx.h:709
Codec control function to enable/disable special mode for altref adaptive quantization. You can use it with –aq-mode concurrently.
Definition: vp8cx.h:580
SVC_LAYER_DROP_MODE
VP9 svc frame dropping mode.
Definition: vp8cx.h:821
vpx image scaling mode
Definition: vp8cx.h:745
Codec control function to set svc layer for spatial and temporal.
Definition: vp8cx.h:447
Codec control function to pass an Active map to encoder.
Definition: vp8cx.h:136
vp9e_tune_content
Definition: vp8cx.h:765