| 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_ENCODER_VP9_ENCODER_H_ | 11 #ifndef VP9_ENCODER_VP9_ENCODER_H_ |
| 12 #define VP9_ENCODER_VP9_ENCODER_H_ | 12 #define VP9_ENCODER_VP9_ENCODER_H_ |
| 13 | 13 |
| 14 #include <stdio.h> | 14 #include <stdio.h> |
| 15 | 15 |
| 16 #include "./vpx_config.h" | 16 #include "./vpx_config.h" |
| 17 #include "vpx/internal/vpx_codec_internal.h" | 17 #include "vpx/internal/vpx_codec_internal.h" |
| 18 #include "vpx/vp8cx.h" | 18 #include "vpx/vp8cx.h" |
| 19 | 19 |
| 20 #include "vp9/common/vp9_ppflags.h" | 20 #include "vp9/common/vp9_ppflags.h" |
| 21 #include "vp9/common/vp9_entropymode.h" | 21 #include "vp9/common/vp9_entropymode.h" |
| 22 #include "vp9/common/vp9_loopfilter_thread.h" |
| 22 #include "vp9/common/vp9_onyxc_int.h" | 23 #include "vp9/common/vp9_onyxc_int.h" |
| 23 #include "vp9/common/vp9_thread.h" | 24 #include "vp9/common/vp9_thread.h" |
| 24 | 25 |
| 25 #include "vp9/encoder/vp9_aq_cyclicrefresh.h" | 26 #include "vp9/encoder/vp9_aq_cyclicrefresh.h" |
| 26 #include "vp9/encoder/vp9_context_tree.h" | 27 #include "vp9/encoder/vp9_context_tree.h" |
| 27 #include "vp9/encoder/vp9_encodemb.h" | 28 #include "vp9/encoder/vp9_encodemb.h" |
| 28 #include "vp9/encoder/vp9_firstpass.h" | 29 #include "vp9/encoder/vp9_firstpass.h" |
| 29 #include "vp9/encoder/vp9_lookahead.h" | 30 #include "vp9/encoder/vp9_lookahead.h" |
| 30 #include "vp9/encoder/vp9_mbgraph.h" | 31 #include "vp9/encoder/vp9_mbgraph.h" |
| 31 #include "vp9/encoder/vp9_mcomp.h" | 32 #include "vp9/encoder/vp9_mcomp.h" |
| 32 #include "vp9/encoder/vp9_quantize.h" | 33 #include "vp9/encoder/vp9_quantize.h" |
| 33 #include "vp9/encoder/vp9_ratectrl.h" | 34 #include "vp9/encoder/vp9_ratectrl.h" |
| 34 #include "vp9/encoder/vp9_rd.h" | 35 #include "vp9/encoder/vp9_rd.h" |
| 35 #include "vp9/encoder/vp9_speed_features.h" | 36 #include "vp9/encoder/vp9_speed_features.h" |
| 36 #include "vp9/encoder/vp9_svc_layercontext.h" | 37 #include "vp9/encoder/vp9_svc_layercontext.h" |
| 37 #include "vp9/encoder/vp9_tokenize.h" | 38 #include "vp9/encoder/vp9_tokenize.h" |
| 38 #include "vp9/encoder/vp9_variance.h" | 39 #include "vp9/encoder/vp9_variance.h" |
| 40 |
| 39 #if CONFIG_VP9_TEMPORAL_DENOISING | 41 #if CONFIG_VP9_TEMPORAL_DENOISING |
| 40 #include "vp9/encoder/vp9_denoiser.h" | 42 #include "vp9/encoder/vp9_denoiser.h" |
| 41 #endif | 43 #endif |
| 42 | 44 |
| 43 #ifdef __cplusplus | 45 #ifdef __cplusplus |
| 44 extern "C" { | 46 extern "C" { |
| 45 #endif | 47 #endif |
| 46 | 48 |
| 47 #define DEFAULT_GF_INTERVAL 10 | 49 #define DEFAULT_GF_INTERVAL 10 |
| 48 #define INVALID_REF_BUFFER_IDX -1 // Marks an invalid reference buffer id. | 50 #define INVALID_REF_BUFFER_IDX -1 // Marks an invalid reference buffer id. |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 | 226 |
| 225 #if CONFIG_FP_MB_STATS | 227 #if CONFIG_FP_MB_STATS |
| 226 vpx_fixed_buf_t firstpass_mb_stats_in; | 228 vpx_fixed_buf_t firstpass_mb_stats_in; |
| 227 #endif | 229 #endif |
| 228 | 230 |
| 229 vp8e_tuning tuning; | 231 vp8e_tuning tuning; |
| 230 vp9e_tune_content content; | 232 vp9e_tune_content content; |
| 231 #if CONFIG_VP9_HIGHBITDEPTH | 233 #if CONFIG_VP9_HIGHBITDEPTH |
| 232 int use_highbitdepth; | 234 int use_highbitdepth; |
| 233 #endif | 235 #endif |
| 236 vpx_color_space_t color_space; |
| 234 } VP9EncoderConfig; | 237 } VP9EncoderConfig; |
| 235 | 238 |
| 236 static INLINE int is_lossless_requested(const VP9EncoderConfig *cfg) { | 239 static INLINE int is_lossless_requested(const VP9EncoderConfig *cfg) { |
| 237 return cfg->best_allowed_q == 0 && cfg->worst_allowed_q == 0; | 240 return cfg->best_allowed_q == 0 && cfg->worst_allowed_q == 0; |
| 238 } | 241 } |
| 239 | 242 |
| 240 // TODO(jingning) All spatially adaptive variables should go to TileDataEnc. | 243 // TODO(jingning) All spatially adaptive variables should go to TileDataEnc. |
| 241 typedef struct TileDataEnc { | 244 typedef struct TileDataEnc { |
| 242 TileInfo tile_info; | 245 TileInfo tile_info; |
| 243 int thresh_freq_fact[BLOCK_SIZES][MAX_MODES]; | 246 int thresh_freq_fact[BLOCK_SIZES][MAX_MODES]; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 254 typedef struct ThreadData { | 257 typedef struct ThreadData { |
| 255 MACROBLOCK mb; | 258 MACROBLOCK mb; |
| 256 RD_COUNTS rd_counts; | 259 RD_COUNTS rd_counts; |
| 257 FRAME_COUNTS *counts; | 260 FRAME_COUNTS *counts; |
| 258 | 261 |
| 259 PICK_MODE_CONTEXT *leaf_tree; | 262 PICK_MODE_CONTEXT *leaf_tree; |
| 260 PC_TREE *pc_tree; | 263 PC_TREE *pc_tree; |
| 261 PC_TREE *pc_root; | 264 PC_TREE *pc_root; |
| 262 } ThreadData; | 265 } ThreadData; |
| 263 | 266 |
| 267 struct EncWorkerData; |
| 268 |
| 264 typedef struct VP9_COMP { | 269 typedef struct VP9_COMP { |
| 265 QUANTS quants; | 270 QUANTS quants; |
| 266 ThreadData td; | 271 ThreadData td; |
| 267 VP9_COMMON common; | 272 VP9_COMMON common; |
| 268 VP9EncoderConfig oxcf; | 273 VP9EncoderConfig oxcf; |
| 269 struct lookahead_ctx *lookahead; | 274 struct lookahead_ctx *lookahead; |
| 270 struct lookahead_entry *alt_ref_source; | 275 struct lookahead_entry *alt_ref_source; |
| 271 | 276 |
| 272 YV12_BUFFER_CONFIG *Source; | 277 YV12_BUFFER_CONFIG *Source; |
| 273 YV12_BUFFER_CONFIG *Last_Source; // NULL for first frame and alt_ref frames | 278 YV12_BUFFER_CONFIG *Last_Source; // NULL for first frame and alt_ref frames |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 int multi_arf_enabled; | 444 int multi_arf_enabled; |
| 440 int multi_arf_last_grp_enabled; | 445 int multi_arf_last_grp_enabled; |
| 441 | 446 |
| 442 #if CONFIG_VP9_TEMPORAL_DENOISING | 447 #if CONFIG_VP9_TEMPORAL_DENOISING |
| 443 VP9_DENOISER denoiser; | 448 VP9_DENOISER denoiser; |
| 444 #endif | 449 #endif |
| 445 | 450 |
| 446 // Multi-threading | 451 // Multi-threading |
| 447 int num_workers; | 452 int num_workers; |
| 448 VP9Worker *workers; | 453 VP9Worker *workers; |
| 454 struct EncWorkerData *tile_thr_data; |
| 455 VP9LfSync lf_row_sync; |
| 449 } VP9_COMP; | 456 } VP9_COMP; |
| 450 | 457 |
| 451 void vp9_initialize_enc(void); | 458 void vp9_initialize_enc(void); |
| 452 | 459 |
| 453 struct VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf); | 460 struct VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf); |
| 454 void vp9_remove_compressor(VP9_COMP *cpi); | 461 void vp9_remove_compressor(VP9_COMP *cpi); |
| 455 | 462 |
| 456 void vp9_change_config(VP9_COMP *cpi, const VP9EncoderConfig *oxcf); | 463 void vp9_change_config(VP9_COMP *cpi, const VP9EncoderConfig *oxcf); |
| 457 | 464 |
| 458 // receive a frames worth of data. caller can assume that a copy of this | 465 // receive a frames worth of data. caller can assume that a copy of this |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 582 | 589 |
| 583 static INLINE int *cond_cost_list(const struct VP9_COMP *cpi, int *cost_list) { | 590 static INLINE int *cond_cost_list(const struct VP9_COMP *cpi, int *cost_list) { |
| 584 return cpi->sf.mv.subpel_search_method != SUBPEL_TREE ? cost_list : NULL; | 591 return cpi->sf.mv.subpel_search_method != SUBPEL_TREE ? cost_list : NULL; |
| 585 } | 592 } |
| 586 | 593 |
| 587 #ifdef __cplusplus | 594 #ifdef __cplusplus |
| 588 } // extern "C" | 595 } // extern "C" |
| 589 #endif | 596 #endif |
| 590 | 597 |
| 591 #endif // VP9_ENCODER_VP9_ENCODER_H_ | 598 #endif // VP9_ENCODER_VP9_ENCODER_H_ |
| OLD | NEW |