]> granicus.if.org Git - libvpx/commitdiff
Changed setup intra recon to be row based
authorScott LaVarnway <slavarnway@google.com>
Thu, 13 Sep 2012 18:51:27 +0000 (11:51 -0700)
committerScott LaVarnway <slavarnway@google.com>
Thu, 13 Sep 2012 18:51:27 +0000 (11:51 -0700)
Initialize the top line at the beginning of each frame and
the left column at the beginning of each row.

Change-Id: I5412f7ea49ffc490215cf65a62715a6c5e3a5a29

vp8/common/setupintrarecon.c
vp8/common/setupintrarecon.h
vp8/decoder/decodframe.c
vp8/decoder/threading.c

index 7976e252b132d6076809eb6045a97693d02220c3..60afe519f565df5bf757adc9b645edbb7afcd287 100644 (file)
@@ -30,3 +30,10 @@ void vp8_setup_intra_recon(YV12_BUFFER_CONFIG *ybf)
         ybf->v_buffer[ybf->uv_stride *i - 1] = (unsigned char) 129;
 
 }
+
+void vp8_setup_intra_recon_top_line(YV12_BUFFER_CONFIG *ybf)
+{
+    vpx_memset(ybf->y_buffer - 1 - ybf->y_stride, 127, ybf->y_width + 5);
+    vpx_memset(ybf->u_buffer - 1 - ybf->uv_stride, 127, ybf->uv_width + 5);
+    vpx_memset(ybf->v_buffer - 1 - ybf->uv_stride, 127, ybf->uv_width + 5);
+}
index 5264fd04b26fbb99117e4cb2f7b0d43d145d4b70..e515c3a005b0a4d43e10b634ffd6dbe6350b9c58 100644 (file)
 
 #include "vpx_scale/yv12config.h"
 extern void vp8_setup_intra_recon(YV12_BUFFER_CONFIG *ybf);
+extern void vp8_setup_intra_recon_top_line(YV12_BUFFER_CONFIG *ybf);
+
+static
+void setup_intra_recon_left(unsigned char *y_buffer,
+                            unsigned char *u_buffer,
+                            unsigned char *v_buffer,
+                            int y_stride,
+                            int uv_stride)
+{
+    int i;
+
+    for (i = 0; i < 16; i++)
+        y_buffer[y_stride *i] = (unsigned char) 129;
+
+    for (i = 0; i < 8; i++)
+        u_buffer[uv_stride *i] = (unsigned char) 129;
+
+    for (i = 0; i < 8; i++)
+        v_buffer[uv_stride *i] = (unsigned char) 129;
+}
index ea8798f477dd1c99172eea90710cee50a1a65417..03a6759ac578da1eca41d4a0cab563d779651c7c 100644 (file)
@@ -553,6 +553,8 @@ static void decode_mb_rows(VP8D_COMP *pbi)
     if(pc->filter_level)
         vp8_loop_filter_frame_init(pc, xd, pc->filter_level);
 
+    vp8_setup_intra_recon_top_line(&pc->yv12_fb[dst_fb_idx]);
+
     /* Decode the individual macro block */
     for (mb_row = 0; mb_row < pc->mb_rows; mb_row++)
     {
@@ -593,6 +595,10 @@ static void decode_mb_rows(VP8D_COMP *pbi)
         xd->recon_left_stride[0] = xd->dst.y_stride;
         xd->recon_left_stride[1] = xd->dst.uv_stride;
 
+        setup_intra_recon_left(xd->recon_left[0], xd->recon_left[1],
+                               xd->recon_left[2], xd->dst.y_stride,
+                               xd->dst.uv_stride);
+
         for (mb_col = 0; mb_col < pc->mb_cols; mb_col++)
         {
             /* Distance of Mb to the various image edges.
@@ -1383,14 +1389,6 @@ int vp8_decode_frame(VP8D_COMP *pbi)
                     }
     }
 
-
-    /* set up frame new frame for intra coded blocks */
-#if CONFIG_MULTITHREAD
-    if (!(pbi->b_multithreaded_rd) || pc->multi_token_partition == ONE_PARTITION || !(pc->filter_level))
-#endif
-        vp8_setup_intra_recon(&pc->yv12_fb[pc->new_fb_idx]);
-
-
     /* clear out the coeff buffer */
     vpx_memset(xd->qcoeff, 0, sizeof(xd->qcoeff));
 
index dce1e4cd6d63d8889614aa5ca2479beb673e0229..de14789cbd50c64a664066bced0024c25560d53d 100644 (file)
@@ -24,6 +24,7 @@
 #include "detokenize.h"
 #include "vp8/common/reconintra4x4.h"
 #include "vp8/common/reconinter.h"
+#include "vp8/common/setupintrarecon.h"
 #if CONFIG_ERROR_CONCEALMENT
 #include "error_concealment.h"
 #endif
@@ -399,6 +400,10 @@ static void mt_decode_mb_rows(VP8D_COMP *pbi, MACROBLOCKD *xd, int start_mb_row)
           /* TODO: move to outside row loop */
           xd->recon_left_stride[0] = xd->dst.y_stride;
           xd->recon_left_stride[1] = xd->dst.uv_stride;
+
+          setup_intra_recon_left(xd->recon_left[0], xd->recon_left[1],
+                                 xd->recon_left[2], xd->dst.y_stride,
+                                 xd->dst.uv_stride);
        }
 
        for (mb_col = 0; mb_col < pc->mb_cols; mb_col++)
@@ -873,9 +878,9 @@ void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd)
     if (filter_level)
     {
         /* Set above_row buffer to 127 for decoding first MB row */
-        vpx_memset(pbi->mt_yabove_row[0] + VP8BORDERINPIXELS-1, 127, pc->yv12_fb[pc->lst_fb_idx].y_width + 5);
-        vpx_memset(pbi->mt_uabove_row[0] + (VP8BORDERINPIXELS>>1)-1, 127, (pc->yv12_fb[pc->lst_fb_idx].y_width>>1) +5);
-        vpx_memset(pbi->mt_vabove_row[0] + (VP8BORDERINPIXELS>>1)-1, 127, (pc->yv12_fb[pc->lst_fb_idx].y_width>>1) +5);
+        vpx_memset(pbi->mt_yabove_row[0] + VP8BORDERINPIXELS-1, 127, pc->yv12_fb[pc->new_fb_idx].y_width + 5);
+        vpx_memset(pbi->mt_uabove_row[0] + (VP8BORDERINPIXELS>>1)-1, 127, (pc->yv12_fb[pc->new_fb_idx].y_width>>1) +5);
+        vpx_memset(pbi->mt_vabove_row[0] + (VP8BORDERINPIXELS>>1)-1, 127, (pc->yv12_fb[pc->new_fb_idx].y_width>>1) +5);
 
         for (j=1; j<pc->mb_rows; j++)
         {
@@ -895,6 +900,8 @@ void vp8mt_decode_mb_rows( VP8D_COMP *pbi, MACROBLOCKD *xd)
         /* Initialize the loop filter for this frame. */
         vp8_loop_filter_frame_init(pc, &pbi->mb, filter_level);
     }
+    else
+        vp8_setup_intra_recon_top_line(&pc->yv12_fb[pc->new_fb_idx]);
 
     setup_decoding_thread_data(pbi, xd, pbi->mb_row_di, pbi->decoding_thread_count);