• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020, Alliance for Open Media. All rights reserved
3  *
4  * This source code is subject to the terms of the BSD 2 Clause License and
5  * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
6  * was not distributed with this source code in the LICENSE file, you can
7  * obtain it at www.aomedia.org/license/software. If the Alliance for Open
8  * Media Patent License 1.0 was not distributed with this source code in the
9  * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
10  */
11 
12 #ifndef AOM_AV1_ENCODER_INTRA_MODE_SEARCH_H_
13 #define AOM_AV1_ENCODER_INTRA_MODE_SEARCH_H_
14 
15 #include "av1/encoder/encoder.h"
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 typedef struct IntraModeSearchState {
22   int skip_intra_modes;
23   PREDICTION_MODE best_intra_mode;
24   int angle_stats_ready;
25   uint8_t directional_mode_skip_mask[INTRA_MODES];
26   int rate_uv_intra;
27   int rate_uv_tokenonly;
28   int64_t dist_uvs;
29   int skip_uvs;
30   UV_PREDICTION_MODE mode_uv;
31   PALETTE_MODE_INFO pmi_uv;
32   int8_t uv_angle_delta;
33   int64_t best_pred_rd[REFERENCE_MODES];
34 } IntraModeSearchState;
35 
36 void av1_restore_uv_color_map(const AV1_COMP *const cpi, MACROBLOCK *x);
37 int av1_search_palette_mode(const AV1_COMP *cpi, MACROBLOCK *x,
38                             RD_STATS *this_rd_cost, PICK_MODE_CONTEXT *ctx,
39                             BLOCK_SIZE bsize, MB_MODE_INFO *const mbmi,
40                             PALETTE_MODE_INFO *const pmi,
41                             unsigned int *ref_costs_single,
42                             IntraModeSearchState *intra_search_state,
43                             int64_t best_rd);
44 
45 int64_t av1_rd_pick_intra_sbuv_mode(const AV1_COMP *const cpi, MACROBLOCK *x,
46                                     int *rate, int *rate_tokenonly,
47                                     int64_t *distortion, int *skippable,
48                                     BLOCK_SIZE bsize, TX_SIZE max_tx_size);
49 
50 int64_t av1_handle_intra_mode(IntraModeSearchState *intra_search_state,
51                               const AV1_COMP *cpi, MACROBLOCK *x,
52                               BLOCK_SIZE bsize, int ref_frame_cost,
53                               const PICK_MODE_CONTEXT *ctx, int disable_skip,
54                               RD_STATS *rd_stats, RD_STATS *rd_stats_y,
55                               RD_STATS *rd_stats_uv, int64_t best_rd,
56                               int64_t *best_intra_rd, int8_t best_mbmode_skip);
57 
58 int64_t av1_rd_pick_intra_sby_mode(const AV1_COMP *const cpi, MACROBLOCK *x,
59                                    int *rate, int *rate_tokenonly,
60                                    int64_t *distortion, int *skippable,
61                                    BLOCK_SIZE bsize, int64_t best_rd,
62                                    PICK_MODE_CONTEXT *ctx);
63 #endif  // AOM_AV1_ENCODER_INTRA_MODE_SEARCH_H_
64