Removing LOOPFILTER_TYPE and corresponding bit in bitstream.

We don't have two loopfilter types anymore.

Change-Id: I53c0137361342c7d00887ad03be3490f0dfa3532
This commit is contained in:
Dmitry Kovalev 2013-05-08 16:39:43 -07:00
Родитель 267e9331e2
Коммит f66320abff
6 изменённых файлов: 60 добавлений и 78 удалений

Просмотреть файл

@ -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;

Просмотреть файл

@ -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];
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);
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
}
}
}

Просмотреть файл

@ -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

Просмотреть файл

@ -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;

Просмотреть файл

@ -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);

Просмотреть файл

@ -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