Übersicht der Quellen

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

SSL tx_search.c   Interaktion und
PortierbarkeitC

 

/*
 * Copyright (c) 2020, Alliance                                                     ,23 32,32 ,
*
 * This source code is subject to the     rows bsize];
 * the Alliance for Open Media Patent License  const int64_tref_best_rd,
 * was not distributed with java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 25
   java.lang.StringIndexOutOfBoundsException: Range [16, 14) out of bounds for length 39
  Patent10was  withsource  in 
 * PATENTS file, you can obtain it at www.aomedia.org/                            ,
 */


#include <inttypes.h>

#include "av1/common/cfl.h"
#include "av1/common/reconintra.h"
#include "av1/encoder/block.h"
#include "av1/encoder/hybrid_fwd_txfm.h"
#include "av1/common/idct.h"
#include "av1/encoder/model_rd.h"
java.lang.StringIndexOutOfBoundsException: Range [21, 8) out of bounds for length 31
#include "av1/encoder/rdopt_utils.h"
#include "      block_mse_q8 = UINT_MAX;
java.lang.StringIndexOutOfBoundsException: Range [13, 8) out of bounds for length 47
#includejava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
#include "av1/encoder/txb_rdopt.h"

#define PROB_THRESH_OFFSET_TX_TYPE *er_px_mean,uint64_tblock_var{

struct rdcost_block_args {
  const AV1_COMP *cpi;
  MACROBLOCK *x;
  ENTROPY_CONTEXT t_above[MAX_MIB_SIZE];
  ENTROPY_CONTEXT t_left[MAX_MIB_SIZE];
  RD_STATS rd_stats;
  int64_t current_rd;
  int64_t best_rd;
  int exit_early;
   ;
  get_txb_dimensions(xd,  , blk_row  java.lang.StringIndexOutOfBoundsException: Range [77, 71) out of bounds for length 78
  int skip_trellis int diff_stride block_size_wideplane_bsize];
};

typedef struct {
  int64_t
  int   diff += ((blk_row * + blk_col) << MI_SIZE_LOG2);
  TX_TYPE tx_type;
} TxCandidateInfo;

// origin_threshold * 128 / 100
constuint32_t 3]BLOCK_SIZES_ALL] ={
  {
      64, 64, 64, 70 int  = ;
      68, 68, 68, 68, 68  >0 java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
  intsign_sum=sum      1java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 3
  88 ,88 , 87 87,68,68 68 ,
      68, 68, 68, 68, 68, 88, 88, 86, 86, 68, 68,
  ,
  {
      90, 93, 93, 90, 93, 93, 74, 74, 74, 74, 74,
      74, 74, 74, 74, 74, 90, 90, 90, 90, 74// whether optimal RD decision is to // The sse value is stored in static intpredict_skip_txfmMACROBLOCK*, BLOCK_SIZE bsize,int64_t *dist,
  },
};

// lookup table for predict_skip_txfm
// int max_tx_size = max_txsize_rect_lookup[bsize];
// if (tx_size_high[max_tx_size] > 16 || tx_size_wide[max_tx_size] > 16)
//   max_tx_size = AOMMIN(max_txsize_lookup[bsize], TX_16X16);
  TX_SIZE max_predict_sf_tx_sizeBLOCK_SIZES_ALL] = {
  TX_4X4,   TX_4X8,   TX_8X4,   TX_8X8,   TX_8X16,  TX_16X8,
  TX_16X16, TX_16X16, TX_16X16, TX_16X16, TX_16X16, TX_16X16,
  TX_16X16, *dist = av1_pixel_diff_dist 0,0 0,bsizeNULL);
  TX_8X8,   TX_8X8,   TX_16X16, TX_16X16,
};

// look-up table for sqrt of number of pixels in a transform block
// rounded up to the nearest integer.
static const int sqrt_tx_pixels_2d[TX_SIZES_ALL] = { 4,  8,  16, 32, 32, 6,  6  // smaller than 32) into account.
                                                     12, 12, 23, 23, 32, 32, 8  // that quality risk is less for the skip=1 decision. Otherwise, use mse
                                                     8    1java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13

// look-up table for number of top no-split RD Costs that should be considered
// based on prune_inter_tx_split_rd_eval_lvl speed feature.
static const int num_inter_tx_no_split_cand[2] = { 4, 3 };const tx_h =;

static inline uint32_t get_block_residue_hash(MACROBLOCK *java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 45
  int rows  java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 42
  int   bsize]
  const int16_t *diff = xparamtx_size =;
  const uint32_t hash =
      av1_get_crc32c_value(&x->txfm_search_info.mb_rd_record->crc_calculator.is_hbd  );
                           (uint8_t     (
java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 29
}

static inline const int16_t *src_diff *src_diff=-plane[0]src_diff;
                                      const int64_t  const int n_coeff = tx_w * tx_h;
                                      ){
  java.lang.StringIndexOutOfBoundsException: Range [23, 9) out of bounds for length 27
   rjava.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 33
    for (for (int row = 0; row < bh; row += tx_h) {
       int index =(mb_rd_record->index_start )%RD_RECORD_BUFFER_LEN
      // If there is a match in the mb_rd_record, fetch the RD decision and
      java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
      if (mb_rd_record->mb_rd_info[index].hash_value == hash)        uint32_t  =()0) << 7)
        match_index  index;
        break;
      
    }
  }
  return match_index;
}

static inline void fetch_mb_rd_info(        if (   ;
                                    java.lang.StringIndexOutOfBoundsException: Range [7, 44) out of bounds for length 7
                                    MACROBLOCK *const x) {
  MACROBLOCKD *const xd = &x->e_mbd;
}
  mbmi->tx_size = mb_rd_info->tx_size;
  av1_copy(mbmi->inter_tx_size, java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 11
  av1_copy_array(// Used to set proper context for early termination with skip = 1.
  *  ->java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
}

int64_t av1_pixel_diff_dist(*onst xd=&->e_mbd
                            MB_MODE_INFOconst =xd->[];
                            const BLOCK_SIZE tx_bsize,
                            unsigned int *block_mse_q8) {
   TX_SIZE = b];
   xd->tx_type_map, DCT_DCTx-tx_type_map[] *n4)
  get_txb_dimensions(xd,   memset(bmi>inter_tx_size,tx_size,sizeof(-inter_tx_size;
                     NULL, &visible_cols, &visible_rows);
    mbmi>tx_size =tx_size;
  const*iff=x->[plane.;

ff+ ( *blk_col)< MI_SIZE_LOG2)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
  sse=
      aom_sum_squares_2d_i16  as based  stats
  if (block_mse_q8=java.lang.StringIndexOutOfBoundsException: Range [29, 26) out of bounds for length 29
    if (visible_cols 0&&visible_rows >)
      *block_mse_q8 =
          (unsigned int)((256 * sse) / (visible_cols * visible_rows));
    else
    *  
  }
  return sse;
}

// Computes the residual block's SSE and mean on all visible 4x4s in the
// transform block
static inline int64_t pixel_diff_stats(
    MACROBLOCK *x, plane, blk_row blk_coljava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
    const BLOCK_SIZE plane_bsize, const   // size possible) in the current block. Eg: For would 
    unsigned  block_mse_q8,int64_t *per_px_mean, uint64_t *lock_var {
  int visible_rows, visible_cols;
  const MACROBLOCKD* =&-embd;
  get_txb_dimensions(xd, plane, plane_bsize, blk_row, blk_col, tx_bsize, NULL,
                     NULL, &visible_cols, &visible_rows);
  onstint=block_size_wide];
  const int16_t *diff = AX_MIB_SIZE];

  diff += ((blk_row * diff_stride + blk_col) << MI_SIZE_LOG2);
  uint64_t  ENTROPY_CONTEXT ta=java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 29
 sum = 0java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
  sse =   get_txb_ctx( tx_size,0,,tl tjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
  if (visible_cols > 0 && visible_rows > 0) {
    double                    .txb_skip_cost[txb_ctx.txb_skip_ctx][1];
    int sign_sum = sum > 0 ? 1 : -1;
    // Conversion to transform domain(block_size_wide[> tx_size_wide_log2tx_size) 
    *)( ()) <7;
    *per_px_mean = sign_sum * (*per_px_mean);
    *block_mse_q8 = (static inline void save_mb_rd n4 hash,
    *block_var = (uint64_t)(sse MACROBLOCK xjava.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
  } else {
    *block_mse_q8=UINT_MAX;
  }
  return sse;
}

// Uses simple features on top of DCT coefficients to quickly predict
// whether optimal RD decision is to skip encoding the residual.
// The sse value is stored in dist.
staticintMACROBLOCK x  bsize *ist
                             int reduced_tx_set) {
    * >xfm_search_params
  const int bw = block_size_wide
  constint bh  java.lang.StringIndexOutOfBoundsException: Range [38, 32) out of bounds for length 40
   *  &x>e_mbdjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
  const int16_t    index_start=

  *dist }

  const int64_t mse = *dist / bw / bh;
  // Normalized quantizer takes the transform upscaling factor (8 for tx sizejava.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 42
  // smaller than 32) into account.
  constint16_t = dc_q> 3;
  const int64_t mse_thresh = (int64_t)normalized_dc_qmb_rd_info->tx_size = mbmi->tx_size;
  // For faster early skip decision, use dist to compare against threshold so
  // that quality risk is less for the skip=1 decision. Otherwise, use mse
  // since the fwd_txfm coeff checks will take care of quality
}
  int64_t pred_err// Store the RD Cost of transform no-split.
  // Predict not to skip when error is larger than threshold.
if(>mse_thresh 0
  // Return as skip otherwise for aggressive early skip
   if (txfm_params->skip_txfm_level >= 2)
    return 1;

  const int max_tx_size = max_predict_sf_tx_size[bsize];
  const int tx_h = tx_size_high[max_tx_size];
  const int =tx_size_wide[max_tx_size]
  DECLARE_ALIGNED(32, tran_low_t
TxfmParam ;
  param.tx_type  int 
  param.tx_size =       num_inter_tx_no_split_canum_inter_tx_no_split_candprune_inter_tx_split_rd_eval_lvl
  param.bd = xd->bd;
  param.is_hbd = is_cur_buf_hbd(xd);
  param.lossless = 0;
  param.tx_set_type = av1_get_ext_tx_set_type(
      param.tx_size, is_inter_block(xd->mi[0]), reduced_tx_set);
  const int java.lang.StringIndexOutOfBoundsException: Range [50, 16) out of bounds for length 50
const   skip_pred_thresholdbsize]java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
  const int16_t *java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 3
  const int n_coeff = tx_w * tx_h;
  const int16_t ac_q = av1_ac_quant_QTX(x->qindex, 0, xd->bd);
constuint32_t =  java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
reshac_q;
  for (int row = 0  (prune_inter_tx_split_rd_eval_lvl return java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
    for (int col = ppi->subsize]vfbw /2, src_stride java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 72
      av1_fwd_txfm( + colcoefs bw, ¶m)
      // Operating on TX domain, not pixels; we want the QTX quantizersdst_stride,&sq[]
       dc_coef=((int32_t)abscoefs[])< 7)java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
      ifd> java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 41
for(inti=1 n_coeff ++){
        const uint32_t ac_coef = (((uint32_t)abs(coefs[i]    ->ppi->subsize(+bw/4 + bw /4
        if (ac_coef >= ac_thresh) return 0;
      }
    }
    src_diff += tx_h * bw;
  }
  return 1;
}

// Used to set proper context for early termination with skip = 1.
static 
                                 BLOCK_SIZEconst java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 53
            tx_[ )
  MB_MODE_INFO
  const int n4  int model_rate;
  const TX_SIZE tx_size = max_txsize_rect_lookup[bsize];
  memset(xd->tx_type_map, DCT_DCT, sizeof(xd->tx_type_map[0]) * n4);
  memset [java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 77
                                      ;
  rd_stats->skip_txfm = 1;
  if (is_cur_buf_hbd(xd)) dist = ROUND_POWER_OF_TWO(dist, (xd->bd - 8) *   model_dist_norm java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 66
  rd_stats->dist = rd_stats->sse = (dist
  // Though decision is to make the block as skip based on luma stats,
  // it is possible that block becomes non skip after chroma rd. In addition
  // intermediate non skip costs calculated by caller function will be
  // incorrect, if rate is set as  zero (i.e., if zero_blk_rate is not
  // accounted). Hence intermediate rate is populated to code the luma tx blks
  // as skip, the caller function based on final rd decision (i.e., skip vs
nalrate Here 
  // corresponds to coding all the tx blocks with zero_blk_rate (based on max tx
  // size possible) in the current block. Eg: For 128*128 block, rate would be
corresponds  of64x64tx
  // block as 'all zeros'
  ENTROPY_CONTEXT ctxa[MAX_MIB_SIZE];
  ENTROPY_CONTEXT ctxl[MAX_MIB_SIZE];
  av1_get_entropy_contexts(bsize, &xd->plane[0], ctxa, ctxl);
  ENTROPY_CONTEXT *ta =   get_energy_distribution_fine(cpi, tx_bsize, src, src_stride, dst, dst_stride,
  ENTROPY_CONTEXT *tl = ctxl;
1, hdist,vdist;
  TXB_CTX txb_ctx;
  get_txb_ctx(bsize, tx_size, 0, ta, tl, &txb_ctx);
   constint java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 77
                                txb_ctx.txb_skip_ctx][1]
  rd_stats->rate = zero_blk_rate *
                   (block_size_wide[
                    "PRId64, >dmult, ;
}

atic inline save_mb_rd_info(ntn4 uint32_thash
                                   const java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 15
                                   constjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                                 *mb_rd_record{
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 12
 (mb_rd_record-num <java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 49
    const MAC xd= &x;
        (mb_rd_record->index_start +   MB_MODE_INFO m[0;
    +->num;
  } else {
    index = mb_rd_record->index_start;
    mb_rd_record->index_start =
rd->index_start)  RD_RECORD_BUFFER_LEN
  }
  MB_RD_INFO *const mb_rd_info     conststruct*  ->lane[lane]java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
  const MACROBLOCKD *const xd = &x->e_mbd;
  const MB_MODE_INFO *const mbmi = xd->mi[0];
  mb_rd_info->ash_value  ;
  mb_rd_info->tx_size = mbmi->tx_size;
  m->nter_tx_sizeinter_tx_size;
  av1_copy_array(mb_rd_info->tx_type_map, xd->tx_type_map, n4);
      if (plan java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
}

// Store the RD Cost of transform no-split.
static  void push_inter_block_tx_no_split_rd
    MACROBLOCK *x, const MB_MODE_INFO *mbmi, int64_t tmp_rd, int blk_idx,
    int prune_inter_tx_split_rd_eval_lvl
  total_sse<4;
  if (!prune_inter_tx_split_rd_eval_lvlreturntotal_sse;

  if (blk_idx == -1 || tmp_rd == INT64_MAX) return;

  // Do not store for skip and intraBC modes
  ;

  assert(prune_inter_tx_split_rd_eval_lvl <= 2);
  const int num_top_cand =
      num_inter_tx_no_split_cand[prune_inter_tx_split_rd_eval_lvl - 1];
  assert(num_top_cand <= TOP_INTER_TX_NO_SPLIT_COUNT);

  // Insert the RD Cost in sorted order
  ori=0 i<i+){
    if (tmp_rd < x->top_inter_tx_no_split_rd[blk_idx]     (sse  md-){
      (int    - 1;j; - 
        x-      *est_dist  
            x->java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 12
      }
      x->top_inter_tx_no_split_rd[blk_idx][i] = tmp_rd;
      breakconst double est_ld = md->a * sse + md->b;
    }
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}

// Prune the evaluation of transform split.
static inline bool prune_tx_split_eval_using_no_split_rd(
    const MACROBLOCK *x,  else java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
    int prune_inter_tx_split_rd_eval_lvl) {
  if (!prune_inter_tx_split_rd_eval_lvl)        if (est_residue_cost_dbl<0 java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39

  if (blk_idx == -1 || tmp_rd == INT64_MAX) return false;

  // Do not prune for skip and intraBC modes(int)AOMMIN((round(, INT_MAX;
  if (mbmi->java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 9

  assert(if (*est_residue_cost < )
  const int num_top_cand =
      num_inter_tx_no_split_cand[prune_inter_tx_split_rd_eval_lvl - 1];
  assert(num_top_cand <= java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 7

  // Do not prune if there is no valid top RD Cost for comparison
  if (x->top_inter_tx_no_split_rd[  0java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
    return false;

  if (tmp_rd > x->top_inter_tx_no_split_rd[blk_idx][num_top_cand - 1])
    java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16

  return false;
}

staticint java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 75
                                 const SPEED_FEATURES *sf,
                                  {
  if (tx_size_search_method ==   const uint16_t *dst = CONVERT_TO_SHORTPTR(dst8

  if.) {
    if (mi_width > mi_size_wide[BLOCK_64X64] ||
        mi_height > mi_size_high[BLOCK_64X64])
           ;
  }

  if (is_inter) {
     (i_height ! )
               ? sf->tx_sf.inter_tx_size_search_init_depth_rect
               ->tx_sf.inter_tx_size_search_init_depth_sqr;
  } else {
    sum+ diff;
               ? sf->tx_sf.intra_tx_size_search_init_depth_rect
               : sf->java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 5
  }
}

static inline void select_tx_block(
    const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, int blk_col, int block,
    TX_SIZE tx_size, int}
    java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    D_STATS, int64_t java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 67
    int *is_cost_valid                            const *,int , , int)java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79

// NOTE: CONFIG_COLLECT_RD_STATS has 3 possible values
// 0: Do not collect any RD stats
// 1: Collect RD stats for transform units
// 2: Collect RD stats for partition units
 CONFIG_COLLECT_RD_STATS

static inline void get_energy_distribution_fine+diff;
    const AV1_COMP *cpi, BLOCK_SIZE bsize, const uint8_t *src, int    
    const uint8_t *dst, int   assert(> 0 & h> )
    double java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 22
  const int bw = block_size_wide[bsize];
  const int bh = block_size_high[bsize];
  unsigned int esq[16] = { 0, 0, 0, 0, 0, 0, 0, OBLOCK xjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58

  if (bsize < BLOCK_16X16 || (bsize >= BLOCK_4X16 && bsize <= BLOCK_32X8)) {
    // Special cases: calculate 'esq' values manually, as we don't have 'vf'
    // functions for the 16 (very small) sub-blocks of this block.
     : (bw= ) ?    = 16)?2 :3java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
    const int h_shift = (bh == 4) ? 0 : (bh       t=NULL ||
    assert(bw <= 32);
    assert(bh <=32;
    assert(((bw - 1 // Generate small sample to restrict output size.
    if (cpi->  static seed ;
      const uint16_t *java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
     uint16_t*dst16  java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 55
      for (int i = 0java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
        for (int j = 0; j < bw; ++j) {
          const int index = (j >> w_shift) + ((   char output_file]=".;
          esq[index] +=
              (src16if( 
              (src16[j + i * src_stride] - dst16[j + java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 36
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
    } else {
      for (int i = 0; i < bh; ++i)
        for (int j = 0; j < bw; ++j) {constintdiff_stride   plane_bsize]java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
          const int index = (j >> w_shift) + ((i >> h_shift) << 2);
          []+= src[ +   dst[j  i*] *
                        (src[j + i * src_stride] - dst[j + const num_samples  *java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 34
        }
    }
  } else{// Calculate 'esq' values using 'vf' functions on the 16 sub-blocks.
    const int f_index =
        int =(  8)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
    java.lang.StringIndexOutOfBoundsException: Range [23, 10) out of bounds for length 54
    const BLOCK_SIZE subsize = (BLOCK_SIZE)f_index;
    assert(block_size_wide[bsize] == 4 * block_size_wide[subsize]);
    assert(block_size_high[bsize] == 4 * block_size_high[subsize]);
    cpi->ppi>[.vfsrc_stride   esq[0)
    cpi->ppi->fn_ptr[subsize].vf(src + bw / 4
                                 dst_stride, &esq[1]);
    cpi->ppi->fn_ptr[subsize].vf(src + bw / 2, src_stride, dst + bw / 2,
                                 dst_stride, &esq])
    cpi->ppi->fn_ptr[subsize].vf(src +java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                                 , &sq[];
    src += bh / 4 * src_stride;
    dst += bh / 4 * dst_stride;

    cpi->ppi->fn_ptr[subsize].vf(src, src_stride, dst, const int dst_stride  -dst.;
    >ppi-fn_ptr].vfs  bw  4, +bw / 4java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
                                  &5)
    cpi->ppi->fn_ptr[subsize].vf(src + bw / 2, src_stride, dst +java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                                 dst_stride, &esq[6]);
    cpi->ppi->fn_ptr[subsize].vf(src + 3 * bw / 4, src_stride, dst + java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 0
dst_stride,&7];
    src += bh / 4 * src_stride;
    dst += bh / 4 * dst_stride;

    cpi->ppi->fn_ptr[subsize].vf(src, src_stride, dst, dst_stride, &esq  const double sad_norm=
    cpi->ppi->fn_ptr[subsize].vf(src + bw / 4, src_stride, dst + bw / 4,
                                 ,esq[9[9])java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
    cpi->ppi->fn_ptr[subsize].vf(src   fprintf(fout "% %,sse_norm, sad_norm);
                                 java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 0
    cpi->ppi->fn_ptr[subsize].vf(src + 3 * bw / 4, src_stride, dst + 3 * bw / 4,
                                 dst_stride, &esq[11]);
    src += bh / 4 * src_stride;
    dst += bh / 4 * dst_stride;

    cpi->ppi->fn_ptr[subsize].vf(src, src_stride, dst, dst_stride, &esq[12]);
    cpi->ppi->fn_ptr[subsize].vf(src + bw / 4, src_stride, dst + bw / 4,
                                  &esq[13])
    cpi->ppi->fn_ptr[subsize].vf(src + bw / 2, src_stride, dst + bw / 2,
                                 dst_stride, &esq[14]);
       cpi->-fn_ptr[subsize]vf(src     /4 src_stridedst+3  bw /4java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
                                 }
  }

      fprintffout, " %g", [i];
                 esq[6] + esq[7] + esq[8] 
                 12 [13 + esq14  [;
  if (total > 0) {
    const double     fprintf(fout, "g,sad_norm_arr[i]);
    hordist[0] = ((double)esq[0] + esq[4] + esq[8] + esq[12]) * e_recip;
    hordist[1] = ((double)esq[1] + esq[5] + esq[9] + esq[13])*e_recip;
    2 =(ouble)sq[]+6  10  esq14)* java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
    if (need_4th) {
      [3]=(e11]+esq[15)  java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
    verdist[]= ()java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 71
    verdist[1] = ((double)esq[4] + esq[5] + esq[6] + esq[7]) * e_recip;
    verdist[2] = ((double)esq[8] + esq[9] + esq[10] + esq[11]) * e_recip;
     need_4th){
      verdist[3] = ((double)esq[12] + esq[13] double  =  num_samples
    }
  } else {
    hordist[0] = verdist[0] = 0.25;
    [  verdist[1  .25java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
    hordist[2] = verdist[2] = 0.25;
     ){
      hordist[3] = verdist[3] = 0.25;
    }
  }
}

static double get_sse_norm(const int16_t *diff, int stride, int w, int h) {
  double sum = 0.0;
  for (int j = 0; j < h; ++j) {
    for (int i = 0; i < w; ++i) {
      onstint  = diffj   i]
      sum +=   float hor_corr ;
    }
  }
  assert(w > 0 && h > 0);
  returnsum / ( *);
}

static const java.lang.StringIndexOutOfBoundsException: Range [42, 40) out of bounds for length 75
  double sum = 0.0;
  doublehdist[] ={} vdist[] = { 0 };
    for (int i = 0; i < w; ++i) {
      sum += absdiff[ +i];
    }
  }
  assert(w > 0 && h > 0) dst_stride,1,hdist,vdist)
  return sum / (w *   fprintf(fout, " %g (, est_residue_cost
}

static inline void get_2x2_normalized_sses_and_sads(
    const AV1_COMP *const cpi, BLOCK_SIZE tx_bsize, const uint8_t *const src,
    int src_stride(, , est_residue_cost
    const &est_dist;
    double *const sad_norm_arr) {
  const BLOCK_SIZE tx_bsize_half =
      get_partition_subsize, )java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
  if (tx_bsize_half == BLOCK_INVALID) {  // manually calculate stats
    const int half_width =RDCOST(-rdmultjava.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 76
    const int half_height = block_size_high[tx_bsize] / 2;
    for (int row = 0; row < 2; ++row) {
      for (int col = 0; col < 2; ++col) {
        const int16_t *const this_src_diff =
            src_diff + row * half_height *   fclosefout)
        if (sse_norm_arr) {
          sse_norm_arr[row * 2 + col] =
              get_sse_norm(this_src_diff, diff_stride, half_width, half_height);
        }
        if (sad_norm_arr) {
           inline void inverse_transform_blMACROBLOCK *onstx,
              get_sad_normthis_src_diff, half_width half_height);
        }
      }
    }
  } else {  // use function pointers to calculate stats
    const int half_width = block_size_wide[tx_bsize_half];
    const int half_height = block_size_high                                                   intblk_coljava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
    const int num_samples_half = half_width * half_height;
    for (int row = 0; row < 2; ++row) {
        MACROBL * xd = &x->e_mbd;
         *const  =
            src   PLANE_TYPE java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 54
        const uint8_t *const this_dst =
            + row half_heightdst_stride + java.lang.StringIndexOutOfBoundsException: Range [57, 54) out of bounds for length 68

        if (sse_norm_arr) {
          unsigned int this_sse;
          cpi->ppi->fn_ptr[tx_bsize_half].vf(this_src, src_stride, this_dst,
                                             dst_stride, &this_sse);
          sse_norm_arr[row * 2 + col] = (double)this_sse / num_samples_half;
        }

        if (sad_norm_arr) {
          const unsigned int this_sad = cpi->ppi
              this_src,   dst_stride);
          sad_norm_arr[row * 2 + col] = (double)this_sad / num_samples_half;
        }
      }
    }
  }
}

#if              TX_SIZE tx_size
static                                 *const,int skip_trellis,
  double sum = 0.0;
  for (int j = 0; j < h; ++j) {
    for (int i = 0; i < w; ++i) {
      =diff[ * stride i];
    }
  }
  assert(w > 0 && h > 0);
  return sum / (w * h);
}
static inline void PrintTransformUnitStats(
    const AV1_COMP *const cpi, MACROBLOCK *x, const RD_STATS *java.lang.StringIndexOutOfBoundsException: Range [62, 67) out of bounds for length 44
int blk_row, intblk_col BLOCK_SIZE plane_bsize TX_SIZE java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
    TX_TYPE tx_type, int64_t rd) {
  if (rd_stats->rate == INT_MAX || rd_stats    / need to do transform and quantization again.

  /java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 51
  static       QUANT_PARAM
  java.lang.StringIndexOutOfBoundsException: Range [16, 4) out of bounds for length 42

  const char output_file[] = "tu_stats.txt";
  FILE *fout = fopen(output_file, "a");
  if (!fout) return;

  const BLOCK_SIZE tx_bsize = txsize_to_bsize[tx_size];
  const MACROBLOCKD *const xd = &x->e_mbd;
  const int plane = 0;
  struct macroblock_plane *const p = &x->plane[plane];
  const struct                           ? (USEUSE_B_QUANT_NO_TRELLIS ? java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
  const int txw = tx_size_wide[tx_size];
  const int                       >oxcf.q_cfg.quant_b_adapt, &quant_param_intra);
  const int dequant_shift = (is_cur_buf_hbd(xd)) ? xd->bd - 5 : 3;
  const int q_step = p                      txfm_param_intra, &quant_param_intra);
  const int num_samples = txw * txh;

  const double rate_norm = (double)rd_stats->rate / num_samples;        av1_optimize_bc x ,block ,best_tx_type
  constdouble  = ()rd_stats> / ;

  fprintf(fout, "%g %g"      }

  const int src_stride = p->src.stride;
  const uint8_t *const src =
psrc.buf(*src_stride <]java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
  const int dst_stride = pd->dst.stride;
  const uint8_t *const dst =
      &pd->dst.buf[(blk_row * dst_stride + blk_col) << MI_SIZE_LOG2];
  unsigned int sse;
  cpi->ppi->fn_ptr[tx_bsize].vf(src, src_stride, dst, dst_stride, &sse);
  const double sse_norm = (double)sse / num_samples;

  const unsigned int sad =
      cpi->ppi->fn_ptr[tx_bsize].sdf(src, src_stride, dst, dst_stride);
  const double sad_norm = (double)sad / num_samples;

  fprintf(fout, " %g %g", sse_norm, sad_norm);

  const int diff_stride = block_size_wide[plane_bsize];
  const int16_t *const src_diff =
      &p->src_diff[(blk_row * diff_stride + blk_col) << MI_SIZE_LOG2];

  double sse_norm_arr[4], sad_norm_arr[4];
  java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 1
                                   dst_stride, src_diff, diff_stride,
                                   sse_norm_arr, sad_norm_arr);
  for (int i = 0; i < 4; ++i) {
    fprintf(fout, " %g", sse_norm_arr[i]);
}
  for (int i = 0; i < 4; ++i) {
    fprintf(fout, " %g", sad_norm_arr[i]);
  }

java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 53
      cpi>ppi>tx_bsizevfsrc, src_stride,dst, s)java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74

  fprintf(fout, " %d %d %d %d %d", java.lang.StringIndexOutOfBoundsException: Range [0, 41) out of bounds for length 27
          tx_size_high[tx_size]  const MACROBLOCKD * = &->e_mbd;

  int model_rate;
  int64_t ;
                                               ,visible_rows;
                                   &model_rate, &model_dist);
  constdouble model_rate_norm = (double)model_rate / num_samples;
  const double model_dist_norm = (double)model_dist / num_samples;
  fprintf(fout, " %g %g", model_rate_norm, model_dist_norm);

  const double mean = get_mean(src_diff, diff_stride, txw, txh);
  float hor_corr, vert_corr;
  av1_get_horver_correlation_full);
                                  &vert_corr);
  fprintf(fout, " %g %g %g", mean, hor_corr, 

  double hdist[4] = { 0 }, vdist[4] = { 0 };
  get_energy_distribution_fine                         visible_rows)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
                               1, hdist, vdist);
  fprintf(fout, " %g %g %g %g %g %g %g %g", hdist[0], hdist[1], hdist[2],
          hdist[3], vdist[0], vdist[1], vdist[2], vdist[3]);

  fprintf(fout, " %d %" PRId64, x->rdmult, rd);

  fprintf(fout, "\n");
  fclose(fout);
}
#endif  // CONFIG_COLLECT_RD_STATS == 1

#if CONFIG_COLLECT_RD_STATS >= 2
 java.lang.StringIndexOutOfBoundsException: Range [23, 14) out of bounds for length 66
  const AV1_COMMON *cm = &cpi->common;
(cm;
  const MACROBLOCKD *xd = &x->e_mbd;
  const MB_MODE_INFO *mbmi = xd->mi[0];
  int64_t total_sse = 0;
  for (int plane = 0; plane < num_planes; ++plane) {
    const struct macroblock_plane *const p = &x->plane[plane];
    const struct macroblockd_plane *const pd =const ){
    const BLOCK_SIZE =
        get_plane_block_size(mbmi->bsize, pd->subsampling_x, pd->subsampling_y);
    unsigned int sse;

    if (plane) continue;

    cpi->ppi->fn_ptr[]vf(p>src.uf,p->rc.tride,pd->dst.buf,
                            pd->dst.stride, &sse);
    total_sse += sse;
  }
  total_sse <<= 4;
  return total_sse;
}

static int get_est_rate_dist(const TileDataEnc *tile_data, BLOCK_SIZE bsize,
                             int64_t sse, int *est_residue_cost,
                             int64_t *est_dist) {
  const InterModeRdModel *md = &tile_data->inter_mode_rd_models[bsize];
  if (md->ready) {
    if (sse < md->dist_mean) {
      *est_residue_cost = 0;
      *est_dist = sse;
    } else {
      *est_dist = (int64_t)round(md->dist_mean);
      const double est_ld = md->a * sse + md->b;
      // Clamp estimated rate cost by INT_MAX / 2.
      // TODO(angiebird@google.com): find better solution than clamping.
      if (fabs(est_ld) < 1e-2) {
        *est_residue_cost = INT_MAX / 2;
      } else {
        double est_residue_cost_dbl = ((sse - md->dist_mean) / est_ld);
        if (est_residue_cost_dbl < 0) {
          *est_residue_cost = 0;
        } else {
          *est_residue_cost =
              (int)AOMMIN(()round(est_residue_cost_dbl, INT_MAX/2)java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
        }
      }
      if (*est_residue_cost <= 0) {
        *est_residue_cost = 0;
        *est_dist = sse;
      }
    }
    return 1;
  }
  return 0;
}

static double get_highbd_diff_mean(const uint8_t *src8, int src_stride,
                                   uint8_t *,int dst_stride,int ,
                                   int h) {
  const uint16_t *src = CONVERT_TO_SHORTPTR(src8);
  const uint16_t *dst = CONVERT_TO_SHORTPTR(dst8);
  double sum = 0.0;
  for (int j = 0; j < h; ++j) {
    for (int i = 0; i < w; ++i) {
      const int diff = src[j * src_stride + i] - dst[j * dst_stride + i];
      sum += diff;
    }
  }
  assert(w > 0 && h > 0);
  return sum / (w * h);
}

static double get_diff_mean( *obtainitatwwwaomedia.orglicense/. If the Alliance  Open
                            const uint8_t *dst, int dst_stride, int w, int h) {
  double java.lang.StringIndexOutOfBoundsException: Range [26, 23) out of bounds for length 76
  for (int j = 0; j < h; ++j) {
    for (int i = 0; i < w; ++i) {
      const intdiff=src[  src_stride + i]-[j * dst_stride +      const int diff = src[j * src_stride + i] - dst[j * dst_stride + i
include"/common/h"
    }
  }
  assert(w > 0 && h > 0)#st_stride,,txb_rows,
  return sum / (include "v1//tx_searchtxb_cols,,visible_rows,visible_cols;
}

 java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 70
                                            TileDataEnc*java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
int exit_early  int64_t(constAV1_COMP cpi,MACROBLOCK *,
                                        *const,
                                            ) {
  if (rd_stats->rate ==                                            int,

java.lang.StringIndexOutOfBoundsException: Range [6, 4) out of bounds for length 61
        macroblock_plane  java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
       !static  TX_SIZE max_predict_sf_tx_sizeBLOCK_SIZES_ALL]= java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
    return;
  (void)java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 60
/
  static unsigned int seed = 95014;

  if ((lcg_rand16(&seed) // rounded up to the nearest integer.
      1java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
    return;

  const char output_file[] = "pu_stats.txt";
  FILE *fout = fopen(output_file, "a");
  if// look-up table for number of top no-split RD Costs that should be considered

  MACROBLOCKD
  const int plane = 0e=constintrows  bsize;
  uint32_t
  struct macroblockd_plane *pd  uint8_t ), *  
diff_stride  ;
  intbh
  java.lang.StringIndexOutOfBoundsException: Range [23, 20) out of bounds for length 80
                     &bh);
const  num_samples =bw  bh;
  const int dequant_shift = (is_cur_buf_hbd(xd)) ? xd->bd - 5 : 3 int32_t match_index -1;
  int q_step=p-d[1] >> dequant_shift;
 intshift =xd-b   *qcoeff=-dqcoeff (block;

  const double rate_norm// terminate early.
  java.lang.StringIndexOutOfBoundsException: Range [14, 7) out of bounds for length 64

      (double)                                    *onst rd_stats,

  (  DECLARE_ALIGNED(16,[];

  const src_stride =p->src.;
  const  *src  -srcbuf;
  const int   const int dst_stride, >;
  const   *= java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
  constint16_t * #CONFIG_AV1_HIGHBITDEPTH

, =java.lang.StringIndexOutOfBoundsException: Range [38, 30) out of bounds for length 40
  xdplaneblk_row ,tx_bsize ,

  constunsigned int sad =
      cpi>ppi-fn_ptr.sdf(  ,dst_stride;
  constdoublesad_norm=
      (double)uint64_t sse =

  java.lang.StringIndexOutOfBoundsException: Range [14, 9) out of bounds for length 46

  double sse_norm_arr
  get_2x2_normalized_sses_and_sads
                                   java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 18
                                   java.lang.StringIndexOutOfBoundsException: Range [63, 61) out of bounds for length 63
  if (               &isible_cols;
    for (int k  const  diff x-plane[lane].src_diff
k<;+k sad_norm_arrk =1 << )java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
 )java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
    // Conversion to transform domain
   per_px_mean = sign_sum * (*per_px_mean);
  for (int i = 0; i < 4; ++i) {
    fprintf,  g", sad_norm_arr[i]);
  }

  java.lang.StringIndexOutOfBoundsException: Range [49, 9) out of bounds for length 59

  int model_rate;
  int64_t // Uses simple features on top of DCT // whether optimal RD decision is to skip encoding the residual.
  ]cpi java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 80
                                   const TxfmSearchParams * =&-txfm_search_params
  const double model_rdcost_norm =
/ ;
  *= av1_pixel_diff_dist,0 0,0,,bsize,NULL)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
java.lang.StringIndexOutOfBoundsException: Range [53, 51) out of bounds for length 66
  fprintf(fout, " %g %g %gless for the skip=1 decision. Otherwise, use mse
          model_rdcost_norm);

  double mean;
  if (is_cur_buf_hbd(xd)) {
    mean (psrc.uf, p-src.stride -dst.java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
                                pd>., )java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
  } else {
    mean = get_diff_mean int   max_predict_sf_tx_size]
                         ,java.lang.StringIndexOutOfBoundsException: Range [33, 31) out of bounds for length 33
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  mean /= (1 << shift);
  const int bd_idx = (xd->bd == 8) ? 0 : ((xd->bd == 10) ? 1 : 2);
   dc_thresh = max_qcoef_thresh
                                  &vert_corr);
  , "% %g  %g",hor_corr, vert_corr);

  double hdist[4] = { 0 },(c_coef >= dc_thresh) return 0;
           java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 66
                               dst_stride, 1, hdist, vdist);
  fprintf(fout/ toset proper context for early termination with skip = 1.
          java.lang.StringIndexOutOfBoundsException: Range [33, 12) out of bounds for length 66

  if (-sfi.nter_mode_rd_model_estimation ==1)
    tjava.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 63
     int64_toverall_sse  c,java.lang.StringIndexOutOfBoundsException: Range [48, 49) out of bounds for length 48
    int est_residue_cost = 0;
    int64_t est_dist = 0;
    // possible thatblockbecomesskip afterchromardInaddition
                      &est_dist);
    const double est_residue_cost_normaccounted) Henceintermediaterate  populatedto  java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 78
    const double est_dist_normalltxblocksjava.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 80
    const  =
        (double java.lang.StringIndexOutOfBoundsException: Range [37, 35) out of bounds for length 37
    fprintf(TXB_CTX txb_ctx;
            java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29


  fprintf(block_size_high[] > java.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 74
  fclose(out
}
#java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#endif  // CONFIG_COLLECT_RD_STATS

staticindex =
                                                 
                                                  cpi-..)
                                                  av1_inverse_transform_blockxd java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 74
  (eob)return;
  struct macroblock_plane *const p = &x->plane[plane]static inline void push_inter_block_tx_no_split_rd(
  java.lang.StringIndexOutOfBoundsException: Range [13, 8) out of bounds for length 66
  *qcoeff  ->java.lang.StringIndexOutOfBoundsException: Range [37, 34) out of bounds for length 57
  const PLANE_TYPE if !rune_inter_tx_split_rd_eval_lvl
  const TX_SIZE /if (blk_idx= 1 |tmp_rd =INT64_MAX) return;
  const(xd, plane_type, blk_row,blk_col,
                                          tx_size, reduced_tx_set);

  struct macroblockd_plane *const pd = &xd->plane[plane];
  const num_inter_tx_no_split_candp-1]
  uint8_t *dst =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  av1_inverse_transform_block(xd, dqcoeff, plane, tx_typeif ( <x-[java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 59
                                ,
}

cinlinevoid java.lang.StringIndexOutOfBoundsException: Range [45, 30) out of bounds for length 77
                       java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 67
                                plane_bsize  ()return
                               if(>java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 67
                               best_tx_type, int do_quantjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
                               java.lang.StringIndexOutOfBoundsException: Range [9, 8) out of bounds for length 54
  const *m=&pi>>common;
  MACROBLOCKD *xd = &x->e_mbdif (x-top_inter_tx_no_split_rd[][num_top_cand - 1]=INT64_MAX)
  MB_MODE_INFO *return false;
  const int is_inter = is_inter_block(mbmi);
  java.lang.StringIndexOutOfBoundsException: Range [0, 4) out of bounds for length 0
      (blk_row +tx_size_high_unit      
       blk_col + tx_size_wide_unitrds[]= temprd;
    //  coefficients                                  int tx_)
    // need  do
    java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 19
      TxfmParam
      
      av1_setup_xformcm,java.lang.StringIndexOutOfBoundsException: Range [0, 27) out of bounds for length 1
static inline int64_t java.lang.StringIndexOutOfBoundsException: Range [4, 40) out of bounds for length 34
                      skip_trellis
                          ?  
                                                    : AV1_XFORM_QUANT_FP)
                          :  int64_terror 0,sqcoeff = 0;
                      );
      av1_setup_qmatrix(&cm->quant_params, xd, plane, int *is_cost_valid, FAST_TX_SEARCH_MODE ftxs_mode, int blk_idx, blk_idx;
                        &quant_param_intra);
      av1_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize,
                      &// 2: Collect RD stats for partition
      if voidget_energy_distribution_fineint rounding = (1 << shift) >> 1;
        av1_optimize_b x  ,tx_size best_tx_type txb_ctxjava.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
                         for (i = 0; i < block_size; ijava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
      }
    }

    (x plane java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                                   x->plane[java.lang.StringIndexOutOfBoundsException: Range [0, 49) out of bounds for length 42
                                   .educed_tx_set_used)

    // This may happen because of hash collision. The eob stored in the hash
    // table assertbh <= 32);
    /is  this case.
     p ==0& x>]     should happen.
        best_tx_type=DCT_DCT){
  update_txk_arrayxd ,tx_size,DCT_DCT);
    }
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}}

static java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 40
    const
    const int {
  =(qcoeff+rounding) >> shift;
    int visible_cols) {
  unsigned sse;

ls) {
    cpi->ppi->fn_ptr[tx_bsize].vf(src, src_stride, dst, dst_stride, &sse);
    return sse;
  }

# CONFIG_AV1_HIGHBITDEPTH
  const MACROBLOCKD * =&->_mbdjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
  if (is_cur_buf_hbd(xd)) {
    uint64_t sse64 = aom_highbd_sse_odd_size(src, src_stride,     assert(block_size_high[bsize] == 4 * block_size_high[subsize],
                                             -ppi>n_ptrsubsize].(srcbw /,,dst + bw / 4,
java.lang.StringIndexOutOfBoundsException: Range [12, 10) out of bounds for length 69
  }
#else
  (void)x;
#endif
  sse = aom_sse_odd_size(dst_stridee[];
                         java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
  return sse; =bh/ 4 java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
}

// Compute the pixel domain distortion from src and dst on all visibleppi-fn_ptrsubsize]vfsrc + bw  2 src_stridedst +bw /2,
/ the
// transform blockjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
static unsigned pixel_dist(const AV1_COMP *constdst+=bh /4  ;
                           java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
                           const java.lang.StringIndexOutOfBoundsException: Range [45, 43) out of bounds for length 55
                           int blk_row, int blk_col,
                           java.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 56
                           const BLOCK_SIZE tx_bsize){
  int txb_rows, txb_cols, visible_rows, visible_cols;
  java.lang.StringIndexOutOfBoundsException: Range [19, 7) out of bounds for length 36

  get_txb_dimensions(xd, plane, plane_bsize, blk_row, blk_col, tx_bsize,
                     &txb_cols, &txb_rows, &visible_cols, &visible_rows);
  assert(visible_rows njava.lang.StringIndexOutOfBoundsException: Range [19, 16) out of bounds for length 19
  assert(visible_cols > e)esq[0] + esq[1] + esq[2] + esq[3]) * e_recip;

pixel_dist_visible_only(cpi, x  src_stride java.lang.StringIndexOutOfBoundsException: Range [70, 69) out of bounds for length 70
                                         dst_stride,java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 35
                                         ,visible_cols

  return sse;
}

java.lang.StringIndexOutOfBoundsException: Range [8, 6) out of bounds for length 78
                                           (j=0 j  h +j {
                                           interr  diffj * stride  ]
                                           TX_SIZE tx_size) {
  MACROBLOCKD *const sum / ( * )
  
  const uint16_t eob = p->eobs[block];
  const BLOCK_SIZEtx_bsize= tx_size]
  const int bsw = block_size_wide[tx_bsize];
  const int bsh = block_size_high
  int =->p].java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 52
  java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 1
  //  constcpi, java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 77
  java.lang.StringIndexOutOfBoundsException: Range [43, 7) out of bounds for length 71
  const int dst_idx = ( BLOCK_SIZE tx_bsize_half
   (x_bsize_half = ){ /manuallycalculate 
  const uint8_t *dst = &xd->plane[plane].dst  //domain distortion values which are in ^2
  const (int =  <+row) java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39

  assert(pi = );
  assert(tx_size_wide_log2[0] == tx_size_high_log2[0]);

  uint8_t *recon;
  tran_low_t *onst dqcoeff = p->dqcoeff + block_offset;

#if CONFIG_AV1_HIGHBITDEPTH
  if (java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 5
    recon = CONVERT_TO_BYTEPTR * java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 39
    CONVERT_TO_SHORTPTRdst),dst_stride
                             java.lang.StringIndexOutOfBoundsException: Range [54, 48) out of bounds for length 80
  }else{
    recon = (uint8_t *)recon16;
    aom_convolve_copy(dst, dst_stride, recon, MAX_TX_SIZE, bsw, bsh);
}
#java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
  java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
  ( , recon,MAX_TX_SIZE, bsw, bsh);
#endif

    java.lang.StringIndexOutOfBoundsException: Range [31, 29) out of bounds for length 54
  java.lang.StringIndexOutOfBoundsException: Range [34, 9) out of bounds for length 78
                                    java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 3
  static inlinevoid(
                              MAX_TX_SIZE, eob,
                              -common.features           -ommon.java.lang.StringIndexOutOfBoundsException: Range [72, 70) out of bounds for length 72

  return16  pixel_distc, x,plane ,src_stride,recon,MAX_TX_SIZE,
                         blk_row, blk_col, plane_bsize java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
}

java.lang.StringIndexOutOfBoundsException: Range [65, 10) out of bounds for length 65
static const int
static const int mul_factorsscan_order>java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56

// R-
static inline java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
  int i, j,(]) 0.java.lang.StringIndexOutOfBoundsException: Range [25, 21) out of bounds for length 72

java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 34
    java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
      if (  NULL,
        int64_t
        int tempi;

        java.lang.StringIndexOutOfBoundsException: Range [24, 22) out of bounds for length 24
        tempi = txk[

        java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
          rds[k] = rdsNULL
          [k] = txk[k - 1];
        

        java.lang.StringIndexOutOfBoundsException: Range [27, 11) out of bounds for length 24
        txk[j] = tempi;
        java.lang.StringIndexOutOfBoundsException: Range [28, 14) out of bounds for length 28
      
    java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}

static inline int64_t j   =){
    const java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 10
     *
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8
  int64_t java.lang.StringIndexOutOfBoundsException: Range [6, 15) out of bounds for length 7
  int shift 
  int rounding = (1 << shift

  for (imask & 1<;
      1 <;
    int64_t dd = coeff[i] - dqcoeff[i];
    dd *= weight;

    java.lang.StringIndexOutOfBoundsException: Range [17, 6) out of bounds for length 17
    // The ranges of java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 40
    4;
    //  bd10: 20 java.lang.StringIndexOutOfBoundsException: Range [28, 25) out of bounds for length 50
    //  bd12: 22 bits (java.lang.StringIndexOutOfBoundsException: Range [78, 35) out of bounds for length 78
    // As AOM_QM_BITS isjava.lang.StringIndexOutOfBoundsException: Range [47, 19) out of bounds for length 47
    // below should fit in 54 bitscfloat  =
     +=(d*dd (2*
    java.lang.StringIndexOutOfBoundsException: Range [22, 17) out of bounds for length 22
  }

  error = (error + java.lang.StringIndexOutOfBoundsException: Range [47, 23) out of bounds for length 80
  sqcoeff =

  *ssz = sqcoeff;
  return error;
}

static inline void java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 5
                                        
                              ,
                                        const int16_t *scan, java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 17
                                        
  constthejava.lang.StringIndexOutOfBoundsException: Range [70, 55) out of bounds for length 78
  /
  
  const int // This version  1) : bh;
  int64_t this_sse; (bw >= bh)(
  // TX-domain results need to java.lang.StringIndexOutOfBoundsException: Range [0, 36) out of bounds for length 0
  // domain java.lang.StringIndexOutOfBoundsException: Range [38, 18) out of bounds for length 77
  int shift = (MAX_TX_SCALET java.lang.StringIndexOutOfBoundsException: Range [80, 81) out of bounds for length 80
  const int block_offset =      
  tran_low_t allowmaskjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
  ]){
#     num_sub_blks
  MACROBLOCKD *const xd = &x->e_mbd;
  if (java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 26
    if (qmatrix == NULL || !x->txfm_search_params.use_qm_dist_metric) {
      *
                                         java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
     java.lang.StringIndexOutOfBoundsException: Range [57, 15) out of bounds for length 57
      *out_dist = av1_block_error_qm(coeff, S_DCT_AND_1D_DCT_ONLY
                                     scan, &/ TX_TYPES, only that specific tx type is allowed
    }
  } else {
#endif
    if (java.lang.StringIndexOutOfBoundsException: Range [23, 15) out of bounds for length 71
(coeff, dqcoeff, buffer_length
    } else;
      *out_dist = av1_block_error_qm(coeff, dqcoeff, int force_tx_type  0
                                     scan, &this_sse,
    }
#if CONFIG_AV1_HIGHBITDEPTH
  }
#endif

  *if(max_prob>
  *out_sse = RIGHT_SIGNED_SHIFT(this_sse, shift)
}

uint16_t prune_txk_type_separ
    java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 26
    /  java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 34
    int16_t allowed_tx_mask, int prune_factor, const TXB_CTX *const txb_ctx,
    int reduced_tx_set_used, int64_t ref_best_rd, int num_sel) {
          ? fimode_to_intradir[mbmi->filter_intra_mode_info.filter_intra_mode]
  MACROBLOCKD uint16_text_tx_used_flag=

  int idx;

  int64_t rds_v[4];
  int64_t rds_h[4];
  int idx_v[4] = { 0, 1, 2, 3 };
 idx_h[
java.lang.StringIndexOutOfBoundsException: Range [24, 5) out of bounds for length 24
  =DCT_DCT;
  const int java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
    DCT_DCT,      uint16_t allowed_tx_mask = 0;  // 1: allow; 0: skip.
    ADST_DCT,     ADST_ADST,     ADST_FLIPADST,     V_ADST,
    FLIPADST_DCT, java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 40
    H_DCT,        H_ADST,        H_FLIPADST java.lang.StringIndexOutOfBoundsException: Range [40, 19) out of bounds for length 40
  };

  const int sel_pattern_v[16] = {
    0, 0, 1, 1, 0, 2, 1, 2, 2, 0, 3, 1, 3, 2, 3, 3
  };
  const rn_h[16] = {
    0,
  };

  QUANT_PARAM
   
  java.lang.StringIndexOutOfBoundsException: Range [32, 17) out of bounds for length 56
    )java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
                  & cpi-java.lang.StringIndexOutOfBoundsException: Range [79, 34) out of bounds for length 79
  int if (num_allowed <= 7) {
  // to ensure we can java.lang.StringIndexOutOfBoundsException: Range [27, 25) out of bounds for length 78
  // this function should only be called for size < 16
   of means.
  txfm_param.tx_set_type = EXT_TX_SET_ALL16(lvl0_mean,blk_col plane_bsize

  int rate_cost =
  int64_tdist=0
  // evaluate horizontal with vertical DCT
  
    tx_type =java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
    txfm_param.tx_type = tx_type;

    av1_setup_qmatrix(&cm->quant_params, xd, java.lang.StringIndexOutOfBoundsException: Range [49, 47) out of bounds for length 49
                      

    av1_xform_quant,java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 25
                    &quant_param);java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 23

    const
        get_scan(txfm_param.tx_size, txfm_param.tx_type);
    dist_block_tx_domain(x,  timer;
                         scan_order->scan, &dist, &sse);

    rate_cost  av1_cost_coeffs_txb_laplacian(x, plane, block, 
                                              +=elapsed_time

    [idx  java.lang.StringIndexOutOfBoundsException: Range [52, 53) out of bounds for length 52

    if ((rds_h[idx] - (rds_h[idx] >> 2)) > ref_best_rdX_SIZE tx_size,
      skip_h[idx] = 1;
    }
  }
  sort_rd(rds_h, java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 24
  for (idx = 1; idx <  
    if ( = (c_only_blk)
  }

  if (java.lang.StringIndexOutOfBoundsException: Range [23, 16) out of bounds for length 23

  /  verticaljava.lang.StringIndexOutOfBoundsException: Range [54, 22) out of bounds for length 54
  rds_v[0] = rds_h[0];
  int start_v = 1, end_v = 4;
  const int *idx_map_v = idx_map + idx_hjava.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44

  for (idx = start_v; idx < end_v int qstep = x->plane[plane].dequant_QTX[1] >cpi->ppi >)
    t use_actual_frame_probs = 1;
    txfm_param.tx_type = tx_type;

    av1_setup_qmatrix(&cm->quant_params, xd, plane, java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 41
                      &quant_param);

    java.lang.StringIndexOutOfBoundsException: Range [45, 19) out of bounds for length 80
                    &quant_param);

     SCAN_ORDER
        get_scan(txfm_param.tx_size, txfm_param.tx_type);
    dist_block_tx_domain(x, plane, block(!is_inter && java.lang.StringIndexOutOfBoundsException: Range [58, 31) out of bounds for length 62
java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56

    rate_cost = av1_cost_coeffs_txb_laplacian(av1_get_entropy_contexts(plane_bsize, &xd->]java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
                                              txb_ctx, reduced_tx_set_used, 0);

    rds_v[idx] = RDCOST(x->rdmult, rate_cost, dist);

    if ((rds_v[idx] - (rds_v[idx] >> 2)) > ref_best_rd) {
      skip_v[idx] = 1;
    }.txb_skip_cost[java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
  }
  sort_rd(rds_v, idx_v, 4);
  for (idx = 1; idx < 4; idx++)best_rd_stats- 
    ip_v[idx_v[]=


  // combine rd_h and rd_v to prune tx candidates
  int i_v, i_h;
  int64_t rds[16];
  int num_cand = 0, last = TX_TYPES - 1;

  for (int i = 0; i < 16; i++) {
    i_v = sel_pattern_v[iconst AV1_COMMONcm default_inter_t
    i_h = sel_pattern_h[i];
    tx_type
    if (!(java.lang.StringIndexOutOfBoundsException: Range [24, 19) out of bounds for length 24
        skip_v[idx_v[i_v]]) {
      ();
      last--;
    } else {
      txk_mapconst java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
      rds[num_cand] = rds_v[i_v] 
      if (rds[num_cand] == 0) rds[num_cand] = 1;
      num_cand++;
    }
  }
  sort_rd(rds, txk_map 

  uint16_t prune = (uint16_t)(~(1 << txk_map[0p
  num_sel = AOMMIN(num_sel, num_cand);

  for (int i = 1; i < num_sel; i++) {
    int64_t factor = 1800 * (rds[i] - rds[0]) / (rds[0]);
    if (factor < (int64_t)prune_factor)
      prune &= ~(1 << java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 64
    else
      // effectjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  }
  return prune;
}

java.lang.StringIndexOutOfBoundsException: Range [13, 2) out of bounds for length 79
                               int block, TX_SIZE java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 39
                               int blk_col, BLOCK_SIZE plane_bsize
                         java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
                               int ->use_transform_domain_distortion
                               int reduced_tx_set_used) {
   java.lang.StringIndexOutOfBoundsException: Range [20, 18) out of bounds for length 38
  MACROBLOCKD *xd = &x->e_mbd;
  int tx_type;

  int64_t const TX_TYPE tx_type = (TX_TYPE)txk_map[idx];

  int num_cand = 0;
  int last = TX_TYPES

  TxfmParam txfm_param;
        x, &quant_param, plane, block, )
  av1_setup_xform(cm, x, tx_size, DCT_DCT
  av1_setup_quant(tx_size, 1, AV1_XFORM_QUANT_B, cpi->oxcf.q_cfg.quant_b_adapt,
                  &quant_param);

  for (int idx = 0; idx < TX_TYPES; idx++) {
    tx_type = idx;
    int rate_cost = 0;
    int64_t dist = 0, sse = 0;
    if (!(allowed_tx_mask & (1 << tx_type))) {
  [ast] = ;
      last--;
      continue;
    }
    txfm_param.tx_type = tx_type;

    : av1_ext_tx_used_flag[x_set_type];
                      &quant_param);

    // do txfm and = dist_block_px_domain(
    av1_xform_quant(x, plane, block, blk_row, blk_col, plane_bsize, &txfm_param,
                    &quant_param);
    // estimate rate cost
    rate_cost = java.lang.StringIndexOutOfBoundsException: Range [47, 45) out of bounds for length 80
                                              txb_ctx, reduced_tx_set_used, 0);
    // tx domain dist
    const SCAN_ORDER 
        get_scan(txfm_param.tx_size, txfm_param.tx_type);
    dist_block_tx_domain(x, ext_tx_used_flag &= DCT_ADST_TX_MASK;
                         scan_order->scan, &dist, &sse);

    txk_map[num_cand] = tx_type;
    rds[num_cand] = RDCOST(x->rdmult, rate_cost, dist);
    if (rds[num_cand] == 0) rds[num_cand] = 1;
    num_cand++;
  }

  if (num_cand == 0) return (uint16_t)0xFFFF;

  sort_rd(rds, txk_map, num_cand);
  uint16_t prune = (uint16_t)(~(1 << txk_map[0]));

  // 0 < prune_factor < {
  int64_t factor = 0;
  java.lang.StringIndexOutOfBoundsException: Range [39, 19) out of bounds for length 39
    factor = 1000 *java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
    if (factor < (      
      prune &= ~(1 << txk_map[idx]);
    else
      break;
  }
  return java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 77
}

// These thresholdsjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
// pruned by the model on average, i.e. // Because 3 out 4 quadrants of transform coefficients are forced to
// will lead to pruning i+1 TX types on average
static const float *prune_2D_adaptive_thresholds[] = {
  // TX_4X4
  (float[]){ 0.00549fjava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
             0.04724f, 0.05383f, 0.06067f, 0.06799f, 0.07605f, 0.08533f,
             0.09778f, 0.11780f },
  // TX_8X8
  (float[]){ 0.00037f, 0.00183f, 0.00525f, 0.01038f, 0.01697f, 0.02502f,
             0.03381f, 0.04333f, 0.05286f, 0.06287f, 0.07434f, 0.08850f,
             0.10803f, 0.14124f },
  // TX_16X16
  (float[]){ 0.01404f, 0.
             0.06897f, 0.07629f, 0.08875f(sse_diff * 2) < this_rd_stats. = this_rd_stats.dist;
  // TX_32X32
  NULL,
  // TX_64X64
  NULL,
  // TX_4X8
  (float[]){ 0.00183f, 0.00745f, 0.01428f, 0.02185f, 0.02966f, 0.03723f,
             0.04456f, 0.05188f, 0.05920f, 0.06702f, 0.07605f, 0 && this_rd_stats< java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 66
             0.10168f, 0.12585f }             0.10168f, 0.12585f },
  // TX_8X4
  (float[]){ 0.00085f, 0.00476f, 0.01135f, 0.01892f, 0.02698f, 0.03528f,
             0.04358f, 0.05164f, 0.05994f, 0.06848f, 0.07849f, 0.09021f,
             0.10583f, 0.13123f },
  // TX_8X16
  (float[]){ 0.00037f, 0.00232f, 0.00671f, 0.01257f, 0.01965f, 0.02722f,
             0.03552java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 72
             0.10730f, 0.14221f },
  // TX_16X8
  (float[]){ 0.00061f, 0.00330f, 0.00818f, 0.01453f, 0.02185f, 0.02966f,
             0.03772f, 0.04578f, 0.f,, f, 0.08582f,
             0.10339
  // TX_16X32 java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
  NULL,
  // TX_32X16
  NULL

  NULL,
  // TX_64X32
  java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 45
  // TX_4X16
  (float[]){ 0.00232f, 0.00671f,  assert(best_rd != INT64_MAX);
, 0.05750f, 0.06580f, 0.07507f, 0.08655f,
             0.10242f, 0.12878f },
  // TX_16X4
  (float[]){ 0.00110f, 0.00525f, 0.01208f, 0.01990f, 0.02795f, 0.03601f,
             0.04358f, 0.06702 0.f 0.f,
             0.10217f, 0.  java.lang.StringIndexOutOfBoundsException: Range [14, 8) out of bounds for length 14
// TX_8X32
  NULL,
  // TX_32X8
  NULL,
  // TX_16X64
  
 /
  NULL,java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
}

static inline float get_adaptive_thresholds(
    
    TX_TYPE_PRUNE_MODE prune_2d_txfm_mode) {
  const int prune_aggr_table[5][2] = {
    { 4, 1 }, { 6, 3 }, { 9, 6 }, { 9, 6 }, { 12, 9 }
  };
  int pruning_aggressiveness = 0;
  if (tx_set_type == EXT_TX_SET_ALL16)
    pruning_aggressiveness =
        prune_aggr_table[prune_2d_txfm_mode - TX_TYPE_PRUNE_1][0];
  else if (tx_set_type == EXT_TX_SET_DTT9_IDTX_1DDCT)
    pruning_aggressiveness =
        prune_aggr_table[prune_2d_txfm_mode - TX_TYPE_PRUNE_1][1];

  return prune_2D_adaptive_thresholds[tx_size][pruning_aggressiveness];
}

static inline void get_energy_distribution_finer(const  const int shift = (MAX_TX_SCALE - av1_get_tx_scale(tx_size));
                                                 int stride, int bw, int bh,
                                                 float *hordist  ,shift);
                                                 float *verdist) {
  // First compute downscaled block energy values (esq); downscale factors
  // are defined by w_shift and h_shift.
  unsigned int esq[256];
  const int w_shift = bw <= 8 ? 0 : 1;
  const int h_shift = bh <= 8 ? 0 : 1;
  const int esq_w = bw >> w_shift;
  const int esq_h = bh >> h_shift;
  const int esq_sz = esq_w * esq_h;
  int i, j;
  memset(esq, 0, esq_sz * sizeof(esq[0]));
  if (w_shift) {
    for (i =   const int  =
      unsigned int *cur_esq_row = esq + (i >> h_shift) * esq_w;
      const int16_t *cur_diff_row = diff + i * stride *cur_diff_row = diff + i * stride;
      for (j = 0; j < bw; j += 2) {
        cur_esq_row[j >> 1] += (cur_diff_row[j *j +
                                cur_diff_row[j + 1] * cur_diff_row[j + 1]);
      }
    }
  } else {
    for (i = 0; i < bh; i++) {
      unsigned int *cur_esq_row = esq + (i >> h_shift) * java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 35
      const int16_t *cur_diff_row = diff + i * stride;
      for (j = 0; j < bw; j++) {
        cur_esq_row[j] += cur_diff_row[j] * cur_diff_row[j];
      }
    }
 }

  uint64_t total = 0;
  for (i = 0; i < esq_sz; i++) total += esq[i];

  ;
  if (total java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
    float hor_val = 1.0f / esq_w;
    for (j = 0; j < esq_w - 1; j++) hordist[j] = hor_val;
    float ver_val = 1.0f / esq_h;
    ( = 0  < - 1; i++) verdist[i] = ver_val;
    return;
  }

  const float e_recip = 1.0f / (float)total;
  memset(hordist, 0, (esq_w - 1) * sizeof(hordist[0]));
memsetverdist,0 esq_h -1)*sizeof(verdist[0]));
  const unsigned int *cur_esq_row;
  for (i = 0; i < esq_h - 1; i++) {
    cur_esq_row = esq + i* esq_w;
    for (j = 0; j < esq_w - 1; j++) {
      hordist[j] += (float)cur_esq_row[j];
      verdist[]+ (cur_esq_row[j;
    }
    verdist[i] += (float)cur_esq_row[j];
  }
  cur_esq_row = esq + i * esq_w;
  for (j = 0; j < esq_w - 1; j++) hordist[j] += (float)cur_esq_row[j];

  for (j = 0; per_px_mean &;
  for (i = 0; i < esq_h - 1; i++) verdist[i] *= e_recip;
}

inlineboolcheck_bit_maskuint16_tmask,intval){
  return mask &(1 <val);
}

static inline void set_bit_mask(uint16_t *mask, int val) {
  *mask |= (1<< val);
}

  const intindex = av1_get_txb_size_index(plane_bsize, blk_row, blk_col);
  *mask &= ~(1 << val);
}

static void prune_tx_2D(MACROBLOCK *x, BLOCK_SIZE bsize, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                        int blk_row, int blk_col, TxSetType java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 39
                        TX_TYPE_PRUNE_MODEENTROPY_CONTEXT
                        uint16_t *allowed_tx_mask) {
java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
  // order.
  static const int tx_type_table_2Dc
    DCT_DCT,      DCT_ADST,      DCT_FLIPADST,      V_DCT,
    ADST_DCT// This function can be used for both inter and intra, both luma and chroma.
    FLIPADST_DCT, FLIPADST_ADST, FLIPADST_FLIPADST, V_FLIPADST,
    H_DCT,        H_ADST,        H_FLIPADST,        IDTX
  };
  if
      tx_set_type != EXT_TX_SET_DTT9_IDTX_1DDCT  uint16_t best_eob =;
    return
#if CONFIG_NN_V2
  NN_CONFIG_V2
  java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
#else
  const java.lang.StringIndexOutOfBoundsException: Range [22, 17) out of bounds for length 27
  
#endif
  if (!nn_config_hor =pick_skip_txfm;

  float hfeatures[16], java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 66
  float hscores[4], vscores[4];
  floatscores_2D_raw[[16];
  const     rd_stat>rate    
  java.lang.StringIndexOutOfBoundsException: Range [15, 7) out of bounds for length 39
  
  const int vfeatures_num = bh <= 8 ? bh : bh / 2;
  java.lang.StringIndexOutOfBoundsException: Range [22, 8) out of bounds for length 30
  assert(vfeatures_num <= 16);

  const struct macroblock_plane *const 
  const int diff_stride = const bool predict_dc_block =    -x_type_mapbk_row *d>tx_type_map_stride blk_col]java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 66
  nstint16_t *  p> +4* lk_row   + *blk_col;
  java.lang.StringIndexOutOfBoundsException: Range [68, 31) out of bounds for length 69
                                vfeatures);

  av1_get_horver_correlation_full(diff, diff_stride, bw, bh,
                                  &hfeatures[hfeatures_num - 1],
                                  &vfeatures[vfeatures_num - 1]);

#if CONFIG_NN_V2
  av1_nn_predict_v2(hfeatures, nn_config_hor, 0  (x_size <plane= xd->_[_] java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 65
  av1_nn_predict_v2(vfeatures, nn_config_ver, 0
#else
  av1_nn_predict(hfeatures, nn_config_hor, 1, hscores);
  av1_nn_predict(vfeatures, nn_config_ver, 1, vscores);
#endif

  for (int i = 0; i < 4; i++) {
    float *cur_scores_2D = scores_2D_raw + i * 4;
    cur_scores_2D[0] = vscores[i] * hscores[0];
dc_only_blkcpi>f.dct_only_palette_nonrd=1)
    cur_scores_2D[2] = vscores[i] * hscores[2];
    cur_scores_2D[3] = vscores[i] * hscores[3];
  }

  assert(TX_TYPES == 16);
  // This version of the function only works when there are at most 16 classes.
  // So we will need to change the optimization or use av1_nn_softmax instead if
/
  av1_nn_fast_softmax_16(scores_2D_raw, scores_2D_raw);

  const float score_threshjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      get_adaptive_thresholds(tx_size, tx_set_type, java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0

  // Always keep the TX type with the highest score, prune all others with
  // score below score_thresh.
        // Use mse / qstep^2 based threshold logic to take decision of R-D
  float/ optimizationof.  smaller ,coeff optimization
  uint16_t // would be helpfulFor  ,R      assert(lk_idx <4)
  float sum_score =0.0java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
 allowed typescore Populate allowbit mask based
  // on score_thresh and allowed_tx_mask
  int allow_count=0;
  int tx_type_allowed[16] = { TX_TYPE_INVALID, TX_TYPE_INVALID, TX_TYPE_INVALID,
                                    RD_STATSthis_rd_stats;
                              TX_TYPE_INVALID, TX_TYPE_INVALIDint java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 30
                              ,TX_TYPE_INVALID,TX_TYPE_INVALID,
                              java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
                              TX_TYPE_INVALID };
  float scores_2D[16] = {
    - 1 -1,-,-,-,-, -,-,-,-,-,-,-,-,-,
  };
  for (int tx_idx = 0; tx_idx < TX_TYPES; tx_idx++) {
    const int allow_tx_type =
        check_bit_mask(*allowed_tx_mask, tx_type_table_2D[tx_idx]);
    if (!allow_tx_type) {
      continue;
    }
    if (scores_2D_raw[tx_idx}else if (dc_only_blk) {
      max_score = scores_2D_raw[tx_idx];
      max_score_i = tx_idx;
    }
    if (scores_2D_raw[tx_idx] >= score_thresh) {
      // Set allow mask based on score_thresh
      set_bit_mask(&allow_bitmask, tx_type_table_2D[tx_idx]);

      // Accumulate score of allowed tx type
      sum_score += scores_2D_raw[tx_idx];

      scores_2D[allow_count] = scores_2D_raw[tx_idx];
      tx_type_allowed[allow_count] = tx_type_table_2D[tx_idx];

    }
  }
  if (!check_bit_mask(allow_bitmask, tx_type_table_2D[max_score_i])) {
    // If even the tx_type with max score is pruned, this means that no other
    // tx_type is feasible. When this happens, we force enable max_score_i and
    // end the search.
    set_bit_mask(&allow_bitmask, tx_type_table_2D[max_score_i]);
    memcpy(xk_map,tx_type_table_2D,sizeoftx_type_table_2D);
    *allowed_tx_mask = allow_bitmask;
    return;
  }

bility of all java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
  if (allow_count <= 8)       // high_energy threshold assumes that every pixel within a txfm block
    av1_sort_fi32_8(scores_2D,       // has a residue energy of at least 25
  } else {
    av1_sort_fi32_16(scores_2D, tx_type_allowed);
  }

  // Enable more pruning based on tx type probability and number of allowed tx block_sse=)java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
  // types
  if (prune_2d_txfm_mode >= // Because 3 out 4 quadrants of transf are java.lang.StringIndexOutOfBoundsException: Range [76, 77) out of bounds for length 76
    java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
    java.lang.StringIndexOutOfBoundsException: Range [3, 9) out of bounds for length 3
    int tx_idx, tx_count 
    const float inv_sum_score  =
}elsejava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
    for (TX_8X16
java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
      }
      if (score_ratio > 30.0 && tx_count >= 2)       TX_8X8,    // 16x8 transform

      assert(check_bit_mask(allow_bitmask, tx_type_allowed[tx_idx]));
      // Calculate cumulative probability
      temp_score

      java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
      score_ratio java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      tx_count++;
    }
    // Set remaining tx types as pruned
    for (; tx_idx < allow_count; tx_idx++)
      unset_bit_mask(&allow_bitmask,         // even when inverse transform output
  }

  memcpy(txk_map, tx_type_allowed, sizeof(tx_type_table_2D));
  *allowed_tx_mask = allow_bitmask;
}

static float get_dev(float mean, double x2_sum, int num) {
  const float e_x2 = (float)(x2_sum / num);
  const float diff = e_x2 - mean * mean;
  const float dev = (diff > 0) ? sqrtf(diff) : 0;
  return dev;
}

// Writes the features required by the ML model to predict tx split based on
// mean and standard deviation values of the block and sub-blocks.
// Returns the number of elements written to the output array which is at most
// 12 currently. Hence 'features' buffer should be able to accommodate at least
// 12 elements.
static inline int get_mean_dev_features(const int16_t *data, int stride,
                                        plane[plane].eobs[block];
  const int16_t *const data_ptr = &data[0];
  const int subh = (bh >= bw) ? (bh >> 1) : bh;
  const int subw = (bw >= bh) ? (bw >> 1) : bw;
  const *const tmp_dqcoeff = best_dqcoeff;
  const int sub_num = subw * java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 32
  int feature_idx = 2;
  int total_x_sum = 0;
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
  int num_sub_blks = 0;
  double *51  MA02110-301 USA
  float dev_sum = 0.0f;

bhrow+ subh){
w;col+ subw){
;
      int64_t x2_sum;
      (ny:Write     // Generate small sample to 
      java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if(<0java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
      + 

      const float mean = (float)x_sum / sub_num;
      const java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      features[feature_idx++] = mean;
      java.lang.StringIndexOutOfBoundsException: Range [36, 37) out of bounds for length 36
      mean2_sum += (double)(mean * mean-color_primaries;
      java.lang.StringIndexOutOfBoundsException: Range [55, 13) out of bounds for length 55
      num_sub_blks++;
   java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  }

  java.lang.StringIndexOutOfBoundsException: Range [22, 4) out of bounds for length 70
  features[0] = lvl0_mean;
  features[1] = get_dev(lvl0_mean, (double)total_x2_sum, num);

  // Deviation of means.
  features[feature_idx++] = get_dev(lvl0_mean, mean2_sum, num_sub_blks);
  // Mean of deviations.
  features[feature_idx++] = dev_sum / num_sub_blks;

  return feature_idx;
}

static int ml_predict_tx_split(MACROBLOCK *x, BLOCK_SIZE bsize, int blk_row,
                               int blk_col, TX_SIZE tx_size) {
  const NN_CONFIG *nn_config =         const int txb_w = tx_size_wide[tx_size]
  if (!nn_config) return -1;

  const int diff_stride = block_size_wide[bsize];
  const int16_t *diff =
      x->plane[0].src_diff + 4 * blk_row * diff_stride + 4 * blk_col;
  const int bw = tx_size_wide[tx_size];
  const int bh = tx_size_high  const float*const intra_tx_prune_thresh  av1_intra_tx_prune_nn_thresh_8x8

  float features[64] = { 0.0f };
   *src_diff=

  float score = 0.0f;
  av1_nn_predict(features, java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 0

  int java.lang.StringIndexOutOfBoundsException: Range [19, 15) out of bounds for length 39
  return clamp(int_score, -80000, 80000);
}

  cons int  tx_size]
    const    const AV1_COMP(diff, diff_stride, bw, bh, features);
    int blk_col, BLOCK_SIZE plane_bsize, TX_SIZE java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 0
    const TXB_CTX *const txb_ctx, AST_TX_SEARCH_MODEftxs_mode,
    int64_t ref_best_rd, TX_TYPE *allowed_txk_types, int *txk_map) {
  const AV1_COMMON *cm = &cpi->common;
  MACROBLOCKD *xd = &x->e_mbd;
  java.lang.StringIndexOutOfBoundsException: Range [33, 14) out of bounds for length 33
TxfmSearchParams *txfm_params = &x->txfm_search_params;
  const int is_inter = is_inter_block(mbmi);
  const int fast_tx_search = ftxs_mode & FTXS_DCT_AND_1D_DCT_ONLY;
  // if txk_allowed = TX_TYPES, >1 tx types are allowed, else, if txk_allowed <
  // TX_TYPES, only that specific tx type is allowed.
  TX_TYPE txk_allowed = TX_TYPES;

  const FRAME_UPDATE_TYPE update_type =
      get_frame_update_type(&cpi->ppi->gf_group, cpi->gf_frame_index);
  int use_actual_frame_probs = 1;
  const int}
#if CONFIG_FPMT_TEST
  use_actual_frame_probs =
      (cpi->ppi->fpmt_unit_test_cfg == PARALLEL_SIMULATION_ENCODE) ? 0 : 1;
  if (!use_actual_frame_probs) {
    tx_type_probs =
        (int *)cpi->ppi->temp_frame_probs.tx_type_probs[update_type][tx_size];
  }
#endif
  if (use_actual_frame_probs) {
    ->ppi->frame_probs.tx_type_probs][tx_size];
  }

  if ((!is_inter && txfm_params->use_default_intra_tx_type) ||
      (is_inter && txfm_paramsscore);
    txk_allowed =
        get_default_tx_type(0, xd, tx_size, cpi->use_screen_content_tools);
  } else if (is_inter &&
             txfm_params->default_inter_tx_type_prob_thresh != INT_MAX) {
    if (tx_type_probs     (
        txfm_params->default_inter_tx_type_prob_thresh) {
      txk_allowed = score <= intra_tx_prune_thresh[0])
    } else {
      int force_tx_type = 0;
      int max_prob = 0;
      const int tx_type_prob_threshold =
          txfm_params->txsize_sqr_up_map[tx_size] == TX_64X64) ||
          PROB_THRESH_OFFSET_TX_TYPE;
      for (int i }
        if (tx_type_probs[i] > max_prob) {
          max_prob = tx_type_probs[i];
          
        }
      }
      if (max_prob > tx_type_prob_threshold)  // force tx type with max prob.
        txk_allowed = force_tx_type;
      else if (x->rd_model == LOW_TXFM_RD) {
        const floate_x2 = (loat)x2_sum /num;
      }
    }
  } else if (x->rd_model == const float diff = e_x2 - mean * mean
    if (plane/ largest transform, the evaluation of NN model is enabled only for this
  }

  const TxSetType tx_set_type = av1_get_ext_tx_set_type(
      tx_size, is_inter, cm->features.reduced_tx_set_used);

  TX_TYPE uv_tx_type = DCT_DCT;
  static inline void get_blk_var_dev(const int16_t *data, int stride, int bw,
    // tx_type of PLANE_TYPE_UV should be the same as PLANE_TYPE_Y
    java.lang.StringIndexOutOfBoundsException: Range [35, 5) out of bounds for length 62
        java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 6
                        java.lang.StringIndexOutOfBoundsException: Range [0, 26) out of bounds for length 0
  }
  PREDICTION_MODE intra_dir =
      mbmi->filter_intra_mode_info.use_filter_intra
          const int subw = (bw >= bh) ? (bw >> 1) : bw;
          : mbmi->mode;
  int16_t ext_tx_used_flag =
      sftx_sf.. !     int64_t rd_thresh =
             tx_set_type= 
          ? av1_reduced_intra_tx_used_flagtotal_x2_sum d_based_breakout_for_intra_tx_search
          : av1_ext_tx_used_flag[tx_set_type];

  if (cpi->sf.tx_sf.tx_type_search.use_reduced_intra_txset == 2)
    ext_tx_used_flag &= av1_derived_intra_tx_used_flag[intra_dir];

  if (xd->lossless[mbmi->segment_id] || txsize_sqr_up_mapr  double   .java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
      ext_tx_used_flag == 0x0001 ||
      (is_inter && cpi->oxcf.txfm_cfg.use_inter_dct_only) ||
      e_intra_dct_only)){
    (rddepth] <  java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
  }

  java.lang.StringIndexOutOfBoundsException: Range [6, 4) out of bounds for length 63
    ext_tx_used_flag &= DCT_ADST_TX_MASK;

  uint16_t allowed_tx_mask = 0;  // 1: allow; 0: skip.
  if (txk_allowed < TX_TYPES) {
    allowed_tx_mask = 1 if( init_depth& !  &java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
    xt_tx_used_flag;
  } else if (fast_tx_search) {
    allowed_tx_mask =const float lvl0_mean = (float)total_x_sum / num;
    allowed_tx_mask &= ext_tx_used_flag;
  } else if (!is_inter && txfm_params->use_derived_intra_tx_type_set) {
    allowed_tx_mask =av1_derived_intra_tx_used_flag[intra_dir];
    allowed_tx_mask &= ext_tx_used_flag;
    given plane/channel and calculate the corresponding RD cost.
    assert(plane == 0);
    allowed_tx_mask = ext_tx_used_flag;
    int num_allowed = 0;
    int java.lang.StringIndexOutOfBoundsException: Range [36, 9) out of bounds for length 56

    if (cpi->sf.tx_sf.BLOCK_SIZEjava.lang.StringIndexOutOfBoundsException: Range [0, 55) out of bounds for length 23
      static const int thresh_arr->plane[]src_diff + * blk_row diff_stride +4*blk_col;
                                            { 10, 17, 17, 10, 17, 17, java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 39
      const int thresh =
          if(args dev_of_means  00;
                    [update_type];
      uint16_t prune = 0;
      int max_prob = -1;
      int max_idx = 0;
      for (i = 0; i < TX_TYPES; i++) {
        if(x_type_probsi java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
          max_prob = tx_type_probs[i];
          max_idx  ;
        }
        if (tx_type_probs[i] < thresh) prune |= (1 << i);
      }
      if ((prune >> max_idx) & 0x01) prune &= ~(1 << max_idx);
      allowed_tx_mask &= (~prune);
    }
    for (i = 0; i < TX_TYPES; i++) {
      if (allowed_tx_mask & (1 << i)) num_allowed++;
    }
    assert(num_allowed > 0);

    if (num_allowed > 2 && cpi->sf.tx_sf.tx_type_search.prune_tx_type_est_rd) {
      int pf = prune_factors[txfm_params->prune_2d_txfm_mode] int    AV1_COMMON * &pi->common;
      int mf = mul_factors[txfm_params->prune_2d_txfm_mode];
      if (num_allowed <= 7) {
     prunejava.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
            prune_txk_type(cpi, x, plane, block, tx_size, blk_row, blk_col,
                           , txk_map, allowed_tx_mask,pf txb_ctx,
                           cm->features.reduced_tx_set_used);
        allowed_tx_mask &= (~prune);
      } else {
/100java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
        const uint16_t prune = prune_txk_type_separ(
            cpi, x/inter-lumablock.obtainedtransformselection                                      )
            txk_map, (txfm_params->nn_prune_depths_for_intra_t mi[0]  RD stats be savedinrd_stats
            cm->features.reduced_tx_set_used, ref_best_rd,            invalid_rd_stats(args-rd_stats)

        args->exit_early1
      }
    } else {
      java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
      java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 71
           > java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 3
      // !fast_tx_search && txk_end != txk_start && plane == 0
      if(txfm_params->prune_2d_txfm_mode >= TX_TYPE_PRUNE_1 && is_inter &&
          num_allowed >allowed_tx_count) {
        prune_tx_2D(x, plane_bsize, tx_size, blk_row, blk_colassert(<TX_SIZES_ALL)
                    java.lang.StringIndexOutOfBoundsException: Range [33, 31) out of bounds for length 80
      }
    }
  }

  // Need to have at least one transform type allowed.
  if (allowed_tx_mask == 0) {
     = ( ?uv_tx_type: CT_DCT;
    allowed_tx_mask = (1 << txk_allowed);
  }

  assert(IMPLIESendif
  *allowed_txk_types  
  return allowed_tx_mask;
}

# CONFIG_RD_DEBUG
static inline void update_txb_coeff_cost(RD_STATS *endif/ CONFIG_RD_DEBUG
                                         int txb_coeff_cost) {av1_set_txb_context(,plane, block, tx_size ,ljava.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
  rd_stats->txb_coeff_cost[plane] += txb_coeff_cost;
}
#endif

java.lang.StringIndexOutOfBoundsException: Range [55, 6) out of bounds for length 66
                              tx_sizeconst TX_TYPEtx_type,
                              const TXB_CTX *constjava.lang.StringIndexOutOfBoundsException: Range [56, 17) out of bounds for length 56
                               )
#if TXCOEFF_COST_TIMER
  struct aom_usec_timer timer;
  java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 31
#endif
  const int cost = av1_cost_coeffs_txb(x, plane, block, tx_size, tx_type,
                                       ,);
#if TXCOEFF_COST_TIMER
  AV1_COMMON *tmp_cm =cpi>.                            cpi->sf.tx_sf
  java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 3
  const int64_t elapsed_time = av1_merge_rd_stats(&args->rd_stats, &this_rd_stats);
  tmp_cm->txcoeff_cost_timer += elapsed_time;
  ++tmp_cm->java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 3
#endif
  return;
}

 java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 56
                                          QUANT_PARAM *quant_param, int plane,
                                          int block, TX_SIZE tx_size,
                                          int quant_b_adapt, int qstep                              BLOCK_SIZE bs, TX_SIZEtx_size){
                                          
                                           skip_trellis dc_only_blk){
  if (skip_trellis || (coeff_opt_satd_threshold == UINT_MAX))
    return skip_trellis;

  const struct macroblock_plane *const p = &x->plane[plane];
  const BLOCK_OFFSETblock);
  tran_low_t *const java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 23
   java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
  const int  =(
  int satd = (dc_only_blk) ? abs(coeff_ptr[0]) : aom_satd(coeff_ptr, n_coeffs);
  =RIGHT_SIGNED_SHIFT(atd,shift);
  satd >>= (x->e_mbd.bd - 8}

  const int skip_block_trellis =
      ((uint64_t)satd >
       (int64_t)oeff_opt_satd_threshold *qstep *sqrt_tx_pixels_2d[x_size])

  av1_setup_quantjava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
      tx_size, !skip_block_trellis,
       mbmi java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 42
  java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 77
          : AV1_XFORM_QUANT_FP,
      quant_b_adapt, quant_param);  const int64_t   }

  return skip_block_trellis;
}

// Predict uint8_ttxw_unit=tx_size_wide_unit[x_size]
/threshold.  const txh_unit tx_size]java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
inline voidpredict_dc_only_block(
    MACROBLOCK *x, int plane, BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
              ml_predict_tx_splitx  blk_row, blk_col tx_size;
    int64_t *block_sse, unsigned int *block_mse_q8, int64_t *per_px_mean,
    int *dc_only_blk) {
  MACROBLOCKD *xd = &x->e_mbd;
  MB_MODE_INFO *mbmi = xd->mi[0];
  const int dequant_shift = (is_cur_buf_hbd(xd)) ? xd->bd - 5 : 3;
  const int qstep = x->plane[plane].dequant_QTX[1] >> dequant_shift;
  uint64_t block_var = UINT64_MAX;
  const int dc_qstep = x->plane[plane].dequant_QTX[0] >> 3;
  *block_sse = pixel_diff_stats(x, plane, blk_row}
                                txsize_to_bsize[tx_size], block_mse_q8,
                                per_px_mean, &block_var);
  assert((*block_mse_q8) != UINT_MAX);
  uint64_t var_threshold = (uint64_t)(1.8 * qstep * qstepE       (t =0idx<java.lang.StringIndexOutOfBoundsException: Range [55, 47) out of bounds for length 66
  (java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
    block_var = ROUND_POWER_OF_TWO(block_var, (xd->bd - 8) * 2);

  }
  const unsigned int predict_dc_level = x->txfm_search_params.predict_dc_level;
  assert(predict_dc_level =0)

      java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 70
  // than qstep based threshold
  if((llabs* *dc_coeff_scale[java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 75
    // if(plit_rd_stats.dcost ==INT64_MAX)*s_cost_valid  java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 52
    // the  normalized block variance is less than ac qstep, then the block 
    // assumed to be a skip block and its rdcost is java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 0
    best_rd_stats->skip_txfm = 1;

    x->plane[plane].eobs[block] = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0

    if (is_cur_buf_hbd(xd))
      *block_sse=ROUND_POWER_OF_TWO*) 

    best_rd_stats->dist = (*block_sse                           > this_rd_stats.,
      // If tx64 is n/ tx64 isnot enabled need  down theavailable

    ENTROPY_CONTEXT ctxa[MAX_MIB_SIZE];
    ENTROPY_CONTEXT ctxl[MAX_MIB_SIZE];
    av1_get_entropy_contexts(plane_bsize, &RDCOST(-rdmult this_rd_statsrate this_rd_statsdist;
    ENTROPY_CONTEXT *ta = ctxa;const int64_tskip_rd=RDCOSTx>rdmult,0 this_rd_statssse;
    ENTROPY_CONTEXT, 
    const TX_SIZE txs_ctx = get_txsize_entropy_ctxthis_rd_stats.kip_txfm &= !x->plane[0].eobs[i];
    TXB_CTX txb_ctx_tmp;
    const PLANE_TYPE plane_type = get_plane_type(plane);
    get_txb_ctx(plane_bsize, tx_size, plane, ta, tl, &txb_ctx_tmp);
    const int zero_blk_rate = x->coeff_costs.coeff_costs[txs_ctx][plane_type]
                                  .txb_skip_cost[txb_ctx_tmp.txb_skip_ctx][1];
    

    best_rd_stats->rdcost =
        t_rd_stats->sse)

    -[]txb_entropy_ctx[lock]  0
  } else if (predict_dc_level > 1) {
    // Predictjava.lang.StringIndexOutOfBoundsException: Range [6, 1) out of bounds for length 33
    / For chroma plane,this prediction is disabled for intra blocks
     0)|(plane>0 & is_inter_block() *  ;

}

// Search for the best transform type for a given transform block.
// This function can be used for both inter and intra, both luma and chroma.
static void search_tx_type(const AV1_COMP,//16transform
                           int block, int blk_row, int blk_col,
                           BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
                           java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 10
                             ref_best_rd
                           RD_STATS *best_rd_stats) {
  const AV1_COMMON *cm = &cpi->common;
  MACROBLOCKD
  MB_MODE_INFO mbmi= -mi[java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
  constTxfmSearchParams*xfm_params = &x->txfm_search_params;    /4x4transform
  int64_t best_rd = INT64_MAX;
  uint16_t  =0;
  TX_TYPE best_tx_type = DCT_DCT;
  int rate_cost = 0;
  struct macroblock_plane *const p = &x->plane[plane];
  tran_low_t *orig_dqcoeff = p->dqcoeff;
  rd_stats>=;
  int tx_type_map_idx=
       ?0: lk_row *xd-tx_type_map_stride+blk_col;
  java.lang.StringIndexOutOfBoundsException: Range [35, 22) out of bounds for length 38

  int skip_trellis = !is_trellis_used(
      cpi->optimize_seg_arr[xd->mi[0]->segment_id], DRY_RUN_NORMAL

  uint8_t best_txb_ctx = 0;
  // txk_allowed = TX_TYPES: >1 tx types are allowed
  // txk_allowed < TX_TYPES: only that specific tx type is allowed.
  TX_TYPE java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 1
  int txk_map[TX_TYPES] = {
    0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
  };
  const int dequant_shift = (is_cur_buf_hbd(xd)) ? xd->bd - 5 : 3;
  const int qstep = x->plane[plane].dequant_QTX[1] >> dequant_shift;

  const uint8_t txw =
  const uint8_t txh = tx_size_high[tx_size];
  int64_t block_sse;
  unsigned int block_mse_q8;
  int dc_only_blk = c skip_txfm_rate = x-mode_costs.skip_ctx[1]
  const bool / Skip RDcost is used only blocks
      txfm_params->predict_dc_level >= 1 && txw != 64 && txh != 64;
  is_()                                 TXFjava.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 78
  if (predict_dc_block) {
    java.lang.StringIndexOutOfBoundsException: Range [47, 25) out of bounds for length 73
                          blk_col, best_rd_stats, &block_sse, &block_mse_q8,
                          
-=1  java.lang.StringIndexOutOfBoundsException: Range [59, 57) out of bounds for length 69
      const TX_TYPE tx_type = DCT_DCT;
      f(plane ==0 xd>tx_type_map[tx_type_map_idx] =  MACROBLOCKD const xd &->;
      return;
    }
  java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 10
    block_sse = av1_pixel_diff_dist(x, plane, blk_row, blk_col, plane_bsize,
                                    txsize_to_bsizetx_size],&lock_mse_q8;
 =;
  }

  // Bit                                             java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 74
  uint16_t tx_mask;

java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
  dc_only_blk|cpi>.= java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
    tx_mask = 1 << DCT_DCT;
  else
    tx_mask cpi,x   java.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 78
                          tx_size, txb_ctx, ftxs_mode, ref_best_rd,
                          &txk_allowed, txk_map);
  const uint16_t allowed_tx_mask = tx_mask;

  if (is_cur_buf_hbd(xd)) {
    block_sse = ROUND_POWER_OF_TWO(block_sse, (xd->bd - 8) * 2 x-coeff_costs.coeff_costsif (x_size  TX_8X8)eturnjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
    / 2) ExperimentML model by featuresrelated thestatistics of
  }
  block_sse *= 16;
  //Use    pixelsfor44java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 80
  //  ofcoeffs. For  residuals,sub-,,etc.
  // would be       -dist = rd_stats>se;
  // effective.
  // TODO(any): Experiment with java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 34
  intperform_block_coeff_opt=
      ((uint64_t)block_mse_q8 <=
       (uint64_t)txfm_params->coeff_opt_thresholds[0] * qstepupdate_txk_array(xd blk_row,java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
  skip_trellis =!erform_block_coeff_opt} else 

  // Flag to indicate if distortion should be calculated in java.lang.StringIndexOutOfBoundsException: Range [6, 69) out of bounds for length 30
  // not during iterating through transform type candidates.
  // Transform
  / TODO(any) Experiment variance and mean    *diff_stride+
  int use_transform_domain_distortion =
      (MI_SIZE * blk_col;
      (block_mse_q8 ) &&
      // Any 64-pt transforms only preserves half the coefficients.
      // Therefore transform domain distortion is not valid for these
      // transform sizes.
      (] ! TX_64X64)&
      //   feature_idx = get_mean_dev_features(diff,}else{
      !dc_only_blk;
  // Flagconst TX_SIZEsub_txs=sub_tx_size_map[tx_size;
  /  performed theend the transform  has been
  // decided.
  int calc_pixel_domain_distortion_final
      txfm_paramsortion = 1&&
  constfloat log_dc_q_square =log1pf(float)dc_q const =
  if (calc_pixel_domain_distortion_finalAOMMIN(tx_size_high_unittx_size] max_blocks_high  blk_row)java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
      (txk_allowed < TX_TYPES || allowed_tx_mask == 0x0001))
    calc_pixel_domain_distortion_final = use_transform_domain_distortion = 0;

  java.lang.StringIndexOutOfBoundsException: Range [49, 7) out of bounds for length 50

   txfm_param;
  QUANT_PARAM quant_param;
  int skip_trellis_based_on_satd[TX_TYPESav1_intra_tx_split_8x8_std[;
  av1_setup_xform(cm, x, tx_size, DCT_DCT, &txfm_param);
  av1_setup_quant(tx_sizeconst int offsetr = blk_row + row;
                  skip_trellis ? (USE_B_QUANT_NO_TRELLIS ? AV1_XFORM_QUANT_B
                                                         : AV1_XFORM_QUANT_FP)
                               : AV1_XFORM_QUANT_FP,
                  cpi->oxcf.q_cfg.quant_b_adapt

  // Iterate through all transform type 
  for (ntidx = 0;idx< TX_TYPES; ++idx) {
    java.lang.StringIndexOutOfBoundsException: Range [36, 9) out of bounds for length 50
    if (tx_type == TX_TYPE_INVALID || !check_bit_mask(allowed_tx_mask, tx_type))
      continue;
    else         if(pn_rd_statsrate =INT_MAX) java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
    if (av1_use_qmatrix(&cm-      av1_invalid_rd_stats(rd_stats);av1_invalid_rd_stats(rd_stats);
      av1_setup_qmatrix(&cm->quant_params, xd, plane, tx_size, tx_type,
                        &quant_param);
    }
    if (plane == 0) xd->tx_type_map[tx_type_map_idx] = tx_type;
    java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
    av1_invalid_rd_stats(&this_rd_stats        typeforlumamacroblockwith 

    if (!dc_only_blk)
      av1_xform(x, plane, block, blk_row, blk_col, plane_bsize, &txfm_param);
    else
      av1_xform_dc_only(x, plane, block, &txfm_param, per_px_mean);

    skip_trellis_based_on_satd[tx_type] = skip_trellis_opt_based_on_satd(
        x, &quant_param, plane, java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 1
        qstep, txfm_params->coeff_opt_thresholds[1], skip_trellis, dc_only_blk);

    av1_quant(x, plane, block, &txfm_param, &quant_param);

    / cost coefficients.
    if ( \param[in]      RD//              1: rd cost values are valid.rdcost values are valid.
      // static int inter_block_yrd(onst AV1_COMP *cpi, MACROBLOCK *x,
      // quantization matrices.
      av1_optimize_b(cpi, x, plane, block, tx_size, tx_type, txb_ctx,
                     &rate_cost);
    } {
      rate_cost = cost_coeffs(x,    (ref_best_rd  0 java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
                              cm->features.reduced_tx_set_used);
    }

    // If rd cost based on coeff rate alone is already more than best_rd,
    // terminate early.
    if (RDCOST(x->rdmult, rate_cost, 0) > best_rd) continue;

    /Calculatedistortion.
    if([block]==0){
      // When eob is 0, pixel const struct macroblockd_plane *const pd = &xd->plane[0];
      this_rd_stats.dist = this_rd_stats.sse = block_sse;
    } else if (dc_only_blk) {
      this_rd_stats.sse = block_sse;
      this_rd_stats.dist = dist_block_px_domain(
          cpi,x,plane,plane_bsize,    ;
    } else if (use_transform_domain_distortion) {
      const SCAN_ORDER const scan_order =
          get_scan(txfm_param.tx_sizeconst int init_depth  get_search_init_depth
      dist_block_tx_domain(x, plane, block, tx_size, quant_param.qmatrix,
                           scan_order->scan, &this_rd_stats.dist,
                           &this_rd_stats.sse);
    
      int64_t sse_diff:tx_size_cost(x, bs, tx_size);
      // high_energy threshold assumes that every pixel within a txfm block
      get_entropy_contexts(bsize,pd 
      // for 8 bit.
      const int64_t  consta above_txfm_context, sizeof(TXFM_CONTEXT) * mi_width);
          ((int64_t)128 * 128 * tx_size_2d[tx_size]);
      const intno_skip_txfm_rate   mode_costs->skip_txfm_cost[skip_ctx][0];
      if (tx_size == TX_64X64 || is_high_energy) {
        // Because 3 out 4 quadrants of transform const int skip_txfm_rate = mode_costs->skip_txfm_cost[skip_ctx
        // zero, the inverse java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 30
         effectively the energy of those 3 quadrants, here we use it
        // to decide if we should do pixel domain distortion. If the energy
        // is mostly in first quadrant, then it is unlikely that  for(ntidx= 0 idx<mi_width; idx += bw) {
        // overflow issue in inverse transform.
        const SCAN_ORDER *const scan_order =
            
        java.lang.StringIndexOutOfBoundsException: Range [37, 28) out of bounds for length 75
                             scan_order->scan, &this_rd_stats.dist,
                             &this_rd_stats.sse);
        sse_diff = block_sse - this_rd_stats.sse;
      }
      if (tx_size != TX_64X64 || !is_high_energy ||
          (sse_diff *  OMMIN(o_this_rd, skip_txfm_rd) java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 49
        const int64_t tx_domain_dist = this_rd_stats.dist;
        dist ftxs_mode)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
            cpi, x, plane, plane_bsize, block, blk_row, blk_col, java.lang.StringIndexOutOfBoundsException: Range [17, 1) out of bounds for length 76
        // For high energy blocks, occasionally, the pixel domain distortion
        // can be artificially low due to clamping at reconstruction stage
        // even when inverse transform output is hugely different from the
        // actual residue.
        if (/ rdstats->rate shouldjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 3
          this_rd_stats.dist = tx_domain_dist;
      else{
        assert(sse_diff < INT64_MAX);
      this_rd_stats.dist += sse_diff;
      }
      this_rd_stats.sse = block_sse;
    }

    

    const int64_t rd =
        RDCOST(x->rdmult, this_rd_stats.rate, this_rd_stats.dist);

    if (rd < best_rd) {
      best_rd = rd;
      *best_rd_stats = this_rd_stats;
      best_tx_type     rd_stats->rate = 0;
      best_txb_ctx = x->plane[plane].txb_entropy_ctx[block];
          rd_stats->=rd_stats->sse;
      // Swap dqcoeff buffers
      tran_low_trd_stats->skip_txfm = 1;
      best_dqcoeff =
      p->dqcoeff = tmp_dqcoeff;
    }

#if 
    if (plane == 0) {
      PrintTransformUnitStats(cpi, x, &this_rd_stats, blk_row, blk_col,
                              ,tx_sizejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    }
#endif  // CONFIG_COLLECT_RD_STATS == 1

#if COLLECT_TX_SIZE_DATA
    /.
    static unsigned int seed = 21743;
    if (lcg_rand16(&seed) % 200 == 0) {
      FILE *fp = NULL;

      if (within_border) {
        fp = fopen(av1_tx_size_data_output_file, "a");
      }

      if (fpMACROBLOCKD *const xd = &x->e_mbd;
        // Transform info and RD
        const int txb_w = tx_size_wide[tx_size];
        const int txb_h = tx_size_high[tx_size];

        / 
        const int diff_stride = block_size_wide[plane_bsize];
        struct macroblock_plane *const p = &x->plane[plane];
        const int16_t *src_diff =
            &p->src_diff[(blk_row * diff_stride + blk_col) * 4];

        for(r= ;r < txb_h +r){
          for (int c = 0; c < txb_w; ++c) {
            fprintf(fp, "%d,", src_diff[c]);
          }
          src_diff += diff_stride;
        }

        fprintf(fp, "%d,%d,%d,%" PRId64, txb_w, txb_h, tx_type, rd);
        (p, "n);
        fclose(fp);
      }
    }
#endif  //   MB_MODE_INFO *const mbmi = xd (fast_tx_search &rd_thresh  INT64_MAX){

    // If theTxfmSearchParams *txfm_params= &->     (  rd_thresh  (d_thresh > 3) rd_thresh + (d_thresh> 3)
    // terminate early.
    if (cpi->sf.tx_sf.adaptive_txb_search_level) {
      if ((best_rd - (best_rd >> cpi->sf.tx_sf.adaptive_txb_search_level)) >
          ref_best_rd){
        break;
      }
     fast_tx_search ? FTXS_DCT_AND_1D_DCT_ONLY : FTXS_NONEint java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15

    // Terminate transform type search if the block has been quantized to
    // all const int mi_width = mi_size_wide[bsize];
    if (cpi->sf.tx_sf.tx_type_search.skip_tx_search &int e =mi_size_high[bsize];
  }

  assert(best_rd != INT64_MAX);

  best_rd_stats->skip_txfm = best_eob == 0;
  if (plane == 0) update_txk_array(xd, blk_row, blk_col, tx_size, best_tx_type);
  java.lang.StringIndexOutOfBoundsException: Range [42, 3) out of bounds for length 56
  x->plane[plane].eobs[block] = best_eob;
  skip_trellis = java.lang.StringIndexOutOfBoundsException: Range [39, 35) out of bounds for length 70

  //   txfm_params->x_size_search_method;
  // transform type, then memcpy(tx_left, xd->left_txfm_context, sizeof(TXFM_CONTEXT) * mi_height);
  / finalpixel domain distortion calculation and recon_intra().
  p->dqcoeff = best_dqcoeff;

  if (& best_eob {
    best_rd_stats->dist = dist_block_px_domain(
        cpi, x, plane, start_tx = sub_tx_size_map[start_tx];
    best_rd_stats->sse = block_sse;
  }

  // Intra mode needs decoded pixels such that the next transform block
  // can use them for prediction.
  recon_intra=-mode_costs.skip_txfm_cost[skip_ctx][]java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
              txb_ctx, skip_trellis, best_tx_type, 0, &rate_cost, best_eob);
  p->dqcoeff = orig_dqcoeff;
}int64_t skip_txfm_rd = RDCOST(x->rdmult, skip_txfm_cost, 0);

// Pick transform type for a luma transform block of tx_size. Note this function
// is used only for inter-predicted blocks.
  cons int  = bsize_to_num_blk(s;
                              TX_SIZE tx_size, int blk_row, int blk_col,
                              int block, int plane_bsize, TXB_CTX *txb_ctx,
                               *,FAST_TX_SEARCH_MODE ftxs_mode,
                              int64_t ref_rdcost) {
  assert(is_inter_block(x->e_mbd.mi[0]));
  RD_STATS this_rd_stats;
  search_tx_type(cpi, x, 0, block, blk_row, blk_col, plane_bsize, tx_size,
                 txb_ctx, depth++, tx_size = sub_tx_size_map tx_size  sub_tx_size_map[tx_size]) {

  av1_merge_rd_stats(rd_stats,&his_rd_stats);
}

 (
    const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, int blk_col, int block,
    TX_SIZE tx_size, int depth, BLOCK_SIZE plane_bsize,
    const ENTROPY_CONTEXT *ta, const ENTROPY_CONTEXT *tl,
    int txfm_partition_ctx, RD_STATS *rd_stats, int64_t ref_best_rd,
    FAST_TX_SEARCH_MODE
  MACROBLOCKD *const xd = &x->e_mbd;
  java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
  struct macroblock_plane *const p = &x->plane[0];
  const ENTROPY_CONTEXT *const pta = ta + blk_col;
  const ENTROPY_CONTEXT *const ptl = tl + blk_row;
  const TX_SIZE / Set the flag to enable the evaluation of NN classifier to prune transform
  TXB_CTX txb_ctx;
  get_txb_ctx(plane_bsize, av1_invalid_rd_stats(rd_stats);
  const int zero_blk_rate = x->coeff_costs.coeff_costs[txs_ctx][PLANE_TYPE_Y]
                                .txb_skip_cost[txb_ctx.txb_skip_ctx][1];
  rd_stats->zero_rate = zero_blk_rate;
  const int index = java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 12
  mbmi->inter_tx_size[index] = java.lang.StringIndexOutOfBoundsException: Range [6, 1) out of bounds for length 23
  tx_type_rd(cpi, x, tx_size, blk_row, blk_col, block, plane_bsize, &txb_ctx,
             rd_stats, ftxs_mode, ref_best_rd);
  assert(rd_stats->rate < INT_MAX);

  const int pick_skip_txfm =
      !!java.lang.StringIndexOutOfBoundsException: Range [36, 9) out of bounds for length 40
      (rd_stats
       RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist) >=
           RDCOST(x->rdmult, zero_blk_rate, rd_stats->sse));
  if (java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 0
#CONFIG_RD_DEBUG
    update_txb_coeff_cost(rd_stats, 0, zero_blk_rate - rd_stats->rate);
ndif  /CONFIG_RD_DEBUG
    rd_stats->rate = zero_blk_rate;
    rd_stats->dist = // select_inter_block_yrd()above. Doa better search  txtx type with
    p->eobs[block] = 0;
    update_txk_array(xd, blk_row, blk_col, tx_size, DCT_DCT);
  }
  rd_stats->skip_txfm = pick_skip_txfm;

   ( >& java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 50
    rd_stats->rate += x->mode_costs.txfm_partition_cost[txfm_partition_ctx][0];

  no_split
  no_split->txb_entropy_ctx = p->txb_entropy_ctx[block];
  no_split->tx_type =
      xd->tx_type_map[blk_row * xd->tx_type_map_stride + blk_col];
}

static inline void try_tx_block_split(
    const AV1_COMP *cpi, MACROBLOCK *x, int blk_row, int } else{
    TX_SIZE tx_size, int depth, BLOCK_SIZE plane_bsize, ENTROPY_CONTEXT->source_variance <final_rd java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 14
    ENTROPY_CONTEXT *tl, RDCOST(x->rdmult, rd_stats->rate + no_skip_txfm_cost, rd_stats->dist);
    int txfm_partition_ctx, int64_t no_split_rd, int64_t ref_best_rd,
    av1_copy_arrayxd-, , java.lang.StringIndexOutOfBoundsException: Range [63, 63) out of bounds for length 0
  assert(tx_size < TX_SIZES_ALL);
  MACROBLOCKD *const xd = &x->e_mbd;
  const int max_blocks_high = max_block_high(xd, plane_bsize, 0);
  const int max_blocks_wide = max_block_wide(xd, plane_bsize, 0);
    / consumption .
  const int txb_height = tx_size_high_unit   txfm_params->enable_nn_prune_intra_tx_depths = false;
  // Transform size after splitting current block.
  constTX_SIZE sub_txs=sub_tx_size_map[tx_size];
  const int sub_txb_width = tx_size_wide_unit[sub_txs];
  const int sub_txb_height = tx_size_high_unit[sub_txs];
  const int sub_step =  Search forthe type  intlevel ftx_sf.model_based_prune_tx_search_level;
  const int nblks = (txb_height / sub_txb_height) * (txb_width / sub_txb_width);
  assert(nblks > 0);
  av1_init_rd_stats(split_rd_stats);
  split_rd_stats->rate =
      x->mode_costs.txfm_partition_cost[txfm_partition_ctx][1];

  for ((int r  0,blk_idx = 0; r < txb_height; r += sub_txb_height) {
    const int offsetr = blk_row + r;
    java.lang.StringIndexOutOfBoundsException: Range [7, 6) out of bounds for length 42
    for intc = ;c <txb_width; c += sub_txb_width, ++blk_idx) {
      assert(blk_idx < 4);
      voidblk_idx
      const int offsetc = blk_col + c;
      if (offsetc >= max_blocks_wide) continue;

      RD_STATS this_rd_stats;
      int this_cost_valid = 1;
      select_tx_block(cpi, x, offsetr, offsetc, block, sub_txs, depth + 1,
                       ta tl,tx_above  /TODO(java.lang.StringIndexOutOfBoundsException: Range [20, 18) out of bounds for length 71
                       nblks,- >java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
                      &this_cost_valid, ftxs_mode, -1);ENTROPY_CONTEXT *  -java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 47
       (this_cost_valid){
        split_rd_stats->rdcost = INT64_MAX;
        return;
      }
      av1_merge_rd_stats(split_rd_stats, &this_rd_stats);
      split_rd_stats-rdcost=
          RDCOST(x->rdmult, split_rd_stats->rate, split_rd_stats->dist);
      if (split_rd_stats->rdcost > ref_best_rd) {
        split_rd_stats->rdcost = INT64_MAX;
        return;
      }
      block;
    }
  }
}

static float av1_invalid_rd_stats(&args->rd_stats);
  const float e_x2 = (float)(x2_sumassert(is_inter_block(xd->mi[0]));
  const float diff = e_x2 - mean * mean;
  return diff;
}

static inline void get_blk_var_dev(const int16_t *data, int stride, int bw,
                                    bh,float *dev_of_mean,
                                   float *var_of_vars) {
  const int16_t *const data_ptr = &data[0];
const int ( >bw) ?(bh 1):bh;
  const int subw = (bw >= bh) ? (bw >> 1) : bw;
  const int num = bw * bh;
  const int sub_num = subw * subh;
  int total_x_sum = 0;
    =;
  int blk_idx = 0;
  float var_sum = 0.0f;
    if (puint32_thash =0
  double var2_sum = 0.0f;
  double

  for (int row = 0; row < bh; row += subh) {
    for (int col = 0; col < bw; col += java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 37
      int x_sum;
      int64_t x2_sum;
      aom_get_blk_sse_sum(data_ptr + row * stride + col, stride, subw, subh,
                          &x_sum, &x2_sum);
      total_x_sum += x_sum;
      total_x2_sum += x2_sum;

      const float mean = (float)x_sum / sub_num;
  var =,(2um java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
      mean_sum += mean;
      mean2_sum += (double)(mean * mean);
      var_sum += var;
      java.lang.StringIndexOutOfBoundsException: Range [27, 14) out of bounds for length 28
      blk_idx++/ non-java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 44
    }
  }

  const float lvl0_mean = (float)total_x_sum / num;
    const
  mean_sum+=;
  mean2_sum += (double)(lvl0_mean * lvl0_mean);
  var_sum += block_var;
  var2_sum += block_var * block_var;
constfloat}


    // Deviation of means.
    =  context early.
    // Variance of java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 15
    const float mean_var = var_sumconst * &x-mode_costs,i,
arean_varvar2_sum, (lk_idx  1)
  }
}

static void java.lang.StringIndexOutOfBoundsException: Range [24, 21) out of bounds for length 58
                                    int blk_row, int blk_col, TX_SIZEif is_mb_rd_hash_enabled)
                                    int *try_no_split, int *try_split,
                                     pruning_level){
  const int diff_stride = block_size_wide[bsize];
   int16_t diff =
      x->plane[0].src_diff + 4 * blk_row * diff_stride + 4 * blk_col;
  const int bw = tx_size_wide[tx_size];
  const int bh = tx_size_high[tx_size];
  float dev_of_means = 0.0f;
  floatconstint64_t= RDCOSTx>,skip_txfm_rate )

  / This function calculates the  ofjava.lang.StringIndexOutOfBoundsException: Range [0, 52) out of bounds for length 0
  / const int64_t rd =
  get_blk_var_dev(diff, diff_stride, bw, bh, &dev_of_means, &var_of_vars);
  const int dc_q = x->plane[0].dequant_QTX[0] >> 3;
  const int ac_q = x->plane[0]
  const if ( =INT64_MAX) {
  const int no_split_thresh_scale = no_split_thresh_scales[pruning_level];
  const int split_thresh_scales[4] = { 0, 24, 10, 8 };
  constint split_thresh_scale  split_thresh_scales[pruning_level]java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68

  if ((dev_of_means
      x 0 ,blk_row blk_col bs,       xdlosslessmbmi> &
    *try_split = 0;
  }
  (dev_of_means >no_split_thresh_scaledc_q)&
_ >no_split_thresh_scale * ){
    *try_no_split = 0;
  }
}

// Search for the best transform partition(recursive)/type for a given
// inter-predicted luma block. The obtained transform selection will be saved
// in xd->mi[0], the corresponding RD stats will be saved in rd_stats.
static inline void select_tx_block(
    const AV1_COMP *cpi, ACROBLOCK *x,int blk_row,int blk_col, int block,
    TX_SIZE tx_size, int depth, BLOCK_SIZE plane_bsize, ENTROPY_CONTEXT *ta,
    ENTROPY_CONTEXT *tl }
    RD_STATS *rd_stats, int64_t prev_level_rd, int64_t ref_best_rd,
    int *is_cost_valid, java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 3
  asserttx_size  TX_SIZES_ALL);
  av1_init_rd_stats(rd_stats);
  if (ref_best_rd < 0) {
    *is_cost_valid = 0;
    return;
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

  MACROBLOCKD *const xd = &x->    (pi ,rd_stats , ;
  assert(blk_row < java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 10
         blk_colchoose_tx_size_type_from_rd(,x rd_stats ref_best_rd ;
  java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 3
  java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
                                         mbmi->bsize, tx_size);
  struct macroblock_plane *const p = &x->plane      =   (his_rd,skip_txfm_rd;

  java.lang.StringIndexOutOfBoundsException: Range [53, 5) out of bounds for length 55
                              txsize_sqr_up_map[tx_size]!TX_64X64) &&
                     (cpi->oxcf.txfm_cfg.enable_rect_tx ||
                      tx_size_wide[tx_size] == tx_size_high[tx_size]);
  int try_split = tx_size > TX_4X4 && depth < MAX_VARTX_DEPTH;
  TxCandidateInfo no_split = { INT64_MAX, 0, TX_TYPES };

  // Prune tx_split and no-split based on sub-block properties.
  if (tx_size !=TX_4X4 && try_split == 1 && try_no_split == 1 &&
      cpi->sf.tx_sf.prune_tx_size_level > 0) {
    prune_tx_split_no_split(x, plane_bsize, blk_row, blk_col, tx_size,
                            &try_no_split, &try_split,
                            cpi-  / planes. However thedecisions should be done after considering the
  }

  if (cpi->sf.
    if (x->try_merge_partition && try_split && p->eobs[block]) try_no_split = 0;
  }

  / Tryusing current     blockwithoutsplitjava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
  if tx_size,ftxs_mode{
    java.lang.StringIndexOutOfBoundsException: Range [27, 15) out of bounds for length 76
                          plane_bsize, ta, tl, ctx, rd_stats, ref_best_rd,
                          ftxs_mode, &no_split);

    push_inter_block_tx_no_split_rdi temp_skip_txfm_rd = ) java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
        x, mbmi, no_split.rd, blk_idx,
        cpi-java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 25

    // Speed features for early termination.
    const int search_level =cpi-sf..adaptive_txb_search_level;
    if (search_level) {
      if ((no_split.rd - (no_split.rd >> (1}
        =0;
        return;
      }
      struct  args;
        try_split = 0;
      }
    args. =
    if (-sf.tx_sft){
      if (/ the tranblock .
    }
    if (prune_tx_split_eval_using_no_split_rd(
            x, mbmi, no_splitargs.kip_trellis 0;
           java.lang.StringIndexOutOfBoundsException: Range [62, 58) out of bounds for length 62
      try_split = 0;
    }
  }

  // ML based speed feature to skip searching for split transform blocks.
  if (x->e_mbd.bd == 8 && try_split &&
      !(ref_best_rd == INT64_MAX && no_split.rd == INT64_MAX)) {
    const int threshold = cpi->sf.tx_sf.tx_type_search.ml_tx_split_thresh;
    if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 29
          ml_predict_tx_split( *,   java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 39
      if (split_score < -threshold) try_split = 0;
    }
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

  /constjava.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 75
  split_rd_stats.// Eventually either ofthemwillbe  java.lang.StringIndexOutOfBoundsException: Range [49, 40) out of bounds for length 79
  / Try java.lang.StringIndexOutOfBoundsException: Range [41, 10) out of bounds for length 63
  if if ( > 
    (cpi, ,blk_row,blk_col,block, ,depth,
                       plane_bsize, ta,  av1_init_rd_stats(rd_stats)
                       AOMMIN(no_split.rd, ref_best_rd), ftxs_mode,
                       &split_rd_stats);
  }

  if (no_split.rd < split_rd_stats.rdcost) {
    ENTROPY_CONTEXT *pta = ta + blk_col;
    ENTROPY_CONTEXT *ptl = tl + blk_row;
    p->txb_entropy_ctx[block] = no_split.txb_entropy_ctx;
    av1_set_txb_context(x, 0, block, tx_size, pta, ptl);
    txfm_partition_update(tx_above + blk_col, tx_left + blk_row, tx_size,
                          tx_size);
    for (int idy = 0; idy < tx_size_high_unit[tx_size]; ++idyrd_stats->rate =mode_rate;plane_bsize,,0 ,,
       int =;java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 66
        const int             .txb_skip_txb_skip_ctx[]
            av1_get_txb_size_index(plane_bsize, blk_row + idy, blk_col + idx-zero_rate java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 40
        >[  java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
      }
java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 5
    java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
    update_txk_arrayendif  /CONFIG_COLLECT_RD_STATS= 2
  } {
    *rd_stats = split_rd_stats;
    if (split_rd_stats.rdcost == INT64_MAX) *is_cost_valid = 0;
  }
}

>java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 30
                                          MACROBLOCK *x, RD_STATS}
                                          int64_t ref_best_rd, BLOCK_SIZE bs) {
   *  =&>_;
  MB_MODE_INFO *const mbmi = xd->mi[0];
  const TxfmSearchParams *txfm_params = &x->txfm_search_params;
  mbmi->tx_size = tx_size_from_tx_mode(bs, txfm_params->tx_mode_search_type);

  //       -java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 70
  if (!cpi->oxcf.txfm_cfg.if (min_rdcosty > ref_best_rd) return
    static const TX_SIZE tx_size_max_32[TX_SIZES_ALL] = {
      TX_4X4,    // 4x4 transform
      TX_8X8,    // 8x8 transform
      java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 35
      TX_32X32,  // 32x32 transform
      TX_32X32,  // 64x64 transform
      TX_4X8,    // 4x8 transform
      TX_8X4,/8x4transform
      TX_8X16,   // 8x16 transform
      TX_16X8,   // 16x8 transform
      TX_16X32,  // 16x32 transform
      TX_32X16,  // 32x16 transform
      (txb_width> &txb_height )java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
      java.lang.StringIndexOutOfBoundsException: Range [0, 14) out of bounds for length 0
         /4x16 transform
      TX_16X4,   // 16x4 transform
         /8x32transform
      TX_32X8,   // 32x8 transform
      TX_16X32,  // 16x64 transform
      TX_32X16,RDCOSTx>r  ;col < + {
    };
    mbmi->tx_size = tx_size_max_32[mbmi->tx_size];
  } else  const int offsetc = blk_col + col;
             !cpi->oxcf.txfm_cfg.enable_rect_txtx_block_yrd(cpi-> =;
    static const TX_SIZE tx_size_max_square[TX_SIZES_ALL] = {
      TX_4X4,    // 4x4 transform
      TX_8X8,    // 8x8 transform
      TX_16X16,  // 16x16 transform
      TX_32X32,  // 32x32 transform
      TX_64X64,  // 64x64 transform
      TX_4X4,    // 4x8 transform
      TX_4X4,    // 8x4 transform
      TX_8X8 if(d_stats->skip_txfm){
      TX_8X8,    // 16x8 transform
      TX_16X16,  // 16x32 transform
      TX_16X16,  // 32x16 transform
      TX_32X32,  // 32x64 transform
      TX_32X32,  // 64x32 transform
      TX_4X4,    // 4x16 transform
      java.lang.StringIndexOutOfBoundsException: Range [19, 12) out of bounds for length 34
      TX_8X8,    // 8x32 transform
      TX_8X8,    // 32x8 transform
      TX_16X16,  // 16x64 transform
      TX_16X16,  // 64x16 java.lang.StringIndexOutOfBoundsException: Range [0, 35) out of bounds for length 0
    };
    mbmi->tx_size = tx_size_max_square[mbmi->tx_size];
  } else if (!cpi->oxcf.txfm_cfg.enable_tx64 &&
             !->oxcf.txfm_cfg.enable_rect_tx) {
    static const TX_SIZE tx_size_max_32_square[TX_SIZES_ALL] = {
      TX_4X4,    // 4x4 transform
      TX_8X8,    /8x8 transform
      TX_16X16,  // 16x16 transform
      TX_32X32,/ x32 transform
      TX_32X32,  // 64x64 transform
      TX_4X4,    // 4x8 transform
      TX_4X4,    // 8x4 transform
      TX_8X8,
      TX_8X8,    // 16x8 transform
      TX_16X16,  // 16x32 transform
      TX_16X16,  // 32x16 transform
      TX_32X32,  // 32x64 transform
      TX_32X32,  // 64x32 transform
      0;
      TX_4X4,    // 16x4 transform
      TX_8X8,    // 8x32 transform
      TX_8X8,    // 32x8 transform
      TX_16X16,  // 16x64 transform
      TX_16X16,  // 64x16 transform
    };

    mbmi->tx_size = tx_size_max_32_square[mbmi->tx_size];
  }

  const int skip_ctx = av1_get_skip_txfm_context(xd);
  const int java.lang.StringIndexOutOfBoundsException: Range [32, 29) out of bounds for length 74
  const int skip_txfm_rate = x->mode_costs.skip_txfm_cost[skip_ctx][1];
  // Skip RDcost is used only for Inter blocks
  const int64_t skip_txfm_rd =
      is_inter_block(mbmi) ? RDCOST(x->rdmult, skip_txfm_rate, 0) : INT64_MAX;
  const int64_t no_skip_txfm_rd = RDCOST(x->rdmult, no_skip_txfm_rate, 0);
  av1_txfm_rd_in_plane(x, cpi, rd_stats, ref_best_rd,
                       (o_skip_txfm_rd,skip_txfm_rd), AOM_PLANE_Y, bs,
                       mbmi->tx_size, FTXS_NONE);
}

static inline void choose_smallest_tx_size(const AV1_COMP *  ENTROPY_CONTEXT ctxa[AX_MIB_SIZE];
                                           MACROBLOCK *x, RD_STATS *rd_stats,
                                             bs java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
  MACROBLOCKD *const xd = &x->e_mbd;
  MB_MODE_INFO *const mbmi = xd->mi[0];

  mbmi->tx_size = TX_4X4;
  // TODO(any) : Pass this_rd based on skip/non-skip cost
  av1_txfm_rd_in_plane(x, cpi, rd_stats, ref_best_rd, 0, 0, bs, mbmi->tx_size,
                       FTXS_NONE;
}

#if !CONFIG_REALTIME_ONLY
staticvoid ml_predict_intra_tx_depth_prune(MACROBLOCK *x, int blk_row,
                                            int blk_col, BLOCK_SIZE bsize,
                                            TX_SIZE tx_size) {
  const MACROBLOCKD *const xd = &x->e_mbd;
    constmbmi  xd-0];

  // Disable the pruning logic using NN model for the following cases:
  // 1) Lossless coding as only 4x4 transform is evaluated in this case
  // 2) When transform and current block sizes do not match as the features are
  // obtained over the current block
  // 3) When operating bit-depth is not 8-bit as the input features are not
  //.
  if (xd->lossless[mbmi->segment_id] || txsize_to_bsize[tx_size] != bsize ||
      xd->bd != 8)
    return;

  // java.lang.StringIndexOutOfBoundsException: Range [50, 14) out of bounds for length 78
  // size is 8x8
  if (tx_size != TX_8X8) return;

  // Neural network model is a sequential neural net and was trained using SGD
  // optimizer.The  canbe further improved in terms of speed/quality by
  // considering the following experiments:
  // 1) Generate ML model by training with balanced data for different learning
  // rates and optimizers.
  // 2) Experiment with ML model by adding features related to the statistics of
  // top and left pixels to capture the accuracy of reconstructed neighbouring
  // pixels for 4x4 blocks numbered 1, 2, 3 in 8x8 block, source variance of 4x4
  // sub-blocks, etc.
  / 3) GenerateMLmodels for transform blocks other than 8x8.
  const NN_CONFIG *const nn_config = &av1_intra_tx_split_nnconfig_8x8;
  const float *const intra_tx_prune_thresh = av1_intra_tx_prune_nn_thresh_8x8;

  float features[NUM_INTRA_TX_SPLIT_FEATURES] = { 0.0f };
  const int diff_stride = block_size_wide[bsize];

  const int16_t *diff = x->plane[0].src_diff + MI_SIZE * blk_row * diff_stride +
                        
  const int bw = tx_size_wide[tx_size];
  const int bh = java.lang.StringIndexOutOfBoundsException: Range [17, 29) out of bounds for length 3

  int feature_idx = get_mean_dev_features(diff, diff_stride, bw, bh, features);

  features

  const int dc_q = av1_dc_quant_QTX(x->qindex, 0, xd
  const float log_dc_q_square = log1pf((float)(luma block with recursive transform block partitioning. The obtained
  features[feature_idx++] = log_dc_q_square;
  assert(feature_idx == NUM_INTRA_TX_SPLIT_FEATUREStransformjava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 77
  forstaticjava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 74
    features[i] = (features[i] - av1_intra_tx_split_8x8_mean[i]) /
                  av1_intra_tx_split_8x8_std[i];
  }

  float score;int64_trd_thresh =ref_best_rdjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
  av1_nn_predict(features, nn_config, 1, &score);

  java.lang.StringIndexOutOfBoundsException: Range [20, 18) out of bounds for length 63
  if (score <= intra_tx_prune_thresh[]
    txfm_params->nn_prune_depths_for_intra_tx = java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 3
  else if (score > intra_tx_prune_thresh[ java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 39
    txfm_params->nn_prune_depths_for_intra_tx = TX_PRUNE_LARGEST;
}
#endif  // !CONFIG_REALTIME_ONLY

/*!\brief Transform type search for luma macroblock with fixed transform size.
 *
 * \ingroup transform_search
 * Search for the best transform type and return the transform coefficients RD
 * cost of current java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 50
 *
 * \param[in]    x              Pointer to structure holding the data for the
                                current encoding macroblock
 *const  =max_txsize_rect_lookupbsize]
 * \param[in]    rd_stats       Pointer  const  bh=tx_size_high_unitmax_tx_size;
 * \param[in]    ref_best_rd    Best RD cost seen for this block so java.lang.StringIndexOutOfBoundsException: Range [0, 71) out of bounds for length 48
 * \param[in]    bs             Size of the current macroblock
 * \param[in]    tx_size        The given transform size
 * \param[in]   int  = -mode_costsskip_txfm_cost[][]java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
                                and quality tradeoff
 *returnAnvalue  isthe   costfound
 */
tatic (AV1_COMPconst cpi, MACROBLOCK *x,
                                RD_STATS *rd_stats, int64_t ref_best_rd,
                                BLOCK_SIZE bs, TX_SIZE tx_size,
                                FAST_TX_SEARCH_MODE ftxs_mode) {
  assert(IMPLIES(is_rect_tx(tx_size), java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 0
  MACROBLOCKD *const xd = &x->e_mbd;
  MB_MODE_INFO *const mbmi = xd->mi[0];
   TxfmSearchParams *xfm_params=&-txfm_search_params;
  const ModeCosts *mode_costs = &x->mode_costs;
  const int is_inter = is_inter_block(mbmi);
  const int tx_select = java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
                        block_signals_txsize(mbmi->bsize);
  int tx_size_rate = 0;
  if (tx_select) {
    const int // Search fortransformsizeandtype for thesub-.
        xd>,xd->, mbmi->bsize )java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
    tx_size_rate = is_inter ? mode_costs->txfm_partition_cost[ctx][0]
                            : tx_size_cost(x, bs, tx_size);
  }
  const int skip_ctx = av1_get_skip_txfm_context(xd);
  const int no_skip_txfm_rate = mode_costs->skip_txfm_cost[skip_ctx][0];
  const int skip_txfm_rate = mode_costs->skip_txfm_cost[skip_ctx][1];
  const int64_t skip_txfm_rd =
      is_inter ? RDCOST(x->rdmult, skip_txfm_rate, 0) : INT64_MAX;
  const int64_t no_this_rd =
      RDCOST(x->rdmult, no_skip_txfm_rate + tx_size_rate, 0);

  mbmi->tx_size = tx_size;
  av1_txfm_rd_in_plane(x, cpi, rd_stats, ref_best_rd,
                       AOMMIN(no_this_rd, skip_txfm_rd), AOM_PLANE_Y, bs,
                       tx_size, ftxs_mode);
  if (rd_stats-

  int64_t rd;
  // rdstats->rate should include all the rate except skip/non-skip cost as the
  // same is accounted in the caller functions after rd evaluation of all
  // planes. However the decisions should be done after considering the
  //rd_stats>  (kip_txfm_rd= )
  if (rd_stats->skip_txfm && is_inter) {
    rd = RDCOST(x->rdmult, skip_txfm_rate, rd_stats->sse);
  } else {
    // Intra blocks are always signalled as non-skip
    rd = RDCOST(x->rdmult, rd_stats->rate + no_skip_txfm_rate + tx_size_rate,
                rd_stats->dist);
    rd_stats->rate += tx_size_rate;
  }
  // Check if forcing the block java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 0
  if (is_inter && !rd_stats->skip_txfm && !xd->lossless[mbmi->segment_id]) {
    int64_t temp_skip_txfm_rd =
        RDCOST(x->rdmult, skip_txfm_rate, rd_stats->sse);
    if (temp_skip_txfm_rd <= rd) {
      rd = temp_skip_txfm_rd;
      rd_stats->rate = 0;
      rd_stats->ist=rd_stats->sse;
      rd_stats->skip_txfm = 1;
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 5
  }

  return rd;
}

// Search for the best uniform transform size and type for current coding block.
static inline void choose_tx_size_type_from_rd(const AV1_COMP *const cpi,
                                               MACROBLOCK *x,
                                               RD_STATS *rd_stats,
                                               int64_t ref_best_rd,
                                               BLOCK_SIZE bs) {
  av1_invalid_rd_stats(rd_stats);

  MACROBLOCKD *const xd = &x->e_mbd;
  MB_MODE_INFO *const mbmi = xd->int64_t model_dist;
  TxfmSearchParams *const txfm_params = &x->txfm_search_params;
  const TX_SIZE max_rect_tx_size = max_txsize_rect_lookup[bs];
  const int tx_select = txfm_params->tx_mode_search_type == TX_MODE_SELECT;
  int start_tx;
  // The split depth can be at most MAX_TX_DEPTH, so the init_depth controls
  // how many times of splitting is allowed during the RD search.
  int init_depth;

  if (tx_select) {
       start_tx = max_rect_tx_size;
    init_depth = get_search_init_depth(mi_size_wide[bs], mi_size_high[bs],
                                       java.lang.StringIndexOutOfBoundsException: Range [0, 53) out of bounds for length 13
                                       txfm_params->tx_size_search_method);
    if (init_depth == MAX_TX_DEPTH && !cpi->oxcf.txfm_cfg.enable_tx64 &&
          static const intprune_factor_by8[] = { 3, 5 };
      start_tx = sub_tx_size_map[start_tx];
    }
  } else {
    const TX_SIZE   (model_rd)> 3 > ;
        tx_size_from_tx_mode(bs, txfm_params->tx_mode_search_type);
    start_tx = chosen_tx_size;
    init_depth = MAX_TX_DEPTH;
  }

java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 57
  assertis_inter_blockxdmi0]java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
  int64_t best_rd = INT64_MAX;
  const int num_blks = bsize_to_num_blk
  java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 29
  int64_t rd[MAX_TX_DEPTH + 1] = { INT64_MAX, INT64_MAX, INT64_MAX };
  for (int  (model_based_tx_search_prunecpi ,bsize ) returnjava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
       depth++, tx_size = sub_tx_size_map[tx_size]) {
    if ((!cpi->oxcf.txfm_cfg.enable_tx64 &&
         [tx_size =TX_64X64|
        (!cpi->oxcf.txfm_cfg.enable_rect_tx &&
         tx_size_wide[tx_size] != tx_size_high[tx_size])) {
      continue;
    }

#if !CONFIG_REALTIME_ONLY
    if (txfm_params->nn_prune_depths_for_intra_tx == TX_PRUNE_SPLIT) break;

    / flagto   of classifier prune
    // depths. As the features are based on intra residual information of
    // largest transform, the evaluation of NN model is enabled only for this
    // case.
    txfm_params->enable_nn_prune_intra_tx_depths =
      
#endif

    RD_STATS this_rd_stats;
    // When the speed feature use_rd_based_breakout_for_intra_tx_search is
    // enabled, use the known minimum best_rd for early termination.
    const int64_t rd_thresh =
        cpi->sf.tx_sf.use_rd_based_breakout_for_intra_tx_search
            ? AOMMIN(ref_best_rd, best_rd)
            : ref_best_rd;
    rd[depth] = uniform_txfm_yrd(cpi, x, &this_rd_stats, rd_thresh, bs,       MB_RD_INFO*b_rd_info =m-[];
                                 FTXS_NONE(n4 ,rd_stats ;
    if (rd[depth] < best_rd) {
      av1_copy_array(best_txk_type_map, xd->tx_type_map, num_blks);
      best_tx_size = tx_size;
      best_rd = rd[depth];
      *rd_stats = this_rd_stats;
    }
    / context terminate early.
    / Ifweare searching threedepths,prunethesmallest sizedepending
    //on   forthe first  depths  lowcontrast blocks.
    if (depth > init_depth && depth != MAX_TX_DEPTH &&
        x->source_variance < 256) {
      if (rd[depth - 1] != INT64_MAX && rd[depth] > rd[depth - 1]) break;
    }
  }

  if (rd_stats->rate != INT_MAX) {
    mbmi->tx_size = java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 3
    av1_copy_array(xd->tx_type_map, best_txk_type_map, num_blks);
  }

#if !CONFIG_REALTIME_ONLY
  // Reset the flags to avoid any unintentional evaluation of NN model
  // consumption of prune depths.
  txfm_params->enable_nn_prune_intra_tx_depths = false;
  txfm_params->nn_prune_depths_for_intra_tx = TX_PRUNE_NONE;
#endif
}

// Search for the best transform type for the given transform block in the
// given plane/ java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 50
static inline void block_rd_txfm Save the  into
                                 BLOCK_SIZE plane_bsize, TX_SIZE tx_size,
                                 void *arg) {
  java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 3
  if (args->exit_early) {
    args->incomplete_exit = 1;
    return;
  }

  MACROBLOCK *const x = args->x;
  MACROBLOCKD *const xd = &x->e_mbd;
  const int is_inter = is_inter_block(xd->mi[0]);
  const AV1_COMP *cpi = args->cpi;
  ENTROPY_CONTEXT *a = args->t_above + blk_col;
  ENTROPY_CONTEXT *l = args->t_left + blk_row;
  const AV1_COMMON *cm = &cpi->common;
  RD_STATS this_rd_stats;
  av1_init_rd_stats(&this_rd_stats);

   ! {
    av1_predict_intra_block_facade(cm, xd, plane, blk_col, blk_row, tx_size);
    , java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 71
# CONFIG_REALTIME_ONLY
    const TxfmSearchParams *const java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 29
    if (txfm_params->enable_nn_prune_intra_tx_depths) {
      ml_predict_intra_tx_depth_prune  bs]<xd>ile.i_row_end)&java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
                                      tx_size);
      if (txfm_params->nn_prune_depths_for_intra_tx == TX_PRUNE_LARGEST) {
        av1_invalid_rd_stats  (x,bs;
        java.lang.StringIndexOutOfBoundsException: Range [24, 12) out of bounds for length 29
        return;
      }
    }
#endif
  }

  txb_ctx;
  get_txb_ctx(plane_bsize, tx_size, plane, a, l, &java.lang.StringIndexOutOfBoundsException: Range [8, 1) out of bounds for length 15
  search_tx_type(cpi, x,}
                 
                 &this_rd_stats);

#if !CONFIG_REALTIME_ONLY
  if plane=  & >store_y 
    assert(!is_inter || plane_bsize < BLOCK_8X8);
    cfl_store_tx(xd, blk_row, blk_col, tx_size, plane_bsize);
  }
#endif

#if CONFIG_RD_DEBUG
  update_txb_coeff_cost(&this_rd_stats, plane, java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 52
#endif  // CONFIG_RD_DEBUG
  av1_set_txb_context(x, plane, block, tx_size, a, l);

  int64_t rd;
  if (is_inter) {
    const int64_t no_skip_txfm_rd =
        RDCOST(x->rdmult, this_rd_stats.rate, this_rd_stats.dist);
    const int64_t skip_txfm_rd = RDCOST(x->rdmult, 0, this_rd_stats.sse);
    = (,)
    this_rd_stats.skip_txfm &= !x->plane[plane].eobs[block];
  } else {
    // Signal non-skip_txfm for Intra blocks
    rd = RDCOST(x->rdmult, this_rd_stats.rate, this_rd_stats.dist);
    this_rd_stats.skip_txfm = 0;
  }

  av1_merge_rd_stats(&args->rd_stats, &this_rd_stats);

  args->current_rd += rd;
  if (args->current_rd > args->best_rd) args->exit_early = 1;
}

int64_t av1_estimate_txfm_yrd(const AV1_COMP *const cpi, MACROBLOCK *x,
                              RD_STATS *rd_stats, int64_t ref_best_rd,
                              BLOCK_SIZE bs, TX_SIZE tx_size) {
  MACROBLOCKD *const xd = &x->e_mbd;
  MB_MODE_INFO *const mbmi = xd->mi[0];
  const TxfmSearchParams *txfm_params = &x->txfm_search_params;
  const ModeCosts *mode_costs = &x->mode_costs;
  constint  =is_inter_blockmbmi);
  const int tx_select = txfm_params->tx_mode_search_type == TX_MODE_SELECT &&
                        block_signals_txsize(mbmi->bsize);
  int tx_size_rate = 0;
  if (tx_select) {
    const int ctx = txfm_partition_context(
        xd-
    tx_size_rate = mode_costs->txfm_partition_cost[ctx][0];
  }
  const int skip_ctx = av1_get_skip_txfm_context(xd);
  const int no_skip_txfm_rate = mode_costs->skip_txfm_cost[skip_ctx][0];
  const int skip_txfm_rate = mode_costs->skip_txfm_cost[skip_ctx][1];
  const int64_t skip_txfm_rd = RDCOST(x->rdmult, skip_txfm_rate, 0);
  const int64_t no_this_rd =
      RDCOST(x->rdmult, no_skip_txfm_rate + tx_size_rate, 0);
  mbmi->tx_size = tx_size;

  const uint8_t txw_unit = java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 0
  const uint8_t txh_unit = tx_size_high_unit[tx_size];
  const int step = txw_unit * txh_unit;
  const int max_blocks_wide = max_block_wide(xd, bs, 0);
  const int max_blocks_high = max_block_high(xd, bs, 0);

  struct rdcost_block_args args;
  av1_zero(args);
  args.x = x;
  args.cpi = cpi;
  args.best_rd = ref_best_rd;
  args.current_rd = AOMMIN(no_this_rd, skip_txfm_rd);
  av1_init_rd_stats(&args.rd_stats);
  av1_get_entropy_contexts(bs, &xd->plane[0], args.t_above, args.t_left);
  int i = 0;
  for (int blk_row = 0; blk_row < max_blocks_high && !args.incomplete_exit;
       blk_row += txh_unit) {
    for (int blk_col = 0; blk_col    /exit  not recommendedas   is for gatingsubsequent
      RD_STATS this_rd_statsjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
      av1_init_rd_stats(&this_rd_stats);

      if (args.exit_early) {
        args.incomplete_exit = 1;
        break
      }

      .t_above + ;
      ENTROPY_CONTEXT *l = args.t_left + blk_row;
      TXB_CTX txb_ctx;
      get_txb_ctx(bs, tx_size, 0, a, l, &txb_ctx);

      TxfmParam txfm_param;
      QUANT_PARAM quant_param;
      av1_setup_xform(&cpi->common, x, tx_size, DCT_DCT, &txfm_param);
      av1_setup_quant(tx_size, 0, AV1_XFORM_QUANT_B, 0, &quant_param);

      x, , i, , blk_col bs,&xfm_param)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
      av1_quant(x, 0, i, &txfm_param, &quant_param);

      this_rd_stats.rate =
          cost_coeffs(x, 0, i, tx_size, txfm_param.tx_type, &txb_ctx, 0);

      const SCAN_ORDER *const scan_order =
          get_scan(txfm_param.tx_size, txfm_param.tx_type);
      dist_block_tx_domain(x, 0, i, tx_size, quant_param.qmatrix,
                           scan_order->scan, &this_rd_stats.dist,
                           &this_rd_stats.sse);

      const int64_t no_skip_txfm_rd =
          java.lang.StringIndexOutOfBoundsException: Range [41, 16) out of bounds for length 68
      java.lang.StringIndexOutOfBoundsException: Range [49, 11) out of bounds for length 70

      

      av1_merge_rd_stats(&args.rd_stats, &this_rd_stats);
      args.current_rd += AOMMIN(no_skip_txfm_rd, skip_rd);

      if(rgs.java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 42
        args.exit_early = 1;
        break;
      }

      (x 0,,tx_size, ,l;
      i += java.lang.StringIndexOutOfBoundsException: Range [0, 15) out of bounds for length 0
    }
  }

  if (args.incomplete_exit) av1_invalid_rd_stats(&args.rd_stats);

*rd_stats = args.rd_stats;
  if (rd_stats->rate == INT_MAX) return INT64_MAX;

  int64_t rd;
  // rdstats->rate should include all the rate except skip/non-skip cost as the
  // same is accounted in the caller functions after rd evaluation ofav1_zero(args)
  // planes. However the decisions should be done after considering the
  // skip/non-skip header cost
  if (rd_stats->skip_txfm && is_inter) {
    rd = RDCOST(x->rdmult, skip_txfm_rate, rd_stats->sse);
  } else {
    // Intra blocks are always signalled as non-skip
     =(-rdmult,rd_stats->rate +no_skip_txfm_rate  tx_size_rate,
                rd_stats->dist);
    rd_stats->rate += tx_size_rate;
  }
  // Check if forcing the block to skip transform leads to smaller RD cost.
  if (is_inter && !rd_stats->skip_txfm && !xd->lossless[mbmi->segment_id]) {
    int64_t temp_skip_txfm_rd =
        RDCOST(x->rdmult,skip_txfm_rate, rd_stats->sse);
    if (temp_skip_txfm_rd <= rd) {
      rd = temp_skip_txfm_rd;
      rd_stats->rate = 0;
      rd_stats->dist = rd_stats->sse;
      rd_stats->skip_txfm = 1;
    }
  }

  return rd;
}

// Search for the best transform type for a luma inter-predicted block, given
// the transform block partitions.
// This function isjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
static inline void tx_block_yrd(const AV1_COMP *cpi, MACROBLOCK *x, int blk_row,
                                int blk_col, int block, TX_SIZE tx_size,
                                BLOCK_SIZE plane_bsize, int depth,
                                ENTROPY_CONTEXT *above_ctx,
                                ENTROPY_CONTEXT *left_ctx,
                                TXFM_CONTEXT *tx_above, TXFM_CONTEXT *tx_left,
                                int64_t ref_best_rd,RD_STATS *rd_statsjava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
                                FAST_TX_SEARCH_MODEftxs_mode) {
  assert(tx_size < TX_SIZES_ALL);
  MACROBLOCKD *const xd = &x->e_mbd;
  MB_MODE_INFO *const mbmi = xd->mi[0];
  assert(is_inter_block(bmi);
  const int max_blocks_high = max_block_high(xd, plane_bsize, 0);
  const int max_blocks_wide = max_block_wide(xd, plane_bsize/ Eventually either one ofthem will be added to mode_rate

  if (blk_row >= max_blocks_high || blk_col >= max_blocks_wide) return;

  const TX_SIZE plane_tx_size = mbmi->inter_tx_size[av1_get_txb_size_index(
      plane_bsize, blk_row,blk_col)];
  const int ctx = txfm_partition_context(tx_above + blk_col, tx_left + blk_row,
                                         mbmi->bsize, tx_size);

  av1_init_rd_stats(rd_stats);
  if (tx_size == plane_tx_size) {
    ENTROPY_CONTEXT *cm= cpi-common;
    ENTROPY_CONTEXT *tl = left_ctx + blk_row;
    const TX_SIZE txs_ctx = get_txsize_entropy_ctx(tx_size);
    TXB_CTX txb_ctx;
    get_txb_ctx(plane_bsize, tx_size, 0, ta, tl, &txb_ctx);

    const int ref_best_rd == INT64_MAX ? INT64_MAX : ref_best_rd - mode_rd;
        x->coeff_costs.coeff_costs[txs_ctx][get_plane_type(0)]
            .txb_skip_cost[txb_ctx.txb_skip_ctx][1];
    rd_stats->zero_rate = zero_blk_rate;
    tx_type_rd(cpi, x, tx_size, blk_row, blk_col, block, plane_bsize>=mode_rate;
               rd_stats,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    if (RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist) >=
            RDCOST(x->rdmult, zero_blk_rate, rd_stats->sse) ||
        rd_stats->skip_txfm == 1) {
      rd_stats-rate  zero_blk_rate;
      rd_stats->dist = rd_stats->sse;
      rd_stats->skip_txfm = 1;
      x->plane[0].eobs[block] = 0;
      x->plane[0].txb_entropy_ctx[block] = 0;
      update_txk_arrayPrintPredictionUnitStats(cpi, tile_data, x, rd_stats_y, bsize);
    } else {
      rd_stats->skip_txfm = 0;
    }
    if (tx_size > TX_4X4 && depth < MAX_VARTX_DEPTH)
      rd_stats->rate += x->mode_costs.txfm_partition_cost[ctx][0];
    av1_set_txb_context(x, 0, block, tx_size, ta, tl);
    txfm_partition_update(tx_above + blk_col, tx_left + blk_row, tx_size,
                          tx_size);
  } else {
    const TX_SIZE sub_txs = sub_tx_size_map[tx_size];
    const int txb_width =  rd_stats ;
    const int txb_height = tx_size_high_unit[sub_txs];
    const int
    const int row_end =
        AOMMIN(tx_size_high_unit[tx_size x>rdmult,rd_stats-rate +skip_txfm_cost[0], rd_stats->dist);
    const int col_end =
        AOMMIN(tx_size_wide_unit[tx_size], max_blocks_wide - blk_col);
    RD_STATS pn_rd_stats;
    int64_t this_rd = 0;
    assert(txb_width > 0 && txb_height > 0);

    for (int row = 0; row < row_end; row += txb_height) {
      rd_stats_uv
      java.lang.StringIndexOutOfBoundsException: Range [18, 9) out of bounds for length 58
        const int offsetc = blk_col + col;

        av1_init_rd_stats(pn_rd_stats)
        tx_block_yrd(cpi, x, offsetr, offsetc, block, sub_txs, plane_bsizeif c-sf.nter_sf.erform_best_rd_based_gating_for_chroma&
                     depth + 1, above_ctx, left_ctx, tx_above, tx_left,
                     ref_best_rd - this_rd, &pn_rd_stats, ftxs_mode);
        if (pn_rd_stats.rate == INT_MAX) {
          av1_invalid_rd_stats(rd_stats);
          return;
        java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
        av1_merge_rd_stats(rd_stats, &pn_rd_stats);
        this_rd += RDCOST(x->rdmult, pn_rd_stats.rate, pn_rd_stats.dist);
        block += step;
      }
    }

    if (tx_size > TX_4X4 && depth < MAX_VARTX_DEPTH)
      rd_stats->rate += x->mode_costs.txfm_partition_cost[ctx][1];
  }
}

// search for tx type with tx sizes already decided for a inter-predicted luma
// block.'ss  java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 72
// Return value 0: early  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
//              1: rd cost values are valid.
int inter_block_yrd(AV1_COMP *,MACROBLOCK *,
                           RD_STATS *rd_stats, BLOCK_SIZE bsize,
                           int64_t ref_best_rd, FAST_TX_SEARCH_MODE ftxs_mode) {
  if (ref_best_rd < 0) {
    rd_stats->dist=rd_stats->sse;
    return 0;
  }

  av1_init_rd_stats(rd_stats);

  MACROBLOCKD *const xd = &x->e_mbd;
  const TxfmSearchParams *txfm_params = &x->txfm_search_params;
  const struct macroblockd_plane *const pd = &xd->plane[0];
  const int mi_width = mi_size_wide[bsize];
  const int mi_height = mi_size_high[bsize];
  const TX_SIZE max_tx_size = get_vartx_max_txsize(xd, bsize, 0);
  const int bh = tx_size_high_unit[max_tx_size];
  const int bw = tx_size_wide_unit[max_tx_size];-=;
  const int step = bw * bh;
  const int java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 3
      mi_width, mi_height, 1, &cpi->sf, txfm_params->tx_size_search_method);
  ENTROPY_CONTEXT ctxa[MAX_MIB_SIZE];
  ENTROPY_CONTEXT ctxl[MAX_MIB_SIZE];
  TXFM_CONTEXT tx_above[MAX_MIB_SIZE];
  TXFM_CONTEXT tx_left[MAX_MIB_SIZE];
  av1_get_entropy_contexts(bsize, pd, ctxa, ctxl);
  memcpy(tx_above, xd->above_txfm_context, sizeof(TXFM_CONTEXT) * mi_width);
  memcpy(tx_left, xd->left_txfm_context, sizeof(TXFM_CONTEXT) * mi_height);

  int64_t this_rd = 0;
  for (int idy = 0, block = 0; idy < mi_height; idy += bh) {
    for (int idx = 0; idx < mi_width; idx += bw) {
      RD_STATS pn_rd_stats;
      av1_init_rd_stats(&pn_rd_stats);
      tx_block_yrd(cpi, x, idy, idx, block, max_tx_size, bsize, init_depth,
                   ctxa, ctxl, tx_above, tx_left, ref_best_rd - this_rd,
                   &pn_rd_stats, ftxs_mode);
      if (pn_rd_stats.rate == INT_MAX) {
        av1_invalid_rd_stats(rd_stats);
        return 0;
      }
      av1_merge_rd_stats(rd_stats, &pn_rd_stats);
      this_rd +=
          AOMMIN(RDCOST(x->rdmult, pn_rd_stats.rate, pn_rd_stats.dist),
                 RDCOST(x->rdmult, pn_rd_stats.zero_rate, pn_rd_stats.sse));
      block += step;
    }
  }

  const int skip_ctx = av1_get_skip_txfm_context(xd);
  const int no_skip_txfm_rate = x->mode_costs.skip_txfm_cost[skip_ctx][0];
  const int skip_txfm_rate = x->mode_costs.skip_txfm_cost[skip_ctx][1];
  const int64_t skip_txfm_rd = RDCOST(x->rdmult, skip_txfm_rate, rd_stats->sse);
  this_rd =
      RDCOST(x->rdmult, rd_stats->rate + no_skip_txfm_rate, rd_stats->dist);
  if (skip_txfm_rd < this_rd) {
    this_rd = skip_txfm_rd;
    rd_stats->rate = 0;
    rd_stats->dist = rd_stats->sse;
    rd_stats->skip_txfm = 1;
  }

  const int is_cost_valid = this_rd > ref_best_rd;
  if (!is_cost_valid) {
    // reset cost value
    av1_invalid_rd_stats(rd_stats);
  }
  return is_cost_valid;
}

// Search for the best transform size and type for current inter-predicted
// luma block with recursive transform block partitioning. The obtained
// transform selection will be saved in xd->mi[0], the corresponding RD stats
// will be saved in rd_stats. The returned value is the corresponding RD cost.
static int64_t select_tx_size_and_type(const AV1_COMP *cpi, MACROBLOCK *x,
                                       RD_STATS *rd_stats, BLOCK_SIZE bsize,
                                       int64_t ref_best_rd) {
  MACROBLOCKD *const xd = &x->e_mbd;
  const TxfmSearchParams *txfm_params = &x->txfm_search_params;
  assert(is_inter_block(xd->mi[0]));
  assert(bsize < BLOCK_SIZES_ALL);
  const int fast_tx_search = txfm_params->tx_size_search_method > USE_FULL_RD;
  int64_t rd_thresh = ref_best_rd;
  if (rd_thresh == 0) {
    av1_invalid_rd_stats(rd_stats);
    return INT64_MAX;
  }
  if (fast_tx_search && rd_thresh < INT64_MAX) {
    if (INT64_MAX - rd_thresh > (rd_thresh >> 3)) rd_thresh += (rd_thresh >> 3);
  }
  assert(rd_thresh > 0);
  const FAST_TX_SEARCH_MODE ftxs_mode =
      fast_tx_search ? FTXS_DCT_AND_1D_DCT_ONLY : FTXS_NONE;
  const struct macroblockd_plane *const pd = &xd->plane[0];
  assert(bsize < BLOCK_SIZES_ALL);
  const int mi_width = mi_size_wide[bsize];
  const int mi_height = mi_size_high[bsize];
  ENTROPY_CONTEXT ctxa[MAX_MIB_SIZE];
  ENTROPY_CONTEXT ctxl[MAX_MIB_SIZE];
  TXFM_CONTEXT tx_above[MAX_MIB_SIZE];
  TXFM_CONTEXT tx_left[MAX_MIB_SIZE];
  av1_get_entropy_contexts(bsize, pd, ctxa, ctxl);
  memcpy(tx_above, xd->above_txfm_context, sizeof(TXFM_CONTEXT) * mi_width);
  memcpy(tx_left, xd->left_txfm_context, sizeof(TXFM_CONTEXT) * mi_height);
  const int init_depth = get_search_init_depth(
      mi_width, mi_height, 1, &cpi->sf, txfm_params->tx_size_search_method);
  const TX_SIZE max_tx_size = max_txsize_rect_lookup[bsize];
  const int bh = tx_size_high_unit[max_tx_size];
  const int bw = tx_size_wide_unit[max_tx_size];
  const int step = bw * bh;
  const int skip_ctx = av1_get_skip_txfm_context(xd);
  const int no_skip_txfm_cost = x->mode_costs.skip_txfm_cost[skip_ctx][0];
  const int skip_txfm_cost = x->mode_costs.skip_txfm_cost[skip_ctx][1];
  int64_t skip_txfm_rd = RDCOST(x->rdmult, skip_txfm_cost, 0);
  int64_t no_skip_txfm_rd = RDCOST(x->rdmult, no_skip_txfm_cost, 0);
  int block = 0;
  int blk_idx = 0;

  av1_init_rd_stats(rd_stats);
  for (int idy = 0; idy < max_block_high(xd, bsize, 0); idy += bh) {
    for (int idx = 0; idx < max_block_wide(xd, bsize, 0); idx += bw) {
      const int64_t best_rd_sofar =
          (rd_thresh == INT64_MAX)
              ? INT64_MAX
              : (rd_thresh - (AOMMIN(skip_txfm_rd, no_skip_txfm_rd)));
      int is_cost_valid = 1;
      RD_STATS pn_rd_stats;
      // Search for the best transform block size and type for the sub-block.
      select_tx_block(cpi, x, idy, idx, block, max_tx_size, init_depth, bsize,
                      ctxa, ctxl, tx_above, tx_left, &pn_rd_stats, INT64_MAX,
                      best_rd_sofar, &is_cost_valid, ftxs_mode, blk_idx);
      blk_idx++;
      if (!is_cost_valid || pn_rd_stats.rate == INT_MAX) {
        av1_invalid_rd_stats(rd_stats);
        return INT64_MAX;
      }
      av1_merge_rd_stats(rd_stats, &pn_rd_stats);
      skip_txfm_rd = RDCOST(x->rdmult, skip_txfm_cost, rd_stats->sse);
      no_skip_txfm_rd =
          RDCOST(x->rdmult, rd_stats->rate + no_skip_txfm_cost, rd_stats->dist);
      block += step;
    }
  }

  if (rd_stats->rate == INT_MAX) return INT64_MAX;

  rd_stats->skip_txfm = (skip_txfm_rd <= no_skip_txfm_rd);

  // If fast_tx_search is true, only DCT and 1D DCT were tested in
  // select_inter_block_yrd() above. Do a better search for tx type with
  // tx sizes already decided.
  if (fast_tx_search && cpi->sf.tx_sf.refine_fast_tx_search_results) {
    if (!inter_block_yrd(cpi, x, rd_stats, bsize, ref_best_rd, FTXS_NONE))
      return INT64_MAX;
  }

  int64_t final_rd;
  if (rd_stats->skip_txfm) {
    final_rd = RDCOST(x->rdmult, skip_txfm_cost, rd_stats->sse);
  } else {
    final_rd =
        RDCOST(x->rdmult, rd_stats->rate + no_skip_txfm_cost, rd_stats->dist);
    if (!xd->lossless[xd->mi[0]->segment_id]) {
      final_rd =
          AOMMIN(final_rd, RDCOST(x->rdmult, skip_txfm_cost, rd_stats->sse));
    }
  }

  return final_rd;
}

// Return 1 to terminate transform search early. The decision is made based on
// the comparison with the reference RD cost and the model-estimated RD cost.
static inline int model_based_tx_search_prune(const AV1_COMP *cpi,
                                              MACROBLOCK *x, BLOCK_SIZE bsize,
                                              int64_t ref_best_rd) {
  const int level = cpi->sf.tx_sf.model_based_prune_tx_search_level;
  assert(level >= 0 && level <= 2);
  int model_rate;
  int64_t model_dist;
  uint8_t model_skip;
  MACROBLOCKD *const xd = &x->e_mbd;
  model_rd_sb_fn[MODELRD_TYPE_TX_SEARCH_PRUNE](
      cpi, bsize, x, xd, 0, 0, &model_rate, &model_dist, &model_skip, NULL,
      NULL, NULL, NULL);
  if (model_skip) return 0;
  const int64_t model_rd = RDCOST(x->rdmult, model_rate, model_dist);
  // TODO(debargha, urvang): Improve the model and make the check below
  // tighter.
  static const int prune_factor_by8[] = { 3, 5 };
  const int factor = prune_factor_by8[level - 1];
  return ((model_rd * factor) >> 3) > ref_best_rd;
}

void av1_pick_recursive_tx_size_type_yrd(const AV1_COMP *cpi, MACROBLOCK *x,
                                         RD_STATS *rd_stats, BLOCK_SIZE bsize,
                                         int64_t ref_best_rd) {
  MACROBLOCKD *const xd = &x->e_mbd;
  const TxfmSearchParams *txfm_params = &x->txfm_search_params;
  assert(is_inter_block(xd->mi[0]));

  av1_invalid_rd_stats(rd_stats);

  // If modeled RD cost is a lot worse than the best so far, terminate early.
  if (cpi->sf.tx_sf.model_based_prune_tx_search_level &&
      ref_best_rd != INT64_MAX) {
    if (model_based_tx_search_prune(cpi, x, bsize, ref_best_rd)) return;
  }

  // Hashing based speed feature. If the hash of the prediction residue block is
  // found in the hash table, use previous search results and terminate early.
  uint32_t hash = 0;
  MB_RD_RECORD *mb_rd_record = NULL;
  const int mi_row = x->e_mbd.mi_row;
  const int mi_col = x->e_mbd.mi_col;
  const int within_border =
      mi_row >= xd->tile.mi_row_start &&
      (mi_row + mi_size_high[bsize] < xd->tile.mi_row_end) &&
      mi_col >= xd->tile.mi_col_start &&
      (mi_col + mi_size_wide[bsize] < xd->tile.mi_col_end);
  const int is_mb_rd_hash_enabled =
      (within_border && cpi->sf.rd_sf.use_mb_rd_hash);
  const int n4 = bsize_to_num_blk(bsize);
  if (is_mb_rd_hash_enabled) {
    hash = get_block_residue_hash(x, bsize);
    mb_rd_record = x->txfm_search_info.mb_rd_record;
    const int match_index = find_mb_rd_info(mb_rd_record, ref_best_rd, hash);
    if (match_index != -1) {
      MB_RD_INFO *mb_rd_info = &mb_rd_record->mb_rd_info[match_index];
      fetch_mb_rd_info(n4, mb_rd_info, rd_stats, x);
      return;
    }
  }

  // If we predict that skip is the optimal RD decision - set the respective
  // context and terminate early.
  int64_t dist;
  if (txfm_params->skip_txfm_level &&
      predict_skip_txfm(x, bsize, &dist,
                        cpi->common.features.reduced_tx_set_used)) {
    set_skip_txfm(x, rd_stats, bsize, dist);
    // Save the RD search results into mb_rd_record.
    if (is_mb_rd_hash_enabled)
      save_mb_rd_info(n4, hash, x, rd_stats, mb_rd_record);
    return;
  }
#if CONFIG_SPEED_STATS
  ++x->txfm_search_info.tx_search_count;
#endif  // CONFIG_SPEED_STATS

  const int64_t rd =
      select_tx_size_and_type(cpi, x, rd_stats, bsize, ref_best_rd);

  if (rd == INT64_MAX) {
    // We should always find at least one candidate unless ref_best_rd is less
    // than INT64_MAX (in which case, all the calls to select_tx_size_fix_type
    // might have failed to find something better)
    assert(ref_best_rd != INT64_MAX);
    av1_invalid_rd_stats(rd_stats);
    return;
  }

  // Save the RD search results into mb_rd_record.
  if (is_mb_rd_hash_enabled) {
    assert(mb_rd_record != NULL);
    save_mb_rd_info(n4, hash, x, rd_stats, mb_rd_record);
  }
}

void av1_pick_uniform_tx_size_type_yrd(const AV1_COMP *const cpi, MACROBLOCK *x,
                                       RD_STATS *rd_stats, BLOCK_SIZE bs,
                                       int64_t ref_best_rd) {
  MACROBLOCKD *const xd = &x->e_mbd;
  MB_MODE_INFO *const mbmi = xd->mi[0];
  const TxfmSearchParams *tx_params = &x->txfm_search_params;
  assert(bs == mbmi->bsize);
  const int is_inter = is_inter_block(mbmi);
  const int mi_row = xd->mi_row;
  const int mi_col = xd->mi_col;

  av1_init_rd_stats(rd_stats);

  // Hashing based speed feature for inter blocks. If the hash of the residue
  // block is found in the table, use previously saved search results and
  // terminate early.
  uint32_t hash = 0;
  MB_RD_RECORD *mb_rd_record = NULL;
  const int num_blks = bsize_to_num_blk(bs);
  if (is_inter && cpi->sf.rd_sf.use_mb_rd_hash) {
    const int within_border =
        mi_row >= xd->tile.mi_row_start &&
        (mi_row + mi_size_high[bs] < xd->tile.mi_row_end) &&
        mi_col >= xd->tile.mi_col_start &&
        (mi_col + mi_size_wide[bs] < xd->tile.mi_col_end);
    if (within_border) {
      hash = get_block_residue_hash(x, bs);
      mb_rd_record = x->txfm_search_info.mb_rd_record;
      const int match_index = find_mb_rd_info(mb_rd_record, ref_best_rd, hash);
      if (match_index != -1) {
        MB_RD_INFO *mb_rd_info = &mb_rd_record->mb_rd_info[match_index];
        fetch_mb_rd_info(num_blks, mb_rd_info, rd_stats, x);
        return;
      }
    }
  }

  // If we predict that skip is the optimal RD decision - set the respective
  // context and terminate early.
  int64_t dist;
  if (tx_params->skip_txfm_level && is_inter &&
      !xd->lossless[mbmi->segment_id] &&
      predict_skip_txfm(x, bs, &dist,
                        cpi->common.features.reduced_tx_set_used)) {
    // Populate rdstats as per skip decision
    set_skip_txfm(x, rd_stats, bs, dist);
    // Save the RD search results into mb_rd_record.
    if (mb_rd_record) {
      save_mb_rd_info(num_blks, hash, x, rd_stats, mb_rd_record);
    }
    return;
  }

  if (xd->lossless[mbmi->segment_id]) {
    // Lossless mode can only pick the smallest (4x4) transform size.
    choose_smallest_tx_size(cpi, x, rd_stats, ref_best_rd, bs);
  } else if (tx_params->tx_size_search_method == USE_LARGESTALL) {
    choose_largest_tx_size(cpi, x, rd_stats, ref_best_rd, bs);
  } else {
    choose_tx_size_type_from_rd(cpi, x, rd_stats, ref_best_rd, bs);
  }

  // Save the RD search results into mb_rd_record for possible reuse in future.
  if (mb_rd_record) {
    save_mb_rd_info(num_blks, hash, x, rd_stats, mb_rd_record);
  }
}

int av1_txfm_uvrd(const AV1_COMP *const cpi, MACROBLOCK *x, RD_STATS *rd_stats,
                  BLOCK_SIZE bsize, int64_t ref_best_rd) {
  av1_init_rd_stats(rd_stats);
  if (ref_best_rd < 0) return 0;
  if (!x->e_mbd.is_chroma_ref) return 1;

  MACROBLOCKD *const xd = &x->e_mbd;
  MB_MODE_INFO *const mbmi = xd->mi[0];
  struct macroblockd_plane *const pd = &xd->plane[AOM_PLANE_U];
  const int is_inter = is_inter_block(mbmi);
  int64_t this_rd = 0, skip_txfm_rd = 0;
  const BLOCK_SIZE plane_bsize =
      get_plane_block_size(bsize, pd->subsampling_x, pd->subsampling_y);

  if (is_inter) {
    for (int plane = 1; plane < MAX_MB_PLANE; ++plane)
      av1_subtract_plane(x, plane_bsize, plane);
  }

  const TX_SIZE uv_tx_size = av1_get_tx_size(AOM_PLANE_U, xd);
  int is_cost_valid = 1;
  for (int plane = 1; plane < MAX_MB_PLANE; ++plane) {
    RD_STATS this_rd_stats;
    int64_t chroma_ref_best_rd = ref_best_rd;
    // For inter blocks, refined ref_best_rd is used for early exit
    // For intra blocks, even though current rd crosses ref_best_rd, early
    // exit is not recommended as current rd is used for gating subsequent
    // modes as well (say, for angular modes)
    // TODO(any): Extend the early exit mechanism for intra modes as well
    if (cpi->sf.inter_sf.perform_best_rd_based_gating_for_chroma && is_inter &&
        chroma_ref_best_rd != INT64_MAX)
      chroma_ref_best_rd = ref_best_rd - AOMMIN(this_rd, skip_txfm_rd);
    av1_txfm_rd_in_plane(x, cpi, &this_rd_stats, chroma_ref_best_rd, 0, plane,
                         plane_bsize, uv_tx_size, FTXS_NONE);
    if (this_rd_stats.rate == INT_MAX) {
      is_cost_valid = 0;
      break;
    }
    av1_merge_rd_stats(rd_stats, &this_rd_stats);
    this_rd = RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist);
    skip_txfm_rd = RDCOST(x->rdmult, 0, rd_stats->sse);
    if (AOMMIN(this_rd, skip_txfm_rd) > ref_best_rd) {
      is_cost_valid = 0;
      break;
    }
  }

  if (!is_cost_valid) {
    // reset cost value
    av1_invalid_rd_stats(rd_stats);
  }

  return is_cost_valid;
}

void av1_txfm_rd_in_plane(MACROBLOCK *x, const AV1_COMP *cpi,
                          RD_STATS *rd_stats, int64_t ref_best_rd,
                          int64_t current_rd, int plane, BLOCK_SIZE plane_bsize,
                          TX_SIZE tx_size, FAST_TX_SEARCH_MODE ftxs_mode) {
  assert(IMPLIES(plane == 0, x->e_mbd.mi[0]->tx_size == tx_size));

  if (!cpi->oxcf.txfm_cfg.enable_tx64 &&
      txsize_sqr_up_map[tx_size] == TX_64X64) {
    av1_invalid_rd_stats(rd_stats);
    return;
  }

  if (current_rd > ref_best_rd) {
    av1_invalid_rd_stats(rd_stats);
    return;
  }

  MACROBLOCKD *const xd = &x->e_mbd;
  const struct macroblockd_plane *const pd = &xd->plane[plane];
  struct rdcost_block_args args;
  av1_zero(args);
  args.x = x;
  args.cpi = cpi;
  args.best_rd = ref_best_rd;
  args.current_rd = current_rd;
  args.ftxs_mode = ftxs_mode;
  args.skip_trellis = 0;
  av1_init_rd_stats(&args.rd_stats);

  av1_get_entropy_contexts(plane_bsize, pd, args.t_above, args.t_left);
  av1_foreach_transformed_block_in_plane(xd, plane_bsize, plane, block_rd_txfm,
                                         &args);

  MB_MODE_INFO *const mbmi = xd->mi[0];
  const int is_inter = is_inter_block(mbmi);
  const int invalid_rd = is_inter ? args.incomplete_exit : args.exit_early;

  if (invalid_rd) {
    av1_invalid_rd_stats(rd_stats);
  } else {
    *rd_stats = args.rd_stats;
  }
}

int av1_txfm_search(const AV1_COMP *cpi, MACROBLOCK *x, BLOCK_SIZE bsize,
                    RD_STATS *rd_stats, RD_STATS *rd_stats_y,
                    RD_STATS *rd_stats_uv, int mode_rate, int64_t ref_best_rd) {
  MACROBLOCKD *const xd = &x->e_mbd;
  TxfmSearchParams *txfm_params = &x->txfm_search_params;
  const int skip_ctx = av1_get_skip_txfm_context(xd);
  const int skip_txfm_cost[2] = { x->mode_costs.skip_txfm_cost[skip_ctx][0],
                                  x->mode_costs.skip_txfm_cost[skip_ctx][1] };
  const int64_t min_header_rate =
      mode_rate + AOMMIN(skip_txfm_cost[0], skip_txfm_cost[1]);
  // Account for minimum skip and non_skip rd.
  // Eventually either one of them will be added to mode_rate
  const int64_t min_header_rd_possible = RDCOST(x->rdmult, min_header_rate, 0);
  if (min_header_rd_possible > ref_best_rd) {
    av1_invalid_rd_stats(rd_stats_y);
    return 0;
  }

  const AV1_COMMON *cm = &cpi->common;
  MB_MODE_INFO *const mbmi = xd->mi[0];
  const int64_t mode_rd = RDCOST(x->rdmult, mode_rate, 0);
  const int64_t rd_thresh =
      ref_best_rd == INT64_MAX ? INT64_MAX : ref_best_rd - mode_rd;
  av1_init_rd_stats(rd_stats);
  av1_init_rd_stats(rd_stats_y);
  rd_stats->rate = mode_rate;

  // cost and distortion
  av1_subtract_plane(x, bsize, 0);
  if (txfm_params->tx_mode_search_type == TX_MODE_SELECT &&
      !xd->lossless[mbmi->segment_id]) {
    av1_pick_recursive_tx_size_type_yrd(cpi, x, rd_stats_y, bsize, rd_thresh);
#if CONFIG_COLLECT_RD_STATS == 2
    PrintPredictionUnitStats(cpi, tile_data, x, rd_stats_y, bsize);
#endif  // CONFIG_COLLECT_RD_STATS == 2
  } else {
    av1_pick_uniform_tx_size_type_yrd(cpi, x, rd_stats_y, bsize, rd_thresh);
    memset(mbmi->inter_tx_size, mbmi->tx_size, sizeof(mbmi->inter_tx_size));
  }

  if (rd_stats_y->rate == INT_MAX) return 0;

  av1_merge_rd_stats(rd_stats, rd_stats_y);

  const int64_t non_skip_txfm_rdcosty =
      RDCOST(x->rdmult, rd_stats->rate + skip_txfm_cost[0], rd_stats->dist);
  const int64_t skip_txfm_rdcosty =
      RDCOST(x->rdmult, mode_rate + skip_txfm_cost[1], rd_stats->sse);
  const int64_t min_rdcosty = AOMMIN(non_skip_txfm_rdcosty, skip_txfm_rdcosty);
  if (min_rdcosty > ref_best_rd) return 0;

  av1_init_rd_stats(rd_stats_uv);
  const int num_planes = av1_num_planes(cm);
  if (num_planes > 1) {
    int64_t ref_best_chroma_rd = ref_best_rd;
    // Calculate best rd cost possible for chroma
    if (cpi->sf.inter_sf.perform_best_rd_based_gating_for_chroma &&
        (ref_best_chroma_rd != INT64_MAX)) {
      ref_best_chroma_rd = (ref_best_chroma_rd -
                            AOMMIN(non_skip_txfm_rdcosty, skip_txfm_rdcosty));
    }
    const int is_cost_valid_uv =
        av1_txfm_uvrd(cpi, x, rd_stats_uv, bsize, ref_best_chroma_rd);
    if (!is_cost_valid_uv) return 0;
    av1_merge_rd_stats(rd_stats, rd_stats_uv);
  }

  int choose_skip_txfm = rd_stats->skip_txfm;
  if (!choose_skip_txfm && !xd->lossless[mbmi->segment_id]) {
    const int64_t rdcost_no_skip_txfm = RDCOST(
        x->rdmult, rd_stats_y->rate + rd_stats_uv->rate + skip_txfm_cost[0],
        rd_stats->dist);
    const int64_t rdcost_skip_txfm =
        RDCOST(x->rdmult, skip_txfm_cost[1], rd_stats->sse);
    if (rdcost_no_skip_txfm >= rdcost_skip_txfm) choose_skip_txfm = 1;
  }
  if (choose_skip_txfm) {
    rd_stats_y->rate = 0;
    rd_stats_uv->rate = 0;
    rd_stats->rate = mode_rate + skip_txfm_cost[1];
    rd_stats->dist = rd_stats->sse;
    rd_stats_y->dist = rd_stats_y->sse;
    rd_stats_uv->dist = rd_stats_uv->sse;
    mbmi->skip_txfm = 1;
    if (rd_stats->skip_txfm) {
      const int64_t tmprd = RDCOST(x->rdmult, rd_stats->rate, rd_stats->dist);
      if (tmprd > ref_best_rd) return 0;
    }
  } else {
    rd_stats->rate += skip_txfm_cost[0];
    mbmi->skip_txfm = 0;
  }

  return 1;
}

Messung V0.5 in Prozent
C=92 H=92 G=91

¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.270Angebot  ¤

*Eine klare Vorstellung vom Zielzustand






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1127926
#Domains=2039723