Пример #1
0
static unsigned int block_variance(const AV1_COMP *const cpi, MACROBLOCK *x,
                                   BLOCK_SIZE bs) {
  MACROBLOCKD *xd = &x->e_mbd;
  unsigned int var, sse;
  int right_overflow =
      (xd->mb_to_right_edge < 0) ? ((-xd->mb_to_right_edge) >> 3) : 0;
  int bottom_overflow =
      (xd->mb_to_bottom_edge < 0) ? ((-xd->mb_to_bottom_edge) >> 3) : 0;

  if (right_overflow || bottom_overflow) {
    const int bw = MI_SIZE * mi_size_wide[bs] - right_overflow;
    const int bh = MI_SIZE * mi_size_high[bs] - bottom_overflow;
    int avg;
    if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
      aq_highbd_8_variance(x->plane[0].src.buf, x->plane[0].src.stride,
                           CONVERT_TO_BYTEPTR(av1_highbd_all_zeros), 0, bw, bh,
                           &sse, &avg);
      sse >>= 2 * (xd->bd - 8);
      avg >>= (xd->bd - 8);
    } else {
Пример #2
0
static unsigned int block_variance(VP9_COMP *cpi, MACROBLOCK *x,
                                   BLOCK_SIZE bs) {
    MACROBLOCKD *xd = &x->e_mbd;
    unsigned int var, sse;
    int right_overflow = (xd->mb_to_right_edge < 0) ?
                         ((-xd->mb_to_right_edge) >> 3) : 0;
    int bottom_overflow = (xd->mb_to_bottom_edge < 0) ?
                          ((-xd->mb_to_bottom_edge) >> 3) : 0;

    if (right_overflow || bottom_overflow) {
        const int bw = 8 * num_8x8_blocks_wide_lookup[bs] - right_overflow;
        const int bh = 8 * num_8x8_blocks_high_lookup[bs] - bottom_overflow;
        int avg;
#if CONFIG_VP9_HIGHBITDEPTH
        if (xd->cur_buf->flags & YV12_FLAG_HIGHBITDEPTH) {
            aq_highbd_8_variance(x->plane[0].src.buf, x->plane[0].src.stride,
                                 CONVERT_TO_BYTEPTR(vp9_highbd_64_zeros), 0, bw, bh,
                                 &sse, &avg);
            sse >>= 2 * (xd->bd - 8);
            avg >>= (xd->bd - 8);
        } else {