AOMedia AV1 Codec
temporal_filter.h
1 /*
2  * Copyright (c) 2016, 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_TEMPORAL_FILTER_H_
13 #define AOM_AV1_ENCODER_TEMPORAL_FILTER_H_
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 struct AV1_COMP;
20 struct AV1EncoderConfig;
21 struct ThreadData;
22 // TODO(any): These two variables are only used in avx2, sse2, sse4
23 // implementations, where the block size is still hard coded. This should be
24 // fixed to align with the c implementation.
25 #define BH 32
26 #define BW 32
27 
28 // Block size used in temporal filtering.
29 #define TF_BLOCK_SIZE BLOCK_32X32
30 
31 // Window size for temporal filtering.
32 #define TF_WINDOW_LENGTH 5
33 
34 // Hyper-parameters used to compute filtering weight. These hyper-parameters can
35 // be tuned for a better performance.
36 // 0. A scale factor used in temporal filtering to raise the filter weight from
37 // `double` with range [0, 1] to `int` with range [0, 1000].
38 #define TF_WEIGHT_SCALE 1000
39 // 1. Weight factor used to balance the weighted-average between window error
40 // and block error. The weight is for window error while the weight for block
41 // error is always set as 1.
42 #define TF_WINDOW_BLOCK_BALANCE_WEIGHT 5
43 // 2. Threshold for using q to adjust the filtering weight. Concretely, when
44 // using a small q (high bitrate), we would like to reduce the filtering
45 // strength such that more detailed information can be preserved. Hence, when
46 // q is smaller than this threshold, we will adjust the filtering weight
47 // based on the q-value.
48 #define TF_Q_DECAY_THRESHOLD 20
49 // 3. Normalization factor used to normalize the motion search error. Since the
50 // motion search error can be large and uncontrollable, we will simply
51 // normalize it before using it to compute the filtering weight.
52 #define TF_SEARCH_ERROR_NORM_WEIGHT 20
53 // 4. Threshold for using `arnr_strength` to adjust the filtering strength.
54 // Concretely, users can use `arnr_strength` arguments to control the
55 // strength of temporal filtering. When `arnr_strength` is small enough (
56 // i.e., smaller than this threshold), we will adjust the filtering weight
57 // based on the strength value.
58 #define TF_STRENGTH_THRESHOLD 4
59 // 5. Threshold for using motion search distance to adjust the filtering weight.
60 // Concretely, larger motion search vector leads to a higher probability of
61 // unreliable search. Hence, we would like to reduce the filtering strength
62 // when the distance is large enough. Considering that the distance actually
63 // relies on the frame size, this threshold is also a resolution-based
64 // threshold. Taking 720p videos as an instance, if this field equals to 0.1,
65 // then the actual threshold will be 720 * 0.1 = 72. Similarly, the threshold
66 // for 360p videos will be 360 * 0.1 = 36.
67 #define TF_SEARCH_DISTANCE_THRESHOLD 0.1
68 // 6. Threshold to identify if the q is in a relative high range.
69 // Above this cutoff q, a stronger filtering is applied.
70 // For a high q, the quantization throws away more information, and thus a
71 // stronger filtering is less likely to distort the encoded quality, while a
72 // stronger filtering could reduce bit rates.
73 // Ror a low q, more details are expected to be retained. Filtering is thus
74 // more conservative.
75 #define TF_QINDEX_CUTOFF 128
76 
77 #define NOISE_ESTIMATION_EDGE_THRESHOLD 50
78 
79 // Sum and SSE source vs filtered frame difference returned by
80 // temporal filter.
81 typedef struct {
82  int64_t sum;
83  int64_t sse;
84 } FRAME_DIFF;
85 
91 typedef struct {
95  YV12_BUFFER_CONFIG *frames[MAX_LAG_BUFFERS];
100 
105 
117  struct scale_factors sf;
121  double noise_levels[MAX_MB_PLANE];
125  int num_pels;
129  int mb_rows;
133  int mb_cols;
141  int q_factor;
143 
149 #define TF_INFO_BUF_COUNT 2
150 
154 typedef struct TEMPORAL_FILTER_INFO {
165  YV12_BUFFER_CONFIG tf_buf[TF_INFO_BUF_COUNT];
166 
177  FRAME_DIFF frame_diff[TF_INFO_BUF_COUNT];
181  int tf_buf_gf_index[TF_INFO_BUF_COUNT];
185  int tf_buf_display_index_offset[TF_INFO_BUF_COUNT];
189  int tf_buf_valid[TF_INFO_BUF_COUNT];
191 
197 int av1_is_temporal_filter_on(const struct AV1EncoderConfig *oxcf);
198 
203 void av1_tf_info_alloc(TEMPORAL_FILTER_INFO *tf_info, struct AV1_COMP *cpi);
204 
208 void av1_tf_info_free(TEMPORAL_FILTER_INFO *tf_info);
209 
213 void av1_tf_info_reset(TEMPORAL_FILTER_INFO *tf_info);
214 
220 void av1_tf_info_filtering(TEMPORAL_FILTER_INFO *tf_info, struct AV1_COMP *cpi,
221  const GF_GROUP *gf_group);
222 
229 YV12_BUFFER_CONFIG *av1_tf_info_get_filtered_buf(TEMPORAL_FILTER_INFO *tf_info,
230  int gf_index,
231  FRAME_DIFF *frame_diff);
232 
235 // Data related to temporal filtering.
236 typedef struct {
237  // Source vs filtered frame error.
238  FRAME_DIFF diff;
239  // Pointer to temporary block info used to store state in temporal filtering
240  // process.
241  MB_MODE_INFO *tmp_mbmi;
242  // Pointer to accumulator buffer used in temporal filtering process.
243  uint32_t *accum;
244  // Pointer to count buffer used in temporal filtering process.
245  uint16_t *count;
246  // Pointer to predictor used in temporal filtering process.
247  uint8_t *pred;
248 } TemporalFilterData;
249 
250 // Data related to temporal filter multi-thread synchronization.
251 typedef struct {
252 #if CONFIG_MULTITHREAD
253  // Mutex lock used for dispatching jobs.
254  pthread_mutex_t *mutex_;
255 #endif // CONFIG_MULTITHREAD
256  // Next temporal filter block row to be filtered.
257  int next_tf_row;
258 } AV1TemporalFilterSync;
259 
260 // Estimates noise level from a given frame using a single plane (Y, U, or V).
261 // This is an adaptation of the mehtod in the following paper:
262 // Shen-Chuan Tai, Shih-Ming Yang, "A fast method for image noise
263 // estimation using Laplacian operator and adaptive edge detection",
264 // Proc. 3rd International Symposium on Communications, Control and
265 // Signal Processing, 2008, St Julians, Malta.
266 // Inputs:
267 // frame: Pointer to the frame to estimate noise level from.
268 // plane: Index of the plane used for noise estimation. Commonly, 0 for
269 // Y-plane, 1 for U-plane, and 2 for V-plane.
270 // bit_depth: Actual bit-depth instead of the encoding bit-depth of the frame.
271 // Returns:
272 // The estimated noise, or -1.0 if there are too few smooth pixels.
273 double av1_estimate_noise_from_single_plane(const YV12_BUFFER_CONFIG *frame,
274  const int plane,
275  const int bit_depth,
276  const int edge_thresh);
290 void av1_tf_do_filtering_row(struct AV1_COMP *cpi, struct ThreadData *td,
291  int mb_row);
292 
317 void av1_temporal_filter(struct AV1_COMP *cpi,
318  const int filter_frame_lookahead_idx,
319  int gf_frame_index, FRAME_DIFF *frame_diff,
320  YV12_BUFFER_CONFIG *output_frame);
321 
337  const FRAME_DIFF *frame_diff, int q_index,
338  aom_bit_depth_t bit_depth);
339 
341 // Helper function to get `q` used for encoding.
342 int av1_get_q(const struct AV1_COMP *cpi);
343 
344 // Allocates memory for members of TemporalFilterData.
345 // Inputs:
346 // tf_data: Pointer to the structure containing temporal filter related data.
347 // num_pels: Number of pixels in the block across all planes.
348 // is_high_bitdepth: Whether the frame is high-bitdepth or not.
349 // Returns:
350 // Nothing will be returned. But the contents of tf_data will be modified.
351 static AOM_INLINE void tf_alloc_and_reset_data(TemporalFilterData *tf_data,
352  int num_pels,
353  int is_high_bitdepth) {
354  tf_data->tmp_mbmi = (MB_MODE_INFO *)malloc(sizeof(*tf_data->tmp_mbmi));
355  memset(tf_data->tmp_mbmi, 0, sizeof(*tf_data->tmp_mbmi));
356  tf_data->accum =
357  (uint32_t *)aom_memalign(16, num_pels * sizeof(*tf_data->accum));
358  tf_data->count =
359  (uint16_t *)aom_memalign(16, num_pels * sizeof(*tf_data->count));
360  memset(&tf_data->diff, 0, sizeof(tf_data->diff));
361  if (is_high_bitdepth)
362  tf_data->pred = CONVERT_TO_BYTEPTR(
363  aom_memalign(32, num_pels * 2 * sizeof(*tf_data->pred)));
364  else
365  tf_data->pred =
366  (uint8_t *)aom_memalign(32, num_pels * sizeof(*tf_data->pred));
367 }
368 
369 // Setup macroblockd params for temporal filtering process.
370 // Inputs:
371 // mbd: Pointer to the block for filtering.
372 // tf_data: Pointer to the structure containing temporal filter related data.
373 // scale: Scaling factor.
374 // Returns:
375 // Nothing will be returned. Contents of mbd will be modified.
376 static AOM_INLINE void tf_setup_macroblockd(MACROBLOCKD *mbd,
377  TemporalFilterData *tf_data,
378  const struct scale_factors *scale) {
379  mbd->block_ref_scale_factors[0] = scale;
380  mbd->block_ref_scale_factors[1] = scale;
381  mbd->mi = &tf_data->tmp_mbmi;
382  mbd->mi[0]->motion_mode = SIMPLE_TRANSLATION;
383 }
384 
385 // Deallocates the memory allocated for members of TemporalFilterData.
386 // Inputs:
387 // tf_data: Pointer to the structure containing temporal filter related data.
388 // is_high_bitdepth: Whether the frame is high-bitdepth or not.
389 // Returns:
390 // Nothing will be returned.
391 static AOM_INLINE void tf_dealloc_data(TemporalFilterData *tf_data,
392  int is_high_bitdepth) {
393  if (is_high_bitdepth)
394  tf_data->pred = (uint8_t *)CONVERT_TO_SHORTPTR(tf_data->pred);
395  free(tf_data->tmp_mbmi);
396  aom_free(tf_data->accum);
397  aom_free(tf_data->count);
398  aom_free(tf_data->pred);
399 }
400 
401 // Saves the state prior to temporal filter process.
402 // Inputs:
403 // mbd: Pointer to the block for filtering.
404 // input_mbmi: Backup block info to save input state.
405 // input_buffer: Backup buffer pointer to save input state.
406 // num_planes: Number of planes.
407 // Returns:
408 // Nothing will be returned. Contents of input_mbmi and input_buffer will be
409 // modified.
410 static INLINE void tf_save_state(MACROBLOCKD *mbd, MB_MODE_INFO ***input_mbmi,
411  uint8_t **input_buffer, int num_planes) {
412  for (int i = 0; i < num_planes; i++) {
413  input_buffer[i] = mbd->plane[i].pre[0].buf;
414  }
415  *input_mbmi = mbd->mi;
416 }
417 
418 // Restores the initial state after temporal filter process.
419 // Inputs:
420 // mbd: Pointer to the block for filtering.
421 // input_mbmi: Backup block info from where input state is restored.
422 // input_buffer: Backup buffer pointer from where input state is restored.
423 // num_planes: Number of planes.
424 // Returns:
425 // Nothing will be returned. Contents of mbd will be modified.
426 static INLINE void tf_restore_state(MACROBLOCKD *mbd, MB_MODE_INFO **input_mbmi,
427  uint8_t **input_buffer, int num_planes) {
428  for (int i = 0; i < num_planes; i++) {
429  mbd->plane[i].pre[0].buf = input_buffer[i];
430  }
431  mbd->mi = input_mbmi;
432 }
433 
435 #ifdef __cplusplus
436 } // extern "C"
437 #endif
438 
439 #endif // AOM_AV1_ENCODER_TEMPORAL_FILTER_H_
TemporalFilterCtx::q_factor
int q_factor
Definition: temporal_filter.h:141
encoder.h
Declares top-level encoder structures and functions.
TemporalFilterCtx
Parameters related to temporal filtering.
Definition: temporal_filter.h:91
FIRSTPASS_STATS
The stucture of acummulated frame stats in the first pass.
Definition: firstpass.h:41
av1_apply_temporal_filter_c
void av1_apply_temporal_filter_c(const YV12_BUFFER_CONFIG *frame_to_filter, const MACROBLOCKD *mbd, const BLOCK_SIZE block_size, const int mb_row, const int mb_col, const int num_planes, const double *noise_levels, const MV *subblock_mvs, const int *subblock_mses, const int q_factor, const int filter_strength, const uint8_t *pred, uint32_t *accum, uint16_t *count)
Applies temporal filtering. NOTE that there are various optimised versions of this function called wh...
Definition: temporal_filter.c:542
FeatureFlags::byte_alignment
int byte_alignment
Definition: av1_common_int.h:420
TemporalFilterCtx::mb_rows
int mb_rows
Definition: temporal_filter.h:129
macroblock::plane
struct macroblock_plane plane[3]
Each of the encoding plane.
Definition: block.h:788
GF_GROUP
Data related to the current GF/ARF group and the individual frames within the group.
Definition: firstpass.h:344
macroblockd::block_ref_scale_factors
const struct scale_factors * block_ref_scale_factors[2]
Definition: blockd.h:694
av1_check_show_filtered_frame
int av1_check_show_filtered_frame(const YV12_BUFFER_CONFIG *frame, const FRAME_DIFF *frame_diff, int q_index, aom_bit_depth_t bit_depth)
Check whether a filtered frame can be show directly.
AOM_PLANE_Y
#define AOM_PLANE_Y
Definition: aom_image.h:199
MultiThreadInfo
Encoder parameters related to multi-threading.
Definition: encoder.h:1565
PRIMARY_RATE_CONTROL
Primary Rate Control parameters and status.
Definition: ratectrl.h:243
AOM_PLANE_U
#define AOM_PLANE_U
Definition: aom_image.h:200
AV1_PRIMARY::twopass
TWO_PASS twopass
Definition: encoder.h:2483
TEMPORAL_FILTER_INFO::tf_buf
YV12_BUFFER_CONFIG tf_buf[2]
Definition: temporal_filter.h:165
AV1_COMP::td
ThreadData td
Definition: encoder.h:2647
AV1_COMP::gf_frame_index
unsigned char gf_frame_index
Definition: encoder.h:2864
AV1_COMP::compressor_stage
COMPRESSOR_STAGE compressor_stage
Definition: encoder.h:3125
TemporalFilterCtx::filter_frame_idx
int filter_frame_idx
Definition: temporal_filter.h:109
AlgoCfg::arnr_max_frames
int arnr_max_frames
Definition: encoder.h:815
AV1Common::error
struct aom_internal_error_info * error
Definition: av1_common_int.h:763
FeatureFlags::cur_frame_force_integer_mv
bool cur_frame_force_integer_mv
Definition: av1_common_int.h:375
AV1_PRIMARY::gf_group
GF_GROUP gf_group
Definition: encoder.h:2453
macroblockd::bd
int bd
Definition: blockd.h:815
TWO_PASS
Two pass status and control data.
Definition: firstpass.h:412
av1_temporal_filter
void av1_temporal_filter(struct AV1_COMP *cpi, const int filter_frame_lookahead_idx, int gf_frame_index, FRAME_DIFF *frame_diff, YV12_BUFFER_CONFIG *output_frame)
Performs temporal filtering if needed on a source frame. For example to create a filtered alternate r...
PRIMARY_RATE_CONTROL::avg_frame_qindex
int avg_frame_qindex[FRAME_TYPES]
Definition: ratectrl.h:338
AV1_COMP::twopass_frame
TWO_PASS_FRAME twopass_frame
Definition: encoder.h:3274
AV1EncoderConfig
Main encoder configuration data structure.
Definition: encoder.h:894
MultiThreadInfo::num_workers
int num_workers
Definition: encoder.h:1569
AV1_COMP::mt_info
MultiThreadInfo mt_info
Definition: encoder.h:2999
TemporalFilterCtx::num_frames
int num_frames
Definition: temporal_filter.h:99
TemporalFilterCtx::compute_frame_diff
int compute_frame_diff
Definition: temporal_filter.h:113
AV1_COMP
Top level encoder structure.
Definition: encoder.h:2632
AV1Common::height
int height
Definition: av1_common_int.h:781
av1_tf_do_filtering_row
void av1_tf_do_filtering_row(AV1_COMP *cpi, ThreadData *td, int mb_row)
Does temporal filter for a given macroblock row.
Definition: temporal_filter.c:764
TemporalFilterCtx::is_highbitdepth
int is_highbitdepth
Definition: temporal_filter.h:137
MotionVectorSearchParams::search_site_cfg
search_site_config search_site_cfg[SS_CFG_TOTAL][NUM_DISTINCT_SEARCH_METHODS]
Definition: encoder.h:1964
TemporalFilterCtx::num_pels
int num_pels
Definition: temporal_filter.h:125
AV1Common::seq_params
SequenceHeader * seq_params
Definition: av1_common_int.h:981
tf_setup_filtering_buffer
static void tf_setup_filtering_buffer(AV1_COMP *cpi, int filter_frame_lookahead_idx, int gf_frame_index)
Setups the frame buffer for temporal filtering. This fuction determines how many frames will be used ...
Definition: temporal_filter.c:938
AV1_PRIMARY::lookahead
struct lookahead_ctx * lookahead
Definition: encoder.h:2425
AV1_COMP::common
AV1_COMMON common
Definition: encoder.h:2675
TemporalFilterCtx::output_frame
YV12_BUFFER_CONFIG * output_frame
Definition: temporal_filter.h:104
TemporalFilterCtx::mb_cols
int mb_cols
Definition: temporal_filter.h:133
AV1_COMP::mv_search_params
MotionVectorSearchParams mv_search_params
Definition: encoder.h:2838
TEMPORAL_FILTER_INFO
Temporal filter info for a gop.
Definition: temporal_filter.h:154
TEMPORAL_FILTER_INFO::tf_buf_valid
int tf_buf_valid[2]
Definition: temporal_filter.h:189
tf_motion_search
static void tf_motion_search(AV1_COMP *cpi, MACROBLOCK *mb, const YV12_BUFFER_CONFIG *frame_to_filter, const YV12_BUFFER_CONFIG *ref_frame, const BLOCK_SIZE block_size, const int mb_row, const int mb_col, MV *ref_mv, MV *subblock_mvs, int *subblock_mses)
Does motion search for blocks in temporal filtering. This is the first step for temporal filtering....
Definition: temporal_filter.c:85
AOM_CODEC_MEM_ERROR
@ AOM_CODEC_MEM_ERROR
Memory operation failed.
Definition: aom_codec.h:163
macroblock::mv_limits
FullMvLimits mv_limits
Limit for the range of motion vectors.
Definition: block.h:1139
AV1_PRIMARY::p_rc
PRIMARY_RATE_CONTROL p_rc
Definition: encoder.h:2488
MB_MODE_INFO::motion_mode
MOTION_MODE motion_mode
The motion mode used by the inter prediction.
Definition: blockd.h:250
TEMPORAL_FILTER_INFO::frame_diff
FRAME_DIFF frame_diff[2]
Definition: temporal_filter.h:177
AV1_COMP::tf_ctx
TemporalFilterCtx tf_ctx
Definition: encoder.h:2739
MotionVectorSearchParams::find_fractional_mv_step
fractional_mv_step_fp * find_fractional_mv_step
Definition: encoder.h:1957
TEMPORAL_FILTER_INFO::tf_buf_display_index_offset
int tf_buf_display_index_offset[2]
Definition: temporal_filter.h:185
TEMPORAL_FILTER_INFO::tf_buf_gf_index
int tf_buf_gf_index[2]
Definition: temporal_filter.h:181
yv12_buffer_config
YV12 frame buffer data structure.
Definition: yv12config.h:39
macroblock_plane::src
struct buf_2d src
A buffer containing the source frame.
Definition: block.h:117
AV1_COMP::rc
RATE_CONTROL rc
Definition: encoder.h:2813
AV1Common
Top level common structure used by both encoder and decoder.
Definition: av1_common_int.h:755
tf_build_predictor
static void tf_build_predictor(const YV12_BUFFER_CONFIG *ref_frame, const MACROBLOCKD *mbd, const BLOCK_SIZE block_size, const int mb_row, const int mb_col, const int num_planes, const struct scale_factors *scale, const MV *subblock_mvs, uint8_t *pred)
Builds predictor for blocks in temporal filtering. This is the second step for temporal filtering,...
Definition: temporal_filter.c:313
AlgoCfg::arnr_strength
int arnr_strength
Definition: encoder.h:820
AV1EncoderConfig::algo_cfg
AlgoCfg algo_cfg
Definition: encoder.h:906
tf_do_filtering
static void tf_do_filtering(AV1_COMP *cpi)
Does temporal filter for a given frame.
Definition: temporal_filter.c:896
av1_lookahead_peek
struct lookahead_entry * av1_lookahead_peek(struct lookahead_ctx *ctx, int index, COMPRESSOR_STAGE stage)
Get a future source buffer to encode.
AV1_COMP::ppi
AV1_PRIMARY * ppi
Definition: encoder.h:2636
MB_MODE_INFO
Stores the prediction/txfm mode of the current coding block.
Definition: blockd.h:222
TEMPORAL_FILTER_INFO::tf_buf_second_arf
YV12_BUFFER_CONFIG tf_buf_second_arf
Definition: temporal_filter.h:173
macroblockd
Variables related to current coding block.
Definition: blockd.h:577
macroblock::e_mbd
MACROBLOCKD e_mbd
Decoder's view of current coding block.
Definition: block.h:796
av1_lookahead_depth
unsigned int av1_lookahead_depth(struct lookahead_ctx *ctx, COMPRESSOR_STAGE stage)
Get the number of frames currently in the lookahead queue.
TemporalFilterCtx::noise_levels
double noise_levels[MAX_MB_PLANE]
Definition: temporal_filter.h:121
TEMPORAL_FILTER_INFO::is_temporal_filter_on
int is_temporal_filter_on
Definition: temporal_filter.h:160
TWO_PASS_FRAME
Frame level Two pass status and control data.
Definition: firstpass.h:455
AV1Common::width
int width
Definition: av1_common_int.h:780
AV1_COMP::oxcf
AV1EncoderConfig oxcf
Definition: encoder.h:2680
AV1_PRIMARY::fn_ptr
aom_variance_fn_ptr_t fn_ptr[BLOCK_SIZES_ALL]
Definition: encoder.h:2530
TemporalFilterCtx::sf
struct scale_factors sf
Definition: temporal_filter.h:117
macroblockd::plane
struct macroblockd_plane plane[3]
Definition: blockd.h:613
aom_bit_depth_t
enum aom_bit_depth aom_bit_depth_t
Bit depth for codecThis enumeration determines the bit depth of the codec.
tf_normalize_filtered_frame
static void tf_normalize_filtered_frame(const MACROBLOCKD *mbd, const BLOCK_SIZE block_size, const int mb_row, const int mb_col, const int num_planes, const uint32_t *accum, const uint16_t *count, YV12_BUFFER_CONFIG *result_buffer)
Normalizes the accumulated filtering result to produce the filtered frame.
Definition: temporal_filter.c:716
AV1Common::features
FeatureFlags features
Definition: av1_common_int.h:910
TemporalFilterCtx::frames
YV12_BUFFER_CONFIG * frames[MAX_LAG_BUFFERS]
Definition: temporal_filter.h:95
AV1_COMP::frame_info
FRAME_INFO frame_info
Definition: encoder.h:2897
AV1Common::mi_params
CommonModeInfoParams mi_params
Definition: av1_common_int.h:915
macroblock
Encoder's parameters related to the current coding block.
Definition: block.h:778
av1_gop_check_forward_keyframe
int av1_gop_check_forward_keyframe(const GF_GROUP *gf_group, int gf_frame_index)
Check whether a frame in the GOP is a forward key frame.
macroblockd::mi
MB_MODE_INFO ** mi
Definition: blockd.h:624
RATE_CONTROL::frames_to_key
int frames_to_key
Definition: ratectrl.h:172