* This interface provides the capability to encode raw VP8 streams.
* @{
*/
-extern vpx_codec_iface_t vpx_codec_vp8_cx_algo;
+extern vpx_codec_iface_t vpx_codec_vp8_cx_algo;
extern vpx_codec_iface_t *vpx_codec_vp8_cx(void);
/*!@} - end algorithm interface member group*/
* This interface provides the capability to encode raw VP9 streams.
* @{
*/
-extern vpx_codec_iface_t vpx_codec_vp9_cx_algo;
+extern vpx_codec_iface_t vpx_codec_vp9_cx_algo;
extern vpx_codec_iface_t *vpx_codec_vp9_cx(void);
/*!@} - end algorithm interface member group*/
* predictor. When not set, the encoder will choose whether to use the
* last frame or not automatically.
*/
-#define VP8_EFLAG_NO_REF_LAST (1<<16)
-
+#define VP8_EFLAG_NO_REF_LAST (1 << 16)
/*!\brief Don't reference the golden frame
*
* predictor. When not set, the encoder will choose whether to use the
* golden frame or not automatically.
*/
-#define VP8_EFLAG_NO_REF_GF (1<<17)
-
+#define VP8_EFLAG_NO_REF_GF (1 << 17)
/*!\brief Don't reference the alternate reference frame
*
* predictor. When not set, the encoder will choose whether to use the
* alt ref frame or not automatically.
*/
-#define VP8_EFLAG_NO_REF_ARF (1<<21)
-
+#define VP8_EFLAG_NO_REF_ARF (1 << 21)
/*!\brief Don't update the last frame
*
* When this flag is set, the encoder will not update the last frame with
* the contents of the current frame.
*/
-#define VP8_EFLAG_NO_UPD_LAST (1<<18)
-
+#define VP8_EFLAG_NO_UPD_LAST (1 << 18)
/*!\brief Don't update the golden frame
*
* When this flag is set, the encoder will not update the golden frame with
* the contents of the current frame.
*/
-#define VP8_EFLAG_NO_UPD_GF (1<<22)
-
+#define VP8_EFLAG_NO_UPD_GF (1 << 22)
/*!\brief Don't update the alternate reference frame
*
* When this flag is set, the encoder will not update the alt ref frame with
* the contents of the current frame.
*/
-#define VP8_EFLAG_NO_UPD_ARF (1<<23)
-
+#define VP8_EFLAG_NO_UPD_ARF (1 << 23)
/*!\brief Force golden frame update
*
* When this flag is set, the encoder copy the contents of the current frame
* to the golden frame buffer.
*/
-#define VP8_EFLAG_FORCE_GF (1<<19)
-
+#define VP8_EFLAG_FORCE_GF (1 << 19)
/*!\brief Force alternate reference frame update
*
* When this flag is set, the encoder copy the contents of the current frame
* to the alternate reference frame buffer.
*/
-#define VP8_EFLAG_FORCE_ARF (1<<24)
-
+#define VP8_EFLAG_FORCE_ARF (1 << 24)
/*!\brief Disable entropy update
*
* When this flag is set, the encoder will not update its internal entropy
* model based on the entropy of this frame.
*/
-#define VP8_EFLAG_NO_UPD_ENTROPY (1<<20)
-
+#define VP8_EFLAG_NO_UPD_ENTROPY (1 << 20)
/*!\brief VPx encoder control functions
*
*
* Supported in codecs: VP8, VP9
*/
- VP8E_SET_ROI_MAP = 8,
+ VP8E_SET_ROI_MAP = 8,
/*!\brief Codec control function to pass an Active map to encoder.
*
*
* Supported in codecs: VP8, VP9
*/
- VP8E_SET_SCALEMODE = 11,
+ VP8E_SET_SCALEMODE = 11,
/*!\brief Codec control function to set encoder internal speed settings.
*
*
* Supported in codecs: VP8, VP9
*/
- VP8E_SET_CPUUSED = 13,
+ VP8E_SET_CPUUSED = 13,
/*!\brief Codec control function to enable automatic set and use alf frames.
*
* 2 = 4 tile columns
* .....
* n = 2**n tile columns
- * The requested tile columns will be capped by encoder based on image size
- * limitation (The minimum width of a tile column is 256 pixel, the maximum
- * is 4096).
+ * The requested tile columns will be capped by the encoder based on image
+ * size limitations (The minimum width of a tile column is 256 pixels, the
+ * maximum is 4096).
*
- * By default, the value is 0, i.e. one single column tile for entire image.
+ * By default, the value is 6, i.e., the maximum number of tiles supported by
+ * the resolution.
*
* Supported in codecs: VP9
*/
* VP9 has a bitstream feature to reduce decoding dependency between frames
* by turning off backward update of probability context used in encoding
* and decoding. This allows staged parallel processing of more than one
- * video frames in the decoder. This control function provides a mean to
+ * video frame in the decoder. This control function provides a means to
* turn this feature on or off for bitstreams produced by encoder.
*
- * By default, this feature is off.
+ * By default, this feature is on.
*
* Supported in codecs: VP9
*/
* \note Valid parameter range:
* VP9E_CONTENT_DEFAULT = Regular video content (Default)
* VP9E_CONTENT_SCREEN = Screen capture content
+ * VP9E_CONTENT_FILM = Film content: improves grain retention
*
* Supported in codecs: VP9
*/
VP9E_SET_COLOR_SPACE,
/*!\brief Codec control function to set temporal layering mode.
- * \note Valid ranges: 0..3, default is "0" (VP9E_TEMPORAL_LAYERING_MODE_NOLAYERING).
+ * \note Valid ranges: 0..3, default is "0"
+ * (VP9E_TEMPORAL_LAYERING_MODE_NOLAYERING).
* 0 = VP9E_TEMPORAL_LAYERING_MODE_NOLAYERING
* 1 = VP9E_TEMPORAL_LAYERING_MODE_BYPASS
* 2 = VP9E_TEMPORAL_LAYERING_MODE_0101
*/
VP9E_SET_TARGET_LEVEL,
+ /*!\brief Codec control function to set row level multi-threading.
+ *
+ * 0 : off, 1 : on
+ *
+ * Supported in codecs: VP9
+ */
+ VP9E_SET_ROW_MT,
+
/*!\brief Codec control function to get bitstream level.
*
* Supported in codecs: VP9
*/
- VP9E_GET_LEVEL
+ VP9E_GET_LEVEL,
+
+ /*!\brief Codec control function to enable/disable special mode for altref
+ * adaptive quantization. You can use it with --aq-mode concurrently.
+ *
+ * Enable special adaptive quantization for altref frames based on their
+ * expected prediction quality for the future frames.
+ *
+ * Supported in codecs: VP9
+ */
+ VP9E_SET_ALT_REF_AQ,
+
+ /*!\brief Boost percentage for Golden Frame in CBR mode.
+ *
+ * This value controls the amount of boost given to Golden Frame in
+ * CBR mode. It is expressed as a percentage of the average
+ * per-frame bitrate, with the special (and default) value 0 meaning
+ * the feature is off, i.e., no golden frame boost in CBR mode and
+ * average bitrate target is used.
+ *
+ * For example, to allow 100% more bits, i.e, 2X, in a golden frame
+ * than average frame, set this to 100.
+ *
+ * Supported in codecs: VP8
+ */
+ VP8E_SET_GF_CBR_BOOST_PCT,
+
+ /*!\brief Codec control function to enable the extreme motion vector unit test
+ * in VP9. Please note that this is only used in motion vector unit test.
+ *
+ * 0 : off, 1 : MAX_EXTREME_MV, 2 : MIN_EXTREME_MV
+ *
+ * Supported in codecs: VP9
+ */
+ VP9E_ENABLE_MOTION_VECTOR_UNIT_TEST,
};
/*!\brief vpx 1-D scaling mode
* This set of constants define 1-D vpx scaling modes
*/
typedef enum vpx_scaling_mode_1d {
- VP8E_NORMAL = 0,
- VP8E_FOURFIVE = 1,
- VP8E_THREEFIVE = 2,
- VP8E_ONETWO = 3
+ VP8E_NORMAL = 0,
+ VP8E_FOURFIVE = 1,
+ VP8E_THREEFIVE = 2,
+ VP8E_ONETWO = 3
} VPX_SCALING_MODE;
/*!\brief Temporal layering mode enum for VP9 SVC.
/*!\brief No temporal layering.
* Used when only spatial layering is used.
*/
- VP9E_TEMPORAL_LAYERING_MODE_NOLAYERING = 0,
+ VP9E_TEMPORAL_LAYERING_MODE_NOLAYERING = 0,
/*!\brief Bypass mode.
* Used when application needs to control temporal layering.
* This will only work when the number of spatial layers equals 1.
*/
- VP9E_TEMPORAL_LAYERING_MODE_BYPASS = 1,
+ VP9E_TEMPORAL_LAYERING_MODE_BYPASS = 1,
/*!\brief 0-1-0-1... temporal layering scheme with two temporal layers.
*/
- VP9E_TEMPORAL_LAYERING_MODE_0101 = 2,
+ VP9E_TEMPORAL_LAYERING_MODE_0101 = 2,
/*!\brief 0-2-1-2... temporal layering scheme with three temporal layers.
*/
- VP9E_TEMPORAL_LAYERING_MODE_0212 = 3
+ VP9E_TEMPORAL_LAYERING_MODE_0212 = 3
} VP9E_TEMPORAL_LAYERING_MODE;
/*!\brief vpx region of interest map
typedef struct vpx_roi_map {
/*! An id between 0 and 3 for each 16x16 region within a frame. */
unsigned char *roi_map;
- unsigned int rows; /**< Number of rows. */
- unsigned int cols; /**< Number of columns. */
+ unsigned int rows; /**< Number of rows. */
+ unsigned int cols; /**< Number of columns. */
// TODO(paulwilkins): broken for VP9 which has 8 segments
// q and loop filter deltas for each segment
// (see MAX_MB_SEGMENTS)
- int delta_q[4]; /**< Quantizer deltas. */
- int delta_lf[4]; /**< Loop filter deltas. */
+ int delta_q[4]; /**< Quantizer deltas. */
+ int delta_lf[4]; /**< Loop filter deltas. */
/*! Static breakout threshold for each segment. */
unsigned int static_threshold[4];
} vpx_roi_map_t;
*
*/
-
typedef struct vpx_active_map {
- unsigned char *active_map; /**< specify an on (1) or off (0) each 16x16 region within a frame */
- unsigned int rows; /**< number of rows */
- unsigned int cols; /**< number of cols */
+ /*!\brief specify an on (1) or off (0) each 16x16 region within a frame */
+ unsigned char *active_map;
+ unsigned int rows; /**< number of rows */
+ unsigned int cols; /**< number of cols */
} vpx_active_map_t;
/*!\brief vpx image scaling mode
*
*/
typedef struct vpx_scaling_mode {
- VPX_SCALING_MODE h_scaling_mode; /**< horizontal scaling mode */
- VPX_SCALING_MODE v_scaling_mode; /**< vertical scaling mode */
+ VPX_SCALING_MODE h_scaling_mode; /**< horizontal scaling mode */
+ VPX_SCALING_MODE v_scaling_mode; /**< vertical scaling mode */
} vpx_scaling_mode_t;
/*!\brief VP8 token partition mode
*/
typedef enum {
- VP8_ONE_TOKENPARTITION = 0,
- VP8_TWO_TOKENPARTITION = 1,
- VP8_FOUR_TOKENPARTITION = 2,
+ VP8_ONE_TOKENPARTITION = 0,
+ VP8_TWO_TOKENPARTITION = 1,
+ VP8_FOUR_TOKENPARTITION = 2,
VP8_EIGHT_TOKENPARTITION = 3
} vp8e_token_partitions;
typedef enum {
VP9E_CONTENT_DEFAULT,
VP9E_CONTENT_SCREEN,
+ VP9E_CONTENT_FILM,
VP9E_CONTENT_INVALID
} vp9e_tune_content;
* Changes the encoder to tune for certain types of input material.
*
*/
-typedef enum {
- VP8_TUNE_PSNR,
- VP8_TUNE_SSIM
-} vp8e_tuning;
+typedef enum { VP8_TUNE_PSNR, VP8_TUNE_SSIM } vp8e_tuning;
/*!\brief vp9 svc layer parameters
*
*
*/
typedef struct vpx_svc_layer_id {
- int spatial_layer_id; /**< Spatial layer id number. */
- int temporal_layer_id; /**< Temporal layer id number. */
+ int spatial_layer_id; /**< Spatial layer id number. */
+ int temporal_layer_id; /**< Temporal layer id number. */
} vpx_svc_layer_id_t;
/*!\brief vp9 svc frame flag parameters.
*
*/
typedef struct vpx_svc_ref_frame_config {
- int frame_flags[VPX_TS_MAX_LAYERS]; /**< Frame flags. */
+ int frame_flags[VPX_TS_MAX_LAYERS]; /**< Frame flags. */
int lst_fb_idx[VPX_TS_MAX_LAYERS]; /**< Last buffer index. */
int gld_fb_idx[VPX_TS_MAX_LAYERS]; /**< Golden buffer index. */
int alt_fb_idx[VPX_TS_MAX_LAYERS]; /**< Altref buffer index. */
*
*/
-VPX_CTRL_USE_TYPE(VP8E_SET_FRAME_FLAGS, int)
+VPX_CTRL_USE_TYPE(VP8E_SET_FRAME_FLAGS, int)
#define VPX_CTRL_VP8E_SET_FRAME_FLAGS
-VPX_CTRL_USE_TYPE(VP8E_SET_TEMPORAL_LAYER_ID, int)
+VPX_CTRL_USE_TYPE(VP8E_SET_TEMPORAL_LAYER_ID, int)
#define VPX_CTRL_VP8E_SET_TEMPORAL_LAYER_ID
-VPX_CTRL_USE_TYPE(VP8E_SET_ROI_MAP, vpx_roi_map_t *)
+VPX_CTRL_USE_TYPE(VP8E_SET_ROI_MAP, vpx_roi_map_t *)
#define VPX_CTRL_VP8E_SET_ROI_MAP
-VPX_CTRL_USE_TYPE(VP8E_SET_ACTIVEMAP, vpx_active_map_t *)
+VPX_CTRL_USE_TYPE(VP8E_SET_ACTIVEMAP, vpx_active_map_t *)
#define VPX_CTRL_VP8E_SET_ACTIVEMAP
-VPX_CTRL_USE_TYPE(VP8E_SET_SCALEMODE, vpx_scaling_mode_t *)
+VPX_CTRL_USE_TYPE(VP8E_SET_SCALEMODE, vpx_scaling_mode_t *)
#define VPX_CTRL_VP8E_SET_SCALEMODE
-VPX_CTRL_USE_TYPE(VP9E_SET_SVC, int)
+VPX_CTRL_USE_TYPE(VP9E_SET_SVC, int)
#define VPX_CTRL_VP9E_SET_SVC
-VPX_CTRL_USE_TYPE(VP9E_SET_SVC_PARAMETERS, void *)
+VPX_CTRL_USE_TYPE(VP9E_SET_SVC_PARAMETERS, void *)
#define VPX_CTRL_VP9E_SET_SVC_PARAMETERS
-VPX_CTRL_USE_TYPE(VP9E_REGISTER_CX_CALLBACK, void *)
+VPX_CTRL_USE_TYPE(VP9E_REGISTER_CX_CALLBACK, void *)
#define VPX_CTRL_VP9E_REGISTER_CX_CALLBACK
-VPX_CTRL_USE_TYPE(VP9E_SET_SVC_LAYER_ID, vpx_svc_layer_id_t *)
+VPX_CTRL_USE_TYPE(VP9E_SET_SVC_LAYER_ID, vpx_svc_layer_id_t *)
#define VPX_CTRL_VP9E_SET_SVC_LAYER_ID
-VPX_CTRL_USE_TYPE(VP8E_SET_CPUUSED, int)
+VPX_CTRL_USE_TYPE(VP8E_SET_CPUUSED, int)
#define VPX_CTRL_VP8E_SET_CPUUSED
-VPX_CTRL_USE_TYPE(VP8E_SET_ENABLEAUTOALTREF, unsigned int)
+VPX_CTRL_USE_TYPE(VP8E_SET_ENABLEAUTOALTREF, unsigned int)
#define VPX_CTRL_VP8E_SET_ENABLEAUTOALTREF
-VPX_CTRL_USE_TYPE(VP8E_SET_NOISE_SENSITIVITY, unsigned int)
+VPX_CTRL_USE_TYPE(VP8E_SET_NOISE_SENSITIVITY, unsigned int)
#define VPX_CTRL_VP8E_SET_NOISE_SENSITIVITY
-VPX_CTRL_USE_TYPE(VP8E_SET_SHARPNESS, unsigned int)
+VPX_CTRL_USE_TYPE(VP8E_SET_SHARPNESS, unsigned int)
#define VPX_CTRL_VP8E_SET_SHARPNESS
-VPX_CTRL_USE_TYPE(VP8E_SET_STATIC_THRESHOLD, unsigned int)
+VPX_CTRL_USE_TYPE(VP8E_SET_STATIC_THRESHOLD, unsigned int)
#define VPX_CTRL_VP8E_SET_STATIC_THRESHOLD
-VPX_CTRL_USE_TYPE(VP8E_SET_TOKEN_PARTITIONS, int) /* vp8e_token_partitions */
+VPX_CTRL_USE_TYPE(VP8E_SET_TOKEN_PARTITIONS, int) /* vp8e_token_partitions */
#define VPX_CTRL_VP8E_SET_TOKEN_PARTITIONS
-VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_MAXFRAMES, unsigned int)
+VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_MAXFRAMES, unsigned int)
#define VPX_CTRL_VP8E_SET_ARNR_MAXFRAMES
-VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_STRENGTH, unsigned int)
+VPX_CTRL_USE_TYPE(VP8E_SET_ARNR_STRENGTH, unsigned int)
#define VPX_CTRL_VP8E_SET_ARNR_STRENGTH
-VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_SET_ARNR_TYPE, unsigned int)
+VPX_CTRL_USE_TYPE_DEPRECATED(VP8E_SET_ARNR_TYPE, unsigned int)
#define VPX_CTRL_VP8E_SET_ARNR_TYPE
-VPX_CTRL_USE_TYPE(VP8E_SET_TUNING, int) /* vp8e_tuning */
+VPX_CTRL_USE_TYPE(VP8E_SET_TUNING, int) /* vp8e_tuning */
#define VPX_CTRL_VP8E_SET_TUNING
-VPX_CTRL_USE_TYPE(VP8E_SET_CQ_LEVEL, unsigned int)
+VPX_CTRL_USE_TYPE(VP8E_SET_CQ_LEVEL, unsigned int)
#define VPX_CTRL_VP8E_SET_CQ_LEVEL
-VPX_CTRL_USE_TYPE(VP9E_SET_TILE_COLUMNS, int)
+VPX_CTRL_USE_TYPE(VP9E_SET_TILE_COLUMNS, int)
#define VPX_CTRL_VP9E_SET_TILE_COLUMNS
-VPX_CTRL_USE_TYPE(VP9E_SET_TILE_ROWS, int)
+VPX_CTRL_USE_TYPE(VP9E_SET_TILE_ROWS, int)
#define VPX_CTRL_VP9E_SET_TILE_ROWS
-VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER, int *)
+VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER, int *)
#define VPX_CTRL_VP8E_GET_LAST_QUANTIZER
-VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER_64, int *)
+VPX_CTRL_USE_TYPE(VP8E_GET_LAST_QUANTIZER_64, int *)
#define VPX_CTRL_VP8E_GET_LAST_QUANTIZER_64
-VPX_CTRL_USE_TYPE(VP9E_GET_SVC_LAYER_ID, vpx_svc_layer_id_t *)
+VPX_CTRL_USE_TYPE(VP9E_GET_SVC_LAYER_ID, vpx_svc_layer_id_t *)
#define VPX_CTRL_VP9E_GET_SVC_LAYER_ID
VPX_CTRL_USE_TYPE(VP8E_SET_MAX_INTRA_BITRATE_PCT, unsigned int)
VPX_CTRL_USE_TYPE(VP8E_SET_MAX_INTER_BITRATE_PCT, unsigned int)
#define VPX_CTRL_VP8E_SET_MAX_INTER_BITRATE_PCT
+VPX_CTRL_USE_TYPE(VP8E_SET_GF_CBR_BOOST_PCT, unsigned int)
+#define VPX_CTRL_VP8E_SET_GF_CBR_BOOST_PCT
+
VPX_CTRL_USE_TYPE(VP8E_SET_SCREEN_CONTENT_MODE, unsigned int)
#define VPX_CTRL_VP8E_SET_SCREEN_CONTENT_MODE
VPX_CTRL_USE_TYPE(VP9E_SET_AQ_MODE, unsigned int)
#define VPX_CTRL_VP9E_SET_AQ_MODE
+VPX_CTRL_USE_TYPE(VP9E_SET_ALT_REF_AQ, int)
+#define VPX_CTRL_VP9E_SET_ALT_REF_AQ
+
VPX_CTRL_USE_TYPE(VP9E_SET_FRAME_PERIODIC_BOOST, unsigned int)
#define VPX_CTRL_VP9E_SET_FRAME_PERIODIC_BOOST
-VPX_CTRL_USE_TYPE(VP9E_SET_NOISE_SENSITIVITY, unsigned int)
+VPX_CTRL_USE_TYPE(VP9E_SET_NOISE_SENSITIVITY, unsigned int)
#define VPX_CTRL_VP9E_SET_NOISE_SENSITIVITY
VPX_CTRL_USE_TYPE(VP9E_SET_TUNE_CONTENT, int) /* vp9e_tune_content */
VPX_CTRL_USE_TYPE(VP9E_SET_COLOR_SPACE, int)
#define VPX_CTRL_VP9E_SET_COLOR_SPACE
-VPX_CTRL_USE_TYPE(VP9E_SET_MIN_GF_INTERVAL, unsigned int)
+VPX_CTRL_USE_TYPE(VP9E_SET_MIN_GF_INTERVAL, unsigned int)
#define VPX_CTRL_VP9E_SET_MIN_GF_INTERVAL
-VPX_CTRL_USE_TYPE(VP9E_SET_MAX_GF_INTERVAL, unsigned int)
+VPX_CTRL_USE_TYPE(VP9E_SET_MAX_GF_INTERVAL, unsigned int)
#define VPX_CTRL_VP9E_SET_MAX_GF_INTERVAL
VPX_CTRL_USE_TYPE(VP9E_GET_ACTIVEMAP, vpx_active_map_t *)
VPX_CTRL_USE_TYPE(VP9E_SET_RENDER_SIZE, int *)
#define VPX_CTRL_VP9E_SET_RENDER_SIZE
-VPX_CTRL_USE_TYPE(VP9E_SET_TARGET_LEVEL, unsigned int)
+VPX_CTRL_USE_TYPE(VP9E_SET_TARGET_LEVEL, unsigned int)
#define VPX_CTRL_VP9E_SET_TARGET_LEVEL
+VPX_CTRL_USE_TYPE(VP9E_SET_ROW_MT, unsigned int)
+#define VPX_CTRL_VP9E_SET_ROW_MT
+
VPX_CTRL_USE_TYPE(VP9E_GET_LEVEL, int *)
#define VPX_CTRL_VP9E_GET_LEVEL
+VPX_CTRL_USE_TYPE(VP9E_ENABLE_MOTION_VECTOR_UNIT_TEST, unsigned int)
+#define VPX_CTRL_VP9E_ENABLE_MOTION_VECTOR_UNIT_TEST
+
/*!\endcond */
/*! @} - end defgroup vp8_encoder */
#ifdef __cplusplus