AOMedia AV1 Codec
encode_strategy.h
Go to the documentation of this file.
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 
15 #ifndef AOM_AV1_ENCODER_ENCODE_STRATEGY_H_
16 #define AOM_AV1_ENCODER_ENCODE_STRATEGY_H_
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 #include <stdint.h>
23 
24 #include "aom/aom_encoder.h"
25 
26 #include "av1/encoder/encoder.h"
27 #include "av1/encoder/firstpass.h"
28 
54 int av1_encode_strategy(AV1_COMP *const cpi, size_t *const size,
55  uint8_t *const dest, unsigned int *frame_flags,
56  int64_t *const time_stamp, int64_t *const time_end,
57  const aom_rational64_t *const timestamp_ratio,
58  int flush);
59 
61 // Set individual buffer update flags based on frame reference type.
62 // force_refresh_all is used when we have a KEY_FRAME or S_FRAME. It forces all
63 // refresh_*_frame flags to be set, because we refresh all buffers in this case.
64 void av1_configure_buffer_updates(
65  AV1_COMP *const cpi, RefreshFrameFlagsInfo *const refresh_frame_flags,
66  const FRAME_UPDATE_TYPE type, const FRAME_TYPE frame_type,
67  int force_refresh_all);
68 
69 int av1_get_refresh_frame_flags(const AV1_COMP *const cpi,
70  const EncodeFrameParams *const frame_params,
71  FRAME_UPDATE_TYPE frame_update_type,
72  const RefBufferStack *const ref_buffer_stack);
73 
74 int av1_get_refresh_ref_frame_map(int refresh_frame_flags);
75 
76 void av1_update_ref_frame_map(AV1_COMP *cpi,
77  FRAME_UPDATE_TYPE frame_update_type,
78  FRAME_TYPE frame_type, int show_existing_frame,
79  int ref_map_index,
80  RefBufferStack *ref_buffer_stack);
81 
82 void av1_get_ref_frames(AV1_COMP *const cpi, RefBufferStack *ref_buffer_stack);
83 
84 int is_forced_keyframe_pending(struct lookahead_ctx *lookahead,
85  const int up_to_index,
86  const COMPRESSOR_STAGE compressor_stage);
88 #ifdef __cplusplus
89 } // extern "C"
90 #endif
91 
92 #endif // AOM_AV1_ENCODER_ENCODE_STRATEGY_H_
Describes the encoder algorithm interface to applications.
int av1_encode_strategy(AV1_COMP *const cpi, size_t *const size, uint8_t *const dest, unsigned int *frame_flags, int64_t *const time_stamp, int64_t *const time_end, const aom_rational64_t *const timestamp_ratio, int flush)
Implement high-level encode strategy.
Definition: encode_strategy.c:1085
contains per-frame encoding parameters decided upon by av1_encode_strategy() and passed down to av1_e...
Definition: encoder.h:2726
Top level encoder structure.
Definition: encoder.h:2095
Declares top-level encoder structures and functions.
Refresh frame flags for different type of frames.
Definition: encoder.h:1767