#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "aom_mem/aom_mem.h"
#include "av1/common/entropy.h"
#include "av1/common/pred_common.h"
#include "av1/common/scan.h"
#include "av1/common/seg_common.h"
#include "av1/encoder/cost.h"
#include "av1/encoder/encoder.h"
#include "av1/encoder/encodetxb.h"
#include "av1/encoder/rdopt.h"
#include "av1/encoder/tokenize.h"
static inline int av1_fast_palette_color_index_context_on_edge(
const uint8_t *color_map, int stride, int r, int c, int *color_idx) { … }
#define SWAP …
#define INVALID_COLOR_IDX …
static inline int av1_fast_palette_color_index_context(const uint8_t *color_map,
int stride, int r, int c,
int *color_idx) { … }
#undef INVALID_COLOR_IDX
#undef SWAP
static int cost_and_tokenize_map(Av1ColorMapParam *param, TokenExtra **t,
int plane, int calc_rate, int allow_update_cdf,
FRAME_COUNTS *counts) { … }
static void get_palette_params(const MACROBLOCK *const x, int plane,
BLOCK_SIZE bsize, Av1ColorMapParam *params) { … }
static void get_color_map_params(const MACROBLOCK *const x, int plane,
BLOCK_SIZE bsize, TX_SIZE tx_size,
COLOR_MAP_TYPE type,
Av1ColorMapParam *params) { … }
int av1_cost_color_map(const MACROBLOCK *const x, int plane, BLOCK_SIZE bsize,
TX_SIZE tx_size, COLOR_MAP_TYPE type) { … }
void av1_tokenize_color_map(const MACROBLOCK *const x, int plane,
TokenExtra **t, BLOCK_SIZE bsize, TX_SIZE tx_size,
COLOR_MAP_TYPE type, int allow_update_cdf,
FRAME_COUNTS *counts) { … }
static void tokenize_vartx(ThreadData *td, TX_SIZE tx_size,
BLOCK_SIZE plane_bsize, int blk_row, int blk_col,
int block, int plane, void *arg) { … }
void av1_tokenize_sb_vartx(const AV1_COMP *cpi, ThreadData *td,
RUN_TYPE dry_run, BLOCK_SIZE bsize, int *rate,
uint8_t allow_update_cdf) { … }