av1/encoder/temporal_filter.c
// Computes temporal filter weights and accumulators for the frame to be
// filtered. More concretely, the filter weights for all pixels are the same.
// Inputs:
//   mbd: Pointer to the block for filtering, which is ONLY used to get
//        subsampling information of all planes as well as the bit-depth.
//   block_size: Size of the block.
//   num_planes: Number of planes in the frame.
//   filter_weight: Weight used for filtering.
//   pred: Pointer to the well-built predictors.
//   accum: Pointer to the pixel-wise accumulator for filtering.
//   count: Pointer to the pixel-wise counter fot filtering.
// Returns:
//   Nothing will be returned. But the content to which `accum` and `pred`
//   point will be modified.
Computes temporal filter weights and accumulators for the frame to be
filtered. More concretely, the filter weights for all pixels are the same.
Inputs:
mbd: Pointer to the block for filtering, which is ONLY used to get
subsampling information of all planes as well as the bit-depth.
block_size: Size of the block.
num_planes: Number of planes in the frame.
filter_weight: Weight used for filtering.
pred: Pointer to the well-built predictors.
accum: Pointer to the pixel-wise accumulator for filtering.
count: Pointer to the pixel-wise counter fot filtering.
Returns:
Nothing will be returned. But the content to which `accum` and `pred`
point will be modified.
Computes temporal filter weights and accumulators for the frame to be filtered . More concretely the filter weights for all pixels are the same . Inputs : mbd : Pointer to the block for filtering which is ONLY used to get subsampling information of all planes as well as the bit - depth . block_size : Size of the block . num_planes : Number of planes in the frame . filter_weight : Weight used for filtering . pred : Pointer to the well - built predictors . accum : Pointer to the pixel - wise accumulator for filtering . count : Pointer to the pixel - wise counter fot filtering . Returns : Nothing will be returned . But the content to which ` accum ` and ` pred ` point will be modified .
void av1_apply_temporal_filter_self(const MACROBLOCKD *mbd,
                                    const BLOCK_SIZE block_size,
                                    const int num_planes,
                                    const int filter_weight,
                                    const uint8_t *pred, uint32_t *accum,
                                    uint16_t *count) {
  assert(num_planes >= 1 && num_planes <= MAX_MB_PLANE);
  const int mb_height = block_size_high[block_size];
  const int mb_width = block_size_wide[block_size];
  const int mb_pels = mb_height * mb_width;
  const int is_high_bitdepth = is_cur_buf_hbd(mbd);
  const uint16_t *pred16 = CONVERT_TO_SHORTPTR(pred);
  int plane_offset = 0;
  for (int plane = 0; plane < num_planes; ++plane) {
    const int subsampling_y = mbd->plane[plane].subsampling_y;
    const int subsampling_x = mbd->plane[plane].subsampling_x;
    const int h = mb_height >> subsampling_y;  
    const int w = mb_width >> subsampling_x;   
    int pred_idx = 0;
    for (int i = 0; i < h; ++i) {
      for (int j = 0; j < w; ++j) {
        const int idx = plane_offset + pred_idx;  
        const int pred_value = is_high_bitdepth ? pred16[idx] : pred[idx];
        accum[idx] += filter_weight * pred_value;
        count[idx] += filter_weight;
        ++pred_idx;
      }
    }
    plane_offset += mb_pels;
  }
}
void av1_apply_temporal_filter_self ( const MACROBLOCKD * mbd , const BLOCK_SIZE block_size , const int num_planes , const int filter_weight , const uint8_t * pred , uint32_t * accum , uint16_t * count ) { assert ( num_planes >= 1 && num_planes <= MAX_MB_PLANE ) ; const int mb_height = block_size_high [ block_size ] ; const int mb_width = block_size_wide [ block_size ] ; const int mb_pels = mb_height * mb_width ; const int is_high_bitdepth = is_cur_buf_hbd ( mbd ) ; const uint16_t * pred16 = CONVERT_TO_SHORTPTR ( pred ) ; int plane_offset = 0 ; for ( int plane = 0 ; plane < num_planes ; ++ plane ) { const int subsampling_y = mbd -> plane [ plane ] . subsampling_y ; const int subsampling_x = mbd -> plane [ plane ] . subsampling_x ; const int h = mb_height >> subsampling_y ; const int w = mb_width >> subsampling_x ; int pred_idx = 0 ; for ( int i = 0 ; i < h ; ++ i ) { for ( int j = 0 ; j < w ; ++ j ) { const int idx = plane_offset + pred_idx ; const int pred_value = is_high_bitdepth ? pred16 [ idx ] : pred [ idx ] ; accum [ idx ] += filter_weight * pred_value ; count [ idx ] += filter_weight ; ++ pred_idx ; } } plane_offset += mb_pels ; } }
Computes temporal filter weights and accumulators for the frame to be
filtered.
Computes temporal filter weights and accumulators for the frame to be filtered .
// Block information. // Plane height. // Plane width. // Index with plane shift.