1 /* 2 * Copyright (c) 2019, Alliance for Open Media. All rights reserved 3 * 4 * This source code is subject to the terms of the BSD 2 Clause License and 5 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License 6 * was not distributed with this source code in the LICENSE file, you can 7 * obtain it at www.aomedia.org/license/software. If the Alliance for Open 8 * Media Patent License 1.0 was not distributed with this source code in the 9 * PATENTS file, you can obtain it at www.aomedia.org/license/patent. 10 */ 11 12 #ifndef AOM_AV1_ENCODER_ENCODE_STRATEGY_H_ 13 #define AOM_AV1_ENCODER_ENCODE_STRATEGY_H_ 14 15 #ifdef __cplusplus 16 extern "C" { 17 #endif 18 19 #include <stdint.h> 20 21 #include "aom/aom_encoder.h" 22 23 #include "av1/encoder/encoder.h" 24 #include "av1/encoder/firstpass.h" 25 26 // This function will implement high-level encode strategy, choosing frame type, 27 // frame placement, etc. It populates an EncodeFrameParams struct with the 28 // results of these decisions and then calls av1_encode() 29 int av1_encode_strategy(AV1_COMP *const cpi, size_t *const size, 30 uint8_t *const dest, unsigned int *frame_flags, 31 int64_t *const time_stamp, int64_t *const time_end, 32 const aom_rational_t *const timebase, int flush); 33 34 // Set individual buffer update flags based on frame reference type. 35 // force_refresh_all is used when we have a KEY_FRAME or S_FRAME. It forces all 36 // refresh_*_frame flags to be set, because we refresh all buffers in this case. 37 void av1_configure_buffer_updates(AV1_COMP *const cpi, 38 EncodeFrameParams *const frame_params, 39 const FRAME_UPDATE_TYPE type, 40 int force_refresh_all); 41 42 #ifdef __cplusplus 43 } // extern "C" 44 #endif 45 46 #endif // AOM_AV1_ENCODER_ENCODE_STRATEGY_H_ 47