summaryrefslogtreecommitdiff
path: root/vp9/common
diff options
context:
space:
mode:
authorYunqing Wang <yunqingwang@google.com>2013-11-27 14:10:57 -0800
committerYunqing Wang <yunqingwang@google.com>2013-11-27 14:10:57 -0800
commit8f05e70340533b9922be5b1c97c37e50607fd862 (patch)
treec82331daaf329af1309a7a9807983ffe46df96ce /vp9/common
parenta622ed554f7072268e4c8d0b8f26d2e8865c2b3b (diff)
downloadlibvpx-8f05e70340533b9922be5b1c97c37e50607fd862.tar
libvpx-8f05e70340533b9922be5b1c97c37e50607fd862.tar.gz
libvpx-8f05e70340533b9922be5b1c97c37e50607fd862.tar.bz2
libvpx-8f05e70340533b9922be5b1c97c37e50607fd862.zip
Simplify mask checking in loop filters
Considering a horizontal edge, if mask_16x16 is 1 for an even- indexed 8x8 block, then mask_16x16 is 1 for next 8x8 block in same row. Similiar to a verticle edge, if mask_16x16 is 1 for an even-rowed 8x8 block, then mask_16x16 is 1 for the 8x8 block right below it in next raw. Based on that, the mask_16x16 checking can be simplified to save cycles. The corresponding 8-pixel vp9_mb_lpf_horizontal_edge code can also be removed. Change-Id: Ic3fe7a5674322239208cbe2731dc3216ce2084f3
Diffstat (limited to 'vp9/common')
-rw-r--r--vp9/common/vp9_loopfilter.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/vp9/common/vp9_loopfilter.c b/vp9/common/vp9_loopfilter.c
index 85dd7d8f0..ff2bc45e4 100644
--- a/vp9/common/vp9_loopfilter.c
+++ b/vp9/common/vp9_loopfilter.c
@@ -353,19 +353,10 @@ 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 | mask_16x16_1) & 1) {
- // TODO(yunqingwang): if (mask_16x16_0 & 1), then (mask_16x16_0 & 1)
- // is always 1. Same is true for horizontal lf.
- 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_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_8x8_0 | mask_8x8_1) & 1) {
@@ -441,14 +432,10 @@ static void filter_selectively_horiz(uint8_t *s, int pitch,
count = 1;
if (mask & 1) {
if (mask_16x16 & 1) {
- 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);
- }
+ // 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;
} else if (mask_8x8 & 1) {
if ((mask_8x8 & 3) == 3) {
// Next block's thresholds