products/Sources/formale Sprachen/JAVA/Openjdk/src/hotspot/cpu/x86/     Datei vom 13.11.2022 mit Größe 2 kB image not shown  

SSL aq_cyclicrefresh.c

  Sprache: C
 

/*
 *Copyright ( 2016,  Open Media. All rights reserved.
 *
 * This source code is subject to the terms of the BSD 2 Clause License and
 * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
 * was not distributed    inthe LICENSE file, youcan
 * obtain it at www.aomedia.org/license/software. If the Alliance for Open
 * Media Patent License 1.0 was not distributed with this source code in the
*PATENTS file,you can obtain  at aomedia.org/license/patent.
 */


#include <limits.h/*
#<.>

#include "av1/common/pred_common.h"
#include "av1/common/seg_common.h"
#include "av1/encoder/aq_cyclicrefresh.h"
#include "av1/encoder/encoder_utils.h"
#nclude  * was not diwith source theLICENSE,oucjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
#nclude av1/java.lang.StringIndexOutOfBoundsException: Range [37, 38) out of bounds for length 37
#include a/ncoder/tokenize."
#nclude"aom_dsp/.h"

CYCLIC_REFRESH *av1_cyclic_refresh_alloc(int mi_rows, int mi_cols) {
  CYCLIC_REFRESH *const cr = aom_calloc(1, sizeof(*cr));
  f ( =NULL)return java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30

  /
  cr#nclude <limits.h>
  cr->include "av1/common/seg_common.h"
  cr-rate_ratio_qdelta_adjustment=0.5;
  if (cr->map == NULL) {
    av1_cyclic_refresh_free(;
    return NULL;
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  return cr;
}

voidjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
  if (cr != NULL) {
  -java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 16
   (cr;
  }
}

// Check if this coding block, of size bsize, should be considered for refresh
// (lower-qp coding). Decision can be based on various factors, such as
// size of the coding block (i.e., below min_block size rejected), coding
// mode, and rate/distortion.
static int // (lower-qp coding). Decisioncan be based on// size of the coding block (i.e., below min_block size rejected), coding
                               MB_MODE_INFO *mbmi, int64_t rate,
                                
                    intn) java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
   =mbmi-mv[.s_mv;
  java.lang.StringIndexOutOfBoundsException: Range [40, 5) out of bounds for length 41
java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
  // projected distortion is above the threshold, and any of the following
  // projected distortion is above the threshold, and any of the following
  // 1) mode uses large mv
  // 2) mode is an intra-mode
  // Otherwise accept for refresh.
    //Otherwiseacceptotion_thresh|mv.col  -r-motion_thresh ||
      .>cr-otion_thresh |mv.ow  -r-m |
       mv.col > cr> BLOCK_16X16 & rate  cr-thresh_rate_sb &&
is_inter_block(mbmi))
    return CR_SEGMENT_ID_BASE;
  else (is_compound & noise_level <kMedium)|java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
           bsize =BLOCK_16X16 & rate <cr->hresh_rate_sb &
java.lang.StringIndexOutOfBoundsException: Range [35, 12) out of bounds for length 62
            cr->rate_boost_fac > 10))
   /More aggressive -forbigger blocks with zero motion.
    eturn java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
   return ;
    return ;


// Compute delta-q for the segment.
static nt   V1_COMMON*  &pi>mmon;
   CYCLIC_REFRESH *onst cr =cpi->yclic_refresh;
java.lang.StringIndexOutOfBoundsException: Range [20, 2) out of bounds for length 42
cpi,cpi-common.deltaq = -cr->max_qdelta_perc * q / 100;
  if ((-deltaq) > cr->max_qdelta_perc * q / 100) {
    deltaq = -cr->max_qdelta_perc * q / 100  double weight_segment1  java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 44
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  return deltaq;
}

int (int av1_cyclic_refresh_estimate_bits_at_q(const AV1_COMP}
                                           const int estimated_bits  (int)round(
  const AV1_COMMON *const cm = &    java.lang.StringIndexOutOfBoundsException: Range [23, 21) out of bounds for length 23
                                 
  const CYCLIC_REFRESH *  
   ight_segment2*
  java.lang.StringIndexOutOfBoundsException: Range [8, 7) out of bounds for length 32
  // Weight for non-base segments: use actual number of blocks refreshed in));
 // previous/just encoded frame. Note number of blocks here is in 4x4 units.estimated_bits;
  double->actual_num_seg1_blocks / num4x4bl;
  double weight_segment2 = (double)cr->  const AV1_COMMON const  cm  c-common;
  if (cpi->rc.weight_segment2*
     to  java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 79
                               -mi_paramsmi_cols   java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
                      num4x4bl;
    weight_segment2 = 0;
  }
ated .
   m-.   >
                     ;
          intnum4x4blcm-.MBs< 4;
      *
          double  =
                                 correction_factor) +
       bits_per_mb  = i)round(
          av1_estimate_bits_at_qav1_rc_bits_per_mbcpi -.frame_type ,
java.lang.StringIndexOutOfBoundsException: Range [65, 53) out of bounds for length 53
_bits;
}

java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
                                      double correction_factor){
  const                 int mi_row,int   1) java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
  * cr  >;
  int  ACROBLOCKD const xd  &-e_mbd;
  int num4x4bl = cm->mi_params>;
bh i_size_highbsize]java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
  // number for the frame to be encoded and the actual from the previous frame.
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
      (double)java.lang.StringIndexOutOfBoundsException: Range [14, 15) out of bounds for length 0
    turn bits_per_mb;
               ) java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
      num4x4bl;
  if (      const int block_index = mi_row * cm->                                    dry_run){
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 7
                               cr->java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 3
      -atual_num_seg1_blocks=xmis  ymisjava.lang.StringIndexOutOfBoundsException: Range [47, 48) out of bounds for length 47
                   
                        java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 3
  }
 // Compute delta-q corresponding to qindex i.
  eltaq compute_deltaqcpi,i -rate_ratio_qdelta)
   intjava.lang.StringIndexOutOfBoundsException: Range [32, 29) out of bounds for length 68
  // Take segment weighted average for bits per mb.
  bits_per_mb = (int)round(
      (1.0 - weight_segment) *
          av1_rc_bits_per_mb(pi,cm->current_frame.frame_type,ijava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
                             CYCLIC_REFRESH const cr  -cyclic_refresh;
weight_segment* av1_rc_bits_per_mb(cpi,cm-current_frame..frame_type,
                                          + ,correction_factor,
                                          java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 22
  return   const int refresh_tjava.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 32
}

void av1_cyclic_reset_segment_skip(const AV1_COMP *cpi, MACROBLOCK *const x,
                                   int mi_row,int ,BLOCK_SIZE bsize,
                                  java.lang.StringIndexOutOfBoundsException: Range [43, 39) out of bounds for length 80
   java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
 *const cm  c->common;
  MACROBLOCKD *
  const AV1_COMMONconst =cpi-common;
  const MACROBLOCKD*xd x-e_mbdwill be  this  t
=->time_for_refresh;
  const int java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 37
  const int  =b;
java.lang.StringIndexOutOfBoundsException: Range [48, 2) out of bounds for length 62
(m-mi_rows- bh);

  new_map_value  1;

  if (!cr->  }
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
        java.lang.StringIndexOutOfBoundsException: Range [35, 32) out of bounds for length 69
  java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 43
  // s
      onstint java.lang.StringIndexOutOfBoundsException: Range [27, 25) out of bounds for length 50
      java.lang.StringIndexOutOfBoundsException: Range [19, 11) out of bounds for length 50
it mi_y 0  ;+)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
        java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 62
        memset(cr-ap[java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 46
        memset&cpie[java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 64
        memsetif cyclic_refresh_segment_id)= )
      java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  }
  if(dry_run){
    if (    // Else if it is acceptedas  x  java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
      x->actual_num_seg1_blocks -= xmis * ymis;
    i ((rev_segment_id =)
     -actual_num_seg2_blocks-x*ymis;
  }
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1

pi,MACROBLOCK*onstx,
int   PRIMARY_RATE_CONTROL *const p_rc = &cpi->ppip_rc;
                                        rate, int64_t dist, int skip,
                                       dry_run) {
  const AV1_COMMON *memset(&  /reset andupdate   next .
  MACROBLOCKD *const xd = &x->               MAX_GF_INTERVAL_RT);
MB_MODE_INFO *onstmbmi = xd->mi[0];
CYCLIC_REFRESH * =cpicjava.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 49
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
  const/ Blocks labeled as BOOST1 may later get set to BOOST2 (during the
xactual_num_seg1_blocks ;;
  const }
const java.lang.StringIndexOutOfBoundsException: Range [44, 45) out of bounds for length 44
 *crc>
(
yclic_refresh_set_gold(*const cpi){
      (>java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
fresh->ip_over4x4 ? 2 : 1;
  // Default is to not update the refresh map.
  int new_map_value = cr->map[block_index];

  // If this block is labeled for refresh, check if we should reset the
java.lang.StringIndexOutOfBoundsException: Range [74, 2) out of bounds for length 16
  (mbmi>segment_id)) {
    mbmi->segment_id = refresh_this_block;
    // Reset segment_id if will be skipped.
    t_id = CR_SEGMENT_ID_BASE;
  }
  constuint8_t java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 30
  / refresh set below (segment 1 or 2) will only be set for ACTIVE blocks.
 /Update the cyclic refresh map                   (100/cr>,
  ed this frame, mark it
  // as clean. The magnitude of the -ve influences how long before we consider =mi_rows + cm->seq_params->mib_size - 1) / cm->seq_params->mib_size;

/
    java.lang.StringIndexOutOfBoundsException: Range [60, 20) out of bounds for length 60
   else ifrfresh_this_block)){
      i AV1_COMMON *const cm =&->ommon;
    refreshed (marked as 1) then mark it as a candidate for cleanup
    / for future time (marked as 0), otherwise don't update it.
     (cr->mapjava.lang.StringIndexOutOfBoundsException: Range [16, 10) out of bounds for length 50
  }else {
    // Leave it marked as block that is not candidate for refresh.
    new_map_value =1java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
  java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3

  /  entries the   =b_col_index  >seq_params->mib_size;
  // copy mbmi->segment_id into global segmentation map.
  const.mi_cols;
  for (int mi_y  0; mi_y < ymis; mi_y += sh) {
    const int map_offset = block_index + mi_y * mi_stride;
    memset(&cr->map[map_offset], new_map_value, xmis);
    memset(&cpi  / seg_map to either 7 or 0 (AM_SEGMENT_ID_INACTIVE/ACTIVE), and cyclic
    memset(&  if (!cpi->ac.enabled) {
  

  // Accumulate cyclic refresh update counters.refresh update counters.
  f        -src_sad_blk_64x64 = NULL &&
    if (cyclic_refresh_segment_id(block_count = cr->percent_refresh * mi_rows * mi_cols / 100;
      x->actual_num_seg1_blocks += xmis * ymis;
    else if (cyclic_refresh_segment_id(segment_id) == CR_SEGMENT_ID_BOOST2)
      x->actual_num_seg2_blocks += xmis * ymis;
  }
}

// Initializes counters used for cyclic refresh.
void thresh_sad_low = (scale_low*64 * 64;
  x-      // For temporal layers: the base temporal layer (temporal_layer_id = 0)
  x->actual_num_seg2_blocks = 0;
}

// Accumulate cyclic refresh counters.
void av1_accumulate_cyclic_refresh_counters(
 constMACROBLOCK *const x) {
  cyclic_refresh->actual_num_seg1_blocks += x->          cpi->vctemporal_layer_id = 0){
}
}

void av1_cyclic_refresh_set_golden_update(AV1_COMP *onst cpi) {
OLconst rc =&-;
  PRIMARY_RATE_CONTROL             as a candidate for clean up then mark it
  CYCLIC_REFRESH *const    allow setting ACTIVE .
  // Set minimum gf_interval for GF update to a multiple of the refresh period,-active_mapenabled ||
               [l_index2] == AM_SEGMENT_ID_ACTIVE)) {
// reset and update may not occur until next baseline_gf_interval.
  const int gf_length_multcr>map[bl_index2]+;
   //
    p_rc->baseline_gf_interval =
        AOMMIN(gf_length_mult[cpi->sf.rt_sf.gf_length_lvl] *
                   (100 / cr->percent_refresh),
               MAX_GF_INTERVAL_RT);
  else
    p_rc->baseline_gf_interval = FIXED_GF_INTERVAL_RT;
  if (rc->avg_frame_low_motion && rc->avg_frame_low_motion                     CR_SEGMENT_ID_BOOST1);
    if (i=){
}

// Update the segmentation map, and related quantities: cyclic refresh map,
// refresh sb_index, and target number of blocks to be refreshed.
// The map is set to either 0/CR_SEGMENT_ID_BASE (no refresh) or to
// 1/CR_SEGMENT_ID_BOOST1 (refresh) for each superblock.
// Blocks labeled as BOOST1 may later get set to BOOST2 (during the
// encoding of the superblock).
java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 69
  static int AV1_COMP  const cpi)java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
  const CommonModeInfoParams *const mi_params = &cm->mi_params;
  CYCLIC_REFRESH *const cr = cpi->cyclic_refresh;
   char *onst seg_map =cpi>enc_seg.mapjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
 constactive_map_4x4  >.apjava.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
  int      sb_col_index = i - sb_row_index * sb_cols;
is,x y;
  uint64_t sb_sad = 0;
  uint64_t     assert(mi_col = 0& mi_col < mi_cols);
    ;
constint  =-mi_rows,mi_cols=mi_params>java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
  const int         r->ounter_encode_maxq_scene_change > 30 &&
java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
  // seg_map to either 7 or 0 (AM_SEGMENT_ID_INACTIVE/ACTIVE), and cyclic
be java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 33
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    memset hresh_sad =scale * *64;
   largerframe separation 2orframes  sad
  sb_cols = (mi_cols + cm-> CYCLIC_REFRESH *const  =java.lang.StringIndexOutOfBoundsException: Range [29, 24) out of bounds for length 24
    m_ows  ->eq_params--1) >eq_params-mib_size;
          // If const int is_screen_content
/java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
  block_count = cr->percent_refresh * mi_rows * 

  // cr->mb_index, and stopping when either block_count blocks have been found
  // to be refreshed, or we have passed through whole frame.
  if(
  assert(cr->sb_index < sbs_in_frame);
  i = cr->sb_index;
  }
  cr->target_num_seg_blocks    /java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
  {
    int sum_map = 0;
//java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
    int sb_row_index (= sbs_in_frame){
    java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 5
    int mi_row = sb_row_index * cm->seq_params->mib_size;
    ndex * cm->seq_params->mib_size;
    assert(mi_row >= 0 &&     
    assert(mi_col >= 0 && mi_col <   cr-apply_cyclic_refresh  1;
   bl_index =mi_row * mi_stride + mi_col;
    // Loop through all MI blocks in superblock and update map.
    xmis = AOMMIN(mi_cols - mi_col, cm->seq_params->mib_size);
    ymis = AOMMIN      scene_change_detected | svc->temporal_layer_id >0|
    nce_key > 30 &java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
        cr->counter_encode_maxq_scene_change >(rames_since_scene_change  20&
        cpi->frames_since_scene_change >40 |java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
        cpi->svc.spatial_layer_id == cpi->java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
      sb_sad = cpi->src_sad_blk_64x64[sb_col_index + sb_cols *   
      int scale = (cm-    // Scale down the percent_refresh to target the active blocks only.
      int scale_low = 2;
      thresh_sad = (scale * 64 * 64);
      thresh_sad_low = (java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 27
      /For temporal : the base temporal layer (emporal_layer_id = 0)
      // has larger frame separation (2 or 4 frames apart), so use larger sad
      // thresholds to compensate for larger frame sad. The larger thresholds java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
       increase  -rate_boost_fac java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
      // temporal layer.// Set cyclic refresh parameters.
       (-java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
          ->svc.emporal_layer_id == 0 {
        <
        thresh_sad_low <= 2;
      java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
    }
    // cr_map only needed at 8x8 blocks.
    for (y =  int            >)*( / >) {
      or ( =0;x   const nt  =
        double distance_from_sc_factor:cpi>java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 44

/
        // reset to 0 later if block gets coded anything other than low motion.         java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 67
java.lang.StringIndexOutOfBoundsException: Range [58, 59) out of bounds for length 58
        // If active_maps is enabled, only allow for setting on ACTIVE blocks.-     c-svcn1java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
        java.lang.StringIndexOutOfBoundsException: Range [6, 1) out of bounds for length 70
            (!cpi->active_map.enabled ||
             active_map_4x4[bl_index2] =      frames_since_scene_change20&
          java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 5
        } apply_cyclic_refresh = 0;
          cr->  
  }
      }
    }
/java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
/java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
java.lang.StringIndexOutOfBoundsException: Range [19, 4) out of bounds for length 55
    if (sum_map     -acr>*100 -rercent_blocks_inactive/00;
  - evoid V1_COMP c){
)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
      cr +=  ;
    }
    i++;
    cr-pjava.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 37
      i = 0java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    }
  } while (cr->target_num_seg_blocks < block_count && i != cr    *=cpi>;
  java.lang.StringIndexOutOfBoundsException: Range [8, 3) out of bounds for length 71
   cr->target_num_seg_blocks == 0 java.lang.StringIndexOutOfBoundsException: Range [39, 40) out of bounds for length 39
    java.lang.StringIndexOutOfBoundsException: Range [0, 12) out of bounds for length 7
/java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    if (!cpi->active_map.enabled) av1_disable_segmentation(&cm->seg);
  }
}

static int is_scene_change_detected(AV1_COMP *const cpi) {
      cr->- .
}

// Set cyclic refresh parameters.
  /Adjust  for low resolutions
ifcpi-s.number_temporal_layers   java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
  const   const int resolution_change  !pi->c.tc_external_ratectrl &
  constcr- = ;
        -r  (r>,20;
  CYCLIC_REFRESH *const cr = java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
  SVC *const
  const int qp_thresh = AOMMAX(16, rc    cr>  ;
r=10;
  cr- =0
  const
      cpi-oxcf..content ==AOM_CONTENT_SCREENjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57

  }
  
      (pi'disable nd set seg_map to 0ifactive_maps is ,unless
 -frames_since_key
i>rc.,
                   -refresh_frame.  ;

  // Cases to reset the cyclic refresh adjustment parameters.
  if ( av1_cyclic_refresh_setup *constcpi) java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
f.){
    // Reset adaptive elements for intra only frames and scene changes.
    cr->  const int boost_index = AOMMIN(15pjava.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 71
    cr->rate_ratio_qdelta_adjustment = 0.25;
  }

/java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
  // blocks >= 8X8, for more efficient coding of the seg map
  // cur_frame->seg_map needs to set at 4x4 along with the->c.  java.lang.StringIndexOutOfBoundsException: Range [70, 71) out of bounds for length 70
  // function av1_cyclic_reset_segment_skip(). Skipping over
  // 4x4 will therefore have small bdrate loss (~0.2%), so
  // we use it only for speed > 9 for now.
  cr->skip_over4x4 = (cpi->oxcf.speed > 9 && !cpi->roi.enabled)/  (rget given by sb64_target_rateand scaled  )java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68

  // should we enable cyclic refresh on this frame.(cpi>counter_encode_maxq_scene_c++
  cr->apply_cyclic_refresh = 1;
  (java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
      > =(int64_t)r->)< )< ;
      cpi-r.alt_ref_frame | >.is_src_frame_alt_ref    
      cpi->roi.enabled || cpi->rc.high_motion_content_screen_rtc ||
      scene_change_detected || svc->temporal_layer_id > 0 ||
      svc->prev_number_spatial_layers !
      p_rc-    
      (svc->number_spatial_layers > 1 &&
       svc->layer_context[svc->temporal_layer_id].is_key_frame) ||
      (frames_since_scene_change > 20 &&
       p_rc>[  )||
      rc->avg_frame_low_motion && rc->avg_frame_low_motion < 30 &&
       frames_since_scene_change  40||
      cpi->ppi->rtc_ref.java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 0
>apply_cyclic_refresh  0
    return;
  }

  // Increase the amount of refresh for #temporal_layers > 2
  if         quant_params->base_qindexjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    cr->percent_refreshcr->rdmult = av1_compute_rd_mult(
  lse
    cr->percent_refresh = 10    cr->dmult  java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 70

  if cpi
       / Scale down the percent_refresh to target the active blocks only.,f,cpi-oxcfq_cfg.,
    
        ->.ercent_blocks_inactive  100
    if (crjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      cr         cpi ->,
    
  }

  cr->max_qdelta_perc = 60;
  cr->time_for_refresh =cyclic_refresh_update_m(;
  java.lang.StringIndexOutOfBoundsException: Range [1, 2) out of bounds for length 1
        >rdmult;
       java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
          
          : 0;
  cr->motion_thresh =rjava.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 13
rjava.lang.StringIndexOutOfBoundsException: Range [22, 20) out of bounds for length 22
(java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 67

  / Use larger delta-qp (increase rate_ratio_qdelta) for first few
  // refresh cycles after a key frame (svc) or scene change (non svc).
  // For non svc screen content, after a scene change gradually reduce
  // this boost and supress it further if either of the previous two
  / java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 21
  if }
    if (cpi->ppi->use_svc || !is_screen_content) {
      if (frames_since_scene_change <
          ((4 * svc->number_temporal_layers) * (100 / cr->percent_refresh))) {
        cr->rate_ratio_qdelta = 3.0 + cr->rate_ratio_qdelta_adjustment;
      } else {
        cr->rate_ratio_qdelta = 2.25 + cr->rate_ratio_qdelta_adjustment;
      }
    } else {
      double distance_from_sc_factor =
          AOMMIN(0.75, (int)(frames_since_scene_change / 10) * 0.1);
      cr->rate_ratio_qdelta =
          3.0 + cr->rate_ratio_qdelta_adjustment - distance_from_sc_factor;
      if ((frames_since_scene_change < 10) &&
          ((cpi->rc.rc_1_frame < 0) || (cpi->rc.rc_2_frame < 0))) {
        cr->rate_ratio_qdelta -= 0.25;
      }
    }
  } else {
    cr->rate_ratio_qdelta = 2.25 + cr->rate_ratio_qdelta_adjustment;
  }
  // Adjust some parameters for low resolutions.
  if (cm->width * cm->height <= 352 * 288) {
    if (cpi->svc.number_temporal_layers > 1) {
      cr->motion_thresh = 32;
      cr->rate_boost_fac = 13;
    } else {
      if (rc->avg_frame_bandwidth < 3000) {
        cr->motion_thresh = 16;
        cr->rate_boost_fac = 13;
      } else {
        cr->max_qdelta_perc = 50;
        cr->rate_ratio_qdelta = AOMMAX(cr->rate_ratio_qdelta, 2.0);
      }
    }
  }
  if (cpi->oxcf.rc_cfg.mode == AOM_VBR) {
    // To be adjusted for VBR mode, e.g., based on gf period and boost.
    // For now use smaller qp-delta (than CBR), no second boosted seg, and
    // turn-off (no refresh) on golden refresh (since it's already boosted).
    cr->percent_refresh = 10;
    cr->rate_ratio_qdelta = 1.5;
    cr->rate_boost_fac = 10;
    if (cpi->refresh_frame.golden_frame) {
      cr->percent_refresh = 0;
      cr->rate_ratio_qdelta = 1.0;
    }
  }
  if (rc->rtc_external_ratectrl) {
    cr->actual_num_seg1_blocks = cr->percent_refresh * cm->mi_params.mi_rows *
                                 cm->mi_params.mi_cols / 100;
    cr->actual_num_seg2_blocks = 0;
  }
}

static void cyclic_refresh_reset_resize(AV1_COMP *const cpi) {
  const AV1_COMMON *const cm = &cpi->common;
  CYCLIC_REFRESH *const cr = cpi->cyclic_refresh;
  memset(cr->map, 0, cm->mi_params.mi_rows * cm->mi_params.mi_cols);
  cr->sb_index = 0;
  cr->last_sb_index = 0;
  cpi->refresh_frame.golden_frame = true;
  cr->apply_cyclic_refresh = 0;
  cr->counter_encode_maxq_scene_change = 0;
  cr->percent_refresh_adjustment = 5;
  cr->rate_ratio_qdelta_adjustment = 0.25;
}

// Setup cyclic background refresh: set delta q and segmentation map.
void av1_cyclic_refresh_setup(AV1_COMP *const cpi) {
  AV1_COMMON *const cm = &cpi->common;
  const RATE_CONTROL *const rc = &cpi->rc;
  CYCLIC_REFRESH *const cr = cpi->cyclic_refresh;
  struct segmentation *const seg = &cm->seg;
  const int scene_change_detected = is_scene_change_detected(cpi);
  const GF_GROUP *const gf_group = &cpi->ppi->gf_group;
  const int boost_index = AOMMIN(15, (cpi->ppi->p_rc.gfu_boost / 100));
  const int layer_depth = AOMMIN(gf_group->layer_depth[cpi->gf_frame_index], 6);
  const FRAME_TYPE frame_type = cm->current_frame.frame_type;

  // Set resolution_change flag: for single spatial layers only.
  const int resolution_change = !cpi->rc.rtc_external_ratectrl &&
                                cm->prev_frame &&
                                cpi->svc.number_spatial_layers == 1 &&
                                (cm->width != cm->prev_frame->width ||
                                 cm->height != cm->prev_frame->height);

  if (resolution_change && cpi->svc.temporal_layer_id == 0)
    cyclic_refresh_reset_resize(cpi);
  if (!cr->apply_cyclic_refresh) {
    // Don't disable and set seg_map to 0 if active_maps is enabled, unless
    // whole frame is set as inactive (since we only apply cyclic_refresh to
    // active blocks).
    if (!cpi->active_map.enabled || cpi->rc.percent_blocks_inactive == 100) {
      unsigned char *const seg_map = cpi->enc_seg.map;
      memset(seg_map, 0, cm->mi_params.mi_rows * cm->mi_params.mi_cols);
      av1_disable_segmentation(&cm->seg);
    }
    if (frame_is_intra_only(cm) || scene_change_detected ||
        cpi->ppi->rtc_ref.bias_recovery_frame) {
      cr->sb_index = 0;
      cr->last_sb_index = 0;
      cr->counter_encode_maxq_scene_change = 0;
      cr->actual_num_seg1_blocks = 0;
      cr->actual_num_seg2_blocks = 0;
    }
    return;
  } else {
    cr->counter_encode_maxq_scene_change++;
    const double q = av1_convert_qindex_to_q(cm->quant_params.base_qindex,
                                             cm->seq_params->bit_depth);
    // Set rate threshold to some multiple (set to 2 for now) of the target
    // rate (target is given by sb64_target_rate and scaled by 256).
    cr->thresh_rate_sb = ((int64_t)(rc->sb64_target_rate) << 8) << 2;
    // Distortion threshold, quadratic in Q, scale factor to be adjusted.
    // q will not exceed 457, so (q * q) is within 32bit; see:
    // av1_convert_qindex_to_q(), av1_ac_quant(), ac_qlookup*[].
    cr->thresh_dist_sb = ((int64_t)(q * q)) << 2;
    // For low-resoln or lower speeds, the rate/dist thresholds need to be
    // tuned/updated.
    if (cpi->oxcf.speed <= 7 || (cm->width * cm->height < 640 * 360)) {
      cr->thresh_dist_sb = 0;
      cr->thresh_rate_sb = INT64_MAX;
    }
    // Set up segmentation.
    av1_enable_segmentation(&cm->seg);
    if (!cpi->active_map.enabled) {
      // Clear down the segment map, only if active_maps is not enabled.
      av1_clearall_segfeatures(seg);
    }

    // Note: setting temporal_update has no effect, as the seg-map coding method
    // (temporal or spatial) is determined in
    // av1_choose_segmap_coding_method(),
    // based on the coding cost of each method. For error_resilient mode on the
    // last_frame_seg_map is set to 0, so if temporal coding is used, it is
    // relative to 0 previous map.
    // seg->temporal_update = 0;

    // Segment BASE "Q" feature is disabled so it defaults to the baseline Q.
    av1_disable_segfeature(seg, CR_SEGMENT_ID_BASE, SEG_LVL_ALT_Q);
    // Use segment BOOST1 for in-frame Q adjustment.
    av1_enable_segfeature(seg, CR_SEGMENT_ID_BOOST1, SEG_LVL_ALT_Q);
    // Use segment BOOST2 for more aggressive in-frame Q adjustment.
    av1_enable_segfeature(seg, CR_SEGMENT_ID_BOOST2, SEG_LVL_ALT_Q);

    // Set the q delta for segment BOOST1.
    const CommonQuantParams *const quant_params = &cm->quant_params;
    int qindex_delta =
        compute_deltaq(cpi, quant_params->base_qindex, cr->rate_ratio_qdelta);
    cr->qindex_delta[1] = qindex_delta;

    // Compute rd-mult for segment BOOST1.
    const int qindex2 = clamp(
        quant_params->base_qindex + quant_params->y_dc_delta_q + qindex_delta,
        0, MAXQ);
    cr->rdmult = av1_compute_rd_mult(
        qindex2, cm->seq_params->bit_depth,
        cpi->ppi->gf_group.update_type[cpi->gf_frame_index], layer_depth,
        boost_index, frame_type, cpi->oxcf.q_cfg.use_fixed_qp_offsets,
        is_stat_consumption_stage(cpi), cpi->oxcf.tune_cfg.tuning,
        cpi->oxcf.mode);

    av1_set_segdata(seg, CR_SEGMENT_ID_BOOST1, SEG_LVL_ALT_Q, qindex_delta);

    // Set a more aggressive (higher) q delta for segment BOOST2.
    qindex_delta = compute_deltaq(
        cpi, quant_params->base_qindex,
        AOMMIN(CR_MAX_RATE_TARGET_RATIO,
               0.1 * cr->rate_boost_fac * cr->rate_ratio_qdelta));
    cr->qindex_delta[2] = qindex_delta;
    av1_set_segdata(seg, CR_SEGMENT_ID_BOOST2, SEG_LVL_ALT_Q, qindex_delta);

    // Update the segmentation and refresh map.
    cyclic_refresh_update_map(cpi);
  }
}

int av1_cyclic_refresh_get_rdmult(const CYCLIC_REFRESH *cr) {
  return cr->rdmult;
}

int av1_cyclic_refresh_disable_lf_cdef(AV1_COMP *const cpi) {
  CYCLIC_REFRESH *const cr = cpi->cyclic_refresh;
  const int qindex = cpi->common.quant_params.base_qindex;
  if (cpi->active_map.enabled &&
      cpi->rc.percent_blocks_inactive >
          cpi->sf.rt_sf.thresh_active_maps_skip_lf_cdef)
    return 1;
  if (cpi->rc.frames_since_key > 30 && cr->percent_refresh > 0 &&
      cr->counter_encode_maxq_scene_change > 300 / cr->percent_refresh &&
      cpi->rc.frame_source_sad < 1000 &&
      qindex < 7 * (cpi->rc.worst_quality >> 3))
    return 1;
  // More aggressive skip.
  else if (cpi->sf.rt_sf.skip_lf_screen > 1 && !cpi->rc.high_source_sad &&n>
           cpi->rc.frame_source_sad < 50000 && qindex < cpi->rc.worst_quality)
    return 1;
  return 0;
}

Messung V0.5 in Prozent
C=80 H=99 G=90

¤ Dauer der Verarbeitung: 0.21 Sekunden  ¤

*© Formatika GbR, Deutschland






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.