Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: source/libvpx/vpx/vpx_encoder.h

Issue 1169543007: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « source/libvpx/vpx/vp8dx.h ('k') | source/libvpx/vpxdec.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 #ifndef VPX_VPX_ENCODER_H_ 10 #ifndef VPX_VPX_ENCODER_H_
(...skipping 24 matching lines...) Expand all
35 * layer membership 35 * layer membership
36 */ 36 */
37 #define VPX_TS_MAX_PERIODICITY 16 37 #define VPX_TS_MAX_PERIODICITY 16
38 38
39 /*! Temporal Scalability: Maximum number of coding layers */ 39 /*! Temporal Scalability: Maximum number of coding layers */
40 #define VPX_TS_MAX_LAYERS 5 40 #define VPX_TS_MAX_LAYERS 5
41 41
42 /*!\deprecated Use #VPX_TS_MAX_PERIODICITY instead. */ 42 /*!\deprecated Use #VPX_TS_MAX_PERIODICITY instead. */
43 #define MAX_PERIODICITY VPX_TS_MAX_PERIODICITY 43 #define MAX_PERIODICITY VPX_TS_MAX_PERIODICITY
44 44
45 /*!\deprecated Use #VPX_TS_MAX_LAYERS instead. */ 45 /*! Temporal+Spatial Scalability: Maximum number of coding layers */
46 #define MAX_LAYERS VPX_TS_MAX_LAYERS 46 #define VPX_MAX_LAYERS 12 // 3 temporal + 4 spatial layers are allowed.
47
48 /*!\deprecated Use #VPX_MAX_LAYERS instead. */
49 #define MAX_LAYERS VPX_MAX_LAYERS // 3 temporal + 4 spatial layers allowed.
47 50
48 /*! Spatial Scalability: Maximum number of coding layers */ 51 /*! Spatial Scalability: Maximum number of coding layers */
49 #define VPX_SS_MAX_LAYERS 5 52 #define VPX_SS_MAX_LAYERS 5
50 53
51 /*! Spatial Scalability: Default number of coding layers */ 54 /*! Spatial Scalability: Default number of coding layers */
52 #define VPX_SS_DEFAULT_LAYERS 1 55 #define VPX_SS_DEFAULT_LAYERS 1
53 56
54 /*!\brief Current ABI version number 57 /*!\brief Current ABI version number
55 * 58 *
56 * \internal 59 * \internal
57 * If this file is altered in any way that changes the ABI, this value 60 * If this file is altered in any way that changes the ABI, this value
58 * must be bumped. Examples include, but are not limited to, changing 61 * must be bumped. Examples include, but are not limited to, changing
59 * types, removing or reassigning enums, adding/removing/rearranging 62 * types, removing or reassigning enums, adding/removing/rearranging
60 * fields to structures 63 * fields to structures
61 */ 64 */
62 #define VPX_ENCODER_ABI_VERSION (4 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer */ 65 #define VPX_ENCODER_ABI_VERSION (5 + VPX_CODEC_ABI_VERSION) /**<\hideinitializer */
63 66
64 67
65 /*! \brief Encoder capabilities bitfield 68 /*! \brief Encoder capabilities bitfield
66 * 69 *
67 * Each encoder advertises the capabilities it supports as part of its 70 * Each encoder advertises the capabilities it supports as part of its
68 * ::vpx_codec_iface_t interface structure. Capabilities are extra 71 * ::vpx_codec_iface_t interface structure. Capabilities are extra
69 * interfaces or functionality, and are not required to be supported 72 * interfaces or functionality, and are not required to be supported
70 * by an encoder. 73 * by an encoder.
71 * 74 *
72 * The available flags are specified by VPX_CODEC_CAP_* defines. 75 * The available flags are specified by VPX_CODEC_CAP_* defines.
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 * returned by calls to vpx_codec_get_cx_data(). Algorithms \ref MAY 159 * returned by calls to vpx_codec_get_cx_data(). Algorithms \ref MAY
157 * extend this list to provide additional functionality. 160 * extend this list to provide additional functionality.
158 */ 161 */
159 enum vpx_codec_cx_pkt_kind { 162 enum vpx_codec_cx_pkt_kind {
160 VPX_CODEC_CX_FRAME_PKT, /**< Compressed video frame */ 163 VPX_CODEC_CX_FRAME_PKT, /**< Compressed video frame */
161 VPX_CODEC_STATS_PKT, /**< Two-pass statistics for this frame */ 164 VPX_CODEC_STATS_PKT, /**< Two-pass statistics for this frame */
162 VPX_CODEC_FPMB_STATS_PKT, /**< first pass mb statistics for this frame */ 165 VPX_CODEC_FPMB_STATS_PKT, /**< first pass mb statistics for this frame */
163 VPX_CODEC_PSNR_PKT, /**< PSNR statistics for this frame */ 166 VPX_CODEC_PSNR_PKT, /**< PSNR statistics for this frame */
164 // Spatial SVC is still experimental and may be removed before the next ABI 167 // Spatial SVC is still experimental and may be removed before the next ABI
165 // bump. 168 // bump.
166 #if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION) 169 #if VPX_ENCODER_ABI_VERSION > (5 + VPX_CODEC_ABI_VERSION)
167 VPX_CODEC_SPATIAL_SVC_LAYER_SIZES, /**< Sizes for each layer in this frame*/ 170 VPX_CODEC_SPATIAL_SVC_LAYER_SIZES, /**< Sizes for each layer in this frame*/
168 VPX_CODEC_SPATIAL_SVC_LAYER_PSNR, /**< PSNR for each layer in this frame*/ 171 VPX_CODEC_SPATIAL_SVC_LAYER_PSNR, /**< PSNR for each layer in this frame*/
169 #endif 172 #endif
170 VPX_CODEC_CUSTOM_PKT = 256 /**< Algorithm extensions */ 173 VPX_CODEC_CUSTOM_PKT = 256 /**< Algorithm extensions */
171 }; 174 };
172 175
173 176
174 /*!\brief Encoder output packet 177 /*!\brief Encoder output packet
175 * 178 *
176 * This structure contains the different kinds of output data the encoder 179 * This structure contains the different kinds of output data the encoder
(...skipping 21 matching lines...) Expand all
198 vpx_fixed_buf_t twopass_stats; /**< data for two-pass packet */ 201 vpx_fixed_buf_t twopass_stats; /**< data for two-pass packet */
199 vpx_fixed_buf_t firstpass_mb_stats; /**< first pass mb packet */ 202 vpx_fixed_buf_t firstpass_mb_stats; /**< first pass mb packet */
200 struct vpx_psnr_pkt { 203 struct vpx_psnr_pkt {
201 unsigned int samples[4]; /**< Number of samples, total/y/u/v */ 204 unsigned int samples[4]; /**< Number of samples, total/y/u/v */
202 uint64_t sse[4]; /**< sum squared error, total/y/u/v */ 205 uint64_t sse[4]; /**< sum squared error, total/y/u/v */
203 double psnr[4]; /**< PSNR, total/y/u/v */ 206 double psnr[4]; /**< PSNR, total/y/u/v */
204 } psnr; /**< data for PSNR packet */ 207 } psnr; /**< data for PSNR packet */
205 vpx_fixed_buf_t raw; /**< data for arbitrary packets */ 208 vpx_fixed_buf_t raw; /**< data for arbitrary packets */
206 // Spatial SVC is still experimental and may be removed before the next 209 // Spatial SVC is still experimental and may be removed before the next
207 // ABI bump. 210 // ABI bump.
208 #if VPX_ENCODER_ABI_VERSION > (4 + VPX_CODEC_ABI_VERSION) 211 #if VPX_ENCODER_ABI_VERSION > (5 + VPX_CODEC_ABI_VERSION)
209 size_t layer_sizes[VPX_SS_MAX_LAYERS]; 212 size_t layer_sizes[VPX_SS_MAX_LAYERS];
210 struct vpx_psnr_pkt layer_psnr[VPX_SS_MAX_LAYERS]; 213 struct vpx_psnr_pkt layer_psnr[VPX_SS_MAX_LAYERS];
211 #endif 214 #endif
212 215
213 /* This packet size is fixed to allow codecs to extend this 216 /* This packet size is fixed to allow codecs to extend this
214 * interface without having to manage storage for raw packets, 217 * interface without having to manage storage for raw packets,
215 * i.e., if it's smaller than 128 bytes, you can store in the 218 * i.e., if it's smaller than 128 bytes, you can store in the
216 * packet list directly. 219 * packet list directly.
217 */ 220 */
218 char pad[128 - sizeof(enum vpx_codec_cx_pkt_kind)]; /**< fixed sz */ 221 char pad[128 - sizeof(enum vpx_codec_cx_pkt_kind)]; /**< fixed sz */
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 unsigned int ts_periodicity; 725 unsigned int ts_periodicity;
723 726
724 /*!\brief Template defining the membership of frames to temporal layers. 727 /*!\brief Template defining the membership of frames to temporal layers.
725 * 728 *
726 * This array defines the membership of frames to temporal coding layers. 729 * This array defines the membership of frames to temporal coding layers.
727 * For a 2-layer encoding that assigns even numbered frames to one temporal 730 * For a 2-layer encoding that assigns even numbered frames to one temporal
728 * layer (0) and odd numbered frames to a second temporal layer (1) with 731 * layer (0) and odd numbered frames to a second temporal layer (1) with
729 * ts_periodicity=8, then ts_layer_id = (0,1,0,1,0,1,0,1). 732 * ts_periodicity=8, then ts_layer_id = (0,1,0,1,0,1,0,1).
730 */ 733 */
731 unsigned int ts_layer_id[VPX_TS_MAX_PERIODICITY]; 734 unsigned int ts_layer_id[VPX_TS_MAX_PERIODICITY];
735
736 /*!\brief Target bitrate for each spatial/temporal layer.
737 *
738 * These values specify the target coding bitrate to be used for each
739 * spatial/temporal layer.
740 *
741 */
742 unsigned int layer_target_bitrate[VPX_MAX_LAYERS];
743
744 /*!\brief Temporal layering mode indicating which temporal layering scheme t o use.
745 *
746 * The value (refer to VP9E_TEMPORAL_LAYERING_MODE) specifies the
747 * temporal layering mode to use.
748 *
749 */
750 int temporal_layering_mode;
732 } vpx_codec_enc_cfg_t; /**< alias for struct vpx_codec_enc_cfg */ 751 } vpx_codec_enc_cfg_t; /**< alias for struct vpx_codec_enc_cfg */
733 752
734 /*!\brief vp9 svc extra configure parameters 753 /*!\brief vp9 svc extra configure parameters
735 * 754 *
736 * This defines max/min quantizers and scale factors for each layer 755 * This defines max/min quantizers and scale factors for each layer
737 * 756 *
738 */ 757 */
739 typedef struct vpx_svc_parameters { 758 typedef struct vpx_svc_parameters {
740 int max_quantizers[VPX_SS_MAX_LAYERS]; /**< Max Q for each layer */ 759 int max_quantizers[VPX_MAX_LAYERS]; /**< Max Q for each layer */
741 int min_quantizers[VPX_SS_MAX_LAYERS]; /**< Min Q for each layer */ 760 int min_quantizers[VPX_MAX_LAYERS]; /**< Min Q for each layer */
742 int scaling_factor_num[VPX_SS_MAX_LAYERS]; /**< Scaling factor-numerator*/ 761 int scaling_factor_num[VPX_MAX_LAYERS]; /**< Scaling factor-numerator */
743 int scaling_factor_den[VPX_SS_MAX_LAYERS]; /**< Scaling factor-denominator*/ 762 int scaling_factor_den[VPX_MAX_LAYERS]; /**< Scaling factor-denominator */
763 int temporal_layering_mode; /**< Temporal layering mode */
744 } vpx_svc_extra_cfg_t; 764 } vpx_svc_extra_cfg_t;
745 765
746 766
747 /*!\brief Initialize an encoder instance 767 /*!\brief Initialize an encoder instance
748 * 768 *
749 * Initializes a encoder context using the given interface. Applications 769 * Initializes a encoder context using the given interface. Applications
750 * should call the vpx_codec_enc_init convenience macro instead of this 770 * should call the vpx_codec_enc_init convenience macro instead of this
751 * function directly, to ensure that the ABI version number parameter 771 * function directly, to ensure that the ABI version number parameter
752 * is properly initialized. 772 * is properly initialized.
753 * 773 *
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 */ 1034 */
1015 const vpx_image_t *vpx_codec_get_preview_frame(vpx_codec_ctx_t *ctx); 1035 const vpx_image_t *vpx_codec_get_preview_frame(vpx_codec_ctx_t *ctx);
1016 1036
1017 1037
1018 /*!@} - end defgroup encoder*/ 1038 /*!@} - end defgroup encoder*/
1019 #ifdef __cplusplus 1039 #ifdef __cplusplus
1020 } 1040 }
1021 #endif 1041 #endif
1022 #endif // VPX_VPX_ENCODER_H_ 1042 #endif // VPX_VPX_ENCODER_H_
1023 1043
OLDNEW
« no previous file with comments | « source/libvpx/vpx/vp8dx.h ('k') | source/libvpx/vpxdec.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698