summaryrefslogtreecommitdiff
path: root/vp8/common/entropymode.c
diff options
context:
space:
mode:
authorYaowu Xu <yaowu@google.com>2011-12-08 11:43:09 -0800
committerYaowu Xu <yaowu@google.com>2011-12-09 14:44:13 -0800
commitbe360d47f412424e1bf1d645860ccabdad2f3343 (patch)
tree5a4d41b8449ffe2770417ce9adc3a4de3da2cccb /vp8/common/entropymode.c
parent43a059de71e73e4eefd620d684f50c8a4c7a5e1d (diff)
downloadlibvpx-be360d47f412424e1bf1d645860ccabdad2f3343.tar
libvpx-be360d47f412424e1bf1d645860ccabdad2f3343.tar.gz
libvpx-be360d47f412424e1bf1d645860ccabdad2f3343.tar.bz2
libvpx-be360d47f412424e1bf1d645860ccabdad2f3343.zip
Enabled adaptive UV intra coding for inter frames
Previously, Y-adaptive UV intra coding only enabled on key frames in UVINTRA experiment. This commit enabled the same coding for inter frames, so the encoding of UV intra modes are consistent cross all frame types. Tests on derf set showed a very small overall gain around .04%: http://www.corp.google.com/~yaowu/no_crawl/interUVintra.html The gain looks to be reasonable given inta coded MBs is only a small portion of MBs in inter frames. Change-Id: Ic6fc261923f2c253f4a0c9f8bccf4797557b9e16
Diffstat (limited to 'vp8/common/entropymode.c')
-rw-r--r--vp8/common/entropymode.c46
1 files changed, 24 insertions, 22 deletions
diff --git a/vp8/common/entropymode.c b/vp8/common/entropymode.c
index a83c1d4bb..6d0f562c1 100644
--- a/vp8/common/entropymode.c
+++ b/vp8/common/entropymode.c
@@ -28,38 +28,35 @@ const unsigned int kf_y_mode_cts[8][VP8_YMODES] =
{99, 42, 43, 21, 12, 39},
};
#else
-static const unsigned int kf_y_mode_cts[VP8_YMODES] = { 49, 22, 23, 11, 23, 128};
+static const unsigned int kf_y_mode_cts[VP8_YMODES] = {
+ 49, 22, 23, 11, 23, 128};
#endif
-/* TODO: calibrate the baseline distribution */
-static const unsigned int y_mode_cts [VP8_YMODES] = { 8080, 1908, 1582, 1007, 2000, 5874};
+
+static const unsigned int y_mode_cts [VP8_YMODES] = {
+ 106, 25, 21, 13, 16, 74};
#if CONFIG_UVINTRA
-static const unsigned int uv_mode_cts [VP8_UV_MODES] ={ 162, 41, 41, 12};
-/*
static const unsigned int uv_mode_cts [VP8_YMODES] [VP8_UV_MODES] ={
- { 180, 35, 35, 6},
- { 152, 76, 20, 8},
- { 152, 20, 76, 8},
- { 172, 36, 36, 12},
- { 162, 41, 41, 12},
- { 162, 41, 41, 12},
+ { 210, 20, 20, 6},
+ { 180, 60, 10, 6},
+ { 150, 20, 80, 6},
+ { 170, 35, 35, 16},
+ { 142, 51, 45, 18}, /* never used */
+ { 160, 40, 46, 10},
};
-*/
#else
static const unsigned int uv_mode_cts [VP8_UV_MODES] = { 59483, 13605, 16492, 4230};
#endif
-
static const unsigned int i8x8_mode_cts [VP8_UV_MODES] = {93, 69, 81, 13};
-
#if CONFIG_UVINTRA
static const unsigned int kf_uv_mode_cts [VP8_YMODES] [VP8_UV_MODES] ={
{ 180, 34, 34, 8},
{ 132, 74, 40, 10},
{ 132, 40, 74, 10},
{ 152, 46, 40, 18},
- { 142, 51, 45, 18},
+ { 142, 51, 45, 18}, /* never used */
{ 142, 51, 45, 18},
};
#else
@@ -268,26 +265,31 @@ void vp8_init_mbmode_probs(VP8_COMMON *x)
256, 1
);
#endif
- vp8_tree_probs_from_distribution(
- VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree,
- x->fc.uv_mode_prob, bct, uv_mode_cts,
- 256, 1
- );
#if CONFIG_UVINTRA
{
int i;
for (i=0;i<VP8_YMODES;i++)
+ {
vp8_tree_probs_from_distribution(
VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree,
x->kf_uv_mode_prob[i], bct, kf_uv_mode_cts[i],
256, 1);
+ vp8_tree_probs_from_distribution(
+ VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree,
+ x->fc.uv_mode_prob[i], bct, uv_mode_cts[i],
+ 256, 1);
+ }
}
#else
vp8_tree_probs_from_distribution(
VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree,
+ x->fc.uv_mode_prob, bct, uv_mode_cts,
+ 256, 1);
+
+ vp8_tree_probs_from_distribution(
+ VP8_UV_MODES, vp8_uv_mode_encodings, vp8_uv_mode_tree,
x->kf_uv_mode_prob, bct, kf_uv_mode_cts,
- 256, 1
- );
+ 256, 1);
#endif
vp8_tree_probs_from_distribution(
VP8_UV_MODES, vp8_i8x8_mode_encodings, vp8_i8x8_mode_tree,