Coverage Report

Created: 2024-09-06 07:53

/src/libvpx/vp9/encoder/vp9_encoder.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3
 *
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
6
 *  tree. An additional intellectual property rights grant can be found
7
 *  in the file PATENTS.  All contributing project authors may
8
 *  be found in the AUTHORS file in the root of the source tree.
9
 */
10
11
#ifndef VPX_VP9_ENCODER_VP9_ENCODER_H_
12
#define VPX_VP9_ENCODER_VP9_ENCODER_H_
13
14
#include <stdio.h>
15
16
#include "./vpx_config.h"
17
#include "./vpx_dsp_rtcd.h"
18
#include "vpx/internal/vpx_codec_internal.h"
19
#include "vpx/vpx_ext_ratectrl.h"
20
#include "vpx/vp8cx.h"
21
#include "vpx/vpx_tpl.h"
22
#if CONFIG_INTERNAL_STATS
23
#include "vpx_dsp/ssim.h"
24
#endif
25
#include "vpx_dsp/variance.h"
26
#include "vpx_dsp/psnr.h"
27
#include "vpx_ports/system_state.h"
28
#include "vpx_util/vpx_pthread.h"
29
#include "vpx_util/vpx_thread.h"
30
#include "vpx_util/vpx_timestamp.h"
31
32
#include "vp9/common/vp9_alloccommon.h"
33
#include "vp9/common/vp9_ppflags.h"
34
#include "vp9/common/vp9_entropymode.h"
35
#include "vp9/common/vp9_thread_common.h"
36
#include "vp9/common/vp9_onyxc_int.h"
37
38
#if !CONFIG_REALTIME_ONLY
39
#include "vp9/encoder/vp9_alt_ref_aq.h"
40
#endif
41
#include "vp9/encoder/vp9_aq_cyclicrefresh.h"
42
#include "vp9/encoder/vp9_context_tree.h"
43
#include "vp9/encoder/vp9_encodemb.h"
44
#include "vp9/encoder/vp9_ethread.h"
45
#include "vp9/encoder/vp9_ext_ratectrl.h"
46
#include "vp9/encoder/vp9_firstpass.h"
47
#include "vp9/encoder/vp9_job_queue.h"
48
#include "vp9/encoder/vp9_lookahead.h"
49
#include "vp9/encoder/vp9_mbgraph.h"
50
#include "vp9/encoder/vp9_mcomp.h"
51
#include "vp9/encoder/vp9_noise_estimate.h"
52
#include "vp9/encoder/vp9_quantize.h"
53
#include "vp9/encoder/vp9_ratectrl.h"
54
#include "vp9/encoder/vp9_rd.h"
55
#include "vp9/encoder/vp9_speed_features.h"
56
#include "vp9/encoder/vp9_svc_layercontext.h"
57
#include "vp9/encoder/vp9_tokenize.h"
58
59
#if CONFIG_VP9_TEMPORAL_DENOISING
60
#include "vp9/encoder/vp9_denoiser.h"
61
#endif
62
63
#ifdef __cplusplus
64
extern "C" {
65
#endif
66
67
// vp9 uses 10,000,000 ticks/second as time stamp
68
92.2k
#define TICKS_PER_SEC 10000000
69
70
typedef struct {
71
  int nmvjointcost[MV_JOINTS];
72
  int nmvcosts[2][MV_VALS];
73
  int nmvcosts_hp[2][MV_VALS];
74
75
  vpx_prob segment_pred_probs[PREDICTION_PROBS];
76
77
  unsigned char *last_frame_seg_map_copy;
78
79
  // 0 = Intra, Last, GF, ARF
80
  signed char last_ref_lf_deltas[MAX_REF_LF_DELTAS];
81
  // 0 = ZERO_MV, MV
82
  signed char last_mode_lf_deltas[MAX_MODE_LF_DELTAS];
83
84
  FRAME_CONTEXT fc;
85
} CODING_CONTEXT;
86
87
typedef enum {
88
  // encode_breakout is disabled.
89
  ENCODE_BREAKOUT_DISABLED = 0,
90
  // encode_breakout is enabled.
91
  ENCODE_BREAKOUT_ENABLED = 1,
92
  // encode_breakout is enabled with small max_thresh limit.
93
  ENCODE_BREAKOUT_LIMITED = 2
94
} ENCODE_BREAKOUT_TYPE;
95
96
typedef enum {
97
  // Good Quality Fast Encoding. The encoder balances quality with the amount of
98
  // time it takes to encode the output. Speed setting controls how fast.
99
  GOOD,
100
101
  // The encoder places priority on the quality of the output over encoding
102
  // speed. The output is compressed at the highest possible quality. This
103
  // option takes the longest amount of time to encode. Speed setting ignored.
104
  BEST,
105
106
  // Realtime/Live Encoding. This mode is optimized for realtime encoding (for
107
  // example, capturing a television signal or feed from a live camera). Speed
108
  // setting controls how fast.
109
  REALTIME
110
} MODE;
111
112
typedef enum {
113
  FRAMEFLAGS_KEY = 1 << 0,
114
  FRAMEFLAGS_GOLDEN = 1 << 1,
115
  FRAMEFLAGS_ALTREF = 1 << 2,
116
} FRAMETYPE_FLAGS;
117
118
typedef enum {
119
  NO_AQ = 0,
120
  VARIANCE_AQ = 1,
121
  COMPLEXITY_AQ = 2,
122
  CYCLIC_REFRESH_AQ = 3,
123
  EQUATOR360_AQ = 4,
124
  PERCEPTUAL_AQ = 5,
125
  PSNR_AQ = 6,
126
  // AQ based on lookahead temporal
127
  // variance (only valid for altref frames)
128
  LOOKAHEAD_AQ = 7,
129
  AQ_MODE_COUNT  // This should always be the last member of the enum
130
} AQ_MODE;
131
132
typedef enum {
133
  RESIZE_NONE = 0,    // No frame resizing allowed (except for SVC).
134
  RESIZE_FIXED = 1,   // All frames are coded at the specified dimension.
135
  RESIZE_DYNAMIC = 2  // Coded size of each frame is determined by the codec.
136
} RESIZE_TYPE;
137
138
typedef enum {
139
  kInvalid = 0,
140
  kLowSadLowSumdiff = 1,
141
  kLowSadHighSumdiff = 2,
142
  kHighSadLowSumdiff = 3,
143
  kHighSadHighSumdiff = 4,
144
  kLowVarHighSumdiff = 5,
145
  kVeryHighSad = 6,
146
} CONTENT_STATE_SB;
147
148
typedef enum {
149
  LOOPFILTER_ALL = 0,
150
  LOOPFILTER_REFERENCE = 1,  // Disable loopfilter on non reference frames.
151
  NO_LOOPFILTER = 2,         // Disable loopfilter on all frames.
152
} LOOPFILTER_CONTROL;
153
154
typedef struct VP9EncoderConfig {
155
  BITSTREAM_PROFILE profile;
156
  vpx_bit_depth_t bit_depth;     // Codec bit-depth.
157
  int width;                     // width of data passed to the compressor
158
  int height;                    // height of data passed to the compressor
159
  unsigned int input_bit_depth;  // Input bit depth.
160
  double init_framerate;         // set to passed in framerate
161
  vpx_rational_t g_timebase;  // equivalent to g_timebase in vpx_codec_enc_cfg_t
162
  vpx_rational64_t g_timebase_in_ts;  // g_timebase * TICKS_PER_SEC
163
164
  int64_t target_bandwidth;  // bandwidth to be used in bits per second
165
166
  int noise_sensitivity;  // pre processing blur: recommendation 0
167
  int sharpness;          // sharpening output: recommendation 0:
168
  int speed;
169
  // maximum allowed bitrate for any intra frame in % of bitrate target.
170
  unsigned int rc_max_intra_bitrate_pct;
171
  // maximum allowed bitrate for any inter frame in % of bitrate target.
172
  unsigned int rc_max_inter_bitrate_pct;
173
  // percent of rate boost for golden frame in CBR mode.
174
  unsigned int gf_cbr_boost_pct;
175
176
  MODE mode;
177
  int pass;
178
179
  // Key Framing Operations
180
  int auto_key;  // autodetect cut scenes and set the keyframes
181
  int key_freq;  // maximum distance to key frame.
182
183
  int lag_in_frames;  // how many frames lag before we start encoding
184
185
  // ----------------------------------------------------------------
186
  // DATARATE CONTROL OPTIONS
187
188
  // vbr, cbr, constrained quality or constant quality
189
  enum vpx_rc_mode rc_mode;
190
191
  // buffer targeting aggressiveness
192
  int under_shoot_pct;
193
  int over_shoot_pct;
194
195
  // buffering parameters
196
  int64_t starting_buffer_level_ms;
197
  int64_t optimal_buffer_level_ms;
198
  int64_t maximum_buffer_size_ms;
199
200
  // Frame drop threshold.
201
  int drop_frames_water_mark;
202
203
  // controlling quality
204
  int fixed_q;
205
  int worst_allowed_q;
206
  int best_allowed_q;
207
  int cq_level;
208
  AQ_MODE aq_mode;  // Adaptive Quantization mode
209
210
  // Special handling of Adaptive Quantization for AltRef frames
211
  int alt_ref_aq;
212
213
  // Internal frame size scaling.
214
  RESIZE_TYPE resize_mode;
215
  int scaled_frame_width;
216
  int scaled_frame_height;
217
218
  // Enable feature to reduce the frame quantization every x frames.
219
  int frame_periodic_boost;
220
221
  // two pass datarate control
222
  int two_pass_vbrbias;  // two pass datarate control tweaks
223
  int two_pass_vbrmin_section;
224
  int two_pass_vbrmax_section;
225
  int vbr_corpus_complexity;  // 0 indicates corpus vbr disabled
226
  // END DATARATE CONTROL OPTIONS
227
  // ----------------------------------------------------------------
228
229
  // Spatial and temporal scalability.
230
  int ss_number_layers;  // Number of spatial layers.
231
  int ts_number_layers;  // Number of temporal layers.
232
  // Bitrate allocation for spatial layers.
233
  int layer_target_bitrate[VPX_MAX_LAYERS];
234
  int ss_target_bitrate[VPX_SS_MAX_LAYERS];
235
  int ss_enable_auto_arf[VPX_SS_MAX_LAYERS];
236
  // Bitrate allocation (CBR mode) and framerate factor, for temporal layers.
237
  int ts_rate_decimator[VPX_TS_MAX_LAYERS];
238
239
  int enable_auto_arf;
240
241
  int encode_breakout;  // early breakout : for video conf recommend 800
242
243
  /* Bitfield defining the error resiliency features to enable.
244
   * Can provide decodable frames after losses in previous
245
   * frames and decodable partitions after losses in the same frame.
246
   */
247
  unsigned int error_resilient_mode;
248
249
  /* Bitfield defining the parallel decoding mode where the
250
   * decoding in successive frames may be conducted in parallel
251
   * just by decoding the frame headers.
252
   */
253
  unsigned int frame_parallel_decoding_mode;
254
255
  int arnr_max_frames;
256
  int arnr_strength;
257
258
  int min_gf_interval;
259
  int max_gf_interval;
260
261
  int tile_columns;
262
  int tile_rows;
263
264
  int enable_tpl_model;
265
266
  int enable_keyframe_filtering;
267
268
  int max_threads;
269
270
  unsigned int target_level;
271
272
  vpx_fixed_buf_t two_pass_stats_in;
273
274
  vp8e_tuning tuning;
275
  vp9e_tune_content content;
276
#if CONFIG_VP9_HIGHBITDEPTH
277
  int use_highbitdepth;
278
#endif
279
  vpx_color_space_t color_space;
280
  vpx_color_range_t color_range;
281
  int render_width;
282
  int render_height;
283
  VP9E_TEMPORAL_LAYERING_MODE temporal_layering_mode;
284
285
  int row_mt;
286
  unsigned int motion_vector_unit_test;
287
  int delta_q_uv;
288
  int use_simple_encode_api;  // Use SimpleEncode APIs or not
289
} VP9EncoderConfig;
290
291
45.2k
static INLINE int is_lossless_requested(const VP9EncoderConfig *cfg) {
292
45.2k
  return cfg->best_allowed_q == 0 && cfg->worst_allowed_q == 0;
293
45.2k
}
Unexecuted instantiation: vp9_cx_iface.c:is_lossless_requested
Unexecuted instantiation: vp9_firstpass.c:is_lossless_requested
Unexecuted instantiation: vp9_mcomp.c:is_lossless_requested
Unexecuted instantiation: vp9_encoder.c:is_lossless_requested
Unexecuted instantiation: vp9_picklpf.c:is_lossless_requested
Unexecuted instantiation: vp9_quantize.c:is_lossless_requested
Unexecuted instantiation: vp9_ratectrl.c:is_lossless_requested
Unexecuted instantiation: vp9_rd.c:is_lossless_requested
Unexecuted instantiation: vp9_segmentation.c:is_lossless_requested
vp9_speed_features.c:is_lossless_requested
Line
Count
Source
291
45.2k
static INLINE int is_lossless_requested(const VP9EncoderConfig *cfg) {
292
45.2k
  return cfg->best_allowed_q == 0 && cfg->worst_allowed_q == 0;
293
45.2k
}
Unexecuted instantiation: vp9_svc_layercontext.c:is_lossless_requested
Unexecuted instantiation: vp9_tokenize.c:is_lossless_requested
Unexecuted instantiation: vp9_aq_variance.c:is_lossless_requested
Unexecuted instantiation: vp9_aq_360.c:is_lossless_requested
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:is_lossless_requested
Unexecuted instantiation: vp9_aq_complexity.c:is_lossless_requested
Unexecuted instantiation: vp9_alt_ref_aq.c:is_lossless_requested
Unexecuted instantiation: vp9_skin_detection.c:is_lossless_requested
Unexecuted instantiation: vp9_noise_estimate.c:is_lossless_requested
Unexecuted instantiation: vp9_ext_ratectrl.c:is_lossless_requested
Unexecuted instantiation: vp9_temporal_filter.c:is_lossless_requested
Unexecuted instantiation: vp9_tpl_model.c:is_lossless_requested
Unexecuted instantiation: vp9_mbgraph.c:is_lossless_requested
Unexecuted instantiation: vp9_bitstream.c:is_lossless_requested
Unexecuted instantiation: vp9_context_tree.c:is_lossless_requested
Unexecuted instantiation: vp9_encodeframe.c:is_lossless_requested
Unexecuted instantiation: vp9_encodemb.c:is_lossless_requested
Unexecuted instantiation: vp9_encodemv.c:is_lossless_requested
Unexecuted instantiation: vp9_ethread.c:is_lossless_requested
Unexecuted instantiation: vp9_frame_scale.c:is_lossless_requested
Unexecuted instantiation: vp9_lookahead.c:is_lossless_requested
Unexecuted instantiation: vp9_multi_thread.c:is_lossless_requested
Unexecuted instantiation: vp9_rdopt.c:is_lossless_requested
Unexecuted instantiation: vp9_pickmode.c:is_lossless_requested
Unexecuted instantiation: temporal_filter_sse4.c:is_lossless_requested
Unexecuted instantiation: highbd_temporal_filter_sse4.c:is_lossless_requested
294
295
typedef struct TplDepStats {
296
  int64_t intra_cost;
297
  int64_t inter_cost;
298
  int64_t mc_flow;
299
  int64_t mc_dep_cost;
300
  int64_t mc_ref_cost;
301
302
  int ref_frame_index;
303
  int_mv mv;
304
} TplDepStats;
305
306
#if CONFIG_NON_GREEDY_MV
307
308
#define ZERO_MV_MODE 0
309
#define NEW_MV_MODE 1
310
#define NEAREST_MV_MODE 2
311
#define NEAR_MV_MODE 3
312
#define MAX_MV_MODE 4
313
#endif
314
315
typedef struct TplDepFrame {
316
  uint8_t is_valid;
317
  TplDepStats *tpl_stats_ptr;
318
  int stride;
319
  int width;
320
  int height;
321
  int mi_rows;
322
  int mi_cols;
323
  int base_qindex;
324
#if CONFIG_NON_GREEDY_MV
325
  int lambda;
326
  int *mv_mode_arr[3];
327
  double *rd_diff_arr[3];
328
#endif
329
} TplDepFrame;
330
331
#define TPL_DEP_COST_SCALE_LOG2 4
332
333
// TODO(jingning) All spatially adaptive variables should go to TileDataEnc.
334
typedef struct TileDataEnc {
335
  TileInfo tile_info;
336
  int thresh_freq_fact[BLOCK_SIZES][MAX_MODES];
337
  int thresh_freq_fact_prev[BLOCK_SIZES][MAX_MODES];
338
  int8_t mode_map[BLOCK_SIZES][MAX_MODES];
339
  FIRSTPASS_DATA fp_data;
340
  VP9RowMTSync row_mt_sync;
341
342
  // Used for adaptive_rd_thresh with row multithreading
343
  int *row_base_thresh_freq_fact;
344
  // The value of sb_rows when row_base_thresh_freq_fact is allocated.
345
  // The row_base_thresh_freq_fact array has sb_rows * BLOCK_SIZES * MAX_MODES
346
  // elements.
347
  int sb_rows;
348
  MV firstpass_top_mv;
349
} TileDataEnc;
350
351
typedef struct RowMTInfo {
352
  JobQueueHandle job_queue_hdl;
353
#if CONFIG_MULTITHREAD
354
  pthread_mutex_t job_mutex;
355
#endif
356
} RowMTInfo;
357
358
typedef struct {
359
  TOKENEXTRA *start;
360
  TOKENEXTRA *stop;
361
  unsigned int count;
362
} TOKENLIST;
363
364
typedef struct MultiThreadHandle {
365
  int allocated_tile_rows;
366
  int allocated_tile_cols;
367
  int allocated_vert_unit_rows;
368
369
  // Frame level params
370
  int num_tile_vert_sbs[MAX_NUM_TILE_ROWS];
371
372
  // Job Queue structure and handles
373
  JobQueue *job_queue;
374
375
  int jobs_per_tile_col;
376
377
  RowMTInfo row_mt_info[MAX_NUM_TILE_COLS];
378
  int thread_id_to_tile_id[MAX_NUM_THREADS];  // Mapping of threads to tiles
379
} MultiThreadHandle;
380
381
typedef struct RD_COUNTS {
382
  vp9_coeff_count coef_counts[TX_SIZES][PLANE_TYPES];
383
  int64_t comp_pred_diff[REFERENCE_MODES];
384
  int64_t filter_diff[SWITCHABLE_FILTER_CONTEXTS];
385
} RD_COUNTS;
386
387
typedef struct ThreadData {
388
  MACROBLOCK mb;
389
  RD_COUNTS rd_counts;
390
  FRAME_COUNTS *counts;
391
392
  PICK_MODE_CONTEXT *leaf_tree;
393
  PC_TREE *pc_tree;
394
  PC_TREE *pc_root;
395
} ThreadData;
396
397
struct EncWorkerData;
398
399
typedef struct ActiveMap {
400
  int enabled;
401
  int update;
402
  unsigned char *map;
403
} ActiveMap;
404
405
typedef enum { Y, U, V, ALL } STAT_TYPE;
406
407
typedef struct IMAGE_STAT {
408
  double stat[ALL + 1];
409
  double worst;
410
} ImageStat;
411
412
// Kf noise filtering currently disabled by default in build.
413
// #define ENABLE_KF_DENOISE 1
414
415
0
#define CPB_WINDOW_SIZE 4
416
0
#define FRAME_WINDOW_SIZE 128
417
0
#define SAMPLE_RATE_GRACE_P 0.015
418
789k
#define VP9_LEVELS 14
419
420
typedef enum {
421
  LEVEL_UNKNOWN = 0,
422
  LEVEL_AUTO = 1,
423
  LEVEL_1 = 10,
424
  LEVEL_1_1 = 11,
425
  LEVEL_2 = 20,
426
  LEVEL_2_1 = 21,
427
  LEVEL_3 = 30,
428
  LEVEL_3_1 = 31,
429
  LEVEL_4 = 40,
430
  LEVEL_4_1 = 41,
431
  LEVEL_5 = 50,
432
  LEVEL_5_1 = 51,
433
  LEVEL_5_2 = 52,
434
  LEVEL_6 = 60,
435
  LEVEL_6_1 = 61,
436
  LEVEL_6_2 = 62,
437
  LEVEL_MAX = 255
438
} VP9_LEVEL;
439
440
typedef struct {
441
  VP9_LEVEL level;
442
  uint64_t max_luma_sample_rate;
443
  uint32_t max_luma_picture_size;
444
  uint32_t max_luma_picture_breadth;
445
  double average_bitrate;  // in kilobits per second
446
  double max_cpb_size;     // in kilobits
447
  double compression_ratio;
448
  uint8_t max_col_tiles;
449
  uint32_t min_altref_distance;
450
  uint8_t max_ref_frame_buffers;
451
} Vp9LevelSpec;
452
453
extern const Vp9LevelSpec vp9_level_defs[VP9_LEVELS];
454
455
typedef struct {
456
  int64_t ts;  // timestamp
457
  uint32_t luma_samples;
458
  uint32_t size;  // in bytes
459
} FrameRecord;
460
461
typedef struct {
462
  FrameRecord buf[FRAME_WINDOW_SIZE];
463
  uint8_t start;
464
  uint8_t len;
465
} FrameWindowBuffer;
466
467
typedef struct {
468
  uint8_t seen_first_altref;
469
  uint32_t frames_since_last_altref;
470
  uint64_t total_compressed_size;
471
  uint64_t total_uncompressed_size;
472
  double time_encoded;  // in seconds
473
  FrameWindowBuffer frame_window_buffer;
474
  int ref_refresh_map;
475
} Vp9LevelStats;
476
477
typedef struct {
478
  Vp9LevelStats level_stats;
479
  Vp9LevelSpec level_spec;
480
} Vp9LevelInfo;
481
482
typedef enum {
483
  BITRATE_TOO_LARGE = 0,
484
  LUMA_PIC_SIZE_TOO_LARGE,
485
  LUMA_PIC_BREADTH_TOO_LARGE,
486
  LUMA_SAMPLE_RATE_TOO_LARGE,
487
  CPB_TOO_LARGE,
488
  COMPRESSION_RATIO_TOO_SMALL,
489
  TOO_MANY_COLUMN_TILE,
490
  ALTREF_DIST_TOO_SMALL,
491
  TOO_MANY_REF_BUFFER,
492
  TARGET_LEVEL_FAIL_IDS
493
} TARGET_LEVEL_FAIL_ID;
494
495
typedef struct {
496
  int8_t level_index;
497
  uint8_t fail_flag;
498
  int max_frame_size;   // in bits
499
  double max_cpb_size;  // in bits
500
} LevelConstraint;
501
502
typedef struct ARNRFilterData {
503
  YV12_BUFFER_CONFIG *frames[MAX_LAG_BUFFERS];
504
  int strength;
505
  int frame_count;
506
  int alt_ref_index;
507
  struct scale_factors sf;
508
  YV12_BUFFER_CONFIG *dst;
509
} ARNRFilterData;
510
511
typedef struct EncFrameBuf {
512
  int mem_valid;
513
  int released;
514
  YV12_BUFFER_CONFIG frame;
515
} EncFrameBuf;
516
517
// Maximum operating frame buffer size needed for a GOP using ARF reference.
518
// This is used to allocate the memory for TPL stats for a GOP.
519
346k
#define MAX_ARF_GOP_SIZE (2 * MAX_LAG_BUFFERS)
520
0
#define MAX_KMEANS_GROUPS 8
521
522
typedef struct KMEANS_DATA {
523
  double value;
524
  int pos;
525
  int group_idx;
526
} KMEANS_DATA;
527
528
#if CONFIG_RATE_CTRL
529
typedef struct PARTITION_INFO {
530
  int row;           // row pixel offset of current 4x4 block
531
  int column;        // column pixel offset of current 4x4 block
532
  int row_start;     // row pixel offset of the start of the prediction block
533
  int column_start;  // column pixel offset of the start of the prediction block
534
  int width;         // prediction block width
535
  int height;        // prediction block height
536
} PARTITION_INFO;
537
538
typedef struct MOTION_VECTOR_INFO {
539
  MV_REFERENCE_FRAME ref_frame[2];
540
  int_mv mv[2];
541
} MOTION_VECTOR_INFO;
542
543
typedef struct GOP_COMMAND {
544
  int use;  // use this command to set gop or not. If not, use vp9's decision.
545
  int show_frame_count;
546
  int use_alt_ref;
547
} GOP_COMMAND;
548
549
static INLINE void gop_command_on(GOP_COMMAND *gop_command,
550
                                  int show_frame_count, int use_alt_ref) {
551
  gop_command->use = 1;
552
  gop_command->show_frame_count = show_frame_count;
553
  gop_command->use_alt_ref = use_alt_ref;
554
}
555
556
static INLINE void gop_command_off(GOP_COMMAND *gop_command) {
557
  gop_command->use = 0;
558
  gop_command->show_frame_count = 0;
559
  gop_command->use_alt_ref = 0;
560
}
561
562
static INLINE int gop_command_coding_frame_count(
563
    const GOP_COMMAND *gop_command) {
564
  if (gop_command->use == 0) {
565
    assert(0);
566
    return -1;
567
  }
568
  return gop_command->show_frame_count + gop_command->use_alt_ref;
569
}
570
571
// TODO(angiebird): See if we can merge this one with FrameType in
572
// simple_encode.h
573
typedef enum ENCODE_FRAME_TYPE {
574
  ENCODE_FRAME_TYPE_KEY,
575
  ENCODE_FRAME_TYPE_INTER,
576
  ENCODE_FRAME_TYPE_ALTREF,
577
  ENCODE_FRAME_TYPE_OVERLAY,
578
  ENCODE_FRAME_TYPE_GOLDEN,
579
  ENCODE_FRAME_TYPES,
580
} ENCODE_FRAME_TYPE;
581
582
// TODO(angiebird): Merge this function with get_frame_type_from_update_type()
583
static INLINE ENCODE_FRAME_TYPE
584
get_encode_frame_type(FRAME_UPDATE_TYPE update_type) {
585
  switch (update_type) {
586
    case KF_UPDATE: return ENCODE_FRAME_TYPE_KEY;
587
    case ARF_UPDATE: return ENCODE_FRAME_TYPE_ALTREF;
588
    case GF_UPDATE: return ENCODE_FRAME_TYPE_GOLDEN;
589
    case OVERLAY_UPDATE: return ENCODE_FRAME_TYPE_OVERLAY;
590
    case LF_UPDATE: return ENCODE_FRAME_TYPE_INTER;
591
    default:
592
      fprintf(stderr, "Unsupported update_type %d\n", update_type);
593
      abort();
594
      return ENCODE_FRAME_TYPE_INTER;
595
  }
596
}
597
598
typedef struct RATE_QSTEP_MODEL {
599
  // The rq model predicts the bit usage as follows.
600
  // rate = bias - ratio * log2(q_step)
601
  int ready;
602
  double bias;
603
  double ratio;
604
} RATE_QSTEP_MODEL;
605
606
typedef struct ENCODE_COMMAND {
607
  int use_external_quantize_index;
608
  int external_quantize_index;
609
610
  int use_external_target_frame_bits;
611
  int target_frame_bits;
612
  double target_frame_bits_error_percent;
613
614
  GOP_COMMAND gop_command;
615
} ENCODE_COMMAND;
616
617
static INLINE void encode_command_set_gop_command(
618
    ENCODE_COMMAND *encode_command, GOP_COMMAND gop_command) {
619
  encode_command->gop_command = gop_command;
620
}
621
622
static INLINE void encode_command_set_external_quantize_index(
623
    ENCODE_COMMAND *encode_command, int quantize_index) {
624
  encode_command->use_external_quantize_index = 1;
625
  encode_command->external_quantize_index = quantize_index;
626
}
627
628
static INLINE void encode_command_reset_external_quantize_index(
629
    ENCODE_COMMAND *encode_command) {
630
  encode_command->use_external_quantize_index = 0;
631
  encode_command->external_quantize_index = -1;
632
}
633
634
static INLINE void encode_command_set_target_frame_bits(
635
    ENCODE_COMMAND *encode_command, int target_frame_bits,
636
    double target_frame_bits_error_percent) {
637
  encode_command->use_external_target_frame_bits = 1;
638
  encode_command->target_frame_bits = target_frame_bits;
639
  encode_command->target_frame_bits_error_percent =
640
      target_frame_bits_error_percent;
641
}
642
643
static INLINE void encode_command_reset_target_frame_bits(
644
    ENCODE_COMMAND *encode_command) {
645
  encode_command->use_external_target_frame_bits = 0;
646
  encode_command->target_frame_bits = -1;
647
  encode_command->target_frame_bits_error_percent = 0;
648
}
649
650
static INLINE void encode_command_init(ENCODE_COMMAND *encode_command) {
651
  vp9_zero(*encode_command);
652
  encode_command_reset_external_quantize_index(encode_command);
653
  encode_command_reset_target_frame_bits(encode_command);
654
  gop_command_off(&encode_command->gop_command);
655
}
656
657
// Returns number of units in size of 4, if not multiple not a multiple of 4,
658
// round it up. For example, size is 7, return 2.
659
static INLINE int get_num_unit_4x4(int size) { return (size + 3) >> 2; }
660
// Returns number of units in size of 16, if not multiple not a multiple of 16,
661
// round it up. For example, size is 17, return 2.
662
static INLINE int get_num_unit_16x16(int size) { return (size + 15) >> 4; }
663
#endif  // CONFIG_RATE_CTRL
664
665
#if CONFIG_COLLECT_COMPONENT_TIMING
666
#include "vpx_ports/vpx_timer.h"
667
// Adjust the following to add new components.
668
typedef enum {
669
  vp9_get_compressed_data_time,
670
  vp9_temporal_filter_time,
671
  vp9_rc_get_second_pass_params_time,
672
  setup_tpl_stats_time,
673
  Pass2Encode_time,
674
675
  encode_with_recode_loop_time,
676
  loopfilter_frame_time,
677
  vp9_pack_bitstream_time,
678
679
  encode_frame_internal_time,
680
  rd_pick_partition_time,
681
  rd_pick_sb_modes_time,
682
  encode_sb_time,
683
684
  vp9_rd_pick_inter_mode_sb_time,
685
  vp9_rd_pick_inter_mode_sub8x8_time,
686
687
  intra_mode_search_time,
688
  handle_inter_mode_time,
689
  single_motion_search_time,
690
  joint_motion_search_time,
691
  interp_filter_time,
692
693
  kTimingComponents,
694
} TIMING_COMPONENT;
695
696
static INLINE char const *get_component_name(int index) {
697
  switch (index) {
698
    case vp9_get_compressed_data_time: return "vp9_get_compressed_data_time";
699
    case vp9_temporal_filter_time: return "vp9_temporal_filter_time";
700
    case vp9_rc_get_second_pass_params_time:
701
      return "vp9_rc_get_second_pass_params_time";
702
    case setup_tpl_stats_time: return "setup_tpl_stats_time";
703
    case Pass2Encode_time: return "Pass2Encode_time";
704
705
    case encode_with_recode_loop_time: return "encode_with_recode_loop_time";
706
    case loopfilter_frame_time: return "loopfilter_frame_time";
707
    case vp9_pack_bitstream_time: return "vp9_pack_bitstream_time";
708
709
    case encode_frame_internal_time: return "encode_frame_internal_time";
710
    case rd_pick_partition_time: return "rd_pick_partition_time";
711
    case rd_pick_sb_modes_time: return "rd_pick_sb_modes_time";
712
    case encode_sb_time: return "encode_sb_time";
713
714
    case vp9_rd_pick_inter_mode_sb_time:
715
      return "vp9_rd_pick_inter_mode_sb_time";
716
    case vp9_rd_pick_inter_mode_sub8x8_time:
717
      return "vp9_rd_pick_inter_mode_sub8x8_time";
718
719
    case intra_mode_search_time: return "intra_mode_search_time";
720
    case handle_inter_mode_time: return "handle_inter_mode_time";
721
    case single_motion_search_time: return "single_motion_search_time";
722
    case joint_motion_search_time: return "joint_motion_search_time";
723
    case interp_filter_time: return "interp_filter_time";
724
725
    default: assert(0);
726
  }
727
  return "error";
728
}
729
#endif
730
731
typedef struct VP9_COMP {
732
  FRAME_INFO frame_info;
733
  QUANTS quants;
734
  ThreadData td;
735
  MB_MODE_INFO_EXT *mbmi_ext_base;
736
  DECLARE_ALIGNED(16, int16_t, y_dequant[QINDEX_RANGE][8]);
737
  DECLARE_ALIGNED(16, int16_t, uv_dequant[QINDEX_RANGE][8]);
738
  VP9_COMMON common;
739
  VP9EncoderConfig oxcf;
740
  struct lookahead_ctx *lookahead;
741
  struct lookahead_entry *alt_ref_source;
742
743
  YV12_BUFFER_CONFIG *Source;
744
  YV12_BUFFER_CONFIG *Last_Source;  // NULL for first frame and alt_ref frames
745
  YV12_BUFFER_CONFIG *un_scaled_source;
746
  YV12_BUFFER_CONFIG scaled_source;
747
  YV12_BUFFER_CONFIG *unscaled_last_source;
748
  YV12_BUFFER_CONFIG scaled_last_source;
749
#ifdef ENABLE_KF_DENOISE
750
  YV12_BUFFER_CONFIG raw_unscaled_source;
751
  YV12_BUFFER_CONFIG raw_scaled_source;
752
#endif
753
  YV12_BUFFER_CONFIG *raw_source_frame;
754
755
  BLOCK_SIZE tpl_bsize;
756
  TplDepFrame tpl_stats[MAX_ARF_GOP_SIZE];
757
  // Used to store TPL stats before propagation
758
  VpxTplGopStats tpl_gop_stats;
759
  YV12_BUFFER_CONFIG *tpl_recon_frames[REF_FRAMES];
760
  EncFrameBuf enc_frame_buf[REF_FRAMES];
761
#if CONFIG_MULTITHREAD
762
  pthread_mutex_t kmeans_mutex;
763
#endif
764
  int kmeans_data_arr_alloc;
765
  KMEANS_DATA *kmeans_data_arr;
766
  int kmeans_data_size;
767
  int kmeans_data_stride;
768
  double kmeans_ctr_ls[MAX_KMEANS_GROUPS];
769
  double kmeans_boundary_ls[MAX_KMEANS_GROUPS];
770
  int kmeans_count_ls[MAX_KMEANS_GROUPS];
771
  int kmeans_ctr_num;
772
#if CONFIG_NON_GREEDY_MV
773
  MotionFieldInfo motion_field_info;
774
  int tpl_ready;
775
  int_mv *select_mv_arr;
776
#endif
777
778
  TileDataEnc *tile_data;
779
  int allocated_tiles;  // Keep track of memory allocated for tiles.
780
781
  int scaled_ref_idx[REFS_PER_FRAME];
782
  int lst_fb_idx;
783
  int gld_fb_idx;
784
  int alt_fb_idx;
785
786
  int ref_fb_idx[REF_FRAMES];
787
788
  int refresh_last_frame;
789
  int refresh_golden_frame;
790
  int refresh_alt_ref_frame;
791
792
  int ext_refresh_frame_flags_pending;
793
  int ext_refresh_last_frame;
794
  int ext_refresh_golden_frame;
795
  int ext_refresh_alt_ref_frame;
796
797
  int ext_refresh_frame_context_pending;
798
  int ext_refresh_frame_context;
799
800
  int64_t norm_wiener_variance;
801
  int64_t *mb_wiener_variance;
802
  int mb_wiener_var_rows;
803
  int mb_wiener_var_cols;
804
  double *mi_ssim_rdmult_scaling_factors;
805
806
  YV12_BUFFER_CONFIG last_frame_uf;
807
808
  TOKENEXTRA *tile_tok[4][1 << 6];
809
  TOKENLIST *tplist[4][1 << 6];
810
811
  // Ambient reconstruction err target for force key frames
812
  int64_t ambient_err;
813
814
  RD_CONTROL rd_ctrl;
815
  RD_OPT rd;
816
817
  CODING_CONTEXT coding_context;
818
819
  int *nmvcosts[2];
820
  int *nmvcosts_hp[2];
821
  int *nmvsadcosts[2];
822
  int *nmvsadcosts_hp[2];
823
824
  int64_t last_time_stamp_seen;
825
  int64_t last_end_time_stamp_seen;
826
  int64_t first_time_stamp_ever;
827
828
  RATE_CONTROL rc;
829
  double framerate;
830
831
  int interp_filter_selected[REF_FRAMES][SWITCHABLE];
832
833
  struct vpx_codec_pkt_list *output_pkt_list;
834
835
  MBGRAPH_FRAME_STATS mbgraph_stats[MAX_LAG_BUFFERS];
836
  int mbgraph_n_frames;  // number of frames filled in the above
837
  int static_mb_pct;     // % forced skip mbs by segmentation
838
  int ref_frame_flags;
839
840
  SPEED_FEATURES sf;
841
842
  uint32_t max_mv_magnitude;
843
  int mv_step_param;
844
845
  int allow_comp_inter_inter;
846
847
  // Default value is 1. From first pass stats, encode_breakout may be disabled.
848
  ENCODE_BREAKOUT_TYPE allow_encode_breakout;
849
850
  // Get threshold from external input. A suggested threshold is 800 for HD
851
  // clips, and 300 for < HD clips.
852
  int encode_breakout;
853
854
  uint8_t *segmentation_map;
855
856
  uint8_t *skin_map;
857
858
  // segment threshold for encode breakout
859
  int segment_encode_breakout[MAX_SEGMENTS];
860
861
  CYCLIC_REFRESH *cyclic_refresh;
862
  ActiveMap active_map;
863
864
  fractional_mv_step_fp *find_fractional_mv_step;
865
  struct scale_factors me_sf;
866
  vp9_diamond_search_fn_t diamond_search_sad;
867
  vp9_variance_fn_ptr_t fn_ptr[BLOCK_SIZES];
868
  uint64_t time_receive_data;
869
  uint64_t time_compress_data;
870
  uint64_t time_pick_lpf;
871
  uint64_t time_encode_sb_row;
872
873
  TWO_PASS twopass;
874
875
  // Force recalculation of segment_ids for each mode info
876
  uint8_t force_update_segmentation;
877
878
  YV12_BUFFER_CONFIG tf_buffer;
879
880
  // class responsible for adaptive
881
  // quantization of altref frames
882
  struct ALT_REF_AQ *alt_ref_aq;
883
884
#if CONFIG_INTERNAL_STATS
885
  unsigned int mode_chosen_counts[MAX_MODES];
886
887
  int count;
888
  uint64_t total_sq_error;
889
  uint64_t total_samples;
890
  ImageStat psnr;
891
892
  uint64_t totalp_sq_error;
893
  uint64_t totalp_samples;
894
  ImageStat psnrp;
895
896
  double total_blockiness;
897
  double worst_blockiness;
898
899
  uint64_t bytes;
900
  double summed_quality;
901
  double summed_weights;
902
  double summedp_quality;
903
  double summedp_weights;
904
  unsigned int tot_recode_hits;
905
  double worst_ssim;
906
907
  ImageStat ssimg;
908
  ImageStat fastssim;
909
  ImageStat psnrhvs;
910
911
  int b_calculate_ssimg;
912
  int b_calculate_blockiness;
913
914
  int b_calculate_consistency;
915
916
  double total_inconsistency;
917
  double worst_consistency;
918
  Ssimv *ssim_vars;
919
  Metrics metrics;
920
#endif
921
  int b_calculate_psnr;
922
923
  int droppable;
924
925
  int initial_width;
926
  int initial_height;
927
  int initial_mbs;  // Number of MBs in the full-size frame; to be used to
928
                    // normalize the firstpass stats. This will differ from the
929
                    // number of MBs in the current frame when the frame is
930
                    // scaled.
931
932
  int last_coded_width;
933
  int last_coded_height;
934
935
  int use_svc;
936
937
  SVC svc;
938
939
  // Store frame variance info in SOURCE_VAR_BASED_PARTITION search type.
940
  Diff *source_diff_var;
941
  // The threshold used in SOURCE_VAR_BASED_PARTITION search type.
942
  unsigned int source_var_thresh;
943
  int frames_till_next_var_check;
944
945
  int frame_flags;
946
947
  search_site_config ss_cfg;
948
949
  int mbmode_cost[INTRA_MODES];
950
  unsigned int inter_mode_cost[INTER_MODE_CONTEXTS][INTER_MODES];
951
  int intra_uv_mode_cost[FRAME_TYPES][INTRA_MODES][INTRA_MODES];
952
  int y_mode_costs[INTRA_MODES][INTRA_MODES][INTRA_MODES];
953
  int switchable_interp_costs[SWITCHABLE_FILTER_CONTEXTS][SWITCHABLE_FILTERS];
954
  int partition_cost[PARTITION_CONTEXTS][PARTITION_TYPES];
955
  // Indices are:  max_tx_size-1,  tx_size_ctx,    tx_size
956
  int tx_size_cost[TX_SIZES - 1][TX_SIZE_CONTEXTS][TX_SIZES];
957
958
#if CONFIG_VP9_TEMPORAL_DENOISING
959
  VP9_DENOISER denoiser;
960
#endif
961
962
  int resize_pending;
963
  RESIZE_STATE resize_state;
964
  int external_resize;
965
  int resize_scale_num;
966
  int resize_scale_den;
967
  int resize_avg_qp;
968
  int resize_buffer_underflow;
969
  int resize_count;
970
971
  int use_skin_detection;
972
973
  int target_level;
974
975
  NOISE_ESTIMATE noise_estimate;
976
977
  // Count on how many consecutive times a block uses small/zeromv for encoding.
978
  uint8_t *consec_zero_mv;
979
980
  // VAR_BASED_PARTITION thresholds
981
  // 0 - threshold_64x64; 1 - threshold_32x32;
982
  // 2 - threshold_16x16; 3 - vbp_threshold_8x8;
983
  int64_t vbp_thresholds[4];
984
  int64_t vbp_threshold_minmax;
985
  int64_t vbp_threshold_sad;
986
  // Threshold used for partition copy
987
  int64_t vbp_threshold_copy;
988
  BLOCK_SIZE vbp_bsize_min;
989
990
  // Multi-threading
991
  int num_workers;
992
  VPxWorker *workers;
993
  struct EncWorkerData *tile_thr_data;
994
  VP9LfSync lf_row_sync;
995
  struct VP9BitstreamWorkerData *vp9_bitstream_worker_data;
996
997
  int keep_level_stats;
998
  Vp9LevelInfo level_info;
999
  MultiThreadHandle multi_thread_ctxt;
1000
  void (*row_mt_sync_read_ptr)(VP9RowMTSync *const, int, int);
1001
  void (*row_mt_sync_write_ptr)(VP9RowMTSync *const, int, int, const int);
1002
  ARNRFilterData arnr_filter_data;
1003
1004
  int row_mt;
1005
  unsigned int row_mt_bit_exact;
1006
1007
  // Previous Partition Info
1008
  BLOCK_SIZE *prev_partition;
1009
  int8_t *prev_segment_id;
1010
  // Used to save the status of whether a block has a low variance in
1011
  // choose_partitioning. 0 for 64x64, 1~2 for 64x32, 3~4 for 32x64, 5~8 for
1012
  // 32x32, 9~24 for 16x16.
1013
  // This is for the last frame and is copied to the current frame
1014
  // when partition copy happens.
1015
  uint8_t *prev_variance_low;
1016
  uint8_t *copied_frame_cnt;
1017
  uint8_t max_copied_frame;
1018
  // If the last frame is dropped, we don't copy partition.
1019
  uint8_t last_frame_dropped;
1020
1021
  // For each superblock: keeps track of the last time (in frame distance) the
1022
  // the superblock did not have low source sad.
1023
  uint8_t *content_state_sb_fd;
1024
1025
  int compute_source_sad_onepass;
1026
1027
  int compute_frame_low_motion_onepass;
1028
1029
  LevelConstraint level_constraint;
1030
1031
  uint8_t *count_arf_frame_usage;
1032
  uint8_t *count_lastgolden_frame_usage;
1033
1034
  int multi_layer_arf;
1035
  vpx_roi_map_t roi;
1036
1037
  LOOPFILTER_CONTROL loopfilter_ctrl;
1038
#if CONFIG_RATE_CTRL
1039
  ENCODE_COMMAND encode_command;
1040
  PARTITION_INFO *partition_info;
1041
  MOTION_VECTOR_INFO *motion_vector_info;
1042
  MOTION_VECTOR_INFO *fp_motion_vector_info;
1043
  TplDepStats *tpl_stats_info;
1044
1045
  RATE_QSTEP_MODEL rq_model[ENCODE_FRAME_TYPES];
1046
#endif
1047
  EXT_RATECTRL ext_ratectrl;
1048
1049
  int fixed_qp_onepass;
1050
1051
  // Flag to keep track of dynamic change in deadline mode
1052
  // (good/best/realtime).
1053
  MODE deadline_mode_previous_frame;
1054
1055
  // Flag to disable scene detection when rtc rate control library is used.
1056
  int disable_scene_detection_rtc_ratectrl;
1057
1058
#if CONFIG_COLLECT_COMPONENT_TIMING
1059
  /*!
1060
   * component_time[] are initialized to zero while encoder starts.
1061
   */
1062
  uint64_t component_time[kTimingComponents];
1063
  /*!
1064
   * Stores timing for individual components between calls of start_timing()
1065
   * and end_timing().
1066
   */
1067
  struct vpx_usec_timer component_timer[kTimingComponents];
1068
  /*!
1069
   * frame_component_time[] are initialized to zero at beginning of each frame.
1070
   */
1071
  uint64_t frame_component_time[kTimingComponents];
1072
#endif
1073
} VP9_COMP;
1074
1075
#if CONFIG_RATE_CTRL
1076
// Allocates memory for the partition information.
1077
// The unit size is each 4x4 block.
1078
// Only called once in vp9_create_compressor().
1079
static INLINE void partition_info_init(struct VP9_COMP *cpi) {
1080
  VP9_COMMON *const cm = &cpi->common;
1081
  const int unit_width = get_num_unit_4x4(cpi->frame_info.frame_width);
1082
  const int unit_height = get_num_unit_4x4(cpi->frame_info.frame_height);
1083
  CHECK_MEM_ERROR(&cm->error, cpi->partition_info,
1084
                  (PARTITION_INFO *)vpx_calloc(unit_width * unit_height,
1085
                                               sizeof(PARTITION_INFO)));
1086
  memset(cpi->partition_info, 0,
1087
         unit_width * unit_height * sizeof(PARTITION_INFO));
1088
}
1089
1090
// Frees memory of the partition information.
1091
// Only called once in dealloc_compressor_data().
1092
static INLINE void free_partition_info(struct VP9_COMP *cpi) {
1093
  vpx_free(cpi->partition_info);
1094
  cpi->partition_info = NULL;
1095
}
1096
1097
static INLINE void reset_mv_info(MOTION_VECTOR_INFO *mv_info) {
1098
  mv_info->ref_frame[0] = NO_REF_FRAME;
1099
  mv_info->ref_frame[1] = NO_REF_FRAME;
1100
  mv_info->mv[0].as_int = INVALID_MV;
1101
  mv_info->mv[1].as_int = INVALID_MV;
1102
}
1103
1104
// Allocates memory for the motion vector information.
1105
// The unit size is each 4x4 block.
1106
// Only called once in vp9_create_compressor().
1107
static INLINE void motion_vector_info_init(struct VP9_COMP *cpi) {
1108
  VP9_COMMON *const cm = &cpi->common;
1109
  const int unit_width = get_num_unit_4x4(cpi->frame_info.frame_width);
1110
  const int unit_height = get_num_unit_4x4(cpi->frame_info.frame_height);
1111
  CHECK_MEM_ERROR(&cm->error, cpi->motion_vector_info,
1112
                  (MOTION_VECTOR_INFO *)vpx_calloc(unit_width * unit_height,
1113
                                                   sizeof(MOTION_VECTOR_INFO)));
1114
  memset(cpi->motion_vector_info, 0,
1115
         unit_width * unit_height * sizeof(MOTION_VECTOR_INFO));
1116
}
1117
1118
// Frees memory of the motion vector information.
1119
// Only called once in dealloc_compressor_data().
1120
static INLINE void free_motion_vector_info(struct VP9_COMP *cpi) {
1121
  vpx_free(cpi->motion_vector_info);
1122
  cpi->motion_vector_info = NULL;
1123
}
1124
1125
// Allocates memory for the tpl stats information.
1126
// Only called once in vp9_create_compressor().
1127
static INLINE void tpl_stats_info_init(struct VP9_COMP *cpi) {
1128
  VP9_COMMON *const cm = &cpi->common;
1129
  CHECK_MEM_ERROR(
1130
      &cm->error, cpi->tpl_stats_info,
1131
      (TplDepStats *)vpx_calloc(MAX_LAG_BUFFERS, sizeof(TplDepStats)));
1132
  memset(cpi->tpl_stats_info, 0, MAX_LAG_BUFFERS * sizeof(TplDepStats));
1133
}
1134
1135
// Frees memory of the tpl stats information.
1136
// Only called once in dealloc_compressor_data().
1137
static INLINE void free_tpl_stats_info(struct VP9_COMP *cpi) {
1138
  vpx_free(cpi->tpl_stats_info);
1139
  cpi->tpl_stats_info = NULL;
1140
}
1141
1142
// Allocates memory for the first pass motion vector information.
1143
// The unit size is each 16x16 block.
1144
// Only called once in vp9_create_compressor().
1145
static INLINE void fp_motion_vector_info_init(struct VP9_COMP *cpi) {
1146
  VP9_COMMON *const cm = &cpi->common;
1147
  const int unit_width = get_num_unit_16x16(cpi->frame_info.frame_width);
1148
  const int unit_height = get_num_unit_16x16(cpi->frame_info.frame_height);
1149
  CHECK_MEM_ERROR(&cm->error, cpi->fp_motion_vector_info,
1150
                  (MOTION_VECTOR_INFO *)vpx_calloc(unit_width * unit_height,
1151
                                                   sizeof(MOTION_VECTOR_INFO)));
1152
}
1153
1154
static INLINE void fp_motion_vector_info_reset(
1155
    int frame_width, int frame_height,
1156
    MOTION_VECTOR_INFO *fp_motion_vector_info) {
1157
  const int unit_width = get_num_unit_16x16(frame_width);
1158
  const int unit_height = get_num_unit_16x16(frame_height);
1159
  int i;
1160
  for (i = 0; i < unit_width * unit_height; ++i) {
1161
    reset_mv_info(fp_motion_vector_info + i);
1162
  }
1163
}
1164
1165
// Frees memory of the first pass motion vector information.
1166
// Only called once in dealloc_compressor_data().
1167
static INLINE void free_fp_motion_vector_info(struct VP9_COMP *cpi) {
1168
  vpx_free(cpi->fp_motion_vector_info);
1169
  cpi->fp_motion_vector_info = NULL;
1170
}
1171
1172
// This is the c-version counter part of ImageBuffer
1173
typedef struct IMAGE_BUFFER {
1174
  int allocated;
1175
  int plane_width[3];
1176
  int plane_height[3];
1177
  uint8_t *plane_buffer[3];
1178
} IMAGE_BUFFER;
1179
1180
#define RATE_CTRL_MAX_RECODE_NUM 7
1181
1182
typedef struct RATE_QINDEX_HISTORY {
1183
  int recode_count;
1184
  int q_index_history[RATE_CTRL_MAX_RECODE_NUM];
1185
  int rate_history[RATE_CTRL_MAX_RECODE_NUM];
1186
  int q_index_high;
1187
  int q_index_low;
1188
} RATE_QINDEX_HISTORY;
1189
1190
#endif  // CONFIG_RATE_CTRL
1191
1192
typedef struct ENCODE_FRAME_RESULT {
1193
  int show_idx;
1194
  FRAME_UPDATE_TYPE update_type;
1195
#if CONFIG_RATE_CTRL
1196
  int frame_coding_index;
1197
  int ref_frame_coding_indexes[MAX_INTER_REF_FRAMES];
1198
  int ref_frame_valid_list[MAX_INTER_REF_FRAMES];
1199
  double psnr;
1200
  uint64_t sse;
1201
  FRAME_COUNTS frame_counts;
1202
  const PARTITION_INFO *partition_info;
1203
  const MOTION_VECTOR_INFO *motion_vector_info;
1204
  const TplDepStats *tpl_stats_info;
1205
  IMAGE_BUFFER coded_frame;
1206
  RATE_QINDEX_HISTORY rq_history;
1207
#endif  // CONFIG_RATE_CTRL
1208
  int quantize_index;
1209
} ENCODE_FRAME_RESULT;
1210
1211
void vp9_init_encode_frame_result(ENCODE_FRAME_RESULT *encode_frame_result);
1212
1213
void vp9_initialize_enc(void);
1214
1215
void vp9_update_compressor_with_img_fmt(VP9_COMP *cpi, vpx_img_fmt_t img_fmt);
1216
struct VP9_COMP *vp9_create_compressor(const VP9EncoderConfig *oxcf,
1217
                                       BufferPool *const pool);
1218
void vp9_remove_compressor(VP9_COMP *cpi);
1219
1220
void vp9_change_config(VP9_COMP *cpi, const VP9EncoderConfig *oxcf);
1221
1222
// receive a frames worth of data. caller can assume that a copy of this
1223
// frame is made and not just a copy of the pointer..
1224
int vp9_receive_raw_frame(VP9_COMP *cpi, vpx_enc_frame_flags_t frame_flags,
1225
                          YV12_BUFFER_CONFIG *sd, int64_t time_stamp,
1226
                          int64_t end_time);
1227
1228
int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
1229
                            size_t *size, uint8_t *dest, size_t dest_size,
1230
                            int64_t *time_stamp, int64_t *time_end, int flush,
1231
                            ENCODE_FRAME_RESULT *encode_frame_result);
1232
1233
int vp9_get_preview_raw_frame(VP9_COMP *cpi, YV12_BUFFER_CONFIG *dest,
1234
                              vp9_ppflags_t *flags);
1235
1236
int vp9_use_as_reference(VP9_COMP *cpi, int ref_frame_flags);
1237
1238
void vp9_update_reference(VP9_COMP *cpi, int ref_frame_flags);
1239
1240
int vp9_copy_reference_enc(VP9_COMP *cpi, VP9_REFFRAME ref_frame_flag,
1241
                           YV12_BUFFER_CONFIG *sd);
1242
1243
int vp9_set_reference_enc(VP9_COMP *cpi, VP9_REFFRAME ref_frame_flag,
1244
                          YV12_BUFFER_CONFIG *sd);
1245
1246
int vp9_update_entropy(VP9_COMP *cpi, int update);
1247
1248
int vp9_set_active_map(VP9_COMP *cpi, unsigned char *new_map_16x16, int rows,
1249
                       int cols);
1250
1251
int vp9_get_active_map(VP9_COMP *cpi, unsigned char *new_map_16x16, int rows,
1252
                       int cols);
1253
1254
int vp9_set_internal_size(VP9_COMP *cpi, VPX_SCALING_MODE horiz_mode,
1255
                          VPX_SCALING_MODE vert_mode);
1256
1257
int vp9_set_size_literal(VP9_COMP *cpi, unsigned int width,
1258
                         unsigned int height);
1259
1260
void vp9_set_svc(VP9_COMP *cpi, int use_svc);
1261
1262
// Check for resetting the rc flags (rc_1_frame, rc_2_frame) if the
1263
// configuration change has a large change in avg_frame_bandwidth.
1264
// For SVC check for resetting based on spatial layer average bandwidth.
1265
// Also reset buffer level to optimal level.
1266
void vp9_check_reset_rc_flag(VP9_COMP *cpi);
1267
1268
void vp9_set_rc_buffer_sizes(VP9_COMP *cpi);
1269
1270
0
static INLINE int stack_pop(int *stack, int stack_size) {
1271
0
  int idx;
1272
0
  const int r = stack[0];
1273
0
  for (idx = 1; idx < stack_size; ++idx) stack[idx - 1] = stack[idx];
1274
1275
0
  return r;
1276
0
}
Unexecuted instantiation: vp9_cx_iface.c:stack_pop
Unexecuted instantiation: vp9_firstpass.c:stack_pop
Unexecuted instantiation: vp9_mcomp.c:stack_pop
Unexecuted instantiation: vp9_encoder.c:stack_pop
Unexecuted instantiation: vp9_picklpf.c:stack_pop
Unexecuted instantiation: vp9_quantize.c:stack_pop
Unexecuted instantiation: vp9_ratectrl.c:stack_pop
Unexecuted instantiation: vp9_rd.c:stack_pop
Unexecuted instantiation: vp9_segmentation.c:stack_pop
Unexecuted instantiation: vp9_speed_features.c:stack_pop
Unexecuted instantiation: vp9_svc_layercontext.c:stack_pop
Unexecuted instantiation: vp9_tokenize.c:stack_pop
Unexecuted instantiation: vp9_aq_variance.c:stack_pop
Unexecuted instantiation: vp9_aq_360.c:stack_pop
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:stack_pop
Unexecuted instantiation: vp9_aq_complexity.c:stack_pop
Unexecuted instantiation: vp9_alt_ref_aq.c:stack_pop
Unexecuted instantiation: vp9_skin_detection.c:stack_pop
Unexecuted instantiation: vp9_noise_estimate.c:stack_pop
Unexecuted instantiation: vp9_ext_ratectrl.c:stack_pop
Unexecuted instantiation: vp9_temporal_filter.c:stack_pop
Unexecuted instantiation: vp9_tpl_model.c:stack_pop
Unexecuted instantiation: vp9_mbgraph.c:stack_pop
Unexecuted instantiation: vp9_bitstream.c:stack_pop
Unexecuted instantiation: vp9_context_tree.c:stack_pop
Unexecuted instantiation: vp9_encodeframe.c:stack_pop
Unexecuted instantiation: vp9_encodemb.c:stack_pop
Unexecuted instantiation: vp9_encodemv.c:stack_pop
Unexecuted instantiation: vp9_ethread.c:stack_pop
Unexecuted instantiation: vp9_frame_scale.c:stack_pop
Unexecuted instantiation: vp9_lookahead.c:stack_pop
Unexecuted instantiation: vp9_multi_thread.c:stack_pop
Unexecuted instantiation: vp9_rdopt.c:stack_pop
Unexecuted instantiation: vp9_pickmode.c:stack_pop
Unexecuted instantiation: temporal_filter_sse4.c:stack_pop
Unexecuted instantiation: highbd_temporal_filter_sse4.c:stack_pop
1277
1278
0
static INLINE int stack_top(const int *stack) { return stack[0]; }
Unexecuted instantiation: vp9_cx_iface.c:stack_top
Unexecuted instantiation: vp9_firstpass.c:stack_top
Unexecuted instantiation: vp9_mcomp.c:stack_top
Unexecuted instantiation: vp9_encoder.c:stack_top
Unexecuted instantiation: vp9_picklpf.c:stack_top
Unexecuted instantiation: vp9_quantize.c:stack_top
Unexecuted instantiation: vp9_ratectrl.c:stack_top
Unexecuted instantiation: vp9_rd.c:stack_top
Unexecuted instantiation: vp9_segmentation.c:stack_top
Unexecuted instantiation: vp9_speed_features.c:stack_top
Unexecuted instantiation: vp9_svc_layercontext.c:stack_top
Unexecuted instantiation: vp9_tokenize.c:stack_top
Unexecuted instantiation: vp9_aq_variance.c:stack_top
Unexecuted instantiation: vp9_aq_360.c:stack_top
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:stack_top
Unexecuted instantiation: vp9_aq_complexity.c:stack_top
Unexecuted instantiation: vp9_alt_ref_aq.c:stack_top
Unexecuted instantiation: vp9_skin_detection.c:stack_top
Unexecuted instantiation: vp9_noise_estimate.c:stack_top
Unexecuted instantiation: vp9_ext_ratectrl.c:stack_top
Unexecuted instantiation: vp9_temporal_filter.c:stack_top
Unexecuted instantiation: vp9_tpl_model.c:stack_top
Unexecuted instantiation: vp9_mbgraph.c:stack_top
Unexecuted instantiation: vp9_bitstream.c:stack_top
Unexecuted instantiation: vp9_context_tree.c:stack_top
Unexecuted instantiation: vp9_encodeframe.c:stack_top
Unexecuted instantiation: vp9_encodemb.c:stack_top
Unexecuted instantiation: vp9_encodemv.c:stack_top
Unexecuted instantiation: vp9_ethread.c:stack_top
Unexecuted instantiation: vp9_frame_scale.c:stack_top
Unexecuted instantiation: vp9_lookahead.c:stack_top
Unexecuted instantiation: vp9_multi_thread.c:stack_top
Unexecuted instantiation: vp9_rdopt.c:stack_top
Unexecuted instantiation: vp9_pickmode.c:stack_top
Unexecuted instantiation: temporal_filter_sse4.c:stack_top
Unexecuted instantiation: highbd_temporal_filter_sse4.c:stack_top
1279
1280
0
static INLINE void stack_push(int *stack, int new_item, int stack_size) {
1281
0
  int idx;
1282
0
  for (idx = stack_size; idx > 0; --idx) stack[idx] = stack[idx - 1];
1283
0
  stack[0] = new_item;
1284
0
}
Unexecuted instantiation: vp9_cx_iface.c:stack_push
Unexecuted instantiation: vp9_firstpass.c:stack_push
Unexecuted instantiation: vp9_mcomp.c:stack_push
Unexecuted instantiation: vp9_encoder.c:stack_push
Unexecuted instantiation: vp9_picklpf.c:stack_push
Unexecuted instantiation: vp9_quantize.c:stack_push
Unexecuted instantiation: vp9_ratectrl.c:stack_push
Unexecuted instantiation: vp9_rd.c:stack_push
Unexecuted instantiation: vp9_segmentation.c:stack_push
Unexecuted instantiation: vp9_speed_features.c:stack_push
Unexecuted instantiation: vp9_svc_layercontext.c:stack_push
Unexecuted instantiation: vp9_tokenize.c:stack_push
Unexecuted instantiation: vp9_aq_variance.c:stack_push
Unexecuted instantiation: vp9_aq_360.c:stack_push
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:stack_push
Unexecuted instantiation: vp9_aq_complexity.c:stack_push
Unexecuted instantiation: vp9_alt_ref_aq.c:stack_push
Unexecuted instantiation: vp9_skin_detection.c:stack_push
Unexecuted instantiation: vp9_noise_estimate.c:stack_push
Unexecuted instantiation: vp9_ext_ratectrl.c:stack_push
Unexecuted instantiation: vp9_temporal_filter.c:stack_push
Unexecuted instantiation: vp9_tpl_model.c:stack_push
Unexecuted instantiation: vp9_mbgraph.c:stack_push
Unexecuted instantiation: vp9_bitstream.c:stack_push
Unexecuted instantiation: vp9_context_tree.c:stack_push
Unexecuted instantiation: vp9_encodeframe.c:stack_push
Unexecuted instantiation: vp9_encodemb.c:stack_push
Unexecuted instantiation: vp9_encodemv.c:stack_push
Unexecuted instantiation: vp9_ethread.c:stack_push
Unexecuted instantiation: vp9_frame_scale.c:stack_push
Unexecuted instantiation: vp9_lookahead.c:stack_push
Unexecuted instantiation: vp9_multi_thread.c:stack_push
Unexecuted instantiation: vp9_rdopt.c:stack_push
Unexecuted instantiation: vp9_pickmode.c:stack_push
Unexecuted instantiation: temporal_filter_sse4.c:stack_push
Unexecuted instantiation: highbd_temporal_filter_sse4.c:stack_push
1285
1286
0
static INLINE void stack_init(int *stack, int length) {
1287
0
  int idx;
1288
0
  for (idx = 0; idx < length; ++idx) stack[idx] = -1;
1289
0
}
Unexecuted instantiation: vp9_cx_iface.c:stack_init
Unexecuted instantiation: vp9_firstpass.c:stack_init
Unexecuted instantiation: vp9_mcomp.c:stack_init
Unexecuted instantiation: vp9_encoder.c:stack_init
Unexecuted instantiation: vp9_picklpf.c:stack_init
Unexecuted instantiation: vp9_quantize.c:stack_init
Unexecuted instantiation: vp9_ratectrl.c:stack_init
Unexecuted instantiation: vp9_rd.c:stack_init
Unexecuted instantiation: vp9_segmentation.c:stack_init
Unexecuted instantiation: vp9_speed_features.c:stack_init
Unexecuted instantiation: vp9_svc_layercontext.c:stack_init
Unexecuted instantiation: vp9_tokenize.c:stack_init
Unexecuted instantiation: vp9_aq_variance.c:stack_init
Unexecuted instantiation: vp9_aq_360.c:stack_init
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:stack_init
Unexecuted instantiation: vp9_aq_complexity.c:stack_init
Unexecuted instantiation: vp9_alt_ref_aq.c:stack_init
Unexecuted instantiation: vp9_skin_detection.c:stack_init
Unexecuted instantiation: vp9_noise_estimate.c:stack_init
Unexecuted instantiation: vp9_ext_ratectrl.c:stack_init
Unexecuted instantiation: vp9_temporal_filter.c:stack_init
Unexecuted instantiation: vp9_tpl_model.c:stack_init
Unexecuted instantiation: vp9_mbgraph.c:stack_init
Unexecuted instantiation: vp9_bitstream.c:stack_init
Unexecuted instantiation: vp9_context_tree.c:stack_init
Unexecuted instantiation: vp9_encodeframe.c:stack_init
Unexecuted instantiation: vp9_encodemb.c:stack_init
Unexecuted instantiation: vp9_encodemv.c:stack_init
Unexecuted instantiation: vp9_ethread.c:stack_init
Unexecuted instantiation: vp9_frame_scale.c:stack_init
Unexecuted instantiation: vp9_lookahead.c:stack_init
Unexecuted instantiation: vp9_multi_thread.c:stack_init
Unexecuted instantiation: vp9_rdopt.c:stack_init
Unexecuted instantiation: vp9_pickmode.c:stack_init
Unexecuted instantiation: temporal_filter_sse4.c:stack_init
Unexecuted instantiation: highbd_temporal_filter_sse4.c:stack_init
1290
1291
int vp9_get_quantizer(const VP9_COMP *cpi);
1292
1293
45.2k
static INLINE int frame_is_kf_gf_arf(const VP9_COMP *cpi) {
1294
45.2k
  return frame_is_intra_only(&cpi->common) || cpi->refresh_alt_ref_frame ||
1295
45.2k
         (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref);
1296
45.2k
}
Unexecuted instantiation: vp9_cx_iface.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_firstpass.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_mcomp.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_encoder.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_picklpf.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_quantize.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_ratectrl.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_rd.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_segmentation.c:frame_is_kf_gf_arf
vp9_speed_features.c:frame_is_kf_gf_arf
Line
Count
Source
1293
45.2k
static INLINE int frame_is_kf_gf_arf(const VP9_COMP *cpi) {
1294
45.2k
  return frame_is_intra_only(&cpi->common) || cpi->refresh_alt_ref_frame ||
1295
45.2k
         (cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref);
1296
45.2k
}
Unexecuted instantiation: vp9_svc_layercontext.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_tokenize.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_aq_variance.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_aq_360.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_aq_complexity.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_alt_ref_aq.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_skin_detection.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_noise_estimate.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_ext_ratectrl.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_temporal_filter.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_tpl_model.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_mbgraph.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_bitstream.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_context_tree.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_encodeframe.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_encodemb.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_encodemv.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_ethread.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_frame_scale.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_lookahead.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_multi_thread.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_rdopt.c:frame_is_kf_gf_arf
Unexecuted instantiation: vp9_pickmode.c:frame_is_kf_gf_arf
Unexecuted instantiation: temporal_filter_sse4.c:frame_is_kf_gf_arf
Unexecuted instantiation: highbd_temporal_filter_sse4.c:frame_is_kf_gf_arf
1297
1298
27.8M
static INLINE int ref_frame_to_flag(int8_t ref_frame) {
1299
27.8M
  static const int kVp9RefFlagList[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG,
1300
27.8M
                                          VP9_ALT_FLAG };
1301
27.8M
  assert(ref_frame >= LAST_FRAME && ref_frame <= ALTREF_FRAME);
1302
27.8M
  return kVp9RefFlagList[ref_frame];
1303
27.8M
}
Unexecuted instantiation: vp9_cx_iface.c:ref_frame_to_flag
Unexecuted instantiation: vp9_firstpass.c:ref_frame_to_flag
Unexecuted instantiation: vp9_mcomp.c:ref_frame_to_flag
Unexecuted instantiation: vp9_encoder.c:ref_frame_to_flag
Unexecuted instantiation: vp9_picklpf.c:ref_frame_to_flag
Unexecuted instantiation: vp9_quantize.c:ref_frame_to_flag
Unexecuted instantiation: vp9_ratectrl.c:ref_frame_to_flag
Unexecuted instantiation: vp9_rd.c:ref_frame_to_flag
Unexecuted instantiation: vp9_segmentation.c:ref_frame_to_flag
Unexecuted instantiation: vp9_speed_features.c:ref_frame_to_flag
Unexecuted instantiation: vp9_svc_layercontext.c:ref_frame_to_flag
Unexecuted instantiation: vp9_tokenize.c:ref_frame_to_flag
Unexecuted instantiation: vp9_aq_variance.c:ref_frame_to_flag
Unexecuted instantiation: vp9_aq_360.c:ref_frame_to_flag
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:ref_frame_to_flag
Unexecuted instantiation: vp9_aq_complexity.c:ref_frame_to_flag
Unexecuted instantiation: vp9_alt_ref_aq.c:ref_frame_to_flag
Unexecuted instantiation: vp9_skin_detection.c:ref_frame_to_flag
Unexecuted instantiation: vp9_noise_estimate.c:ref_frame_to_flag
Unexecuted instantiation: vp9_ext_ratectrl.c:ref_frame_to_flag
Unexecuted instantiation: vp9_temporal_filter.c:ref_frame_to_flag
Unexecuted instantiation: vp9_tpl_model.c:ref_frame_to_flag
Unexecuted instantiation: vp9_mbgraph.c:ref_frame_to_flag
Unexecuted instantiation: vp9_bitstream.c:ref_frame_to_flag
Unexecuted instantiation: vp9_context_tree.c:ref_frame_to_flag
vp9_encodeframe.c:ref_frame_to_flag
Line
Count
Source
1298
126k
static INLINE int ref_frame_to_flag(int8_t ref_frame) {
1299
126k
  static const int kVp9RefFlagList[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG,
1300
126k
                                          VP9_ALT_FLAG };
1301
126k
  assert(ref_frame >= LAST_FRAME && ref_frame <= ALTREF_FRAME);
1302
126k
  return kVp9RefFlagList[ref_frame];
1303
126k
}
Unexecuted instantiation: vp9_encodemb.c:ref_frame_to_flag
Unexecuted instantiation: vp9_encodemv.c:ref_frame_to_flag
Unexecuted instantiation: vp9_ethread.c:ref_frame_to_flag
Unexecuted instantiation: vp9_frame_scale.c:ref_frame_to_flag
Unexecuted instantiation: vp9_lookahead.c:ref_frame_to_flag
Unexecuted instantiation: vp9_multi_thread.c:ref_frame_to_flag
vp9_rdopt.c:ref_frame_to_flag
Line
Count
Source
1298
27.7M
static INLINE int ref_frame_to_flag(int8_t ref_frame) {
1299
27.7M
  static const int kVp9RefFlagList[4] = { 0, VP9_LAST_FLAG, VP9_GOLD_FLAG,
1300
27.7M
                                          VP9_ALT_FLAG };
1301
27.7M
  assert(ref_frame >= LAST_FRAME && ref_frame <= ALTREF_FRAME);
1302
27.7M
  return kVp9RefFlagList[ref_frame];
1303
27.7M
}
Unexecuted instantiation: vp9_pickmode.c:ref_frame_to_flag
Unexecuted instantiation: temporal_filter_sse4.c:ref_frame_to_flag
Unexecuted instantiation: highbd_temporal_filter_sse4.c:ref_frame_to_flag
1304
1305
static INLINE int get_ref_frame_map_idx(const VP9_COMP *cpi,
1306
31.2M
                                        MV_REFERENCE_FRAME ref_frame) {
1307
31.2M
  if (ref_frame == LAST_FRAME) {
1308
15.5M
    return cpi->lst_fb_idx;
1309
15.6M
  } else if (ref_frame == GOLDEN_FRAME) {
1310
10.0M
    return cpi->gld_fb_idx;
1311
10.0M
  } else {
1312
5.64M
    return cpi->alt_fb_idx;
1313
5.64M
  }
1314
31.2M
}
Unexecuted instantiation: vp9_cx_iface.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_firstpass.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_mcomp.c:get_ref_frame_map_idx
vp9_encoder.c:get_ref_frame_map_idx
Line
Count
Source
1306
510k
                                        MV_REFERENCE_FRAME ref_frame) {
1307
510k
  if (ref_frame == LAST_FRAME) {
1308
188k
    return cpi->lst_fb_idx;
1309
321k
  } else if (ref_frame == GOLDEN_FRAME) {
1310
174k
    return cpi->gld_fb_idx;
1311
174k
  } else {
1312
147k
    return cpi->alt_fb_idx;
1313
147k
  }
1314
510k
}
Unexecuted instantiation: vp9_picklpf.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_quantize.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_ratectrl.c:get_ref_frame_map_idx
vp9_rd.c:get_ref_frame_map_idx
Line
Count
Source
1306
13.7M
                                        MV_REFERENCE_FRAME ref_frame) {
1307
13.7M
  if (ref_frame == LAST_FRAME) {
1308
6.80M
    return cpi->lst_fb_idx;
1309
6.96M
  } else if (ref_frame == GOLDEN_FRAME) {
1310
4.44M
    return cpi->gld_fb_idx;
1311
4.44M
  } else {
1312
2.51M
    return cpi->alt_fb_idx;
1313
2.51M
  }
1314
13.7M
}
Unexecuted instantiation: vp9_segmentation.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_speed_features.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_svc_layercontext.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_tokenize.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_aq_variance.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_aq_360.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_aq_complexity.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_alt_ref_aq.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_skin_detection.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_noise_estimate.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_ext_ratectrl.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_temporal_filter.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_tpl_model.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_mbgraph.c:get_ref_frame_map_idx
vp9_bitstream.c:get_ref_frame_map_idx
Line
Count
Source
1306
138k
                                        MV_REFERENCE_FRAME ref_frame) {
1307
138k
  if (ref_frame == LAST_FRAME) {
1308
69.0k
    return cpi->lst_fb_idx;
1309
69.0k
  } else if (ref_frame == GOLDEN_FRAME) {
1310
34.5k
    return cpi->gld_fb_idx;
1311
34.5k
  } else {
1312
34.5k
    return cpi->alt_fb_idx;
1313
34.5k
  }
1314
138k
}
Unexecuted instantiation: vp9_context_tree.c:get_ref_frame_map_idx
vp9_encodeframe.c:get_ref_frame_map_idx
Line
Count
Source
1306
3.43M
                                        MV_REFERENCE_FRAME ref_frame) {
1307
3.43M
  if (ref_frame == LAST_FRAME) {
1308
2.62M
    return cpi->lst_fb_idx;
1309
2.62M
  } else if (ref_frame == GOLDEN_FRAME) {
1310
652k
    return cpi->gld_fb_idx;
1311
652k
  } else {
1312
158k
    return cpi->alt_fb_idx;
1313
158k
  }
1314
3.43M
}
Unexecuted instantiation: vp9_encodemb.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_encodemv.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_ethread.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_frame_scale.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_lookahead.c:get_ref_frame_map_idx
Unexecuted instantiation: vp9_multi_thread.c:get_ref_frame_map_idx
vp9_rdopt.c:get_ref_frame_map_idx
Line
Count
Source
1306
13.3M
                                        MV_REFERENCE_FRAME ref_frame) {
1307
13.3M
  if (ref_frame == LAST_FRAME) {
1308
5.87M
    return cpi->lst_fb_idx;
1309
7.48M
  } else if (ref_frame == GOLDEN_FRAME) {
1310
4.69M
    return cpi->gld_fb_idx;
1311
4.69M
  } else {
1312
2.78M
    return cpi->alt_fb_idx;
1313
2.78M
  }
1314
13.3M
}
Unexecuted instantiation: vp9_pickmode.c:get_ref_frame_map_idx
Unexecuted instantiation: temporal_filter_sse4.c:get_ref_frame_map_idx
Unexecuted instantiation: highbd_temporal_filter_sse4.c:get_ref_frame_map_idx
1315
1316
static INLINE int get_ref_frame_buf_idx(const VP9_COMP *const cpi,
1317
31.1M
                                        int ref_frame) {
1318
31.1M
  const VP9_COMMON *const cm = &cpi->common;
1319
31.1M
  const int map_idx = get_ref_frame_map_idx(cpi, ref_frame);
1320
31.1M
  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : INVALID_IDX;
1321
31.1M
}
Unexecuted instantiation: vp9_cx_iface.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_firstpass.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_mcomp.c:get_ref_frame_buf_idx
vp9_encoder.c:get_ref_frame_buf_idx
Line
Count
Source
1317
510k
                                        int ref_frame) {
1318
510k
  const VP9_COMMON *const cm = &cpi->common;
1319
510k
  const int map_idx = get_ref_frame_map_idx(cpi, ref_frame);
1320
510k
  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : INVALID_IDX;
1321
510k
}
Unexecuted instantiation: vp9_picklpf.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_quantize.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_ratectrl.c:get_ref_frame_buf_idx
vp9_rd.c:get_ref_frame_buf_idx
Line
Count
Source
1317
13.7M
                                        int ref_frame) {
1318
13.7M
  const VP9_COMMON *const cm = &cpi->common;
1319
13.7M
  const int map_idx = get_ref_frame_map_idx(cpi, ref_frame);
1320
13.7M
  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : INVALID_IDX;
1321
13.7M
}
Unexecuted instantiation: vp9_segmentation.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_speed_features.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_svc_layercontext.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_tokenize.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_aq_variance.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_aq_360.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_aq_complexity.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_alt_ref_aq.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_skin_detection.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_noise_estimate.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_ext_ratectrl.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_temporal_filter.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_tpl_model.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_mbgraph.c:get_ref_frame_buf_idx
vp9_bitstream.c:get_ref_frame_buf_idx
Line
Count
Source
1317
34.5k
                                        int ref_frame) {
1318
34.5k
  const VP9_COMMON *const cm = &cpi->common;
1319
34.5k
  const int map_idx = get_ref_frame_map_idx(cpi, ref_frame);
1320
34.5k
  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : INVALID_IDX;
1321
34.5k
}
Unexecuted instantiation: vp9_context_tree.c:get_ref_frame_buf_idx
vp9_encodeframe.c:get_ref_frame_buf_idx
Line
Count
Source
1317
3.43M
                                        int ref_frame) {
1318
3.43M
  const VP9_COMMON *const cm = &cpi->common;
1319
3.43M
  const int map_idx = get_ref_frame_map_idx(cpi, ref_frame);
1320
3.43M
  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : INVALID_IDX;
1321
3.43M
}
Unexecuted instantiation: vp9_encodemb.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_encodemv.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_ethread.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_frame_scale.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_lookahead.c:get_ref_frame_buf_idx
Unexecuted instantiation: vp9_multi_thread.c:get_ref_frame_buf_idx
vp9_rdopt.c:get_ref_frame_buf_idx
Line
Count
Source
1317
13.3M
                                        int ref_frame) {
1318
13.3M
  const VP9_COMMON *const cm = &cpi->common;
1319
13.3M
  const int map_idx = get_ref_frame_map_idx(cpi, ref_frame);
1320
13.3M
  return (map_idx != INVALID_IDX) ? cm->ref_frame_map[map_idx] : INVALID_IDX;
1321
13.3M
}
Unexecuted instantiation: vp9_pickmode.c:get_ref_frame_buf_idx
Unexecuted instantiation: temporal_filter_sse4.c:get_ref_frame_buf_idx
Unexecuted instantiation: highbd_temporal_filter_sse4.c:get_ref_frame_buf_idx
1322
1323
static INLINE RefCntBuffer *get_ref_cnt_buffer(const VP9_COMMON *cm,
1324
211k
                                               int fb_idx) {
1325
211k
  return fb_idx != INVALID_IDX ? &cm->buffer_pool->frame_bufs[fb_idx] : NULL;
1326
211k
}
Unexecuted instantiation: vp9_cx_iface.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_firstpass.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_mcomp.c:get_ref_cnt_buffer
vp9_encoder.c:get_ref_cnt_buffer
Line
Count
Source
1324
211k
                                               int fb_idx) {
1325
211k
  return fb_idx != INVALID_IDX ? &cm->buffer_pool->frame_bufs[fb_idx] : NULL;
1326
211k
}
Unexecuted instantiation: vp9_picklpf.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_quantize.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_ratectrl.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_rd.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_segmentation.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_speed_features.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_svc_layercontext.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_tokenize.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_aq_variance.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_aq_360.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_aq_complexity.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_alt_ref_aq.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_skin_detection.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_noise_estimate.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_ext_ratectrl.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_temporal_filter.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_tpl_model.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_mbgraph.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_bitstream.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_context_tree.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_encodeframe.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_encodemb.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_encodemv.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_ethread.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_frame_scale.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_lookahead.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_multi_thread.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_rdopt.c:get_ref_cnt_buffer
Unexecuted instantiation: vp9_pickmode.c:get_ref_cnt_buffer
Unexecuted instantiation: temporal_filter_sse4.c:get_ref_cnt_buffer
Unexecuted instantiation: highbd_temporal_filter_sse4.c:get_ref_cnt_buffer
1327
1328
static INLINE void get_ref_frame_bufs(
1329
0
    const VP9_COMP *cpi, RefCntBuffer *ref_frame_bufs[MAX_INTER_REF_FRAMES]) {
1330
0
  const VP9_COMMON *const cm = &cpi->common;
1331
0
  MV_REFERENCE_FRAME ref_frame;
1332
0
  for (ref_frame = LAST_FRAME; ref_frame < MAX_REF_FRAMES; ++ref_frame) {
1333
0
    int ref_frame_buf_idx = get_ref_frame_buf_idx(cpi, ref_frame);
1334
0
    int inter_ref_idx = mv_ref_frame_to_inter_ref_idx(ref_frame);
1335
0
    ref_frame_bufs[inter_ref_idx] = get_ref_cnt_buffer(cm, ref_frame_buf_idx);
1336
0
  }
1337
0
}
Unexecuted instantiation: vp9_cx_iface.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_firstpass.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_mcomp.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_encoder.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_picklpf.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_quantize.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_ratectrl.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_rd.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_segmentation.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_speed_features.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_svc_layercontext.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_tokenize.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_aq_variance.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_aq_360.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_aq_complexity.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_alt_ref_aq.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_skin_detection.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_noise_estimate.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_ext_ratectrl.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_temporal_filter.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_tpl_model.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_mbgraph.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_bitstream.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_context_tree.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_encodeframe.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_encodemb.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_encodemv.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_ethread.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_frame_scale.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_lookahead.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_multi_thread.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_rdopt.c:get_ref_frame_bufs
Unexecuted instantiation: vp9_pickmode.c:get_ref_frame_bufs
Unexecuted instantiation: temporal_filter_sse4.c:get_ref_frame_bufs
Unexecuted instantiation: highbd_temporal_filter_sse4.c:get_ref_frame_bufs
1338
1339
static INLINE YV12_BUFFER_CONFIG *get_ref_frame_buffer(
1340
17.0M
    const VP9_COMP *const cpi, MV_REFERENCE_FRAME ref_frame) {
1341
17.0M
  const VP9_COMMON *const cm = &cpi->common;
1342
17.0M
  const int buf_idx = get_ref_frame_buf_idx(cpi, ref_frame);
1343
17.0M
  return buf_idx != INVALID_IDX ? &cm->buffer_pool->frame_bufs[buf_idx].buf
1344
17.0M
                                : NULL;
1345
17.0M
}
Unexecuted instantiation: vp9_cx_iface.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_firstpass.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_mcomp.c:get_ref_frame_buffer
vp9_encoder.c:get_ref_frame_buffer
Line
Count
Source
1340
170k
    const VP9_COMP *const cpi, MV_REFERENCE_FRAME ref_frame) {
1341
170k
  const VP9_COMMON *const cm = &cpi->common;
1342
170k
  const int buf_idx = get_ref_frame_buf_idx(cpi, ref_frame);
1343
170k
  return buf_idx != INVALID_IDX ? &cm->buffer_pool->frame_bufs[buf_idx].buf
1344
170k
                                : NULL;
1345
170k
}
Unexecuted instantiation: vp9_picklpf.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_quantize.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_ratectrl.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_rd.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_segmentation.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_speed_features.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_svc_layercontext.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_tokenize.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_aq_variance.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_aq_360.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_aq_complexity.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_alt_ref_aq.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_skin_detection.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_noise_estimate.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_ext_ratectrl.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_temporal_filter.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_tpl_model.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_mbgraph.c:get_ref_frame_buffer
vp9_bitstream.c:get_ref_frame_buffer
Line
Count
Source
1340
34.5k
    const VP9_COMP *const cpi, MV_REFERENCE_FRAME ref_frame) {
1341
34.5k
  const VP9_COMMON *const cm = &cpi->common;
1342
34.5k
  const int buf_idx = get_ref_frame_buf_idx(cpi, ref_frame);
1343
34.5k
  return buf_idx != INVALID_IDX ? &cm->buffer_pool->frame_bufs[buf_idx].buf
1344
34.5k
                                : NULL;
1345
34.5k
}
Unexecuted instantiation: vp9_context_tree.c:get_ref_frame_buffer
vp9_encodeframe.c:get_ref_frame_buffer
Line
Count
Source
1340
3.43M
    const VP9_COMP *const cpi, MV_REFERENCE_FRAME ref_frame) {
1341
3.43M
  const VP9_COMMON *const cm = &cpi->common;
1342
3.43M
  const int buf_idx = get_ref_frame_buf_idx(cpi, ref_frame);
1343
3.43M
  return buf_idx != INVALID_IDX ? &cm->buffer_pool->frame_bufs[buf_idx].buf
1344
3.43M
                                : NULL;
1345
3.43M
}
Unexecuted instantiation: vp9_encodemb.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_encodemv.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_ethread.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_frame_scale.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_lookahead.c:get_ref_frame_buffer
Unexecuted instantiation: vp9_multi_thread.c:get_ref_frame_buffer
vp9_rdopt.c:get_ref_frame_buffer
Line
Count
Source
1340
13.3M
    const VP9_COMP *const cpi, MV_REFERENCE_FRAME ref_frame) {
1341
13.3M
  const VP9_COMMON *const cm = &cpi->common;
1342
13.3M
  const int buf_idx = get_ref_frame_buf_idx(cpi, ref_frame);
1343
13.3M
  return buf_idx != INVALID_IDX ? &cm->buffer_pool->frame_bufs[buf_idx].buf
1344
13.3M
                                : NULL;
1345
13.3M
}
Unexecuted instantiation: vp9_pickmode.c:get_ref_frame_buffer
Unexecuted instantiation: temporal_filter_sse4.c:get_ref_frame_buffer
Unexecuted instantiation: highbd_temporal_filter_sse4.c:get_ref_frame_buffer
1346
1347
103k
static INLINE int get_token_alloc(int mb_rows, int mb_cols) {
1348
  // TODO(JBB): double check we can't exceed this token count if we have a
1349
  // 32x32 transform crossing a boundary at a multiple of 16.
1350
  // mb_rows, cols are in units of 16 pixels. We assume 3 planes all at full
1351
  // resolution. We assume up to 1 token per pixel, and then allow
1352
  // a head room of 4.
1353
1354
  // Use aligned mb_rows and mb_cols to better align with actual token sizes.
1355
103k
  const int aligned_mb_rows =
1356
103k
      ALIGN_POWER_OF_TWO(mb_rows, MI_BLOCK_SIZE_LOG2 - 1);
1357
103k
  const int aligned_mb_cols =
1358
103k
      ALIGN_POWER_OF_TWO(mb_cols, MI_BLOCK_SIZE_LOG2 - 1);
1359
103k
  return aligned_mb_rows * aligned_mb_cols * (16 * 16 * 3 + 4);
1360
103k
}
Unexecuted instantiation: vp9_cx_iface.c:get_token_alloc
Unexecuted instantiation: vp9_firstpass.c:get_token_alloc
Unexecuted instantiation: vp9_mcomp.c:get_token_alloc
vp9_encoder.c:get_token_alloc
Line
Count
Source
1347
2.98k
static INLINE int get_token_alloc(int mb_rows, int mb_cols) {
1348
  // TODO(JBB): double check we can't exceed this token count if we have a
1349
  // 32x32 transform crossing a boundary at a multiple of 16.
1350
  // mb_rows, cols are in units of 16 pixels. We assume 3 planes all at full
1351
  // resolution. We assume up to 1 token per pixel, and then allow
1352
  // a head room of 4.
1353
1354
  // Use aligned mb_rows and mb_cols to better align with actual token sizes.
1355
2.98k
  const int aligned_mb_rows =
1356
2.98k
      ALIGN_POWER_OF_TWO(mb_rows, MI_BLOCK_SIZE_LOG2 - 1);
1357
2.98k
  const int aligned_mb_cols =
1358
2.98k
      ALIGN_POWER_OF_TWO(mb_cols, MI_BLOCK_SIZE_LOG2 - 1);
1359
2.98k
  return aligned_mb_rows * aligned_mb_cols * (16 * 16 * 3 + 4);
1360
2.98k
}
Unexecuted instantiation: vp9_picklpf.c:get_token_alloc
Unexecuted instantiation: vp9_quantize.c:get_token_alloc
Unexecuted instantiation: vp9_ratectrl.c:get_token_alloc
Unexecuted instantiation: vp9_rd.c:get_token_alloc
Unexecuted instantiation: vp9_segmentation.c:get_token_alloc
Unexecuted instantiation: vp9_speed_features.c:get_token_alloc
Unexecuted instantiation: vp9_svc_layercontext.c:get_token_alloc
Unexecuted instantiation: vp9_tokenize.c:get_token_alloc
Unexecuted instantiation: vp9_aq_variance.c:get_token_alloc
Unexecuted instantiation: vp9_aq_360.c:get_token_alloc
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:get_token_alloc
Unexecuted instantiation: vp9_aq_complexity.c:get_token_alloc
Unexecuted instantiation: vp9_alt_ref_aq.c:get_token_alloc
Unexecuted instantiation: vp9_skin_detection.c:get_token_alloc
Unexecuted instantiation: vp9_noise_estimate.c:get_token_alloc
Unexecuted instantiation: vp9_ext_ratectrl.c:get_token_alloc
Unexecuted instantiation: vp9_temporal_filter.c:get_token_alloc
Unexecuted instantiation: vp9_tpl_model.c:get_token_alloc
Unexecuted instantiation: vp9_mbgraph.c:get_token_alloc
Unexecuted instantiation: vp9_bitstream.c:get_token_alloc
Unexecuted instantiation: vp9_context_tree.c:get_token_alloc
vp9_encodeframe.c:get_token_alloc
Line
Count
Source
1347
100k
static INLINE int get_token_alloc(int mb_rows, int mb_cols) {
1348
  // TODO(JBB): double check we can't exceed this token count if we have a
1349
  // 32x32 transform crossing a boundary at a multiple of 16.
1350
  // mb_rows, cols are in units of 16 pixels. We assume 3 planes all at full
1351
  // resolution. We assume up to 1 token per pixel, and then allow
1352
  // a head room of 4.
1353
1354
  // Use aligned mb_rows and mb_cols to better align with actual token sizes.
1355
100k
  const int aligned_mb_rows =
1356
100k
      ALIGN_POWER_OF_TWO(mb_rows, MI_BLOCK_SIZE_LOG2 - 1);
1357
100k
  const int aligned_mb_cols =
1358
100k
      ALIGN_POWER_OF_TWO(mb_cols, MI_BLOCK_SIZE_LOG2 - 1);
1359
100k
  return aligned_mb_rows * aligned_mb_cols * (16 * 16 * 3 + 4);
1360
100k
}
Unexecuted instantiation: vp9_encodemb.c:get_token_alloc
Unexecuted instantiation: vp9_encodemv.c:get_token_alloc
Unexecuted instantiation: vp9_ethread.c:get_token_alloc
Unexecuted instantiation: vp9_frame_scale.c:get_token_alloc
Unexecuted instantiation: vp9_lookahead.c:get_token_alloc
Unexecuted instantiation: vp9_multi_thread.c:get_token_alloc
Unexecuted instantiation: vp9_rdopt.c:get_token_alloc
Unexecuted instantiation: vp9_pickmode.c:get_token_alloc
Unexecuted instantiation: temporal_filter_sse4.c:get_token_alloc
Unexecuted instantiation: highbd_temporal_filter_sse4.c:get_token_alloc
1361
1362
// Get the allocated token size for a tile. It does the same calculation as in
1363
// the frame token allocation.
1364
44.7k
static INLINE int allocated_tokens(TileInfo tile) {
1365
44.7k
  int tile_mb_rows = (tile.mi_row_end - tile.mi_row_start + 1) >> 1;
1366
44.7k
  int tile_mb_cols = (tile.mi_col_end - tile.mi_col_start + 1) >> 1;
1367
1368
44.7k
  return get_token_alloc(tile_mb_rows, tile_mb_cols);
1369
44.7k
}
Unexecuted instantiation: vp9_cx_iface.c:allocated_tokens
Unexecuted instantiation: vp9_firstpass.c:allocated_tokens
Unexecuted instantiation: vp9_mcomp.c:allocated_tokens
Unexecuted instantiation: vp9_encoder.c:allocated_tokens
Unexecuted instantiation: vp9_picklpf.c:allocated_tokens
Unexecuted instantiation: vp9_quantize.c:allocated_tokens
Unexecuted instantiation: vp9_ratectrl.c:allocated_tokens
Unexecuted instantiation: vp9_rd.c:allocated_tokens
Unexecuted instantiation: vp9_segmentation.c:allocated_tokens
Unexecuted instantiation: vp9_speed_features.c:allocated_tokens
Unexecuted instantiation: vp9_svc_layercontext.c:allocated_tokens
Unexecuted instantiation: vp9_tokenize.c:allocated_tokens
Unexecuted instantiation: vp9_aq_variance.c:allocated_tokens
Unexecuted instantiation: vp9_aq_360.c:allocated_tokens
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:allocated_tokens
Unexecuted instantiation: vp9_aq_complexity.c:allocated_tokens
Unexecuted instantiation: vp9_alt_ref_aq.c:allocated_tokens
Unexecuted instantiation: vp9_skin_detection.c:allocated_tokens
Unexecuted instantiation: vp9_noise_estimate.c:allocated_tokens
Unexecuted instantiation: vp9_ext_ratectrl.c:allocated_tokens
Unexecuted instantiation: vp9_temporal_filter.c:allocated_tokens
Unexecuted instantiation: vp9_tpl_model.c:allocated_tokens
Unexecuted instantiation: vp9_mbgraph.c:allocated_tokens
Unexecuted instantiation: vp9_bitstream.c:allocated_tokens
Unexecuted instantiation: vp9_context_tree.c:allocated_tokens
vp9_encodeframe.c:allocated_tokens
Line
Count
Source
1364
44.7k
static INLINE int allocated_tokens(TileInfo tile) {
1365
44.7k
  int tile_mb_rows = (tile.mi_row_end - tile.mi_row_start + 1) >> 1;
1366
44.7k
  int tile_mb_cols = (tile.mi_col_end - tile.mi_col_start + 1) >> 1;
1367
1368
44.7k
  return get_token_alloc(tile_mb_rows, tile_mb_cols);
1369
44.7k
}
Unexecuted instantiation: vp9_encodemb.c:allocated_tokens
Unexecuted instantiation: vp9_encodemv.c:allocated_tokens
Unexecuted instantiation: vp9_ethread.c:allocated_tokens
Unexecuted instantiation: vp9_frame_scale.c:allocated_tokens
Unexecuted instantiation: vp9_lookahead.c:allocated_tokens
Unexecuted instantiation: vp9_multi_thread.c:allocated_tokens
Unexecuted instantiation: vp9_rdopt.c:allocated_tokens
Unexecuted instantiation: vp9_pickmode.c:allocated_tokens
Unexecuted instantiation: temporal_filter_sse4.c:allocated_tokens
Unexecuted instantiation: highbd_temporal_filter_sse4.c:allocated_tokens
1370
1371
static INLINE void get_start_tok(VP9_COMP *cpi, int tile_row, int tile_col,
1372
55.4k
                                 int mi_row, TOKENEXTRA **tok) {
1373
55.4k
  VP9_COMMON *const cm = &cpi->common;
1374
55.4k
  const int tile_cols = 1 << cm->log2_tile_cols;
1375
55.4k
  TileDataEnc *this_tile = &cpi->tile_data[tile_row * tile_cols + tile_col];
1376
55.4k
  const TileInfo *const tile_info = &this_tile->tile_info;
1377
1378
55.4k
  int tile_mb_cols = (tile_info->mi_col_end - tile_info->mi_col_start + 1) >> 1;
1379
55.4k
  const int mb_row = (mi_row - tile_info->mi_row_start) >> 1;
1380
1381
55.4k
  *tok =
1382
55.4k
      cpi->tile_tok[tile_row][tile_col] + get_token_alloc(mb_row, tile_mb_cols);
1383
55.4k
}
Unexecuted instantiation: vp9_cx_iface.c:get_start_tok
Unexecuted instantiation: vp9_firstpass.c:get_start_tok
Unexecuted instantiation: vp9_mcomp.c:get_start_tok
Unexecuted instantiation: vp9_encoder.c:get_start_tok
Unexecuted instantiation: vp9_picklpf.c:get_start_tok
Unexecuted instantiation: vp9_quantize.c:get_start_tok
Unexecuted instantiation: vp9_ratectrl.c:get_start_tok
Unexecuted instantiation: vp9_rd.c:get_start_tok
Unexecuted instantiation: vp9_segmentation.c:get_start_tok
Unexecuted instantiation: vp9_speed_features.c:get_start_tok
Unexecuted instantiation: vp9_svc_layercontext.c:get_start_tok
Unexecuted instantiation: vp9_tokenize.c:get_start_tok
Unexecuted instantiation: vp9_aq_variance.c:get_start_tok
Unexecuted instantiation: vp9_aq_360.c:get_start_tok
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:get_start_tok
Unexecuted instantiation: vp9_aq_complexity.c:get_start_tok
Unexecuted instantiation: vp9_alt_ref_aq.c:get_start_tok
Unexecuted instantiation: vp9_skin_detection.c:get_start_tok
Unexecuted instantiation: vp9_noise_estimate.c:get_start_tok
Unexecuted instantiation: vp9_ext_ratectrl.c:get_start_tok
Unexecuted instantiation: vp9_temporal_filter.c:get_start_tok
Unexecuted instantiation: vp9_tpl_model.c:get_start_tok
Unexecuted instantiation: vp9_mbgraph.c:get_start_tok
Unexecuted instantiation: vp9_bitstream.c:get_start_tok
Unexecuted instantiation: vp9_context_tree.c:get_start_tok
vp9_encodeframe.c:get_start_tok
Line
Count
Source
1372
55.4k
                                 int mi_row, TOKENEXTRA **tok) {
1373
55.4k
  VP9_COMMON *const cm = &cpi->common;
1374
55.4k
  const int tile_cols = 1 << cm->log2_tile_cols;
1375
55.4k
  TileDataEnc *this_tile = &cpi->tile_data[tile_row * tile_cols + tile_col];
1376
55.4k
  const TileInfo *const tile_info = &this_tile->tile_info;
1377
1378
55.4k
  int tile_mb_cols = (tile_info->mi_col_end - tile_info->mi_col_start + 1) >> 1;
1379
55.4k
  const int mb_row = (mi_row - tile_info->mi_row_start) >> 1;
1380
1381
55.4k
  *tok =
1382
55.4k
      cpi->tile_tok[tile_row][tile_col] + get_token_alloc(mb_row, tile_mb_cols);
1383
55.4k
}
Unexecuted instantiation: vp9_encodemb.c:get_start_tok
Unexecuted instantiation: vp9_encodemv.c:get_start_tok
Unexecuted instantiation: vp9_ethread.c:get_start_tok
Unexecuted instantiation: vp9_frame_scale.c:get_start_tok
Unexecuted instantiation: vp9_lookahead.c:get_start_tok
Unexecuted instantiation: vp9_multi_thread.c:get_start_tok
Unexecuted instantiation: vp9_rdopt.c:get_start_tok
Unexecuted instantiation: vp9_pickmode.c:get_start_tok
Unexecuted instantiation: temporal_filter_sse4.c:get_start_tok
Unexecuted instantiation: highbd_temporal_filter_sse4.c:get_start_tok
1384
1385
int64_t vp9_get_y_sse(const YV12_BUFFER_CONFIG *a, const YV12_BUFFER_CONFIG *b);
1386
#if CONFIG_VP9_HIGHBITDEPTH
1387
int64_t vp9_highbd_get_y_sse(const YV12_BUFFER_CONFIG *a,
1388
                             const YV12_BUFFER_CONFIG *b);
1389
#endif  // CONFIG_VP9_HIGHBITDEPTH
1390
1391
void vp9_scale_references(VP9_COMP *cpi);
1392
1393
void vp9_update_reference_frames(VP9_COMP *cpi);
1394
1395
void vp9_get_ref_frame_info(FRAME_UPDATE_TYPE update_type, int ref_frame_flags,
1396
                            RefCntBuffer *ref_frame_bufs[MAX_INTER_REF_FRAMES],
1397
                            int *ref_frame_coding_indexes,
1398
                            int *ref_frame_valid_list);
1399
1400
void vp9_set_high_precision_mv(VP9_COMP *cpi, int allow_high_precision_mv);
1401
1402
#if CONFIG_VP9_HIGHBITDEPTH
1403
void vp9_scale_and_extend_frame_nonnormative(const YV12_BUFFER_CONFIG *src,
1404
                                             YV12_BUFFER_CONFIG *dst, int bd);
1405
#else
1406
void vp9_scale_and_extend_frame_nonnormative(const YV12_BUFFER_CONFIG *src,
1407
                                             YV12_BUFFER_CONFIG *dst);
1408
#endif  // CONFIG_VP9_HIGHBITDEPTH
1409
1410
YV12_BUFFER_CONFIG *vp9_scale_if_required(
1411
    VP9_COMMON *cm, YV12_BUFFER_CONFIG *unscaled, YV12_BUFFER_CONFIG *scaled,
1412
    int use_normative_scaler, INTERP_FILTER filter_type, int phase_scaler);
1413
1414
void vp9_apply_encoding_flags(VP9_COMP *cpi, vpx_enc_frame_flags_t flags);
1415
1416
713k
static INLINE int is_one_pass_svc(const struct VP9_COMP *const cpi) {
1417
713k
  return (cpi->use_svc && cpi->oxcf.pass == 0);
1418
713k
}
vp9_cx_iface.c:is_one_pass_svc
Line
Count
Source
1416
42.2k
static INLINE int is_one_pass_svc(const struct VP9_COMP *const cpi) {
1417
42.2k
  return (cpi->use_svc && cpi->oxcf.pass == 0);
1418
42.2k
}
Unexecuted instantiation: vp9_firstpass.c:is_one_pass_svc
Unexecuted instantiation: vp9_mcomp.c:is_one_pass_svc
vp9_encoder.c:is_one_pass_svc
Line
Count
Source
1416
628k
static INLINE int is_one_pass_svc(const struct VP9_COMP *const cpi) {
1417
628k
  return (cpi->use_svc && cpi->oxcf.pass == 0);
1418
628k
}
Unexecuted instantiation: vp9_picklpf.c:is_one_pass_svc
Unexecuted instantiation: vp9_quantize.c:is_one_pass_svc
vp9_ratectrl.c:is_one_pass_svc
Line
Count
Source
1416
42.2k
static INLINE int is_one_pass_svc(const struct VP9_COMP *const cpi) {
1417
42.2k
  return (cpi->use_svc && cpi->oxcf.pass == 0);
1418
42.2k
}
Unexecuted instantiation: vp9_rd.c:is_one_pass_svc
Unexecuted instantiation: vp9_segmentation.c:is_one_pass_svc
Unexecuted instantiation: vp9_speed_features.c:is_one_pass_svc
Unexecuted instantiation: vp9_svc_layercontext.c:is_one_pass_svc
Unexecuted instantiation: vp9_tokenize.c:is_one_pass_svc
Unexecuted instantiation: vp9_aq_variance.c:is_one_pass_svc
Unexecuted instantiation: vp9_aq_360.c:is_one_pass_svc
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:is_one_pass_svc
Unexecuted instantiation: vp9_aq_complexity.c:is_one_pass_svc
Unexecuted instantiation: vp9_alt_ref_aq.c:is_one_pass_svc
Unexecuted instantiation: vp9_skin_detection.c:is_one_pass_svc
Unexecuted instantiation: vp9_noise_estimate.c:is_one_pass_svc
Unexecuted instantiation: vp9_ext_ratectrl.c:is_one_pass_svc
Unexecuted instantiation: vp9_temporal_filter.c:is_one_pass_svc
Unexecuted instantiation: vp9_tpl_model.c:is_one_pass_svc
Unexecuted instantiation: vp9_mbgraph.c:is_one_pass_svc
Unexecuted instantiation: vp9_bitstream.c:is_one_pass_svc
Unexecuted instantiation: vp9_context_tree.c:is_one_pass_svc
Unexecuted instantiation: vp9_encodeframe.c:is_one_pass_svc
Unexecuted instantiation: vp9_encodemb.c:is_one_pass_svc
Unexecuted instantiation: vp9_encodemv.c:is_one_pass_svc
Unexecuted instantiation: vp9_ethread.c:is_one_pass_svc
Unexecuted instantiation: vp9_frame_scale.c:is_one_pass_svc
Unexecuted instantiation: vp9_lookahead.c:is_one_pass_svc
Unexecuted instantiation: vp9_multi_thread.c:is_one_pass_svc
Unexecuted instantiation: vp9_rdopt.c:is_one_pass_svc
Unexecuted instantiation: vp9_pickmode.c:is_one_pass_svc
Unexecuted instantiation: temporal_filter_sse4.c:is_one_pass_svc
Unexecuted instantiation: highbd_temporal_filter_sse4.c:is_one_pass_svc
1419
1420
#if CONFIG_VP9_TEMPORAL_DENOISING
1421
static INLINE int denoise_svc(const struct VP9_COMP *const cpi) {
1422
  return (!cpi->use_svc || (cpi->use_svc && cpi->svc.spatial_layer_id >=
1423
                                                cpi->svc.first_layer_denoise));
1424
}
1425
#endif
1426
1427
295k
#define MIN_LOOKAHEAD_FOR_ARFS 4
1428
147k
static INLINE int is_altref_enabled(const VP9_COMP *const cpi) {
1429
147k
  return !(cpi->oxcf.mode == REALTIME && cpi->oxcf.rc_mode == VPX_CBR) &&
1430
147k
         cpi->oxcf.lag_in_frames >= MIN_LOOKAHEAD_FOR_ARFS &&
1431
147k
         cpi->oxcf.enable_auto_arf;
1432
147k
}
Unexecuted instantiation: vp9_cx_iface.c:is_altref_enabled
Unexecuted instantiation: vp9_firstpass.c:is_altref_enabled
Unexecuted instantiation: vp9_mcomp.c:is_altref_enabled
vp9_encoder.c:is_altref_enabled
Line
Count
Source
1428
105k
static INLINE int is_altref_enabled(const VP9_COMP *const cpi) {
1429
105k
  return !(cpi->oxcf.mode == REALTIME && cpi->oxcf.rc_mode == VPX_CBR) &&
1430
105k
         cpi->oxcf.lag_in_frames >= MIN_LOOKAHEAD_FOR_ARFS &&
1431
105k
         cpi->oxcf.enable_auto_arf;
1432
105k
}
Unexecuted instantiation: vp9_picklpf.c:is_altref_enabled
Unexecuted instantiation: vp9_quantize.c:is_altref_enabled
vp9_ratectrl.c:is_altref_enabled
Line
Count
Source
1428
42.2k
static INLINE int is_altref_enabled(const VP9_COMP *const cpi) {
1429
42.2k
  return !(cpi->oxcf.mode == REALTIME && cpi->oxcf.rc_mode == VPX_CBR) &&
1430
42.2k
         cpi->oxcf.lag_in_frames >= MIN_LOOKAHEAD_FOR_ARFS &&
1431
42.2k
         cpi->oxcf.enable_auto_arf;
1432
42.2k
}
Unexecuted instantiation: vp9_rd.c:is_altref_enabled
Unexecuted instantiation: vp9_segmentation.c:is_altref_enabled
Unexecuted instantiation: vp9_speed_features.c:is_altref_enabled
Unexecuted instantiation: vp9_svc_layercontext.c:is_altref_enabled
Unexecuted instantiation: vp9_tokenize.c:is_altref_enabled
Unexecuted instantiation: vp9_aq_variance.c:is_altref_enabled
Unexecuted instantiation: vp9_aq_360.c:is_altref_enabled
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:is_altref_enabled
Unexecuted instantiation: vp9_aq_complexity.c:is_altref_enabled
Unexecuted instantiation: vp9_alt_ref_aq.c:is_altref_enabled
Unexecuted instantiation: vp9_skin_detection.c:is_altref_enabled
Unexecuted instantiation: vp9_noise_estimate.c:is_altref_enabled
Unexecuted instantiation: vp9_ext_ratectrl.c:is_altref_enabled
Unexecuted instantiation: vp9_temporal_filter.c:is_altref_enabled
Unexecuted instantiation: vp9_tpl_model.c:is_altref_enabled
Unexecuted instantiation: vp9_mbgraph.c:is_altref_enabled
Unexecuted instantiation: vp9_bitstream.c:is_altref_enabled
Unexecuted instantiation: vp9_context_tree.c:is_altref_enabled
Unexecuted instantiation: vp9_encodeframe.c:is_altref_enabled
Unexecuted instantiation: vp9_encodemb.c:is_altref_enabled
Unexecuted instantiation: vp9_encodemv.c:is_altref_enabled
Unexecuted instantiation: vp9_ethread.c:is_altref_enabled
Unexecuted instantiation: vp9_frame_scale.c:is_altref_enabled
Unexecuted instantiation: vp9_lookahead.c:is_altref_enabled
Unexecuted instantiation: vp9_multi_thread.c:is_altref_enabled
Unexecuted instantiation: vp9_rdopt.c:is_altref_enabled
Unexecuted instantiation: vp9_pickmode.c:is_altref_enabled
Unexecuted instantiation: temporal_filter_sse4.c:is_altref_enabled
Unexecuted instantiation: highbd_temporal_filter_sse4.c:is_altref_enabled
1433
1434
static INLINE void set_ref_ptrs(const VP9_COMMON *const cm, MACROBLOCKD *xd,
1435
                                MV_REFERENCE_FRAME ref0,
1436
53.3M
                                MV_REFERENCE_FRAME ref1) {
1437
53.3M
  xd->block_refs[0] =
1438
53.3M
      &cm->frame_refs[ref0 >= LAST_FRAME ? ref0 - LAST_FRAME : 0];
1439
53.3M
  xd->block_refs[1] =
1440
53.3M
      &cm->frame_refs[ref1 >= LAST_FRAME ? ref1 - LAST_FRAME : 0];
1441
53.3M
}
Unexecuted instantiation: vp9_cx_iface.c:set_ref_ptrs
Unexecuted instantiation: vp9_firstpass.c:set_ref_ptrs
Unexecuted instantiation: vp9_mcomp.c:set_ref_ptrs
vp9_encoder.c:set_ref_ptrs
Line
Count
Source
1436
42.2k
                                MV_REFERENCE_FRAME ref1) {
1437
42.2k
  xd->block_refs[0] =
1438
42.2k
      &cm->frame_refs[ref0 >= LAST_FRAME ? ref0 - LAST_FRAME : 0];
1439
42.2k
  xd->block_refs[1] =
1440
42.2k
      &cm->frame_refs[ref1 >= LAST_FRAME ? ref1 - LAST_FRAME : 0];
1441
42.2k
}
Unexecuted instantiation: vp9_picklpf.c:set_ref_ptrs
Unexecuted instantiation: vp9_quantize.c:set_ref_ptrs
Unexecuted instantiation: vp9_ratectrl.c:set_ref_ptrs
Unexecuted instantiation: vp9_rd.c:set_ref_ptrs
Unexecuted instantiation: vp9_segmentation.c:set_ref_ptrs
Unexecuted instantiation: vp9_speed_features.c:set_ref_ptrs
Unexecuted instantiation: vp9_svc_layercontext.c:set_ref_ptrs
Unexecuted instantiation: vp9_tokenize.c:set_ref_ptrs
Unexecuted instantiation: vp9_aq_variance.c:set_ref_ptrs
Unexecuted instantiation: vp9_aq_360.c:set_ref_ptrs
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:set_ref_ptrs
Unexecuted instantiation: vp9_aq_complexity.c:set_ref_ptrs
Unexecuted instantiation: vp9_alt_ref_aq.c:set_ref_ptrs
Unexecuted instantiation: vp9_skin_detection.c:set_ref_ptrs
Unexecuted instantiation: vp9_noise_estimate.c:set_ref_ptrs
Unexecuted instantiation: vp9_ext_ratectrl.c:set_ref_ptrs
Unexecuted instantiation: vp9_temporal_filter.c:set_ref_ptrs
Unexecuted instantiation: vp9_tpl_model.c:set_ref_ptrs
Unexecuted instantiation: vp9_mbgraph.c:set_ref_ptrs
Unexecuted instantiation: vp9_bitstream.c:set_ref_ptrs
Unexecuted instantiation: vp9_context_tree.c:set_ref_ptrs
vp9_encodeframe.c:set_ref_ptrs
Line
Count
Source
1436
3.43M
                                MV_REFERENCE_FRAME ref1) {
1437
3.43M
  xd->block_refs[0] =
1438
3.43M
      &cm->frame_refs[ref0 >= LAST_FRAME ? ref0 - LAST_FRAME : 0];
1439
3.43M
  xd->block_refs[1] =
1440
3.43M
      &cm->frame_refs[ref1 >= LAST_FRAME ? ref1 - LAST_FRAME : 0];
1441
3.43M
}
Unexecuted instantiation: vp9_encodemb.c:set_ref_ptrs
Unexecuted instantiation: vp9_encodemv.c:set_ref_ptrs
Unexecuted instantiation: vp9_ethread.c:set_ref_ptrs
Unexecuted instantiation: vp9_frame_scale.c:set_ref_ptrs
Unexecuted instantiation: vp9_lookahead.c:set_ref_ptrs
Unexecuted instantiation: vp9_multi_thread.c:set_ref_ptrs
vp9_rdopt.c:set_ref_ptrs
Line
Count
Source
1436
49.9M
                                MV_REFERENCE_FRAME ref1) {
1437
49.9M
  xd->block_refs[0] =
1438
49.9M
      &cm->frame_refs[ref0 >= LAST_FRAME ? ref0 - LAST_FRAME : 0];
1439
49.9M
  xd->block_refs[1] =
1440
49.9M
      &cm->frame_refs[ref1 >= LAST_FRAME ? ref1 - LAST_FRAME : 0];
1441
49.9M
}
Unexecuted instantiation: vp9_pickmode.c:set_ref_ptrs
Unexecuted instantiation: temporal_filter_sse4.c:set_ref_ptrs
Unexecuted instantiation: highbd_temporal_filter_sse4.c:set_ref_ptrs
1442
1443
20.0M
static INLINE int get_chessboard_index(const int frame_index) {
1444
20.0M
  return frame_index & 0x1;
1445
20.0M
}
Unexecuted instantiation: vp9_cx_iface.c:get_chessboard_index
Unexecuted instantiation: vp9_firstpass.c:get_chessboard_index
Unexecuted instantiation: vp9_mcomp.c:get_chessboard_index
Unexecuted instantiation: vp9_encoder.c:get_chessboard_index
Unexecuted instantiation: vp9_picklpf.c:get_chessboard_index
Unexecuted instantiation: vp9_quantize.c:get_chessboard_index
Unexecuted instantiation: vp9_ratectrl.c:get_chessboard_index
Unexecuted instantiation: vp9_rd.c:get_chessboard_index
Unexecuted instantiation: vp9_segmentation.c:get_chessboard_index
Unexecuted instantiation: vp9_speed_features.c:get_chessboard_index
Unexecuted instantiation: vp9_svc_layercontext.c:get_chessboard_index
Unexecuted instantiation: vp9_tokenize.c:get_chessboard_index
Unexecuted instantiation: vp9_aq_variance.c:get_chessboard_index
Unexecuted instantiation: vp9_aq_360.c:get_chessboard_index
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:get_chessboard_index
Unexecuted instantiation: vp9_aq_complexity.c:get_chessboard_index
Unexecuted instantiation: vp9_alt_ref_aq.c:get_chessboard_index
Unexecuted instantiation: vp9_skin_detection.c:get_chessboard_index
Unexecuted instantiation: vp9_noise_estimate.c:get_chessboard_index
Unexecuted instantiation: vp9_ext_ratectrl.c:get_chessboard_index
Unexecuted instantiation: vp9_temporal_filter.c:get_chessboard_index
Unexecuted instantiation: vp9_tpl_model.c:get_chessboard_index
Unexecuted instantiation: vp9_mbgraph.c:get_chessboard_index
Unexecuted instantiation: vp9_bitstream.c:get_chessboard_index
Unexecuted instantiation: vp9_context_tree.c:get_chessboard_index
Unexecuted instantiation: vp9_encodeframe.c:get_chessboard_index
Unexecuted instantiation: vp9_encodemb.c:get_chessboard_index
Unexecuted instantiation: vp9_encodemv.c:get_chessboard_index
Unexecuted instantiation: vp9_ethread.c:get_chessboard_index
Unexecuted instantiation: vp9_frame_scale.c:get_chessboard_index
Unexecuted instantiation: vp9_lookahead.c:get_chessboard_index
Unexecuted instantiation: vp9_multi_thread.c:get_chessboard_index
vp9_rdopt.c:get_chessboard_index
Line
Count
Source
1443
20.0M
static INLINE int get_chessboard_index(const int frame_index) {
1444
20.0M
  return frame_index & 0x1;
1445
20.0M
}
Unexecuted instantiation: vp9_pickmode.c:get_chessboard_index
Unexecuted instantiation: temporal_filter_sse4.c:get_chessboard_index
Unexecuted instantiation: highbd_temporal_filter_sse4.c:get_chessboard_index
1446
1447
33.2M
static INLINE int *cond_cost_list(const struct VP9_COMP *cpi, int *cost_list) {
1448
33.2M
  return cpi->sf.mv.subpel_search_method != SUBPEL_TREE ? cost_list : NULL;
1449
33.2M
}
Unexecuted instantiation: vp9_cx_iface.c:cond_cost_list
Unexecuted instantiation: vp9_firstpass.c:cond_cost_list
Unexecuted instantiation: vp9_mcomp.c:cond_cost_list
Unexecuted instantiation: vp9_encoder.c:cond_cost_list
Unexecuted instantiation: vp9_picklpf.c:cond_cost_list
Unexecuted instantiation: vp9_quantize.c:cond_cost_list
Unexecuted instantiation: vp9_ratectrl.c:cond_cost_list
Unexecuted instantiation: vp9_rd.c:cond_cost_list
Unexecuted instantiation: vp9_segmentation.c:cond_cost_list
Unexecuted instantiation: vp9_speed_features.c:cond_cost_list
Unexecuted instantiation: vp9_svc_layercontext.c:cond_cost_list
Unexecuted instantiation: vp9_tokenize.c:cond_cost_list
Unexecuted instantiation: vp9_aq_variance.c:cond_cost_list
Unexecuted instantiation: vp9_aq_360.c:cond_cost_list
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:cond_cost_list
Unexecuted instantiation: vp9_aq_complexity.c:cond_cost_list
Unexecuted instantiation: vp9_alt_ref_aq.c:cond_cost_list
Unexecuted instantiation: vp9_skin_detection.c:cond_cost_list
Unexecuted instantiation: vp9_noise_estimate.c:cond_cost_list
Unexecuted instantiation: vp9_ext_ratectrl.c:cond_cost_list
Unexecuted instantiation: vp9_temporal_filter.c:cond_cost_list
Unexecuted instantiation: vp9_tpl_model.c:cond_cost_list
Unexecuted instantiation: vp9_mbgraph.c:cond_cost_list
Unexecuted instantiation: vp9_bitstream.c:cond_cost_list
Unexecuted instantiation: vp9_context_tree.c:cond_cost_list
vp9_encodeframe.c:cond_cost_list
Line
Count
Source
1447
1.13M
static INLINE int *cond_cost_list(const struct VP9_COMP *cpi, int *cost_list) {
1448
1.13M
  return cpi->sf.mv.subpel_search_method != SUBPEL_TREE ? cost_list : NULL;
1449
1.13M
}
Unexecuted instantiation: vp9_encodemb.c:cond_cost_list
Unexecuted instantiation: vp9_encodemv.c:cond_cost_list
Unexecuted instantiation: vp9_ethread.c:cond_cost_list
Unexecuted instantiation: vp9_frame_scale.c:cond_cost_list
Unexecuted instantiation: vp9_lookahead.c:cond_cost_list
Unexecuted instantiation: vp9_multi_thread.c:cond_cost_list
vp9_rdopt.c:cond_cost_list
Line
Count
Source
1447
32.1M
static INLINE int *cond_cost_list(const struct VP9_COMP *cpi, int *cost_list) {
1448
32.1M
  return cpi->sf.mv.subpel_search_method != SUBPEL_TREE ? cost_list : NULL;
1449
32.1M
}
Unexecuted instantiation: vp9_pickmode.c:cond_cost_list
Unexecuted instantiation: temporal_filter_sse4.c:cond_cost_list
Unexecuted instantiation: highbd_temporal_filter_sse4.c:cond_cost_list
1450
1451
44.7k
static INLINE int get_num_vert_units(TileInfo tile, int shift) {
1452
44.7k
  int num_vert_units =
1453
44.7k
      (tile.mi_row_end - tile.mi_row_start + (1 << shift) - 1) >> shift;
1454
44.7k
  return num_vert_units;
1455
44.7k
}
Unexecuted instantiation: vp9_cx_iface.c:get_num_vert_units
Unexecuted instantiation: vp9_firstpass.c:get_num_vert_units
Unexecuted instantiation: vp9_mcomp.c:get_num_vert_units
Unexecuted instantiation: vp9_encoder.c:get_num_vert_units
Unexecuted instantiation: vp9_picklpf.c:get_num_vert_units
Unexecuted instantiation: vp9_quantize.c:get_num_vert_units
Unexecuted instantiation: vp9_ratectrl.c:get_num_vert_units
Unexecuted instantiation: vp9_rd.c:get_num_vert_units
Unexecuted instantiation: vp9_segmentation.c:get_num_vert_units
Unexecuted instantiation: vp9_speed_features.c:get_num_vert_units
Unexecuted instantiation: vp9_svc_layercontext.c:get_num_vert_units
Unexecuted instantiation: vp9_tokenize.c:get_num_vert_units
Unexecuted instantiation: vp9_aq_variance.c:get_num_vert_units
Unexecuted instantiation: vp9_aq_360.c:get_num_vert_units
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:get_num_vert_units
Unexecuted instantiation: vp9_aq_complexity.c:get_num_vert_units
Unexecuted instantiation: vp9_alt_ref_aq.c:get_num_vert_units
Unexecuted instantiation: vp9_skin_detection.c:get_num_vert_units
Unexecuted instantiation: vp9_noise_estimate.c:get_num_vert_units
Unexecuted instantiation: vp9_ext_ratectrl.c:get_num_vert_units
Unexecuted instantiation: vp9_temporal_filter.c:get_num_vert_units
Unexecuted instantiation: vp9_tpl_model.c:get_num_vert_units
Unexecuted instantiation: vp9_mbgraph.c:get_num_vert_units
Unexecuted instantiation: vp9_bitstream.c:get_num_vert_units
Unexecuted instantiation: vp9_context_tree.c:get_num_vert_units
vp9_encodeframe.c:get_num_vert_units
Line
Count
Source
1451
44.7k
static INLINE int get_num_vert_units(TileInfo tile, int shift) {
1452
44.7k
  int num_vert_units =
1453
44.7k
      (tile.mi_row_end - tile.mi_row_start + (1 << shift) - 1) >> shift;
1454
44.7k
  return num_vert_units;
1455
44.7k
}
Unexecuted instantiation: vp9_encodemb.c:get_num_vert_units
Unexecuted instantiation: vp9_encodemv.c:get_num_vert_units
Unexecuted instantiation: vp9_ethread.c:get_num_vert_units
Unexecuted instantiation: vp9_frame_scale.c:get_num_vert_units
Unexecuted instantiation: vp9_lookahead.c:get_num_vert_units
Unexecuted instantiation: vp9_multi_thread.c:get_num_vert_units
Unexecuted instantiation: vp9_rdopt.c:get_num_vert_units
Unexecuted instantiation: vp9_pickmode.c:get_num_vert_units
Unexecuted instantiation: temporal_filter_sse4.c:get_num_vert_units
Unexecuted instantiation: highbd_temporal_filter_sse4.c:get_num_vert_units
1456
1457
55.4k
static INLINE int get_num_cols(TileInfo tile, int shift) {
1458
55.4k
  int num_cols =
1459
55.4k
      (tile.mi_col_end - tile.mi_col_start + (1 << shift) - 1) >> shift;
1460
55.4k
  return num_cols;
1461
55.4k
}
Unexecuted instantiation: vp9_cx_iface.c:get_num_cols
Unexecuted instantiation: vp9_firstpass.c:get_num_cols
Unexecuted instantiation: vp9_mcomp.c:get_num_cols
Unexecuted instantiation: vp9_encoder.c:get_num_cols
Unexecuted instantiation: vp9_picklpf.c:get_num_cols
Unexecuted instantiation: vp9_quantize.c:get_num_cols
Unexecuted instantiation: vp9_ratectrl.c:get_num_cols
Unexecuted instantiation: vp9_rd.c:get_num_cols
Unexecuted instantiation: vp9_segmentation.c:get_num_cols
Unexecuted instantiation: vp9_speed_features.c:get_num_cols
Unexecuted instantiation: vp9_svc_layercontext.c:get_num_cols
Unexecuted instantiation: vp9_tokenize.c:get_num_cols
Unexecuted instantiation: vp9_aq_variance.c:get_num_cols
Unexecuted instantiation: vp9_aq_360.c:get_num_cols
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:get_num_cols
Unexecuted instantiation: vp9_aq_complexity.c:get_num_cols
Unexecuted instantiation: vp9_alt_ref_aq.c:get_num_cols
Unexecuted instantiation: vp9_skin_detection.c:get_num_cols
Unexecuted instantiation: vp9_noise_estimate.c:get_num_cols
Unexecuted instantiation: vp9_ext_ratectrl.c:get_num_cols
Unexecuted instantiation: vp9_temporal_filter.c:get_num_cols
Unexecuted instantiation: vp9_tpl_model.c:get_num_cols
Unexecuted instantiation: vp9_mbgraph.c:get_num_cols
Unexecuted instantiation: vp9_bitstream.c:get_num_cols
Unexecuted instantiation: vp9_context_tree.c:get_num_cols
vp9_encodeframe.c:get_num_cols
Line
Count
Source
1457
55.4k
static INLINE int get_num_cols(TileInfo tile, int shift) {
1458
55.4k
  int num_cols =
1459
55.4k
      (tile.mi_col_end - tile.mi_col_start + (1 << shift) - 1) >> shift;
1460
55.4k
  return num_cols;
1461
55.4k
}
Unexecuted instantiation: vp9_encodemb.c:get_num_cols
Unexecuted instantiation: vp9_encodemv.c:get_num_cols
Unexecuted instantiation: vp9_ethread.c:get_num_cols
Unexecuted instantiation: vp9_frame_scale.c:get_num_cols
Unexecuted instantiation: vp9_lookahead.c:get_num_cols
Unexecuted instantiation: vp9_multi_thread.c:get_num_cols
Unexecuted instantiation: vp9_rdopt.c:get_num_cols
Unexecuted instantiation: vp9_pickmode.c:get_num_cols
Unexecuted instantiation: temporal_filter_sse4.c:get_num_cols
Unexecuted instantiation: highbd_temporal_filter_sse4.c:get_num_cols
1462
1463
52.6k
static INLINE int get_level_index(VP9_LEVEL level) {
1464
52.6k
  int i;
1465
789k
  for (i = 0; i < VP9_LEVELS; ++i) {
1466
736k
    if (level == vp9_level_defs[i].level) return i;
1467
736k
  }
1468
52.6k
  return -1;
1469
52.6k
}
vp9_cx_iface.c:get_level_index
Line
Count
Source
1463
23.9k
static INLINE int get_level_index(VP9_LEVEL level) {
1464
23.9k
  int i;
1465
359k
  for (i = 0; i < VP9_LEVELS; ++i) {
1466
335k
    if (level == vp9_level_defs[i].level) return i;
1467
335k
  }
1468
23.9k
  return -1;
1469
23.9k
}
Unexecuted instantiation: vp9_firstpass.c:get_level_index
Unexecuted instantiation: vp9_mcomp.c:get_level_index
vp9_encoder.c:get_level_index
Line
Count
Source
1463
28.6k
static INLINE int get_level_index(VP9_LEVEL level) {
1464
28.6k
  int i;
1465
429k
  for (i = 0; i < VP9_LEVELS; ++i) {
1466
401k
    if (level == vp9_level_defs[i].level) return i;
1467
401k
  }
1468
28.6k
  return -1;
1469
28.6k
}
Unexecuted instantiation: vp9_picklpf.c:get_level_index
Unexecuted instantiation: vp9_quantize.c:get_level_index
Unexecuted instantiation: vp9_ratectrl.c:get_level_index
Unexecuted instantiation: vp9_rd.c:get_level_index
Unexecuted instantiation: vp9_segmentation.c:get_level_index
Unexecuted instantiation: vp9_speed_features.c:get_level_index
Unexecuted instantiation: vp9_svc_layercontext.c:get_level_index
Unexecuted instantiation: vp9_tokenize.c:get_level_index
Unexecuted instantiation: vp9_aq_variance.c:get_level_index
Unexecuted instantiation: vp9_aq_360.c:get_level_index
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:get_level_index
Unexecuted instantiation: vp9_aq_complexity.c:get_level_index
Unexecuted instantiation: vp9_alt_ref_aq.c:get_level_index
Unexecuted instantiation: vp9_skin_detection.c:get_level_index
Unexecuted instantiation: vp9_noise_estimate.c:get_level_index
Unexecuted instantiation: vp9_ext_ratectrl.c:get_level_index
Unexecuted instantiation: vp9_temporal_filter.c:get_level_index
Unexecuted instantiation: vp9_tpl_model.c:get_level_index
Unexecuted instantiation: vp9_mbgraph.c:get_level_index
Unexecuted instantiation: vp9_bitstream.c:get_level_index
Unexecuted instantiation: vp9_context_tree.c:get_level_index
Unexecuted instantiation: vp9_encodeframe.c:get_level_index
Unexecuted instantiation: vp9_encodemb.c:get_level_index
Unexecuted instantiation: vp9_encodemv.c:get_level_index
Unexecuted instantiation: vp9_ethread.c:get_level_index
Unexecuted instantiation: vp9_frame_scale.c:get_level_index
Unexecuted instantiation: vp9_lookahead.c:get_level_index
Unexecuted instantiation: vp9_multi_thread.c:get_level_index
Unexecuted instantiation: vp9_rdopt.c:get_level_index
Unexecuted instantiation: vp9_pickmode.c:get_level_index
Unexecuted instantiation: temporal_filter_sse4.c:get_level_index
Unexecuted instantiation: highbd_temporal_filter_sse4.c:get_level_index
1470
1471
// Return the log2 value of max column tiles corresponding to the level that
1472
// the picture size fits into.
1473
static INLINE int log_tile_cols_from_picsize_level(uint32_t width,
1474
0
                                                   uint32_t height) {
1475
0
  int i;
1476
0
  const uint32_t pic_size = width * height;
1477
0
  const uint32_t pic_breadth = VPXMAX(width, height);
1478
0
  for (i = LEVEL_1; i < LEVEL_MAX; ++i) {
1479
0
    if (vp9_level_defs[i].max_luma_picture_size >= pic_size &&
1480
0
        vp9_level_defs[i].max_luma_picture_breadth >= pic_breadth) {
1481
0
      return get_msb(vp9_level_defs[i].max_col_tiles);
1482
0
    }
1483
0
  }
1484
0
  return INT_MAX;
1485
0
}
Unexecuted instantiation: vp9_cx_iface.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_firstpass.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_mcomp.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_encoder.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_picklpf.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_quantize.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_ratectrl.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_rd.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_segmentation.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_speed_features.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_svc_layercontext.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_tokenize.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_aq_variance.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_aq_360.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_aq_complexity.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_alt_ref_aq.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_skin_detection.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_noise_estimate.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_ext_ratectrl.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_temporal_filter.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_tpl_model.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_mbgraph.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_bitstream.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_context_tree.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_encodeframe.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_encodemb.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_encodemv.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_ethread.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_frame_scale.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_lookahead.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_multi_thread.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_rdopt.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: vp9_pickmode.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: temporal_filter_sse4.c:log_tile_cols_from_picsize_level
Unexecuted instantiation: highbd_temporal_filter_sse4.c:log_tile_cols_from_picsize_level
1486
1487
VP9_LEVEL vp9_get_level(const Vp9LevelSpec *const level_spec);
1488
1489
vpx_codec_err_t vp9_set_roi_map(VP9_COMP *cpi, unsigned char *map,
1490
                                unsigned int rows, unsigned int cols,
1491
                                int delta_q[8], int delta_lf[8], int skip[8],
1492
                                int ref_frame[8]);
1493
1494
void vp9_new_framerate(VP9_COMP *cpi, double framerate);
1495
1496
void vp9_set_row_mt(VP9_COMP *cpi);
1497
1498
int vp9_get_psnr(const VP9_COMP *cpi, PSNR_STATS *psnr);
1499
1500
2.98k
#define LAYER_IDS_TO_IDX(sl, tl, num_tl) ((sl) * (num_tl) + (tl))
1501
1502
42.2k
static INLINE void alloc_frame_mvs(VP9_COMMON *const cm, int buffer_idx) {
1503
42.2k
  RefCntBuffer *const new_fb_ptr = &cm->buffer_pool->frame_bufs[buffer_idx];
1504
42.2k
  if (new_fb_ptr->mvs == NULL || new_fb_ptr->mi_rows < cm->mi_rows ||
1505
42.2k
      new_fb_ptr->mi_cols < cm->mi_cols) {
1506
7.00k
    vpx_free(new_fb_ptr->mvs);
1507
7.00k
    CHECK_MEM_ERROR(&cm->error, new_fb_ptr->mvs,
1508
7.00k
                    (MV_REF *)vpx_calloc(cm->mi_rows * cm->mi_cols,
1509
7.00k
                                         sizeof(*new_fb_ptr->mvs)));
1510
7.00k
    new_fb_ptr->mi_rows = cm->mi_rows;
1511
7.00k
    new_fb_ptr->mi_cols = cm->mi_cols;
1512
7.00k
  }
1513
42.2k
}
Unexecuted instantiation: vp9_cx_iface.c:alloc_frame_mvs
Unexecuted instantiation: vp9_firstpass.c:alloc_frame_mvs
Unexecuted instantiation: vp9_mcomp.c:alloc_frame_mvs
vp9_encoder.c:alloc_frame_mvs
Line
Count
Source
1502
42.2k
static INLINE void alloc_frame_mvs(VP9_COMMON *const cm, int buffer_idx) {
1503
42.2k
  RefCntBuffer *const new_fb_ptr = &cm->buffer_pool->frame_bufs[buffer_idx];
1504
42.2k
  if (new_fb_ptr->mvs == NULL || new_fb_ptr->mi_rows < cm->mi_rows ||
1505
42.2k
      new_fb_ptr->mi_cols < cm->mi_cols) {
1506
7.00k
    vpx_free(new_fb_ptr->mvs);
1507
7.00k
    CHECK_MEM_ERROR(&cm->error, new_fb_ptr->mvs,
1508
7.00k
                    (MV_REF *)vpx_calloc(cm->mi_rows * cm->mi_cols,
1509
7.00k
                                         sizeof(*new_fb_ptr->mvs)));
1510
7.00k
    new_fb_ptr->mi_rows = cm->mi_rows;
1511
7.00k
    new_fb_ptr->mi_cols = cm->mi_cols;
1512
7.00k
  }
1513
42.2k
}
Unexecuted instantiation: vp9_picklpf.c:alloc_frame_mvs
Unexecuted instantiation: vp9_quantize.c:alloc_frame_mvs
Unexecuted instantiation: vp9_ratectrl.c:alloc_frame_mvs
Unexecuted instantiation: vp9_rd.c:alloc_frame_mvs
Unexecuted instantiation: vp9_segmentation.c:alloc_frame_mvs
Unexecuted instantiation: vp9_speed_features.c:alloc_frame_mvs
Unexecuted instantiation: vp9_svc_layercontext.c:alloc_frame_mvs
Unexecuted instantiation: vp9_tokenize.c:alloc_frame_mvs
Unexecuted instantiation: vp9_aq_variance.c:alloc_frame_mvs
Unexecuted instantiation: vp9_aq_360.c:alloc_frame_mvs
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:alloc_frame_mvs
Unexecuted instantiation: vp9_aq_complexity.c:alloc_frame_mvs
Unexecuted instantiation: vp9_alt_ref_aq.c:alloc_frame_mvs
Unexecuted instantiation: vp9_skin_detection.c:alloc_frame_mvs
Unexecuted instantiation: vp9_noise_estimate.c:alloc_frame_mvs
Unexecuted instantiation: vp9_ext_ratectrl.c:alloc_frame_mvs
Unexecuted instantiation: vp9_temporal_filter.c:alloc_frame_mvs
Unexecuted instantiation: vp9_tpl_model.c:alloc_frame_mvs
Unexecuted instantiation: vp9_mbgraph.c:alloc_frame_mvs
Unexecuted instantiation: vp9_bitstream.c:alloc_frame_mvs
Unexecuted instantiation: vp9_context_tree.c:alloc_frame_mvs
Unexecuted instantiation: vp9_encodeframe.c:alloc_frame_mvs
Unexecuted instantiation: vp9_encodemb.c:alloc_frame_mvs
Unexecuted instantiation: vp9_encodemv.c:alloc_frame_mvs
Unexecuted instantiation: vp9_ethread.c:alloc_frame_mvs
Unexecuted instantiation: vp9_frame_scale.c:alloc_frame_mvs
Unexecuted instantiation: vp9_lookahead.c:alloc_frame_mvs
Unexecuted instantiation: vp9_multi_thread.c:alloc_frame_mvs
Unexecuted instantiation: vp9_rdopt.c:alloc_frame_mvs
Unexecuted instantiation: vp9_pickmode.c:alloc_frame_mvs
Unexecuted instantiation: temporal_filter_sse4.c:alloc_frame_mvs
Unexecuted instantiation: highbd_temporal_filter_sse4.c:alloc_frame_mvs
1514
1515
static INLINE int mv_cost(const MV *mv, const int *joint_cost,
1516
975M
                          int *const comp_cost[2]) {
1517
975M
  assert(mv->row >= -MV_MAX && mv->row < MV_MAX);
1518
975M
  assert(mv->col >= -MV_MAX && mv->col < MV_MAX);
1519
975M
  return joint_cost[vp9_get_mv_joint(mv)] + comp_cost[0][mv->row] +
1520
975M
         comp_cost[1][mv->col];
1521
975M
}
Unexecuted instantiation: vp9_cx_iface.c:mv_cost
Unexecuted instantiation: vp9_firstpass.c:mv_cost
vp9_mcomp.c:mv_cost
Line
Count
Source
1516
975M
                          int *const comp_cost[2]) {
1517
975M
  assert(mv->row >= -MV_MAX && mv->row < MV_MAX);
1518
975M
  assert(mv->col >= -MV_MAX && mv->col < MV_MAX);
1519
975M
  return joint_cost[vp9_get_mv_joint(mv)] + comp_cost[0][mv->row] +
1520
975M
         comp_cost[1][mv->col];
1521
975M
}
Unexecuted instantiation: vp9_encoder.c:mv_cost
Unexecuted instantiation: vp9_picklpf.c:mv_cost
Unexecuted instantiation: vp9_quantize.c:mv_cost
Unexecuted instantiation: vp9_ratectrl.c:mv_cost
Unexecuted instantiation: vp9_rd.c:mv_cost
Unexecuted instantiation: vp9_segmentation.c:mv_cost
Unexecuted instantiation: vp9_speed_features.c:mv_cost
Unexecuted instantiation: vp9_svc_layercontext.c:mv_cost
Unexecuted instantiation: vp9_tokenize.c:mv_cost
Unexecuted instantiation: vp9_aq_variance.c:mv_cost
Unexecuted instantiation: vp9_aq_360.c:mv_cost
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:mv_cost
Unexecuted instantiation: vp9_aq_complexity.c:mv_cost
Unexecuted instantiation: vp9_alt_ref_aq.c:mv_cost
Unexecuted instantiation: vp9_skin_detection.c:mv_cost
Unexecuted instantiation: vp9_noise_estimate.c:mv_cost
Unexecuted instantiation: vp9_ext_ratectrl.c:mv_cost
Unexecuted instantiation: vp9_temporal_filter.c:mv_cost
Unexecuted instantiation: vp9_tpl_model.c:mv_cost
Unexecuted instantiation: vp9_mbgraph.c:mv_cost
Unexecuted instantiation: vp9_bitstream.c:mv_cost
Unexecuted instantiation: vp9_context_tree.c:mv_cost
Unexecuted instantiation: vp9_encodeframe.c:mv_cost
Unexecuted instantiation: vp9_encodemb.c:mv_cost
Unexecuted instantiation: vp9_encodemv.c:mv_cost
Unexecuted instantiation: vp9_ethread.c:mv_cost
Unexecuted instantiation: vp9_frame_scale.c:mv_cost
Unexecuted instantiation: vp9_lookahead.c:mv_cost
Unexecuted instantiation: vp9_multi_thread.c:mv_cost
Unexecuted instantiation: vp9_rdopt.c:mv_cost
Unexecuted instantiation: vp9_pickmode.c:mv_cost
Unexecuted instantiation: temporal_filter_sse4.c:mv_cost
Unexecuted instantiation: highbd_temporal_filter_sse4.c:mv_cost
1522
1523
static INLINE int mvsad_err_cost(const MACROBLOCK *x, const MV *mv,
1524
553M
                                 const MV *ref, int sad_per_bit) {
1525
553M
  MV diff;
1526
553M
  diff.row = mv->row - ref->row;
1527
553M
  diff.col = mv->col - ref->col;
1528
553M
  return ROUND_POWER_OF_TWO(
1529
553M
      (unsigned)mv_cost(&diff, x->nmvjointsadcost, x->nmvsadcost) * sad_per_bit,
1530
553M
      VP9_PROB_COST_SHIFT);
1531
553M
}
Unexecuted instantiation: vp9_cx_iface.c:mvsad_err_cost
Unexecuted instantiation: vp9_firstpass.c:mvsad_err_cost
vp9_mcomp.c:mvsad_err_cost
Line
Count
Source
1524
553M
                                 const MV *ref, int sad_per_bit) {
1525
553M
  MV diff;
1526
553M
  diff.row = mv->row - ref->row;
1527
553M
  diff.col = mv->col - ref->col;
1528
553M
  return ROUND_POWER_OF_TWO(
1529
553M
      (unsigned)mv_cost(&diff, x->nmvjointsadcost, x->nmvsadcost) * sad_per_bit,
1530
553M
      VP9_PROB_COST_SHIFT);
1531
553M
}
Unexecuted instantiation: vp9_encoder.c:mvsad_err_cost
Unexecuted instantiation: vp9_picklpf.c:mvsad_err_cost
Unexecuted instantiation: vp9_quantize.c:mvsad_err_cost
Unexecuted instantiation: vp9_ratectrl.c:mvsad_err_cost
Unexecuted instantiation: vp9_rd.c:mvsad_err_cost
Unexecuted instantiation: vp9_segmentation.c:mvsad_err_cost
Unexecuted instantiation: vp9_speed_features.c:mvsad_err_cost
Unexecuted instantiation: vp9_svc_layercontext.c:mvsad_err_cost
Unexecuted instantiation: vp9_tokenize.c:mvsad_err_cost
Unexecuted instantiation: vp9_aq_variance.c:mvsad_err_cost
Unexecuted instantiation: vp9_aq_360.c:mvsad_err_cost
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:mvsad_err_cost
Unexecuted instantiation: vp9_aq_complexity.c:mvsad_err_cost
Unexecuted instantiation: vp9_alt_ref_aq.c:mvsad_err_cost
Unexecuted instantiation: vp9_skin_detection.c:mvsad_err_cost
Unexecuted instantiation: vp9_noise_estimate.c:mvsad_err_cost
Unexecuted instantiation: vp9_ext_ratectrl.c:mvsad_err_cost
Unexecuted instantiation: vp9_temporal_filter.c:mvsad_err_cost
Unexecuted instantiation: vp9_tpl_model.c:mvsad_err_cost
Unexecuted instantiation: vp9_mbgraph.c:mvsad_err_cost
Unexecuted instantiation: vp9_bitstream.c:mvsad_err_cost
Unexecuted instantiation: vp9_context_tree.c:mvsad_err_cost
Unexecuted instantiation: vp9_encodeframe.c:mvsad_err_cost
Unexecuted instantiation: vp9_encodemb.c:mvsad_err_cost
Unexecuted instantiation: vp9_encodemv.c:mvsad_err_cost
Unexecuted instantiation: vp9_ethread.c:mvsad_err_cost
Unexecuted instantiation: vp9_frame_scale.c:mvsad_err_cost
Unexecuted instantiation: vp9_lookahead.c:mvsad_err_cost
Unexecuted instantiation: vp9_multi_thread.c:mvsad_err_cost
Unexecuted instantiation: vp9_rdopt.c:mvsad_err_cost
Unexecuted instantiation: vp9_pickmode.c:mvsad_err_cost
Unexecuted instantiation: temporal_filter_sse4.c:mvsad_err_cost
Unexecuted instantiation: highbd_temporal_filter_sse4.c:mvsad_err_cost
1532
1533
static INLINE uint32_t get_start_mv_sad(const MACROBLOCK *x, const MV *mvp_full,
1534
                                        const MV *ref_mv_full,
1535
0
                                        vpx_sad_fn_t sad_fn_ptr, int sadpb) {
1536
0
  const int src_buf_stride = x->plane[0].src.stride;
1537
0
  const uint8_t *const src_buf = x->plane[0].src.buf;
1538
0
  const MACROBLOCKD *const xd = &x->e_mbd;
1539
0
  const int pred_buf_stride = xd->plane[0].pre[0].stride;
1540
0
  const uint8_t *const pred_buf =
1541
0
      xd->plane[0].pre[0].buf + mvp_full->row * pred_buf_stride + mvp_full->col;
1542
0
  uint32_t start_mv_sad =
1543
0
      sad_fn_ptr(src_buf, src_buf_stride, pred_buf, pred_buf_stride);
1544
0
  start_mv_sad += mvsad_err_cost(x, mvp_full, ref_mv_full, sadpb);
1545
1546
0
  return start_mv_sad;
1547
0
}
Unexecuted instantiation: vp9_cx_iface.c:get_start_mv_sad
Unexecuted instantiation: vp9_firstpass.c:get_start_mv_sad
Unexecuted instantiation: vp9_mcomp.c:get_start_mv_sad
Unexecuted instantiation: vp9_encoder.c:get_start_mv_sad
Unexecuted instantiation: vp9_picklpf.c:get_start_mv_sad
Unexecuted instantiation: vp9_quantize.c:get_start_mv_sad
Unexecuted instantiation: vp9_ratectrl.c:get_start_mv_sad
Unexecuted instantiation: vp9_rd.c:get_start_mv_sad
Unexecuted instantiation: vp9_segmentation.c:get_start_mv_sad
Unexecuted instantiation: vp9_speed_features.c:get_start_mv_sad
Unexecuted instantiation: vp9_svc_layercontext.c:get_start_mv_sad
Unexecuted instantiation: vp9_tokenize.c:get_start_mv_sad
Unexecuted instantiation: vp9_aq_variance.c:get_start_mv_sad
Unexecuted instantiation: vp9_aq_360.c:get_start_mv_sad
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:get_start_mv_sad
Unexecuted instantiation: vp9_aq_complexity.c:get_start_mv_sad
Unexecuted instantiation: vp9_alt_ref_aq.c:get_start_mv_sad
Unexecuted instantiation: vp9_skin_detection.c:get_start_mv_sad
Unexecuted instantiation: vp9_noise_estimate.c:get_start_mv_sad
Unexecuted instantiation: vp9_ext_ratectrl.c:get_start_mv_sad
Unexecuted instantiation: vp9_temporal_filter.c:get_start_mv_sad
Unexecuted instantiation: vp9_tpl_model.c:get_start_mv_sad
Unexecuted instantiation: vp9_mbgraph.c:get_start_mv_sad
Unexecuted instantiation: vp9_bitstream.c:get_start_mv_sad
Unexecuted instantiation: vp9_context_tree.c:get_start_mv_sad
Unexecuted instantiation: vp9_encodeframe.c:get_start_mv_sad
Unexecuted instantiation: vp9_encodemb.c:get_start_mv_sad
Unexecuted instantiation: vp9_encodemv.c:get_start_mv_sad
Unexecuted instantiation: vp9_ethread.c:get_start_mv_sad
Unexecuted instantiation: vp9_frame_scale.c:get_start_mv_sad
Unexecuted instantiation: vp9_lookahead.c:get_start_mv_sad
Unexecuted instantiation: vp9_multi_thread.c:get_start_mv_sad
Unexecuted instantiation: vp9_rdopt.c:get_start_mv_sad
Unexecuted instantiation: vp9_pickmode.c:get_start_mv_sad
Unexecuted instantiation: temporal_filter_sse4.c:get_start_mv_sad
Unexecuted instantiation: highbd_temporal_filter_sse4.c:get_start_mv_sad
1548
1549
static INLINE int num_4x4_to_edge(int plane_4x4_dim, int mb_to_edge_dim,
1550
327M
                                  int subsampling_dim, int blk_dim) {
1551
327M
  return plane_4x4_dim + (mb_to_edge_dim >> (5 + subsampling_dim)) - blk_dim;
1552
327M
}
Unexecuted instantiation: vp9_cx_iface.c:num_4x4_to_edge
Unexecuted instantiation: vp9_firstpass.c:num_4x4_to_edge
Unexecuted instantiation: vp9_mcomp.c:num_4x4_to_edge
Unexecuted instantiation: vp9_encoder.c:num_4x4_to_edge
Unexecuted instantiation: vp9_picklpf.c:num_4x4_to_edge
Unexecuted instantiation: vp9_quantize.c:num_4x4_to_edge
Unexecuted instantiation: vp9_ratectrl.c:num_4x4_to_edge
Unexecuted instantiation: vp9_rd.c:num_4x4_to_edge
Unexecuted instantiation: vp9_segmentation.c:num_4x4_to_edge
Unexecuted instantiation: vp9_speed_features.c:num_4x4_to_edge
Unexecuted instantiation: vp9_svc_layercontext.c:num_4x4_to_edge
Unexecuted instantiation: vp9_tokenize.c:num_4x4_to_edge
Unexecuted instantiation: vp9_aq_variance.c:num_4x4_to_edge
Unexecuted instantiation: vp9_aq_360.c:num_4x4_to_edge
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:num_4x4_to_edge
Unexecuted instantiation: vp9_aq_complexity.c:num_4x4_to_edge
Unexecuted instantiation: vp9_alt_ref_aq.c:num_4x4_to_edge
Unexecuted instantiation: vp9_skin_detection.c:num_4x4_to_edge
Unexecuted instantiation: vp9_noise_estimate.c:num_4x4_to_edge
Unexecuted instantiation: vp9_ext_ratectrl.c:num_4x4_to_edge
Unexecuted instantiation: vp9_temporal_filter.c:num_4x4_to_edge
Unexecuted instantiation: vp9_tpl_model.c:num_4x4_to_edge
Unexecuted instantiation: vp9_mbgraph.c:num_4x4_to_edge
Unexecuted instantiation: vp9_bitstream.c:num_4x4_to_edge
Unexecuted instantiation: vp9_context_tree.c:num_4x4_to_edge
Unexecuted instantiation: vp9_encodeframe.c:num_4x4_to_edge
Unexecuted instantiation: vp9_encodemb.c:num_4x4_to_edge
Unexecuted instantiation: vp9_encodemv.c:num_4x4_to_edge
Unexecuted instantiation: vp9_ethread.c:num_4x4_to_edge
Unexecuted instantiation: vp9_frame_scale.c:num_4x4_to_edge
Unexecuted instantiation: vp9_lookahead.c:num_4x4_to_edge
Unexecuted instantiation: vp9_multi_thread.c:num_4x4_to_edge
vp9_rdopt.c:num_4x4_to_edge
Line
Count
Source
1550
327M
                                  int subsampling_dim, int blk_dim) {
1551
327M
  return plane_4x4_dim + (mb_to_edge_dim >> (5 + subsampling_dim)) - blk_dim;
1552
327M
}
Unexecuted instantiation: vp9_pickmode.c:num_4x4_to_edge
Unexecuted instantiation: temporal_filter_sse4.c:num_4x4_to_edge
Unexecuted instantiation: highbd_temporal_filter_sse4.c:num_4x4_to_edge
1553
1554
// Compute the sum of squares on all visible 4x4s in the transform block.
1555
static int64_t sum_squares_visible(const MACROBLOCKD *xd,
1556
                                   const struct macroblockd_plane *const pd,
1557
                                   const int16_t *diff, const int diff_stride,
1558
                                   int blk_row, int blk_col,
1559
                                   const BLOCK_SIZE plane_bsize,
1560
                                   const BLOCK_SIZE tx_bsize,
1561
43.9M
                                   int *visible_width, int *visible_height) {
1562
43.9M
  int64_t sse;
1563
43.9M
  const int plane_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize];
1564
43.9M
  const int plane_4x4_h = num_4x4_blocks_high_lookup[plane_bsize];
1565
43.9M
  const int tx_4x4_w = num_4x4_blocks_wide_lookup[tx_bsize];
1566
43.9M
  const int tx_4x4_h = num_4x4_blocks_high_lookup[tx_bsize];
1567
43.9M
  const int b4x4s_to_right_edge = num_4x4_to_edge(
1568
43.9M
      plane_4x4_w, xd->mb_to_right_edge, pd->subsampling_x, blk_col);
1569
43.9M
  const int b4x4s_to_bottom_edge = num_4x4_to_edge(
1570
43.9M
      plane_4x4_h, xd->mb_to_bottom_edge, pd->subsampling_y, blk_row);
1571
43.9M
  if (tx_bsize == BLOCK_4X4 ||
1572
43.9M
      (b4x4s_to_right_edge >= tx_4x4_w && b4x4s_to_bottom_edge >= tx_4x4_h)) {
1573
43.5M
    assert(tx_4x4_w == tx_4x4_h);
1574
43.5M
    sse = (int64_t)vpx_sum_squares_2d_i16(diff, diff_stride, tx_4x4_w << 2);
1575
43.5M
    *visible_width = tx_4x4_w << 2;
1576
43.5M
    *visible_height = tx_4x4_h << 2;
1577
43.5M
  } else {
1578
359k
    int r, c;
1579
359k
    const int max_r = VPXMIN(b4x4s_to_bottom_edge, tx_4x4_h);
1580
359k
    const int max_c = VPXMIN(b4x4s_to_right_edge, tx_4x4_w);
1581
359k
    sse = 0;
1582
    // if we are in the unrestricted motion border.
1583
1.46M
    for (r = 0; r < max_r; ++r) {
1584
      // Skip visiting the sub blocks that are wholly within the UMV.
1585
4.99M
      for (c = 0; c < max_c; ++c) {
1586
3.88M
        sse += (int64_t)vpx_sum_squares_2d_i16(
1587
3.88M
            diff + r * diff_stride * 4 + c * 4, diff_stride, 4);
1588
3.88M
      }
1589
1.10M
    }
1590
359k
    *visible_width = max_c << 2;
1591
359k
    *visible_height = max_r << 2;
1592
359k
  }
1593
43.9M
  return sse;
1594
43.9M
}
Unexecuted instantiation: vp9_cx_iface.c:sum_squares_visible
Unexecuted instantiation: vp9_firstpass.c:sum_squares_visible
Unexecuted instantiation: vp9_mcomp.c:sum_squares_visible
Unexecuted instantiation: vp9_encoder.c:sum_squares_visible
Unexecuted instantiation: vp9_picklpf.c:sum_squares_visible
Unexecuted instantiation: vp9_quantize.c:sum_squares_visible
Unexecuted instantiation: vp9_ratectrl.c:sum_squares_visible
Unexecuted instantiation: vp9_rd.c:sum_squares_visible
Unexecuted instantiation: vp9_segmentation.c:sum_squares_visible
Unexecuted instantiation: vp9_speed_features.c:sum_squares_visible
Unexecuted instantiation: vp9_svc_layercontext.c:sum_squares_visible
Unexecuted instantiation: vp9_tokenize.c:sum_squares_visible
Unexecuted instantiation: vp9_aq_variance.c:sum_squares_visible
Unexecuted instantiation: vp9_aq_360.c:sum_squares_visible
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:sum_squares_visible
Unexecuted instantiation: vp9_aq_complexity.c:sum_squares_visible
Unexecuted instantiation: vp9_alt_ref_aq.c:sum_squares_visible
Unexecuted instantiation: vp9_skin_detection.c:sum_squares_visible
Unexecuted instantiation: vp9_noise_estimate.c:sum_squares_visible
Unexecuted instantiation: vp9_ext_ratectrl.c:sum_squares_visible
Unexecuted instantiation: vp9_temporal_filter.c:sum_squares_visible
Unexecuted instantiation: vp9_tpl_model.c:sum_squares_visible
Unexecuted instantiation: vp9_mbgraph.c:sum_squares_visible
Unexecuted instantiation: vp9_bitstream.c:sum_squares_visible
Unexecuted instantiation: vp9_context_tree.c:sum_squares_visible
Unexecuted instantiation: vp9_encodeframe.c:sum_squares_visible
Unexecuted instantiation: vp9_encodemb.c:sum_squares_visible
Unexecuted instantiation: vp9_encodemv.c:sum_squares_visible
Unexecuted instantiation: vp9_ethread.c:sum_squares_visible
Unexecuted instantiation: vp9_frame_scale.c:sum_squares_visible
Unexecuted instantiation: vp9_lookahead.c:sum_squares_visible
Unexecuted instantiation: vp9_multi_thread.c:sum_squares_visible
vp9_rdopt.c:sum_squares_visible
Line
Count
Source
1561
43.9M
                                   int *visible_width, int *visible_height) {
1562
43.9M
  int64_t sse;
1563
43.9M
  const int plane_4x4_w = num_4x4_blocks_wide_lookup[plane_bsize];
1564
43.9M
  const int plane_4x4_h = num_4x4_blocks_high_lookup[plane_bsize];
1565
43.9M
  const int tx_4x4_w = num_4x4_blocks_wide_lookup[tx_bsize];
1566
43.9M
  const int tx_4x4_h = num_4x4_blocks_high_lookup[tx_bsize];
1567
43.9M
  const int b4x4s_to_right_edge = num_4x4_to_edge(
1568
43.9M
      plane_4x4_w, xd->mb_to_right_edge, pd->subsampling_x, blk_col);
1569
43.9M
  const int b4x4s_to_bottom_edge = num_4x4_to_edge(
1570
43.9M
      plane_4x4_h, xd->mb_to_bottom_edge, pd->subsampling_y, blk_row);
1571
43.9M
  if (tx_bsize == BLOCK_4X4 ||
1572
43.9M
      (b4x4s_to_right_edge >= tx_4x4_w && b4x4s_to_bottom_edge >= tx_4x4_h)) {
1573
43.5M
    assert(tx_4x4_w == tx_4x4_h);
1574
43.5M
    sse = (int64_t)vpx_sum_squares_2d_i16(diff, diff_stride, tx_4x4_w << 2);
1575
43.5M
    *visible_width = tx_4x4_w << 2;
1576
43.5M
    *visible_height = tx_4x4_h << 2;
1577
43.5M
  } else {
1578
359k
    int r, c;
1579
359k
    const int max_r = VPXMIN(b4x4s_to_bottom_edge, tx_4x4_h);
1580
359k
    const int max_c = VPXMIN(b4x4s_to_right_edge, tx_4x4_w);
1581
359k
    sse = 0;
1582
    // if we are in the unrestricted motion border.
1583
1.46M
    for (r = 0; r < max_r; ++r) {
1584
      // Skip visiting the sub blocks that are wholly within the UMV.
1585
4.99M
      for (c = 0; c < max_c; ++c) {
1586
3.88M
        sse += (int64_t)vpx_sum_squares_2d_i16(
1587
3.88M
            diff + r * diff_stride * 4 + c * 4, diff_stride, 4);
1588
3.88M
      }
1589
1.10M
    }
1590
359k
    *visible_width = max_c << 2;
1591
359k
    *visible_height = max_r << 2;
1592
359k
  }
1593
43.9M
  return sse;
1594
43.9M
}
Unexecuted instantiation: vp9_pickmode.c:sum_squares_visible
Unexecuted instantiation: temporal_filter_sse4.c:sum_squares_visible
Unexecuted instantiation: highbd_temporal_filter_sse4.c:sum_squares_visible
1595
1596
// Check if trellis coefficient optimization of the transform block is enabled.
1597
static INLINE int do_trellis_opt(const struct macroblockd_plane *pd,
1598
                                 const int16_t *src_diff, int diff_stride,
1599
                                 int blk_row, int blk_col,
1600
                                 BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
1601
357M
                                 void *arg) {
1602
357M
  const struct encode_b_args *const args = (struct encode_b_args *)arg;
1603
357M
  const MACROBLOCK *const x = args->x;
1604
1605
357M
  switch (args->enable_trellis_opt) {
1606
244M
    case DISABLE_TRELLIS_OPT: return 0;
1607
0
    case ENABLE_TRELLIS_OPT: return 1;
1608
112M
    case ENABLE_TRELLIS_OPT_TX_RD_SRC_VAR: {
1609
112M
      vpx_clear_system_state();
1610
1611
112M
      return (args->trellis_opt_thresh > 0.0)
1612
112M
                 ? (x->log_block_src_var <= args->trellis_opt_thresh)
1613
112M
                 : 1;
1614
0
    }
1615
0
    case ENABLE_TRELLIS_OPT_TX_RD_RESIDUAL_MSE: {
1616
0
      const MACROBLOCKD *const xd = &x->e_mbd;
1617
0
      const BLOCK_SIZE tx_bsize = txsize_to_bsize[tx_size];
1618
0
#if CONFIG_VP9_HIGHBITDEPTH
1619
0
      const int dequant_shift =
1620
0
          (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) ? xd->bd - 5 : 3;
1621
#else
1622
      const int dequant_shift = 3;
1623
#endif  // CONFIG_VP9_HIGHBITDEPTH
1624
0
      const int qstep = pd->dequant[1] >> dequant_shift;
1625
0
      int *sse_calc_done = args->sse_calc_done;
1626
0
      int64_t *sse = args->sse;
1627
0
      int visible_width = 0, visible_height = 0;
1628
1629
      // TODO: Enable the sf for high bit-depth case
1630
0
      if ((xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) || !sse ||
1631
0
          !sse_calc_done)
1632
0
        return 1;
1633
1634
0
      *sse = sum_squares_visible(xd, pd, src_diff, diff_stride, blk_row,
1635
0
                                 blk_col, plane_bsize, tx_bsize, &visible_width,
1636
0
                                 &visible_height);
1637
0
      *sse_calc_done = 1;
1638
1639
0
      vpx_clear_system_state();
1640
1641
0
      return (*(sse) <= (int64_t)visible_width * visible_height * qstep *
1642
0
                            qstep * args->trellis_opt_thresh);
1643
0
    }
1644
0
    default: assert(0 && "Invalid trellis optimization method."); return 1;
1645
357M
  }
1646
357M
}
Unexecuted instantiation: vp9_cx_iface.c:do_trellis_opt
Unexecuted instantiation: vp9_firstpass.c:do_trellis_opt
Unexecuted instantiation: vp9_mcomp.c:do_trellis_opt
Unexecuted instantiation: vp9_encoder.c:do_trellis_opt
Unexecuted instantiation: vp9_picklpf.c:do_trellis_opt
Unexecuted instantiation: vp9_quantize.c:do_trellis_opt
Unexecuted instantiation: vp9_ratectrl.c:do_trellis_opt
Unexecuted instantiation: vp9_rd.c:do_trellis_opt
Unexecuted instantiation: vp9_segmentation.c:do_trellis_opt
Unexecuted instantiation: vp9_speed_features.c:do_trellis_opt
Unexecuted instantiation: vp9_svc_layercontext.c:do_trellis_opt
Unexecuted instantiation: vp9_tokenize.c:do_trellis_opt
Unexecuted instantiation: vp9_aq_variance.c:do_trellis_opt
Unexecuted instantiation: vp9_aq_360.c:do_trellis_opt
Unexecuted instantiation: vp9_aq_cyclicrefresh.c:do_trellis_opt
Unexecuted instantiation: vp9_aq_complexity.c:do_trellis_opt
Unexecuted instantiation: vp9_alt_ref_aq.c:do_trellis_opt
Unexecuted instantiation: vp9_skin_detection.c:do_trellis_opt
Unexecuted instantiation: vp9_noise_estimate.c:do_trellis_opt
Unexecuted instantiation: vp9_ext_ratectrl.c:do_trellis_opt
Unexecuted instantiation: vp9_temporal_filter.c:do_trellis_opt
Unexecuted instantiation: vp9_tpl_model.c:do_trellis_opt
Unexecuted instantiation: vp9_mbgraph.c:do_trellis_opt
Unexecuted instantiation: vp9_bitstream.c:do_trellis_opt
Unexecuted instantiation: vp9_context_tree.c:do_trellis_opt
Unexecuted instantiation: vp9_encodeframe.c:do_trellis_opt
vp9_encodemb.c:do_trellis_opt
Line
Count
Source
1601
296M
                                 void *arg) {
1602
296M
  const struct encode_b_args *const args = (struct encode_b_args *)arg;
1603
296M
  const MACROBLOCK *const x = args->x;
1604
1605
296M
  switch (args->enable_trellis_opt) {
1606
215M
    case DISABLE_TRELLIS_OPT: return 0;
1607
0
    case ENABLE_TRELLIS_OPT: return 1;
1608
80.8M
    case ENABLE_TRELLIS_OPT_TX_RD_SRC_VAR: {
1609
80.8M
      vpx_clear_system_state();
1610
1611
80.8M
      return (args->trellis_opt_thresh > 0.0)
1612
80.8M
                 ? (x->log_block_src_var <= args->trellis_opt_thresh)
1613
80.8M
                 : 1;
1614
0
    }
1615
0
    case ENABLE_TRELLIS_OPT_TX_RD_RESIDUAL_MSE: {
1616
0
      const MACROBLOCKD *const xd = &x->e_mbd;
1617
0
      const BLOCK_SIZE tx_bsize = txsize_to_bsize[tx_size];
1618
0
#if CONFIG_VP9_HIGHBITDEPTH
1619
0
      const int dequant_shift =
1620
0
          (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) ? xd->bd - 5 : 3;
1621
#else
1622
      const int dequant_shift = 3;
1623
#endif  // CONFIG_VP9_HIGHBITDEPTH
1624
0
      const int qstep = pd->dequant[1] >> dequant_shift;
1625
0
      int *sse_calc_done = args->sse_calc_done;
1626
0
      int64_t *sse = args->sse;
1627
0
      int visible_width = 0, visible_height = 0;
1628
1629
      // TODO: Enable the sf for high bit-depth case
1630
0
      if ((xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) || !sse ||
1631
0
          !sse_calc_done)
1632
0
        return 1;
1633
1634
0
      *sse = sum_squares_visible(xd, pd, src_diff, diff_stride, blk_row,
1635
0
                                 blk_col, plane_bsize, tx_bsize, &visible_width,
1636
0
                                 &visible_height);
1637
0
      *sse_calc_done = 1;
1638
1639
0
      vpx_clear_system_state();
1640
1641
0
      return (*(sse) <= (int64_t)visible_width * visible_height * qstep *
1642
0
                            qstep * args->trellis_opt_thresh);
1643
0
    }
1644
0
    default: assert(0 && "Invalid trellis optimization method."); return 1;
1645
296M
  }
1646
296M
}
Unexecuted instantiation: vp9_encodemv.c:do_trellis_opt
Unexecuted instantiation: vp9_ethread.c:do_trellis_opt
Unexecuted instantiation: vp9_frame_scale.c:do_trellis_opt
Unexecuted instantiation: vp9_lookahead.c:do_trellis_opt
Unexecuted instantiation: vp9_multi_thread.c:do_trellis_opt
vp9_rdopt.c:do_trellis_opt
Line
Count
Source
1601
60.8M
                                 void *arg) {
1602
60.8M
  const struct encode_b_args *const args = (struct encode_b_args *)arg;
1603
60.8M
  const MACROBLOCK *const x = args->x;
1604
1605
60.8M
  switch (args->enable_trellis_opt) {
1606
28.9M
    case DISABLE_TRELLIS_OPT: return 0;
1607
0
    case ENABLE_TRELLIS_OPT: return 1;
1608
31.8M
    case ENABLE_TRELLIS_OPT_TX_RD_SRC_VAR: {
1609
31.8M
      vpx_clear_system_state();
1610
1611
31.8M
      return (args->trellis_opt_thresh > 0.0)
1612
31.8M
                 ? (x->log_block_src_var <= args->trellis_opt_thresh)
1613
31.8M
                 : 1;
1614
0
    }
1615
0
    case ENABLE_TRELLIS_OPT_TX_RD_RESIDUAL_MSE: {
1616
0
      const MACROBLOCKD *const xd = &x->e_mbd;
1617
0
      const BLOCK_SIZE tx_bsize = txsize_to_bsize[tx_size];
1618
0
#if CONFIG_VP9_HIGHBITDEPTH
1619
0
      const int dequant_shift =
1620
0
          (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) ? xd->bd - 5 : 3;
1621
#else
1622
      const int dequant_shift = 3;
1623
#endif  // CONFIG_VP9_HIGHBITDEPTH
1624
0
      const int qstep = pd->dequant[1] >> dequant_shift;
1625
0
      int *sse_calc_done = args->sse_calc_done;
1626
0
      int64_t *sse = args->sse;
1627
0
      int visible_width = 0, visible_height = 0;
1628
1629
      // TODO: Enable the sf for high bit-depth case
1630
0
      if ((xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) || !sse ||
1631
0
          !sse_calc_done)
1632
0
        return 1;
1633
1634
0
      *sse = sum_squares_visible(xd, pd, src_diff, diff_stride, blk_row,
1635
0
                                 blk_col, plane_bsize, tx_bsize, &visible_width,
1636
0
                                 &visible_height);
1637
0
      *sse_calc_done = 1;
1638
1639
0
      vpx_clear_system_state();
1640
1641
0
      return (*(sse) <= (int64_t)visible_width * visible_height * qstep *
1642
0
                            qstep * args->trellis_opt_thresh);
1643
0
    }
1644
0
    default: assert(0 && "Invalid trellis optimization method."); return 1;
1645
60.8M
  }
1646
60.8M
}
Unexecuted instantiation: vp9_pickmode.c:do_trellis_opt
Unexecuted instantiation: temporal_filter_sse4.c:do_trellis_opt
Unexecuted instantiation: highbd_temporal_filter_sse4.c:do_trellis_opt
1647
1648
#if CONFIG_COLLECT_COMPONENT_TIMING
1649
static INLINE void start_timing(VP9_COMP *cpi, int component) {
1650
  vpx_usec_timer_start(&cpi->component_timer[component]);
1651
}
1652
static INLINE void end_timing(VP9_COMP *cpi, int component) {
1653
  vpx_usec_timer_mark(&cpi->component_timer[component]);
1654
  cpi->frame_component_time[component] +=
1655
      vpx_usec_timer_elapsed(&cpi->component_timer[component]);
1656
}
1657
static INLINE char const *get_frame_type_enum(int type) {
1658
  switch (type) {
1659
    case 0: return "KEY_FRAME";
1660
    case 1: return "INTER_FRAME";
1661
    default: assert(0);
1662
  }
1663
  return "error";
1664
}
1665
#endif
1666
1667
#ifdef __cplusplus
1668
}  // extern "C"
1669
#endif
1670
1671
#endif  // VPX_VP9_ENCODER_VP9_ENCODER_H_