summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYunqing Wang <yunqingwang@google.com>2013-12-04 11:19:53 -0800
committerYunqing Wang <yunqingwang@google.com>2013-12-04 11:31:19 -0800
commitf6582d69289325f5d43d80801f11d7a9219991f4 (patch)
tree1cb5d421a19c61f7355f5a779b6598301e57d665
parent1470789927fa0b2ad1680443460168da97ca8c1b (diff)
downloadlibvpx-f6582d69289325f5d43d80801f11d7a9219991f4.tar
libvpx-f6582d69289325f5d43d80801f11d7a9219991f4.tar.gz
libvpx-f6582d69289325f5d43d80801f11d7a9219991f4.tar.bz2
libvpx-f6582d69289325f5d43d80801f11d7a9219991f4.zip
Revert "Simplify mask checking in loop filters"
Jingning saw bitstream change with this patch. It could be true that (mask_16x16_0 & 1) is 1, but (mask_16x16_1 & 1) is 0 in some edge cases. This reverts commit 8f05e70340533b9922be5b1c97c37e50607fd862. Change-Id: I0a529435ce816a1e14653eb510d5090de276070a
-rw-r--r--vp9/common/vp9_loopfilter.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/vp9/common/vp9_loopfilter.c b/vp9/common/vp9_loopfilter.c
index ff2bc45e4..40d8ffd3d 100644
--- a/vp9/common/vp9_loopfilter.c
+++ b/vp9/common/vp9_loopfilter.c
@@ -353,10 +353,17 @@ static void filter_selectively_vert_row2(PLANE_TYPE plane_type,
// TODO(yunqingwang): count in loopfilter functions should be removed.
if (mask & 1) {
- if (mask_16x16_0 & 1) {
- // if (mask_16x16_0 & 1) is 1, then (mask_16x16_1 & 1) is 1.
- vp9_mb_lpf_vertical_edge_w_16(s, pitch, lfi0->mblim, lfi0->lim,
- lfi0->hev_thr);
+ if ((mask_16x16_0 | mask_16x16_1) & 1) {
+ if ((mask_16x16_0 & mask_16x16_1) & 1) {
+ vp9_mb_lpf_vertical_edge_w_16(s, pitch, lfi0->mblim, lfi0->lim,
+ lfi0->hev_thr);
+ } else if (mask_16x16_0 & 1) {
+ vp9_mb_lpf_vertical_edge_w(s, pitch, lfi0->mblim, lfi0->lim,
+ lfi0->hev_thr);
+ } else {
+ vp9_mb_lpf_vertical_edge_w(s + 8 *pitch, pitch, lfi1->mblim,
+ lfi1->lim, lfi1->hev_thr);
+ }
}
if ((mask_8x8_0 | mask_8x8_1) & 1) {
@@ -432,10 +439,14 @@ static void filter_selectively_horiz(uint8_t *s, int pitch,
count = 1;
if (mask & 1) {
if (mask_16x16 & 1) {
- // If (mask_16x16 & 1) is 1, then (mask_16x16 & 3) is 3.
- vp9_mb_lpf_horizontal_edge_w(s, pitch, lfi->mblim, lfi->lim,
- lfi->hev_thr, 2);
- count = 2;
+ if ((mask_16x16 & 3) == 3) {
+ vp9_mb_lpf_horizontal_edge_w(s, pitch, lfi->mblim, lfi->lim,
+ lfi->hev_thr, 2);
+ count = 2;
+ } else {
+ vp9_mb_lpf_horizontal_edge_w(s, pitch, lfi->mblim, lfi->lim,
+ lfi->hev_thr, 1);
+ }
} else if (mask_8x8 & 1) {
if ((mask_8x8 & 3) == 3) {
// Next block's thresholds