summaryrefslogtreecommitdiff
path: root/vp8/decoder
diff options
context:
space:
mode:
authorYaowu Xu <yaowu@google.com>2011-11-30 16:36:46 -0800
committerYaowu Xu <yaowu@google.com>2011-12-02 14:43:33 -0800
commitacf5d20ce5811ff8b6eb561f09c5751b25539fb8 (patch)
tree4020b7c7722e58eec1f43f05d8dd1fc4dfb7c165 /vp8/decoder
parenta8fbab8697c77dc82013862e0a9c7f82b6402db8 (diff)
downloadlibvpx-acf5d20ce5811ff8b6eb561f09c5751b25539fb8.tar
libvpx-acf5d20ce5811ff8b6eb561f09c5751b25539fb8.tar.gz
libvpx-acf5d20ce5811ff8b6eb561f09c5751b25539fb8.tar.bz2
libvpx-acf5d20ce5811ff8b6eb561f09c5751b25539fb8.zip
added separate entropy context for alt_ref
This commit added code to keep track of separate entropy contexts for normal frames and alt ref frames. The underly assumption was that the two type of frames have different entropy characteristics given they typically have quite different quantization levels. By keeping entropy contexts separate, it helps the entropy context distribution to be more closely adapted to each frame type. Tests on derf set showed a good and very consistent gain on all clips on all metrics, avg psnr: 0.89%, overall psnr: 0.84% and ssim 0.93%. http://www.corp.google.com/~yaowu/no_crawl/mulcontext.html Change-Id: I15bc9697f6ff7829042911fe0c62930585d7e65d
Diffstat (limited to 'vp8/decoder')
-rw-r--r--vp8/decoder/decodemv.c2
-rw-r--r--vp8/decoder/decodframe.c25
-rw-r--r--vp8/decoder/onyxd_if.c18
3 files changed, 40 insertions, 5 deletions
diff --git a/vp8/decoder/decodemv.c b/vp8/decoder/decodemv.c
index 68044f4d5..7e3137fd2 100644
--- a/vp8/decoder/decodemv.c
+++ b/vp8/decoder/decodemv.c
@@ -854,4 +854,4 @@ void vp8_decode_mode_mvs(VP8D_COMP *pbi)
#endif
-}
+} \ No newline at end of file
diff --git a/vp8/decoder/decodframe.c b/vp8/decoder/decodframe.c
index 5e8925286..f3da2d0b5 100644
--- a/vp8/decoder/decodframe.c
+++ b/vp8/decoder/decodframe.c
@@ -830,9 +830,16 @@ static void init_frame(VP8D_COMP *pbi)
*/
pc->ref_frame_sign_bias[GOLDEN_FRAME] = 0;
pc->ref_frame_sign_bias[ALTREF_FRAME] = 0;
+
+#if CONFIG_MULCONTEXT
+ vpx_memcpy(&pc->lfc, &pc->fc, sizeof(pc->fc));
+ vpx_memcpy(&pc->lfc_a, &pc->fc, sizeof(pc->fc));
+#endif
+
}
else
{
+
if (!pc->use_bilinear_mc_filter)
pc->mcomp_filter_type = SIXTAP;
else
@@ -1206,6 +1213,13 @@ int vp8_decode_frame(VP8D_COMP *pbi)
pc->refresh_alt_ref_frame = 0;
#endif
+#if CONFIG_MULCONTEXT
+ if(pc->refresh_alt_ref_frame)
+ vpx_memcpy(&pc->fc, &pc->lfc_a, sizeof(pc->fc));
+ else
+ vpx_memcpy(&pc->fc, &pc->lfc, sizeof(pc->fc));
+#endif
+
/* Buffer to buffer copy flags. */
pc->copy_buffer_to_gf = 0;
@@ -1391,12 +1405,21 @@ int vp8_decode_frame(VP8D_COMP *pbi)
{
pc->last_kf_gf_q = pc->base_qindex;
}
-
+#if CONFIG_MULCONTEXT
+ if(pc->refresh_entropy_probs)
+ {
+ if(pc->refresh_alt_ref_frame)
+ vpx_memcpy(&pc->lfc_a, &pc->fc, sizeof(pc->fc));
+ else
+ vpx_memcpy(&pc->lfc, &pc->fc, sizeof(pc->fc));
+ }
+#else
if (pc->refresh_entropy_probs == 0)
{
vpx_memcpy(&pc->fc, &pc->lfc, sizeof(pc->fc));
pbi->independent_partitions = prev_independent_partitions;
}
+#endif
#ifdef PACKET_TESTING
{
diff --git a/vp8/decoder/onyxd_if.c b/vp8/decoder/onyxd_if.c
index a45d692d0..7862cbf90 100644
--- a/vp8/decoder/onyxd_if.c
+++ b/vp8/decoder/onyxd_if.c
@@ -80,6 +80,7 @@ void vp8_recon_write_yuv_frame(char *name, YV12_BUFFER_CONFIG *s)
fclose(yuv_file);
}
#endif
+//#define WRITE_RECON_BUFFER 1
#if WRITE_RECON_BUFFER
void write_dx_frame_to_file(YV12_BUFFER_CONFIG *frame, int this_frame)
{
@@ -93,21 +94,24 @@ void write_dx_frame_to_file(YV12_BUFFER_CONFIG *frame, int this_frame)
yframe = fopen(filename, "wb");
for (i = 0; i < frame->y_height; i++)
- fwrite(frame->y_buffer + i * frame->y_stride, frame->y_width, 1, yframe);
+ fwrite(frame->y_buffer + i * frame->y_stride,
+ frame->y_width, 1, yframe);
fclose(yframe);
sprintf(filename, "dx\\u%04d.raw", this_frame);
yframe = fopen(filename, "wb");
for (i = 0; i < frame->uv_height; i++)
- fwrite(frame->u_buffer + i * frame->uv_stride, frame->uv_width, 1, yframe);
+ fwrite(frame->u_buffer + i * frame->uv_stride,
+ frame->uv_width, 1, yframe);
fclose(yframe);
sprintf(filename, "dx\\v%04d.raw", this_frame);
yframe = fopen(filename, "wb");
for (i = 0; i < frame->uv_height; i++)
- fwrite(frame->v_buffer + i * frame->uv_stride, frame->uv_width, 1, yframe);
+ fwrite(frame->v_buffer + i * frame->uv_stride,
+ frame->uv_width, 1, yframe);
fclose(yframe);
}
@@ -579,9 +583,17 @@ int vp8dx_receive_compressed_data(VP8D_PTR ptr, unsigned long size, const unsign
#if WRITE_RECON_BUFFER
if(cm->show_frame)
+<<<<<<< HEAD
write_dx_frame_to_file(cm->frame_to_show, cm->current_video_frame);
else
write_dx_frame_to_file(cm->frame_to_show, cm->current_video_frame+1000);
+=======
+ write_dx_frame_to_file(cm->frame_to_show,
+ cm->current_video_frame);
+ else
+ write_dx_frame_to_file(cm->frame_to_show,
+ cm->current_video_frame+1000);
+>>>>>>> added separate entropy context for alt_ref
#endif
if(cm->filter_level)