Expanding the coefficient encoding contexts
This patch expands the set of prev contexts used for video coding from 3 to 4. There is a small improvement of the order of 0.08% for derf and 0.15% on the HD set. The tests were rerun after the various merges last week. There are two columns in each test - the first are the results with the mbskip change, and the second with expanded contexts added on top of that. Derf: http://www.corp.google.com/~debargha/vp8_results/explibvpx_newentropy_expcontext.html HD: http://www.corp.google.com/~debargha/vp8_results/explibvpx_hd_newentropy_expcontext.html Rebased. Broke up 80 char lines. Change-Id: I82d2e72d054e530cbf5ce9aa0e6d85c582965675
This commit is contained in:
		@@ -803,6 +803,12 @@ static void read_coef_probs3(VP8D_COMP *pbi)
 | 
			
		||||
                for (j = !i; j < COEF_BANDS; j++)
 | 
			
		||||
                    for (k = 0; k < PREV_COEF_CONTEXTS; k++)
 | 
			
		||||
                    {
 | 
			
		||||
#if CONFIG_EXPANDED_COEF_CONTEXT
 | 
			
		||||
                        if (k >= 3 && ((i == 0 && j == 1) ||
 | 
			
		||||
                                       (i > 0 && j == 0)))
 | 
			
		||||
                            continue;
 | 
			
		||||
#endif
 | 
			
		||||
                        {
 | 
			
		||||
                        vp8_prob *const p = pc->fc.coef_probs [i][j][k] + l;
 | 
			
		||||
                        int u = vp8_read(bc, vp8_coef_update_probs [i][j][k][l]);
 | 
			
		||||
                        if (u)
 | 
			
		||||
@@ -810,6 +816,7 @@ static void read_coef_probs3(VP8D_COMP *pbi)
 | 
			
		||||
                            int delp = vp8_decode_term_subexp(bc, SUBEXP_PARAM, 255);
 | 
			
		||||
                            *p = (vp8_prob)inv_remap_prob(delp, *p);
 | 
			
		||||
                        }
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
@@ -824,6 +831,12 @@ static void read_coef_probs3(VP8D_COMP *pbi)
 | 
			
		||||
                    for (j = !i; j < COEF_BANDS; j++)
 | 
			
		||||
                        for (k = 0; k < PREV_COEF_CONTEXTS; k++)
 | 
			
		||||
                        {
 | 
			
		||||
#if CONFIG_EXPANDED_COEF_CONTEXT
 | 
			
		||||
                            if (k >= 3 && ((i == 0 && j == 1) ||
 | 
			
		||||
                                           (i > 0 && j == 0)))
 | 
			
		||||
                                continue;
 | 
			
		||||
#endif
 | 
			
		||||
                            {
 | 
			
		||||
                            vp8_prob *const p = pc->fc.coef_probs_8x8 [i][j][k] + l;
 | 
			
		||||
                            int u = vp8_read(bc, vp8_coef_update_probs_8x8 [i][j][k][l]);
 | 
			
		||||
                            if (u)
 | 
			
		||||
@@ -831,6 +844,7 @@ static void read_coef_probs3(VP8D_COMP *pbi)
 | 
			
		||||
                                int delp = vp8_decode_term_subexp(bc, SUBEXP_PARAM, 255);
 | 
			
		||||
                                *p = (vp8_prob)inv_remap_prob(delp, *p);
 | 
			
		||||
                            }
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
@@ -852,6 +866,12 @@ static void read_coef_probs2(VP8D_COMP *pbi)
 | 
			
		||||
                for (j = !i; j < COEF_BANDS; j++)
 | 
			
		||||
                    for (k = 0; k < PREV_COEF_CONTEXTS; k++)
 | 
			
		||||
                    {
 | 
			
		||||
#if CONFIG_EXPANDED_COEF_CONTEXT
 | 
			
		||||
                        if (k >= 3 && ((i == 0 && j == 1) ||
 | 
			
		||||
                                       (i > 0 && j == 0)))
 | 
			
		||||
                            continue;
 | 
			
		||||
#endif
 | 
			
		||||
                        {
 | 
			
		||||
                        vp8_prob *const p = pc->fc.coef_probs [i][j][k] + l;
 | 
			
		||||
                        int u = vp8_read(bc, vp8_coef_update_probs [i][j][k][l]);
 | 
			
		||||
                        if (u)
 | 
			
		||||
@@ -859,6 +879,7 @@ static void read_coef_probs2(VP8D_COMP *pbi)
 | 
			
		||||
                            int delp = vp8_decode_term_subexp(bc, SUBEXP_PARAM, 255);
 | 
			
		||||
                            *p = (vp8_prob)inv_remap_prob(delp, *p);
 | 
			
		||||
                        }
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
@@ -872,6 +893,12 @@ static void read_coef_probs2(VP8D_COMP *pbi)
 | 
			
		||||
                    for (j = !i; j < COEF_BANDS; j++)
 | 
			
		||||
                        for (k = 0; k < PREV_COEF_CONTEXTS; k++)
 | 
			
		||||
                        {
 | 
			
		||||
#if CONFIG_EXPANDED_COEF_CONTEXT
 | 
			
		||||
                            if (k >= 3 && ((i == 0 && j == 1) ||
 | 
			
		||||
                                           (i > 0 && j == 0)))
 | 
			
		||||
                                continue;
 | 
			
		||||
#endif
 | 
			
		||||
                            {
 | 
			
		||||
                            vp8_prob *const p = pc->fc.coef_probs_8x8 [i][j][k] + l;
 | 
			
		||||
 | 
			
		||||
                            int u = vp8_read(bc, vp8_coef_update_probs_8x8 [i][j][k][l]);
 | 
			
		||||
@@ -880,6 +907,7 @@ static void read_coef_probs2(VP8D_COMP *pbi)
 | 
			
		||||
                                int delp = vp8_decode_term_subexp(bc, SUBEXP_PARAM, 255);
 | 
			
		||||
                                *p = (vp8_prob)inv_remap_prob(delp, *p);
 | 
			
		||||
                            }
 | 
			
		||||
                            }
 | 
			
		||||
                        }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
@@ -904,6 +932,12 @@ static void read_coef_probs(VP8D_COMP *pbi)
 | 
			
		||||
            for (j = 0; j < COEF_BANDS; j++)
 | 
			
		||||
#endif
 | 
			
		||||
                for (k = 0; k < PREV_COEF_CONTEXTS; k++)
 | 
			
		||||
                {
 | 
			
		||||
#if CONFIG_EXPANDED_COEF_CONTEXT
 | 
			
		||||
                    if (k >= 3 && ((i == 0 && j == 1) ||
 | 
			
		||||
                                   (i > 0 && j == 0)))
 | 
			
		||||
                        continue;
 | 
			
		||||
#endif
 | 
			
		||||
                    for (l = 0; l < ENTROPY_NODES; l++)
 | 
			
		||||
                    {
 | 
			
		||||
                        vp8_prob *const p = pc->fc.coef_probs [i][j][k] + l;
 | 
			
		||||
@@ -920,6 +954,7 @@ static void read_coef_probs(VP8D_COMP *pbi)
 | 
			
		||||
#endif
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -933,6 +968,12 @@ static void read_coef_probs(VP8D_COMP *pbi)
 | 
			
		||||
            for (j = 0; j < COEF_BANDS; j++)
 | 
			
		||||
#endif
 | 
			
		||||
                for (k = 0; k < PREV_COEF_CONTEXTS; k++)
 | 
			
		||||
                {
 | 
			
		||||
#if CONFIG_EXPANDED_COEF_CONTEXT
 | 
			
		||||
                    if (k >= 3 && ((i == 0 && j == 1) ||
 | 
			
		||||
                                   (i > 0 && j == 0)))
 | 
			
		||||
                        continue;
 | 
			
		||||
#endif
 | 
			
		||||
                    for (l = 0; l < ENTROPY_NODES; l++)
 | 
			
		||||
                    {
 | 
			
		||||
 | 
			
		||||
@@ -948,6 +989,7 @@ static void read_coef_probs(VP8D_COMP *pbi)
 | 
			
		||||
#endif
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -1390,7 +1432,6 @@ int vp8_decode_frame(VP8D_COMP *pbi)
 | 
			
		||||
    read_coef_probs(pbi);
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    vpx_memcpy(&xd->pre, &pc->yv12_fb[pc->lst_fb_idx], sizeof(YV12_BUFFER_CONFIG));
 | 
			
		||||
    vpx_memcpy(&xd->dst, &pc->yv12_fb[pc->new_fb_idx], sizeof(YV12_BUFFER_CONFIG));
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user