From f66320abff79ee376ca9ad9282d12509f6e38e50 Mon Sep 17 00:00:00 2001 From: Dmitry Kovalev Date: Wed, 8 May 2013 16:39:43 -0700 Subject: [PATCH] Removing LOOPFILTER_TYPE and corresponding bit in bitstream. We don't have two loopfilter types anymore. Change-Id: I53c0137361342c7d00887ad03be3490f0dfa3532 --- vp9/common/vp9_alloccommon.c | 4 -- vp9/common/vp9_loopfilter.c | 127 +++++++++++++++++++++---------------------- vp9/common/vp9_loopfilter.h | 6 -- vp9/common/vp9_onyxc_int.h | 1 - vp9/decoder/vp9_decodframe.c | 1 - vp9/encoder/vp9_bitstream.c | 1 - 6 files changed, 61 insertions(+), 79 deletions(-) diff --git a/vp9/common/vp9_alloccommon.c b/vp9/common/vp9_alloccommon.c index fd39439..a4120c2 100644 --- a/vp9/common/vp9_alloccommon.c +++ b/vp9/common/vp9_alloccommon.c @@ -177,18 +177,15 @@ void vp9_setup_version(VP9_COMMON *cm) { switch (cm->version & 0x3) { case 0: cm->no_lpf = 0; - cm->filter_type = NORMAL_LOOPFILTER; cm->use_bilinear_mc_filter = 0; break; case 1: cm->no_lpf = 0; - cm->filter_type = SIMPLE_LOOPFILTER; cm->use_bilinear_mc_filter = 1; break; case 2: case 3: cm->no_lpf = 1; - cm->filter_type = NORMAL_LOOPFILTER; cm->use_bilinear_mc_filter = 1; break; } @@ -203,7 +200,6 @@ void vp9_create_common(VP9_COMMON *oci) { oci->txfm_mode = ONLY_4X4; oci->comp_pred_mode = HYBRID_PREDICTION; oci->no_lpf = 0; - oci->filter_type = NORMAL_LOOPFILTER; oci->use_bilinear_mc_filter = 0; oci->clr_type = REG_YUV; oci->clamp_type = RECON_CLAMP_REQUIRED; diff --git a/vp9/common/vp9_loopfilter.c b/vp9/common/vp9_loopfilter.c index d6afabd..b668212 100644 --- a/vp9/common/vp9_loopfilter.c +++ b/vp9/common/vp9_loopfilter.c @@ -199,80 +199,75 @@ static void lpf_mb(VP9_COMMON *cm, const MODE_INFO *mi, if (filter_level) { const int skip_lf = mb_lf_skip(&mi->mbmi); const int tx_size = mi->mbmi.txfm_size; - if (cm->filter_type == NORMAL_LOOPFILTER) { - const int hev_index = filter_level >> 4; - lfi.mblim = lfi_n->mblim[filter_level]; - lfi.blim = lfi_n->blim[filter_level]; - lfi.lim = lfi_n->lim[filter_level]; - lfi.hev_thr = lfi_n->hev_thr[hev_index]; - - if (do_above_mb_h) { - if (tx_size >= TX_16X16) - vp9_lpf_mbh_w(y_ptr, - do_above_mbuv_h ? u_ptr : NULL, - do_above_mbuv_h ? v_ptr : NULL, - y_stride, uv_stride, &lfi); + const int hev_index = filter_level >> 4; + lfi.mblim = lfi_n->mblim[filter_level]; + lfi.blim = lfi_n->blim[filter_level]; + lfi.lim = lfi_n->lim[filter_level]; + lfi.hev_thr = lfi_n->hev_thr[hev_index]; + + if (do_above_mb_h) { + if (tx_size >= TX_16X16) + vp9_lpf_mbh_w(y_ptr, + do_above_mbuv_h ? u_ptr : NULL, + do_above_mbuv_h ? v_ptr : NULL, + y_stride, uv_stride, &lfi); + else + vp9_loop_filter_mbh(y_ptr, u_ptr, v_ptr, y_stride, uv_stride, &lfi); + } + + if (!skip_lf) { + if (tx_size >= TX_8X8) { + if (tx_size == TX_8X8 && + mi->mbmi.sb_type < BLOCK_SIZE_MB16X16) + vp9_loop_filter_bh8x8(y_ptr, u_ptr, v_ptr, + y_stride, uv_stride, &lfi); else - vp9_loop_filter_mbh(y_ptr, u_ptr, v_ptr, y_stride, uv_stride, &lfi); + vp9_loop_filter_bh8x8(y_ptr, NULL, NULL, + y_stride, uv_stride, &lfi); + } else { + vp9_loop_filter_bh(y_ptr, u_ptr, v_ptr, + y_stride, uv_stride, &lfi); } + } - if (!skip_lf) { - if (tx_size >= TX_8X8) { - if (tx_size == TX_8X8 && - (mi->mbmi.sb_type < BLOCK_SIZE_MB16X16) - ) - vp9_loop_filter_bh8x8(y_ptr, u_ptr, v_ptr, - y_stride, uv_stride, &lfi); - else - vp9_loop_filter_bh8x8(y_ptr, NULL, NULL, - y_stride, uv_stride, &lfi); - } else { - vp9_loop_filter_bh(y_ptr, u_ptr, v_ptr, - y_stride, uv_stride, &lfi); - } - } + if (do_left_mb_v) { + if (tx_size >= TX_16X16) + vp9_lpf_mbv_w(y_ptr, + do_left_mbuv_v ? u_ptr : NULL, + do_left_mbuv_v ? v_ptr : NULL, + y_stride, uv_stride, &lfi); + else + vp9_loop_filter_mbv(y_ptr, u_ptr, v_ptr, y_stride, uv_stride, &lfi); + } - if (do_left_mb_v) { - if (tx_size >= TX_16X16) - vp9_lpf_mbv_w(y_ptr, - do_left_mbuv_v ? u_ptr : NULL, - do_left_mbuv_v ? v_ptr : NULL, - y_stride, uv_stride, &lfi); + if (!skip_lf) { + if (tx_size >= TX_8X8) { + if (tx_size == TX_8X8 && + mi->mbmi.sb_type < BLOCK_SIZE_MB16X16) + vp9_loop_filter_bv8x8(y_ptr, u_ptr, v_ptr, + y_stride, uv_stride, &lfi); else - vp9_loop_filter_mbv(y_ptr, u_ptr, v_ptr, y_stride, uv_stride, &lfi); + vp9_loop_filter_bv8x8(y_ptr, NULL, NULL, + y_stride, uv_stride, &lfi); + } else { + vp9_loop_filter_bv(y_ptr, u_ptr, v_ptr, + y_stride, uv_stride, &lfi); } - - if (!skip_lf) { - if (tx_size >= TX_8X8) { - if (tx_size == TX_8X8 && - (mi->mbmi.sb_type < BLOCK_SIZE_MB16X16)) - vp9_loop_filter_bv8x8(y_ptr, u_ptr, v_ptr, - y_stride, uv_stride, &lfi); - else - vp9_loop_filter_bv8x8(y_ptr, NULL, NULL, - y_stride, uv_stride, &lfi); - } else { - vp9_loop_filter_bv(y_ptr, u_ptr, v_ptr, - y_stride, uv_stride, &lfi); - } - } - if (dering) { + } + if (dering) { #if CONFIG_LOOP_DERING - vp9_post_proc_down_and_across(y_ptr, y_ptr, - y_stride, y_stride, - 16, 16, dering); - if (u_ptr && v_ptr) { - vp9_post_proc_down_and_across(u_ptr, u_ptr, - uv_stride, uv_stride, - 8, 8, dering); - vp9_post_proc_down_and_across(v_ptr, v_ptr, - uv_stride, uv_stride, - 8, 8, dering); - } -#endif + vp9_post_proc_down_and_across(y_ptr, y_ptr, + y_stride, y_stride, + 16, 16, dering); + if (u_ptr && v_ptr) { + vp9_post_proc_down_and_across(u_ptr, u_ptr, + uv_stride, uv_stride, + 8, 8, dering); + vp9_post_proc_down_and_across(v_ptr, v_ptr, + uv_stride, uv_stride, + 8, 8, dering); } - } else { - // TODO(yaowu): simple loop filter +#endif } } } diff --git a/vp9/common/vp9_loopfilter.h b/vp9/common/vp9_loopfilter.h index 81745e4..80fccd5 100644 --- a/vp9/common/vp9_loopfilter.h +++ b/vp9/common/vp9_loopfilter.h @@ -16,12 +16,6 @@ #include "vp9/common/vp9_blockd.h" #define MAX_LOOP_FILTER 63 - -typedef enum { - NORMAL_LOOPFILTER = 0, - SIMPLE_LOOPFILTER = 1 -} LOOPFILTER_TYPE; - #define SIMD_WIDTH 16 /* Need to align this structure so when it is declared and diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h index de2cace..9f0c712 100644 --- a/vp9/common/vp9_onyxc_int.h +++ b/vp9/common/vp9_onyxc_int.h @@ -198,7 +198,6 @@ typedef struct VP9Common { unsigned char *last_frame_seg_map; INTERPOLATIONFILTERTYPE mcomp_filter_type; - LOOPFILTER_TYPE filter_type; loop_filter_info_n lf_info; diff --git a/vp9/decoder/vp9_decodframe.c b/vp9/decoder/vp9_decodframe.c index 5ce224b..54e06f5 100644 --- a/vp9/decoder/vp9_decodframe.c +++ b/vp9/decoder/vp9_decodframe.c @@ -656,7 +656,6 @@ static void setup_pred_probs(VP9_COMMON *pc, vp9_reader *r) { } static void setup_loopfilter(VP9_COMMON *pc, MACROBLOCKD *xd, vp9_reader *r) { - pc->filter_type = (LOOPFILTER_TYPE) vp9_read_bit(r); pc->filter_level = vp9_read_literal(r, 6); pc->sharpness_level = vp9_read_literal(r, 3); diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c index 050821d..20154d8 100644 --- a/vp9/encoder/vp9_bitstream.c +++ b/vp9/encoder/vp9_bitstream.c @@ -1496,7 +1496,6 @@ void vp9_pack_bitstream(VP9_COMP *cpi, uint8_t *dest, unsigned long *size) { vp9_write_bit(&header_bc, cpi->mb.e_mbd.lossless); // Encode the loop filter level and type - vp9_write_bit(&header_bc, pc->filter_type); vp9_write_literal(&header_bc, pc->filter_level, 6); vp9_write_literal(&header_bc, pc->sharpness_level, 3); #if CONFIG_LOOP_DERING -- 2.7.4