Commit 845bc13b authored by Paul Wilkins's avatar Paul Wilkins

Remove loop dering experiment.

Change-Id: I1a979bf74c286b157c31bab6bdcba0494acb4918
parent 0b2b8124
...@@ -240,7 +240,6 @@ HAVE_LIST=" ...@@ -240,7 +240,6 @@ HAVE_LIST="
EXPERIMENT_LIST=" EXPERIMENT_LIST="
csm csm
implicit_segmentation implicit_segmentation
loop_dering
oneshotq oneshotq
multiple_arf multiple_arf
non420 non420
......
...@@ -187,7 +187,7 @@ static void lpf_mb(VP9_COMMON *cm, const MODE_INFO *mi, ...@@ -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_mb_v, int do_above_mb_h,
int do_left_mbuv_v, int do_above_mbuv_h, int do_left_mbuv_v, int do_above_mbuv_h,
uint8_t *y_ptr, uint8_t *u_ptr, uint8_t *v_ptr, 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; loop_filter_info_n *lfi_n = &cm->lf_info;
struct loop_filter_info lfi; struct loop_filter_info lfi;
int mode = mi->mbmi.mode; int mode = mi->mbmi.mode;
...@@ -254,21 +254,6 @@ static void lpf_mb(VP9_COMMON *cm, const MODE_INFO *mi, ...@@ -254,21 +254,6 @@ static void lpf_mb(VP9_COMMON *cm, const MODE_INFO *mi,
y_stride, uv_stride, &lfi); 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, ...@@ -276,7 +261,7 @@ static void lpf_sb32(VP9_COMMON *cm, const MODE_INFO *mode_info_context,
int mb_row, int mb_col, int mb_row, int mb_col,
uint8_t *y_ptr, uint8_t *u_ptr, uint8_t *v_ptr, uint8_t *y_ptr, uint8_t *u_ptr, uint8_t *v_ptr,
int y_stride, int uv_stride, 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; 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); const int wbl = b_width_log2(sb_type), hbl = b_height_log2(sb_type);
TX_SIZE tx_size = mode_info_context->mbmi.txfm_size; 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, ...@@ -298,7 +283,7 @@ static void lpf_sb32(VP9_COMMON *cm, const MODE_INFO *mode_info_context,
y_ptr, y_ptr,
y_only? 0 : u_ptr, y_only? 0 : u_ptr,
y_only? 0 : v_ptr, y_only? 0 : v_ptr,
y_stride, uv_stride, dering); y_stride, uv_stride);
// process 2nd MB top-right // process 2nd MB top-right
mi = mode_info_context + 2; mi = mode_info_context + 2;
do_left_v = !(wbl >= 3 /* 32x16 or >=32x32 */ && (tx_size >= TX_32X32 || 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, ...@@ -313,7 +298,7 @@ static void lpf_sb32(VP9_COMMON *cm, const MODE_INFO *mode_info_context,
y_ptr + 16, y_ptr + 16,
y_only ? 0 : (u_ptr + 8), y_only ? 0 : (u_ptr + 8),
y_only ? 0 : (v_ptr + 8), y_only ? 0 : (v_ptr + 8),
y_stride, uv_stride, dering); y_stride, uv_stride);
// process 3rd MB bottom-left // process 3rd MB bottom-left
mi = mode_info_context + (mis << 1); mi = mode_info_context + (mis << 1);
...@@ -329,7 +314,7 @@ static void lpf_sb32(VP9_COMMON *cm, const MODE_INFO *mode_info_context, ...@@ -329,7 +314,7 @@ static void lpf_sb32(VP9_COMMON *cm, const MODE_INFO *mode_info_context,
y_ptr + 16 * y_stride, y_ptr + 16 * y_stride,
y_only ? 0 : (u_ptr + 8 * uv_stride), y_only ? 0 : (u_ptr + 8 * uv_stride),
y_only ? 0 : (v_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 // process 4th MB bottom right
mi = mode_info_context + ((mis + 1) << 1); mi = mode_info_context + ((mis + 1) << 1);
...@@ -346,39 +331,38 @@ static void lpf_sb32(VP9_COMMON *cm, const MODE_INFO *mode_info_context, ...@@ -346,39 +331,38 @@ static void lpf_sb32(VP9_COMMON *cm, const MODE_INFO *mode_info_context,
y_ptr + 16 * y_stride + 16, y_ptr + 16 * y_stride + 16,
y_only ? 0 : (u_ptr + 8 * uv_stride + 8), y_only ? 0 : (u_ptr + 8 * uv_stride + 8),
y_only ? 0 : (v_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, static void lpf_sb64(VP9_COMMON *cm, const MODE_INFO *mode_info_context,
int mb_row, int mb_col, int mb_row, int mb_col,
uint8_t *y_ptr, uint8_t *u_ptr, uint8_t *v_ptr, uint8_t *y_ptr, uint8_t *u_ptr, uint8_t *v_ptr,
int y_stride, int uv_stride, int y_stride, int uv_stride,
int y_only, int dering) { int y_only) {
lpf_sb32(cm, mode_info_context, mb_row, mb_col, lpf_sb32(cm, mode_info_context, mb_row, mb_col,
y_ptr, u_ptr, v_ptr, 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, lpf_sb32(cm, mode_info_context + 4, mb_row, mb_col + 2,
y_ptr + 32, u_ptr + 16, v_ptr + 16, 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, lpf_sb32(cm, mode_info_context + cm->mode_info_stride * 4,
mb_row + 2, mb_col, mb_row + 2, mb_col,
y_ptr + 32 * y_stride, y_ptr + 32 * y_stride,
u_ptr + 16 * uv_stride, u_ptr + 16 * uv_stride,
v_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, lpf_sb32(cm, mode_info_context + cm->mode_info_stride * 4 + 4,
mb_row + 2, mb_col + 2, mb_row + 2, mb_col + 2,
y_ptr + 32 * y_stride + 32, y_ptr + 32 * y_stride + 32,
u_ptr + 16 * uv_stride + 16, u_ptr + 16 * uv_stride + 16,
v_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, void vp9_loop_filter_frame(VP9_COMMON *cm,
MACROBLOCKD *xd, MACROBLOCKD *xd,
int frame_filter_level, int frame_filter_level,
int y_only, int y_only) {
int dering) {
YV12_BUFFER_CONFIG *post = cm->frame_to_show; YV12_BUFFER_CONFIG *post = cm->frame_to_show;
int mb_row, mb_col; int mb_row, mb_col;
const int sb64_rows = cm->mb_rows / 4; const int sb64_rows = cm->mb_rows / 4;
...@@ -432,7 +416,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm, ...@@ -432,7 +416,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
for (mb_col = 0; mb_col < sb64_cols * 4; mb_col += 4) { for (mb_col = 0; mb_col < sb64_cols * 4; mb_col += 4) {
lpf_sb64(cm, mode_info_context, mb_row, mb_col, lpf_sb64(cm, mode_info_context, mb_row, mb_col,
y_ptr, u_ptr, v_ptr, y_ptr, u_ptr, v_ptr,
y_stride, uv_stride, y_only, dering); y_stride, uv_stride, y_only);
y_ptr += 64; y_ptr += 64;
u_ptr = y_only? 0 : u_ptr + 32; u_ptr = y_only? 0 : u_ptr + 32;
v_ptr = y_only? 0 : v_ptr + 32; v_ptr = y_only? 0 : v_ptr + 32;
...@@ -442,13 +426,13 @@ void vp9_loop_filter_frame(VP9_COMMON *cm, ...@@ -442,13 +426,13 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
// process 2 SB32s in the extra SB32 col // process 2 SB32s in the extra SB32 col
lpf_sb32(cm, mode_info_context, mb_row, mb_col, lpf_sb32(cm, mode_info_context, mb_row, mb_col,
y_ptr, u_ptr, v_ptr, 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, lpf_sb32(cm, mode_info_context + mis * 4,
mb_row + 2, mb_col, mb_row + 2, mb_col,
y_ptr + 32 * y_stride, y_ptr + 32 * y_stride,
u_ptr + 16 * uv_stride, u_ptr + 16 * uv_stride,
v_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; y_ptr += 32;
u_ptr = y_only? 0 : u_ptr + 16; u_ptr = y_only? 0 : u_ptr + 16;
v_ptr = y_only? 0 : v_ptr + 16; v_ptr = y_only? 0 : v_ptr + 16;
...@@ -469,7 +453,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm, ...@@ -469,7 +453,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
y_ptr + (k * 16) * y_stride, y_ptr + (k * 16) * y_stride,
y_only ? 0 : (u_ptr + (k * 8) * uv_stride), y_only ? 0 : (u_ptr + (k * 8) * uv_stride),
y_only ? 0 : (v_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; y_ptr += 16;
...@@ -491,7 +475,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm, ...@@ -491,7 +475,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
for (mb_col = 0; mb_col < sb32_cols * 2; mb_col += 2) { for (mb_col = 0; mb_col < sb32_cols * 2; mb_col += 2) {
lpf_sb32(cm, mode_info_context, mb_row, mb_col, lpf_sb32(cm, mode_info_context, mb_row, mb_col,
y_ptr, u_ptr, v_ptr, y_ptr, u_ptr, v_ptr,
y_stride, uv_stride, y_only, dering); y_stride, uv_stride, y_only);
y_ptr += 32; y_ptr += 32;
u_ptr = y_only? 0 : u_ptr + 16; u_ptr = y_only? 0 : u_ptr + 16;
v_ptr = y_only? 0 : v_ptr + 16; v_ptr = y_only? 0 : v_ptr + 16;
...@@ -509,7 +493,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm, ...@@ -509,7 +493,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
y_ptr, y_ptr,
y_only? NULL : u_ptr, y_only? NULL : u_ptr,
y_only? NULL : v_ptr, y_only? NULL : v_ptr,
y_stride, uv_stride, dering); y_stride, uv_stride);
// process 2nd MB // process 2nd MB
mi = mode_info_context + (mis << 1); mi = mode_info_context + (mis << 1);
do_left_v = (mb_col > 0); do_left_v = (mb_col > 0);
...@@ -521,7 +505,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm, ...@@ -521,7 +505,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
y_ptr + 16 * y_stride, y_ptr + 16 * y_stride,
y_only ? NULL : (u_ptr + 8 * uv_stride), y_only ? NULL : (u_ptr + 8 * uv_stride),
y_only ? NULL : (v_ptr + 8 * uv_stride), y_only ? NULL : (v_ptr + 8 * uv_stride),
y_stride, uv_stride, dering); y_stride, uv_stride);
y_ptr += 16; y_ptr += 16;
u_ptr = y_only? 0 : u_ptr + 8; u_ptr = y_only? 0 : u_ptr + 8;
v_ptr = y_only? 0 : v_ptr + 8; v_ptr = y_only? 0 : v_ptr + 8;
...@@ -547,7 +531,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm, ...@@ -547,7 +531,7 @@ void vp9_loop_filter_frame(VP9_COMMON *cm,
y_ptr, y_ptr,
y_only? 0 : u_ptr, y_only? 0 : u_ptr,
y_only? 0 : v_ptr, y_only? 0 : v_ptr,
y_stride, uv_stride, dering); y_stride, uv_stride);
y_ptr += 16; y_ptr += 16;
u_ptr = y_only? 0 : u_ptr + 8; u_ptr = y_only? 0 : u_ptr + 8;
v_ptr = y_only? 0 : v_ptr + 8; v_ptr = y_only? 0 : v_ptr + 8;
......
...@@ -73,8 +73,7 @@ void vp9_loop_filter_frame_init(struct VP9Common *cm, ...@@ -73,8 +73,7 @@ void vp9_loop_filter_frame_init(struct VP9Common *cm,
void vp9_loop_filter_frame(struct VP9Common *cm, void vp9_loop_filter_frame(struct VP9Common *cm,
struct macroblockd *mbd, struct macroblockd *mbd,
int filter_level, int filter_level,
int y_only, int y_only);
int dering);
void vp9_loop_filter_partial_frame(struct VP9Common *cm, void vp9_loop_filter_partial_frame(struct VP9Common *cm,
struct macroblockd *mbd, struct macroblockd *mbd,
......
...@@ -205,7 +205,6 @@ typedef struct VP9Common { ...@@ -205,7 +205,6 @@ typedef struct VP9Common {
int filter_level; int filter_level;
int last_sharpness_level; int last_sharpness_level;
int sharpness_level; int sharpness_level;
int dering_enabled;
int refresh_frame_context; /* Two state 0 = NO, 1 = YES */ int refresh_frame_context; /* Two state 0 = NO, 1 = YES */
......
...@@ -700,13 +700,6 @@ static void setup_loopfilter(VP9_COMMON *pc, MACROBLOCKD *xd, vp9_reader *r) { ...@@ -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->filter_level = vp9_read_literal(r, 6);
pc->sharpness_level = vp9_read_literal(r, 3); 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 // Read in loop filter deltas applied at the MB level based on mode or ref
// frame. // frame.
xd->mode_ref_lf_delta_update = 0; xd->mode_ref_lf_delta_update = 0;
......
...@@ -349,8 +349,7 @@ int vp9_receive_compressed_data(VP9D_PTR ptr, ...@@ -349,8 +349,7 @@ int vp9_receive_compressed_data(VP9D_PTR ptr,
if (cm->filter_level) { if (cm->filter_level) {
/* Apply the loop filter if appropriate. */ /* Apply the loop filter if appropriate. */
vp9_loop_filter_frame(cm, &pbi->mb, cm->filter_level, 0, vp9_loop_filter_frame(cm, &pbi->mb, cm->filter_level, 0);
cm->dering_enabled);
} }
#if WRITE_RECON_BUFFER == 2 #if WRITE_RECON_BUFFER == 2
......
...@@ -1351,14 +1351,6 @@ static void encode_loopfilter(VP9_COMMON *pc, MACROBLOCKD *xd, vp9_writer *w) { ...@@ -1351,14 +1351,6 @@ static void encode_loopfilter(VP9_COMMON *pc, MACROBLOCKD *xd, vp9_writer *w) {
// Encode the loop filter level and type // Encode the loop filter level and type
vp9_write_literal(w, pc->filter_level, 6); vp9_write_literal(w, pc->filter_level, 6);
vp9_write_literal(w, pc->sharpness_level, 3); 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 // Write out loop filter deltas applied at the MB level based on mode or
// ref frame (if they are enabled). // ref frame (if they are enabled).
......
...@@ -2416,8 +2416,7 @@ static void loopfilter_frame(VP9_COMP *cpi, VP9_COMMON *cm) { ...@@ -2416,8 +2416,7 @@ static void loopfilter_frame(VP9_COMP *cpi, VP9_COMMON *cm) {
if (cm->filter_level > 0) { if (cm->filter_level > 0) {
vp9_set_alt_lf_level(cpi, cm->filter_level); vp9_set_alt_lf_level(cpi, cm->filter_level);
vp9_loop_filter_frame(cm, &cpi->mb.e_mbd, cm->filter_level, 0, vp9_loop_filter_frame(cm, &cpi->mb.e_mbd, cm->filter_level, 0);
cm->dering_enabled);
} }
vp9_extend_frame_borders(cm->frame_to_show, vp9_extend_frame_borders(cm->frame_to_show,
......
...@@ -163,7 +163,7 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi) { ...@@ -163,7 +163,7 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi) {
// Get baseline error score // Get baseline error score
vp9_set_alt_lf_level(cpi, filt_mid); 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); best_err = vp9_calc_ss_err(sd, cm->frame_to_show);
filt_best = filt_mid; filt_best = filt_mid;
...@@ -188,7 +188,7 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi) { ...@@ -188,7 +188,7 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi) {
if ((filt_direction <= 0) && (filt_low != filt_mid)) { if ((filt_direction <= 0) && (filt_low != filt_mid)) {
// Get Low filter error score // Get Low filter error score
vp9_set_alt_lf_level(cpi, filt_low); 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); 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) { ...@@ -208,7 +208,7 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi) {
// Now look at filt_high // Now look at filt_high
if ((filt_direction >= 0) && (filt_high != filt_mid)) { if ((filt_direction >= 0) && (filt_high != filt_mid)) {
vp9_set_alt_lf_level(cpi, filt_high); 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); 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) { ...@@ -233,30 +233,4 @@ void vp9_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP9_COMP *cpi) {
} }
cm->filter_level = filt_best; 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
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment