Remove loop dering experiment.

Change-Id: I1a979bf74c286b157c31bab6bdcba0494acb4918
This commit is contained in:
Paul Wilkins 2013-05-24 15:40:20 +01:00
parent 0b2b81249b
commit 845bc13ba9
9 changed files with 26 additions and 88 deletions

1
configure vendored
View File

@ -240,7 +240,6 @@ HAVE_LIST="
EXPERIMENT_LIST="
csm
implicit_segmentation
loop_dering
oneshotq
multiple_arf
non420

View File

@ -187,7 +187,7 @@ static void lpf_mb(VP9_COMMON *cm, const MODE_INFO *mi,
int do_left_mb_v, int do_above_mb_h,
int do_left_mbuv_v, int do_above_mbuv_h,
uint8_t *y_ptr, uint8_t *u_ptr, uint8_t *v_ptr,
int y_stride, int uv_stride, int dering) {
int y_stride, int uv_stride) {
loop_filter_info_n *lfi_n = &cm->lf_info;
struct loop_filter_info lfi;
int mode = mi->mbmi.mode;
@ -254,21 +254,6 @@ static void lpf_mb(VP9_COMMON *cm, const MODE_INFO *mi,
y_stride, uv_stride, &lfi);
}
}
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
}
}
}
@ -276,7 +261,7 @@ static void lpf_sb32(VP9_COMMON *cm, const MODE_INFO *mode_info_context,
int mb_row, int mb_col,
uint8_t *y_ptr, uint8_t *u_ptr, uint8_t *v_ptr,
int y_stride, int uv_stride,
int y_only, int dering) {
int y_only) {
BLOCK_SIZE_TYPE sb_type = mode_info_context->mbmi.sb_type;
const int wbl = b_width_log2(sb_type), hbl = b_height_log2(sb_type);
TX_SIZE tx_size = mode_info_context->mbmi.txfm_size;
@ -298,7 +283,7 @@ static void lpf_sb32(VP9_COMMON *cm, const MODE_INFO *mode_info_context,
y_ptr,
y_only? 0 : u_ptr,
y_only? 0 : v_ptr,
y_stride, uv_stride, dering);
y_stride, uv_stride);
// process 2nd MB top-right
mi = mode_info_context + 2;
do_left_v = !(wbl >= 3 /* 32x16 or >=32x32 */ && (tx_size >= TX_32X32 ||
@ -313,7 +298,7 @@ static void lpf_sb32(VP9_COMMON *cm, const MODE_INFO *mode_info_context,
y_ptr + 16,
y_only ? 0 : (u_ptr + 8),
y_only ? 0 : (v_ptr + 8),
y_stride, uv_stride, dering);
y_stride, uv_stride);
// process 3rd MB bottom-left
mi = mode_info_context + (mis << 1);
@ -329,7 +314,7 @@ static void lpf_sb32(VP9_COMMON *cm, const MODE_INFO *mode_info_context,
y_ptr + 16 * y_stride,
y_only ? 0 : (u_ptr + 8 * uv_stride),
y_only ? 0 : (v_ptr + 8 * uv_stride),
y_stride, uv_stride, dering);
y_stride, uv_stride);
// process 4th MB bottom right
mi = mode_info_context + ((mis + 1) << 1);
@ -346,39 +331,38 @@ static void lpf_sb32(VP9_COMMON *cm, const MODE_INFO *mode_info_context,
y_ptr + 16 * y_stride + 16,
y_only ? 0 : (u_ptr + 8 * uv_stride + 8),
y_only ? 0 : (v_ptr + 8 * uv_stride + 8),
y_stride, uv_stride, dering);
y_stride, uv_stride);
}
static void lpf_sb64(VP9_COMMON *cm, const MODE_INFO *mode_info_context,
int mb_row, int mb_col,
uint8_t *y_ptr, uint8_t *u_ptr, uint8_t *v_ptr,
int y_stride, int uv_stride,
int y_only, int dering) {
int y_only) {
lpf_sb32(cm, mode_info_context, mb_row, mb_col,
y_ptr, u_ptr, v_ptr,
y_stride, uv_stride, y_only, dering);
y_stride, uv_stride, y_only);
lpf_sb32(cm, mode_info_context + 4, mb_row, mb_col + 2,
y_ptr + 32, u_ptr + 16, v_ptr + 16,
y_stride, uv_stride, y_only, dering);
y_stride, uv_stride, y_only);
lpf_sb32(cm, mode_info_context + cm->mode_info_stride * 4,
mb_row + 2, mb_col,
y_ptr + 32 * y_stride,
u_ptr + 16 * uv_stride,
v_ptr + 16 * uv_stride,
y_stride, uv_stride, y_only, dering);
y_stride, uv_stride, y_only);
lpf_sb32(cm, mode_info_context + cm->mode_info_stride * 4 + 4,
mb_row + 2, mb_col + 2,
y_ptr + 32 * y_stride + 32,
u_ptr + 16 * uv_stride + 16,
v_ptr + 16 * uv_stride + 16,
y_stride, uv_stride, y_only, dering);
y_stride, uv_stride, y_only);
}
void vp9_loop_filter_frame(VP9_COMMON *cm,
MACROBLOCKD *xd,
int frame_filter_level,
int y_only,
int dering) {
int y_only) {
YV12_BUFFER_CONFIG *post = cm->frame_to_show;
int mb_row, mb_col;
const int sb64_rows = cm->mb_rows / 4;
@ -432,7 +416,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
for (mb_col = 0; mb_col < sb64_cols * 4; mb_col += 4) {
lpf_sb64(cm, mode_info_context, mb_row, mb_col,
y_ptr, u_ptr, v_ptr,
y_stride, uv_stride, y_only, dering);
y_stride, uv_stride, y_only);
y_ptr += 64;
u_ptr = y_only? 0 : u_ptr + 32;
v_ptr = y_only? 0 : v_ptr + 32;
@ -442,13 +426,13 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
// process 2 SB32s in the extra SB32 col
lpf_sb32(cm, mode_info_context, mb_row, mb_col,
y_ptr, u_ptr, v_ptr,
y_stride, uv_stride, y_only, dering);
y_stride, uv_stride, y_only);
lpf_sb32(cm, mode_info_context + mis * 4,
mb_row + 2, mb_col,
y_ptr + 32 * y_stride,
u_ptr + 16 * uv_stride,
v_ptr + 16 * uv_stride,
y_stride, uv_stride, y_only, dering);
y_stride, uv_stride, y_only);
y_ptr += 32;
u_ptr = y_only? 0 : u_ptr + 16;
v_ptr = y_only? 0 : v_ptr + 16;
@ -469,7 +453,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
y_ptr + (k * 16) * y_stride,
y_only ? 0 : (u_ptr + (k * 8) * uv_stride),
y_only ? 0 : (v_ptr + (k * 8) * uv_stride),
y_stride, uv_stride, dering);
y_stride, uv_stride);
}
y_ptr += 16;
@ -491,7 +475,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
for (mb_col = 0; mb_col < sb32_cols * 2; mb_col += 2) {
lpf_sb32(cm, mode_info_context, mb_row, mb_col,
y_ptr, u_ptr, v_ptr,
y_stride, uv_stride, y_only, dering);
y_stride, uv_stride, y_only);
y_ptr += 32;
u_ptr = y_only? 0 : u_ptr + 16;
v_ptr = y_only? 0 : v_ptr + 16;
@ -509,7 +493,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
y_ptr,
y_only? NULL : u_ptr,
y_only? NULL : v_ptr,
y_stride, uv_stride, dering);
y_stride, uv_stride);
// process 2nd MB
mi = mode_info_context + (mis << 1);
do_left_v = (mb_col > 0);
@ -521,7 +505,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
y_ptr + 16 * y_stride,
y_only ? NULL : (u_ptr + 8 * uv_stride),
y_only ? NULL : (v_ptr + 8 * uv_stride),
y_stride, uv_stride, dering);
y_stride, uv_stride);
y_ptr += 16;
u_ptr = y_only? 0 : u_ptr + 8;
v_ptr = y_only? 0 : v_ptr + 8;
@ -547,7 +531,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
y_ptr,
y_only? 0 : u_ptr,
y_only? 0 : v_ptr,
y_stride, uv_stride, dering);
y_stride, uv_stride);
y_ptr += 16;
u_ptr = y_only? 0 : u_ptr + 8;
v_ptr = y_only? 0 : v_ptr + 8;

View File

@ -73,8 +73,7 @@ void vp9_loop_filter_frame_init(struct VP9Common *cm,
void vp9_loop_filter_frame(struct VP9Common *cm,
struct macroblockd *mbd,
int filter_level,
int y_only,
int dering);
int y_only);
void vp9_loop_filter_partial_frame(struct VP9Common *cm,
struct macroblockd *mbd,

View File

@ -205,7 +205,6 @@ typedef struct VP9Common {
int filter_level;
int last_sharpness_level;
int sharpness_level;
int dering_enabled;
int refresh_frame_context; /* Two state 0 = NO, 1 = YES */

View File

@ -700,13 +700,6 @@ static void setup_loopfilter(VP9_COMMON *pc, MACROBLOCKD *xd, vp9_reader *r) {
pc->filter_level = vp9_read_literal(r, 6);
pc->sharpness_level = vp9_read_literal(r, 3);
#if CONFIG_LOOP_DERING
if (vp9_read_bit(r))
pc->dering_enabled = 1 + vp9_read_literal(r, 4);
else
pc->dering_enabled = 0;
#endif
// Read in loop filter deltas applied at the MB level based on mode or ref
// frame.
xd->mode_ref_lf_delta_update = 0;

View File

@ -349,8 +349,7 @@ int vp9_receive_compressed_data(VP9D_PTR ptr,
if (cm->filter_level) {
/* Apply the loop filter if appropriate. */
vp9_loop_filter_frame(cm, &pbi->mb, cm->filter_level, 0,
cm->dering_enabled);
vp9_loop_filter_frame(cm, &pbi->mb, cm->filter_level, 0);
}
#if WRITE_RECON_BUFFER == 2

View File

@ -1351,14 +1351,6 @@ static void encode_loopfilter(VP9_COMMON *pc, MACROBLOCKD *xd, vp9_writer *w) {
// Encode the loop filter level and type
vp9_write_literal(w, pc->filter_level, 6);
vp9_write_literal(w, pc->sharpness_level, 3);
#if CONFIG_LOOP_DERING
if (pc->dering_enabled) {
vp9_write_bit(w, 1);
vp9_write_literal(w, pc->dering_enabled - 1, 4);
} else {
vp9_write_bit(w, 0);
}
#endif
// Write out loop filter deltas applied at the MB level based on mode or
// ref frame (if they are enabled).

View File

@ -2416,8 +2416,7 @@ static void loopfilter_frame(VP9_COMP *cpi, VP9_COMMON *cm) {
if (cm->filter_level > 0) {
vp9_set_alt_lf_level(cpi, cm->filter_level);
vp9_loop_filter_frame(cm, &cpi->mb.e_mbd, cm->filter_level, 0,
cm->dering_enabled);
vp9_loop_filter_frame(cm, &cpi->mb.e_mbd, cm->filter_level, 0);
}
vp9_extend_frame_borders(cm->frame_to_show,

View File

@ -163,7 +163,7 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi) {
// Get baseline error score
vp9_set_alt_lf_level(cpi, filt_mid);
vp9_loop_filter_frame(cm, &cpi->mb.e_mbd, filt_mid, 1, 0);
vp9_loop_filter_frame(cm, &cpi->mb.e_mbd, filt_mid, 1);
best_err = vp9_calc_ss_err(sd, cm->frame_to_show);
filt_best = filt_mid;
@ -188,7 +188,7 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi) {
if ((filt_direction <= 0) && (filt_low != filt_mid)) {
// Get Low filter error score
vp9_set_alt_lf_level(cpi, filt_low);
vp9_loop_filter_frame(cm, &cpi->mb.e_mbd, filt_low, 1, 0);
vp9_loop_filter_frame(cm, &cpi->mb.e_mbd, filt_low, 1);
filt_err = vp9_calc_ss_err(sd, cm->frame_to_show);
@ -208,7 +208,7 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi) {
// Now look at filt_high
if ((filt_direction >= 0) && (filt_high != filt_mid)) {
vp9_set_alt_lf_level(cpi, filt_high);
vp9_loop_filter_frame(cm, &cpi->mb.e_mbd, filt_high, 1, 0);
vp9_loop_filter_frame(cm, &cpi->mb.e_mbd, filt_high, 1);
filt_err = vp9_calc_ss_err(sd, cm->frame_to_show);
@ -233,30 +233,4 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi) {
}
cm->filter_level = filt_best;
#if CONFIG_LOOP_DERING
/* Decide whether to turn on deringing filter */
{ // NOLINT
int best_dering = 0;
int this_dering;
int last_err_diff = INT_MAX;
for (this_dering = 1; this_dering <= 16; this_dering++) {
vp9_set_alt_lf_level(cpi, filt_best);
vp9_loop_filter_frame(cm, &cpi->mb.e_mbd, filt_high, 1, this_dering);
filt_err = vp9_calc_ss_err(sd, cm->frame_to_show);
vp8_yv12_copy_y(&cpi->last_frame_uf, cm->frame_to_show);
if (filt_err < best_err) {
best_err = filt_err;
best_dering = this_dering;
last_err_diff = INT_MAX;
} else {
if (filt_err - best_err > last_err_diff)
break;
last_err_diff = filt_err - best_err;
}
}
cm->dering_enabled = best_dering;
}
#endif
}