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_VP8CX_H_
11 #define 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);
53 extern vpx_codec_iface_t vpx_codec_vp10_cx_algo;
54 extern vpx_codec_iface_t *vpx_codec_vp10_cx(void);
57 /*
58  * Algorithm Flags
59  */
60 
67 #define VP8_EFLAG_NO_REF_LAST (1<<16)
68 
69 
76 #define VP8_EFLAG_NO_REF_GF (1<<17)
77 
78 
85 #define VP8_EFLAG_NO_REF_ARF (1<<21)
86 
87 
93 #define VP8_EFLAG_NO_UPD_LAST (1<<18)
94 
95 
101 #define VP8_EFLAG_NO_UPD_GF (1<<22)
102 
103 
109 #define VP8_EFLAG_NO_UPD_ARF (1<<23)
110 
111 
117 #define VP8_EFLAG_FORCE_GF (1<<19)
118 
119 
125 #define VP8_EFLAG_FORCE_ARF (1<<24)
126 
127 
133 #define VP8_EFLAG_NO_UPD_ENTROPY (1<<20)
134 
135 
149 
155 
161 
174 
180 
189 
195 
201 
207 
215 
224 
230 
236 
239 
245 
255 
270 
276 
291 
306 
317 
325 
340 
363 
383 
397 
410 
425 
433 
442 
450 
459 
468 
476 
484 
499 
510 
518 
526 
532 
541 
549 
557 };
558 
563 typedef enum vpx_scaling_mode_1d {
564  VP8E_NORMAL = 0,
565  VP8E_FOURFIVE = 1,
566  VP8E_THREEFIVE = 2,
567  VP8E_ONETWO = 3
569 
581 
587 
591 
596 
603 typedef struct vpx_roi_map {
605  unsigned char *roi_map;
606  unsigned int rows;
607  unsigned int cols;
608  // TODO(paulwilkins): broken for VP9 which has 8 segments
609  // q and loop filter deltas for each segment
610  // (see MAX_MB_SEGMENTS)
611  int delta_q[4];
612  int delta_lf[4];
614  unsigned int static_threshold[4];
615 } vpx_roi_map_t;
616 
624 typedef struct vpx_active_map {
625  unsigned char *active_map;
626  unsigned int rows;
627  unsigned int cols;
629 
635 typedef struct vpx_scaling_mode {
639 
647 typedef enum {
648  VP8_ONE_TOKENPARTITION = 0,
649  VP8_TWO_TOKENPARTITION = 1,
650  VP8_FOUR_TOKENPARTITION = 2,
651  VP8_EIGHT_TOKENPARTITION = 3
653 
655 typedef enum {
656  VP9E_CONTENT_DEFAULT,
657  VP9E_CONTENT_SCREEN,
658  VP9E_CONTENT_INVALID
660 
666 typedef enum {
667  VP8_TUNE_PSNR,
668  VP8_TUNE_SSIM
669 } vp8e_tuning;
670 
678 typedef struct vpx_svc_layer_id {
682 
691 typedef struct vpx_svc_ref_frame_config {
692  int frame_flags[VPX_TS_MAX_LAYERS];
693  int lst_fb_idx[VPX_TS_MAX_LAYERS];
694  int gld_fb_idx[VPX_TS_MAX_LAYERS];
695  int alt_fb_idx[VPX_TS_MAX_LAYERS];
697 
707 #define VPX_CTRL_VP8E_SET_FRAME_FLAGS
709 #define VPX_CTRL_VP8E_SET_TEMPORAL_LAYER_ID
711 #define VPX_CTRL_VP8E_SET_ROI_MAP
713 #define VPX_CTRL_VP8E_SET_ACTIVEMAP
715 #define VPX_CTRL_VP8E_SET_SCALEMODE
716 
718 #define VPX_CTRL_VP9E_SET_SVC
720 #define VPX_CTRL_VP9E_SET_SVC_PARAMETERS
722 #define VPX_CTRL_VP9E_REGISTER_CX_CALLBACK
724 #define VPX_CTRL_VP9E_SET_SVC_LAYER_ID
725 
727 #define VPX_CTRL_VP8E_SET_CPUUSED
729 #define VPX_CTRL_VP8E_SET_ENABLEAUTOALTREF
731 #define VPX_CTRL_VP8E_SET_NOISE_SENSITIVITY
733 #define VPX_CTRL_VP8E_SET_SHARPNESS
735 #define VPX_CTRL_VP8E_SET_STATIC_THRESHOLD
736 VPX_CTRL_USE_TYPE(VP8E_SET_TOKEN_PARTITIONS, int) /* vp8e_token_partitions */
737 #define VPX_CTRL_VP8E_SET_TOKEN_PARTITIONS
738 
740 #define VPX_CTRL_VP8E_SET_ARNR_MAXFRAMES
742 #define VPX_CTRL_VP8E_SET_ARNR_STRENGTH
744 #define VPX_CTRL_VP8E_SET_ARNR_TYPE
745 VPX_CTRL_USE_TYPE(VP8E_SET_TUNING, int) /* vp8e_tuning */
746 #define VPX_CTRL_VP8E_SET_TUNING
748 #define VPX_CTRL_VP8E_SET_CQ_LEVEL
749 
751 #define VPX_CTRL_VP9E_SET_TILE_COLUMNS
753 #define VPX_CTRL_VP9E_SET_TILE_ROWS
754 
756 #define VPX_CTRL_VP8E_GET_LAST_QUANTIZER
758 #define VPX_CTRL_VP8E_GET_LAST_QUANTIZER_64
760 #define VPX_CTRL_VP9E_GET_SVC_LAYER_ID
761 
763 #define VPX_CTRL_VP8E_SET_MAX_INTRA_BITRATE_PCT
764 VPX_CTRL_USE_TYPE(VP8E_SET_MAX_INTER_BITRATE_PCT, unsigned int)
765 #define VPX_CTRL_VP8E_SET_MAX_INTER_BITRATE_PCT
766 
768 #define VPX_CTRL_VP8E_SET_SCREEN_CONTENT_MODE
769 
771 #define VPX_CTRL_VP9E_SET_GF_CBR_BOOST_PCT
772 
774 #define VPX_CTRL_VP9E_SET_LOSSLESS
775 
777 #define VPX_CTRL_VP9E_SET_FRAME_PARALLEL_DECODING
778 
779 VPX_CTRL_USE_TYPE(VP9E_SET_AQ_MODE, unsigned int)
780 #define VPX_CTRL_VP9E_SET_AQ_MODE
781 
783 #define VPX_CTRL_VP9E_SET_FRAME_PERIODIC_BOOST
784 
786 #define VPX_CTRL_VP9E_SET_NOISE_SENSITIVITY
787 
788 VPX_CTRL_USE_TYPE(VP9E_SET_TUNE_CONTENT, int) /* vp9e_tune_content */
789 #define VPX_CTRL_VP9E_SET_TUNE_CONTENT
790 
792 #define VPX_CTRL_VP9E_SET_COLOR_SPACE
793 
795 #define VPX_CTRL_VP9E_SET_MIN_GF_INTERVAL
796 
798 #define VPX_CTRL_VP9E_SET_MAX_GF_INTERVAL
799 
801 #define VPX_CTRL_VP9E_GET_ACTIVEMAP
802 
804 #define VPX_CTRL_VP9E_SET_COLOR_RANGE
805 
807 #define VPX_CTRL_VP9E_SET_SVC_REF_FRAME_CONFIG
808 
810 #define VPX_CTRL_VP9E_SET_RENDER_SIZE
811 
814 #ifdef __cplusplus
815 } // extern "C"
816 #endif
817 
818 #endif // VPX_VP8CX_H_
unsigned char * roi_map
Definition: vp8cx.h:605
Codec control function to set encoder internal speed settings.
Definition: vp8cx.h:173
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:627
vp8e_enc_control_id
VPx encoder control functions.
Definition: vp8cx.h:143
#define VPX_TS_MAX_LAYERS
Definition: vpx_encoder.h:40
Codec control function to set content type.
Definition: vp8cx.h:467
Codec control function to set noise sensitivity.
Definition: vp8cx.h:432
enum vpx_scaling_mode_1d VPX_SCALING_MODE
vpx 1-D scaling mode
unsigned int cols
Definition: vp8cx.h:607
Codec control function to set reference and update frame flags.
Definition: vp8cx.h:275
Codec control function to set encoder scaling mode.
Definition: vp8cx.h:160
VPX_SCALING_MODE v_scaling_mode
Definition: vp8cx.h:637
vp8e_token_partitions
VP8 token partition mode.
Definition: vp8cx.h:647
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:148
Codec control function to set visual tuning.
Definition: vp8cx.h:244
Codec control function to set constrained quality level.
Definition: vp8cx.h:254
Definition: vp8cx.h:238
int spatial_layer_id
Definition: vp8cx.h:679
Codec control function to set Max data rate for Intra frames.
Definition: vp8cx.h:269
Codec control function to set parameters for SVC.
Definition: vp8cx.h:449
Codec control function to set number of tile columns.
Definition: vp8cx.h:362
#define VPX_CTRL_USE_TYPE(id, typ)
vpx_codec_control type definition macro
Definition: vpx_codec.h:423
unsigned int static_threshold[4]
Definition: vp8cx.h:614
Codec control function to set adaptive quantization mode.
Definition: vp8cx.h:409
Codec control function to set color space info.
Definition: vp8cx.h:498
Codec control function to get svc layer ID.
Definition: vp8cx.h:475
Codec control function to set lossless encoding mode.
Definition: vp8cx.h:339
Codec control function to get last quantizer chosen by the encoder.
Definition: vp8cx.h:223
vp9 svc layer parameters
Definition: vp8cx.h:678
Codec control function to set the temporal layer id.
Definition: vp8cx.h:316
0-1-0-1... temporal layering scheme with two temporal layers.
Definition: vp8cx.h:590
Codec control function to set the number of token partitions.
Definition: vp8cx.h:206
control function to set noise sensitivity
Definition: vp8cx.h:188
const struct vpx_codec_iface vpx_codec_iface_t
Codec interface structure.
Definition: vpx_codec.h:173
Boost percentage for Golden Frame in CBR mode.
Definition: vp8cx.h:305
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:548
int delta_lf[4]
Definition: vp8cx.h:612
vp9e_temporal_layering_mode
Temporal layering mode enum for VP9 SVC.
Definition: vp8cx.h:576
Codec control function to set intended rendering image size.
Definition: vp8cx.h:556
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:594
No temporal layering. Used when only spatial layering is used.
Definition: vp8cx.h:580
#define VPX_CTRL_USE_TYPE_DEPRECATED(id, typ)
vpx_codec_control deprecated type definition macro
Definition: vpx_codec.h:450
unsigned char * active_map
Definition: vp8cx.h:625
Codec control function to set encoder screen content mode.
Definition: vp8cx.h:324
Bypass mode. Used when application needs to control temporal layering. This will only work when the n...
Definition: vp8cx.h:586
unsigned int rows
Definition: vp8cx.h:626
Codec control function to set the max no of frames to create arf.
Definition: vp8cx.h:229
int temporal_layer_id
Definition: vp8cx.h:680
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:483
Codec control function to set the filter strength for the arf.
Definition: vp8cx.h:235
Codec control function to enable/disable periodic Q boost.
Definition: vp8cx.h:424
Codec control function to get an Active map back from the encoder.
Definition: vp8cx.h:531
Provides controls common to both the VP8 encoder and decoder.
Codec control function to set color range bit.
Definition: vp8cx.h:540
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:214
Codec control function to enable automatic set and use alf frames.
Definition: vp8cx.h:179
Codec control function to set minimum interval between GF/ARF frames.
Definition: vp8cx.h:517
Codec control function to set temporal layering mode.
Definition: vp8cx.h:509
VPX_SCALING_MODE h_scaling_mode
Definition: vp8cx.h:636
Codec control function to set minimum interval between GF/ARF frames.
Definition: vp8cx.h:525
Codec control function to turn on/off SVC in encoder.
Definition: vp8cx.h:441
vpx active region map
Definition: vp8cx.h:624
struct vpx_roi_map vpx_roi_map_t
vpx region of interest map
unsigned int rows
Definition: vp8cx.h:606
Codec control function to enable frame parallel decoding feature.
Definition: vp8cx.h:396
Codec control function to set max data rate for Inter frames.
Definition: vp8cx.h:290
vp9 svc frame flag parameters.
Definition: vp8cx.h:691
Codec control function to set the threshold for MBs treated static.
Definition: vp8cx.h:200
vpx_scaling_mode_1d
vpx 1-D scaling mode
Definition: vp8cx.h:563
Codec control function to set number of tile rows.
Definition: vp8cx.h:382
vp8e_tuning
VP8 model tuning parameters.
Definition: vp8cx.h:666
Codec control function to set sharpness.
Definition: vp8cx.h:194
vpx region of interest map
Definition: vp8cx.h:603
int delta_q[4]
Definition: vp8cx.h:611
vpx image scaling mode
Definition: vp8cx.h:635
Codec control function to set svc layer for spatial and temporal.
Definition: vp8cx.h:458
Codec control function to pass an Active map to encoder.
Definition: vp8cx.h:154
vp9e_tune_content
Definition: vp8cx.h:655