| OLD | NEW |
| 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 | 10 |
| 11 #ifndef VP9_COMMON_VP9_ONYX_H_ | 11 #ifndef VP9_COMMON_VP9_ONYX_H_ |
| 12 #define VP9_COMMON_VP9_ONYX_H_ | 12 #define VP9_COMMON_VP9_ONYX_H_ |
| 13 | 13 |
| 14 #ifdef __cplusplus | 14 #ifdef __cplusplus |
| 15 extern "C" | 15 extern "C" |
| 16 { | 16 { // NOLINT |
| 17 #endif | 17 #endif |
| 18 | 18 |
| 19 #include "./vpx_config.h" | 19 #include "./vpx_config.h" |
| 20 #include "vpx/internal/vpx_codec_internal.h" | 20 #include "vpx/internal/vpx_codec_internal.h" |
| 21 #include "vpx/vp8cx.h" | 21 #include "vpx/vp8cx.h" |
| 22 #include "vpx_scale/yv12config.h" | 22 #include "vpx_scale/yv12config.h" |
| 23 #include "vp9/common/vp9_ppflags.h" | 23 #include "vp9/common/vp9_ppflags.h" |
| 24 | 24 |
| 25 #define MAX_SEGMENTS 8 | 25 #define MAX_SEGMENTS 8 |
| 26 | 26 |
| 27 typedef int *VP9_PTR; | 27 typedef int *VP9_PTR; |
| 28 | 28 |
| 29 /* Create/destroy static data structures. */ | 29 /* Create/destroy static data structures. */ |
| 30 | 30 |
| 31 typedef enum { | 31 typedef enum { |
| 32 NORMAL = 0, | 32 NORMAL = 0, |
| 33 FOURFIVE = 1, | 33 FOURFIVE = 1, |
| 34 THREEFIVE = 2, | 34 THREEFIVE = 2, |
| 35 ONETWO = 3 | 35 ONETWO = 3 |
| 36 | |
| 37 } VPX_SCALING; | 36 } VPX_SCALING; |
| 38 | 37 |
| 39 typedef enum { | 38 typedef enum { |
| 40 VP9_LAST_FLAG = 1, | 39 VP9_LAST_FLAG = 1, |
| 41 VP9_GOLD_FLAG = 2, | 40 VP9_GOLD_FLAG = 2, |
| 42 VP9_ALT_FLAG = 4 | 41 VP9_ALT_FLAG = 4 |
| 43 } VP9_REFFRAME; | 42 } VP9_REFFRAME; |
| 44 | 43 |
| 45 | 44 |
| 46 typedef enum { | 45 typedef enum { |
| (...skipping 17 matching lines...) Expand all Loading... |
| 64 FRAMEFLAGS_GOLDEN = 2, | 63 FRAMEFLAGS_GOLDEN = 2, |
| 65 FRAMEFLAGS_ALTREF = 4, | 64 FRAMEFLAGS_ALTREF = 4, |
| 66 } FRAMETYPE_FLAGS; | 65 } FRAMETYPE_FLAGS; |
| 67 | 66 |
| 68 typedef struct { | 67 typedef struct { |
| 69 int version; // 4 versions of bitstream defined: | 68 int version; // 4 versions of bitstream defined: |
| 70 // 0 - best quality/slowest decode, | 69 // 0 - best quality/slowest decode, |
| 71 // 3 - lowest quality/fastest decode | 70 // 3 - lowest quality/fastest decode |
| 72 int width; // width of data passed to the compressor | 71 int width; // width of data passed to the compressor |
| 73 int height; // height of data passed to the compressor | 72 int height; // height of data passed to the compressor |
| 74 double framerate; // set to passed in framerate | 73 double framerate; // set to passed in framerate |
| 75 int64_t target_bandwidth; // bandwidth to be used in kilobits per second | 74 int64_t target_bandwidth; // bandwidth to be used in kilobits per second |
| 76 | 75 |
| 77 int noise_sensitivity; // parameter used for applying pre processing blur:
recommendation 0 | 76 int noise_sensitivity; // pre processing blur: recommendation 0 |
| 78 int Sharpness; // parameter used for sharpening output: recommendat
ion 0: | 77 int Sharpness; // sharpening output: recommendation 0: |
| 79 int cpu_used; | 78 int cpu_used; |
| 80 unsigned int rc_max_intra_bitrate_pct; | 79 unsigned int rc_max_intra_bitrate_pct; |
| 81 | 80 |
| 82 // mode -> | 81 // mode -> |
| 83 // (0)=Realtime/Live Encoding. This mode is optimized for realtim encoding (
for example, capturing | 82 // (0)=Realtime/Live Encoding. This mode is optimized for realtime |
| 84 // a television signal or feed from a live camera). ( speed setting contr
ols how fast ) | 83 // encoding (for example, capturing a television signal or feed from |
| 85 // (1)=Good Quality Fast Encoding. The encoder balances quality with the amo
unt of time it takes to | 84 // a live camera). ( speed setting controls how fast ) |
| 86 // encode the output. ( speed setting controls how fast ) | 85 // (1)=Good Quality Fast Encoding. The encoder balances quality with the |
| 87 // (2)=One Pass - Best Quality. The encoder places priority on the quality o
f the output over encoding | 86 // amount of time it takes to encode the output. ( speed setting |
| 88 // speed. The output is compressed at the highest possible quality. This
option takes the longest | 87 // controls how fast ) |
| 89 // amount of time to encode. ( speed setting ignored ) | 88 // (2)=One Pass - Best Quality. The encoder places priority on the |
| 90 // (3)=Two Pass - First Pass. The encoder generates a file of statistics for
use in the second encoding | 89 // quality of the output over encoding speed. The output is compressed |
| 91 // pass. ( speed setting controls how fast ) | 90 // at the highest possible quality. This option takes the longest |
| 92 // (4)=Two Pass - Second Pass. The encoder uses the statistics that were gen
erated in the first encoding | 91 // amount of time to encode. ( speed setting ignored ) |
| 93 // pass to create the compressed output. ( speed setting controls how fas
t ) | 92 // (3)=Two Pass - First Pass. The encoder generates a file of statistics |
| 94 // (5)=Two Pass - Second Pass Best. The encoder uses the statistics that we
re generated in the first | 93 // for use in the second encoding pass. ( speed setting controls how |
| 95 // encoding pass to create the compressed output using the highest possib
le quality, and taking a | 94 // fast ) |
| 95 // (4)=Two Pass - Second Pass. The encoder uses the statistics that were |
| 96 // generated in the first encoding pass to create the compressed |
| 97 // output. ( speed setting controls how fast ) |
| 98 // (5)=Two Pass - Second Pass Best. The encoder uses the statistics that |
| 99 // were generated in the first encoding pass to create the compressed |
| 100 // output using the highest possible quality, and taking a |
| 96 // longer amount of time to encode.. ( speed setting ignored ) | 101 // longer amount of time to encode.. ( speed setting ignored ) |
| 97 int Mode; // | 102 int Mode; |
| 98 | 103 |
| 99 // Key Framing Operations | 104 // Key Framing Operations |
| 100 int auto_key; // automatically detect cut scenes and set the keyf
rames | 105 int auto_key; // autodetect cut scenes and set the keyframes |
| 101 int key_freq; // maximum distance to key frame. | 106 int key_freq; // maximum distance to key frame. |
| 102 | 107 |
| 103 int allow_lag; // allow lagged compression (if 0 lagin frames is i
gnored) | 108 int allow_lag; // allow lagged compression (if 0 lagin frames is ignored) |
| 104 int lag_in_frames; // how many frames lag before we start encoding | 109 int lag_in_frames; // how many frames lag before we start encoding |
| 105 | 110 |
| 106 // ---------------------------------------------------------------- | 111 // ---------------------------------------------------------------- |
| 107 // DATARATE CONTROL OPTIONS | 112 // DATARATE CONTROL OPTIONS |
| 108 | 113 |
| 109 int end_usage; // vbr or cbr | 114 int end_usage; // vbr or cbr |
| 110 | 115 |
| 111 // buffer targeting aggressiveness | 116 // buffer targeting aggressiveness |
| 112 int under_shoot_pct; | 117 int under_shoot_pct; |
| 113 int over_shoot_pct; | 118 int over_shoot_pct; |
| 114 | 119 |
| 115 // buffering parameters | 120 // buffering parameters |
| 116 int64_t starting_buffer_level; // in seconds | 121 int64_t starting_buffer_level; // in seconds |
| 117 int64_t optimal_buffer_level; | 122 int64_t optimal_buffer_level; |
| 118 int64_t maximum_buffer_size; | 123 int64_t maximum_buffer_size; |
| 119 | 124 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 131 // END DATARATE CONTROL OPTIONS | 136 // END DATARATE CONTROL OPTIONS |
| 132 // ---------------------------------------------------------------- | 137 // ---------------------------------------------------------------- |
| 133 | 138 |
| 134 // Spatial scalability | 139 // Spatial scalability |
| 135 int ss_number_layers; | 140 int ss_number_layers; |
| 136 | 141 |
| 137 // these parameters aren't to be used in final build don't use!!! | 142 // these parameters aren't to be used in final build don't use!!! |
| 138 int play_alternate; | 143 int play_alternate; |
| 139 int alt_freq; | 144 int alt_freq; |
| 140 | 145 |
| 141 int encode_breakout; // early breakout encode threshold : for video conf re
commend 800 | 146 int encode_breakout; // early breakout : for video conf recommend 800 |
| 142 | 147 |
| 143 /* Bitfield defining the error resiliency features to enable. | 148 /* Bitfield defining the error resiliency features to enable. |
| 144 * Can provide decodable frames after losses in previous | 149 * Can provide decodable frames after losses in previous |
| 145 * frames and decodable partitions after losses in the same frame. | 150 * frames and decodable partitions after losses in the same frame. |
| 146 */ | 151 */ |
| 147 unsigned int error_resilient_mode; | 152 unsigned int error_resilient_mode; |
| 148 | 153 |
| 149 /* Bitfield defining the parallel decoding mode where the | 154 /* Bitfield defining the parallel decoding mode where the |
| 150 * decoding in successive frames may be conducted in parallel | 155 * decoding in successive frames may be conducted in parallel |
| 151 * just by decoding the frame headers. | 156 * just by decoding the frame headers. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 166 } VP9_CONFIG; | 171 } VP9_CONFIG; |
| 167 | 172 |
| 168 | 173 |
| 169 void vp9_initialize_enc(); | 174 void vp9_initialize_enc(); |
| 170 | 175 |
| 171 VP9_PTR vp9_create_compressor(VP9_CONFIG *oxcf); | 176 VP9_PTR vp9_create_compressor(VP9_CONFIG *oxcf); |
| 172 void vp9_remove_compressor(VP9_PTR *comp); | 177 void vp9_remove_compressor(VP9_PTR *comp); |
| 173 | 178 |
| 174 void vp9_change_config(VP9_PTR onyx, VP9_CONFIG *oxcf); | 179 void vp9_change_config(VP9_PTR onyx, VP9_CONFIG *oxcf); |
| 175 | 180 |
| 176 // receive a frames worth of data caller can assume that a copy of this frame is
made | 181 // receive a frames worth of data. caller can assume that a copy of this |
| 177 // and not just a copy of the pointer.. | 182 // frame is made and not just a copy of the pointer.. |
| 178 int vp9_receive_raw_frame(VP9_PTR comp, unsigned int frame_flags, | 183 int vp9_receive_raw_frame(VP9_PTR comp, unsigned int frame_flags, |
| 179 YV12_BUFFER_CONFIG *sd, int64_t time_stamp, | 184 YV12_BUFFER_CONFIG *sd, int64_t time_stamp, |
| 180 int64_t end_time_stamp); | 185 int64_t end_time_stamp); |
| 181 | 186 |
| 182 int vp9_get_compressed_data(VP9_PTR comp, unsigned int *frame_flags, | 187 int vp9_get_compressed_data(VP9_PTR comp, unsigned int *frame_flags, |
| 183 unsigned long *size, unsigned char *dest, | 188 unsigned long *size, unsigned char *dest, |
| 184 int64_t *time_stamp, int64_t *time_end, | 189 int64_t *time_stamp, int64_t *time_end, |
| 185 int flush); | 190 int flush); |
| 186 | 191 |
| 187 int vp9_get_preview_raw_frame(VP9_PTR comp, YV12_BUFFER_CONFIG *dest, | 192 int vp9_get_preview_raw_frame(VP9_PTR comp, YV12_BUFFER_CONFIG *dest, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 | 225 |
| 221 void vp9_set_svc(VP9_PTR comp, int use_svc); | 226 void vp9_set_svc(VP9_PTR comp, int use_svc); |
| 222 | 227 |
| 223 int vp9_get_quantizer(VP9_PTR c); | 228 int vp9_get_quantizer(VP9_PTR c); |
| 224 | 229 |
| 225 #ifdef __cplusplus | 230 #ifdef __cplusplus |
| 226 } | 231 } |
| 227 #endif | 232 #endif |
| 228 | 233 |
| 229 #endif // VP9_COMMON_VP9_ONYX_H_ | 234 #endif // VP9_COMMON_VP9_ONYX_H_ |
| OLD | NEW |