Merge "remove unused temporal preproc code"
authorJohn Koleszar <jkoleszar@google.com>
Mon, 13 Dec 2010 21:57:59 +0000 (13:57 -0800)
committerCode Review <code-review@webmproject.org>
Mon, 13 Dec 2010 21:57:59 +0000 (13:57 -0800)
vp8/encoder/ethreading.c
vpxenc.c [changed mode: 0644->0755]

index 3646375..3c768b2 100644 (file)
@@ -132,6 +132,7 @@ THREAD_FUNCTION thread_encoding_proc(void *p_data)
                         else
                             xd->mode_info_context->mbmi.segment_id = 0;         // Set to Segment 0 by default
 
+                        x->active_ptr = cpi->active_map + seg_map_index + mb_col;
 
                         if (cm->frame_type == KEY_FRAME)
                         {
@@ -163,8 +164,28 @@ THREAD_FUNCTION thread_encoding_proc(void *p_data)
                             if ((xd->mode_info_context->mbmi.mode == ZEROMV) && (xd->mode_info_context->mbmi.ref_frame == LAST_FRAME))
                                 cpi->inter_zz_count ++;
 
-                        }
+                            // Special case code for cyclic refresh
+                            // If cyclic update enabled then copy xd->mbmi.segment_id; (which may have been updated based on mode
+                            // during vp8cx_encode_inter_macroblock()) back into the global sgmentation map
+                            if (cpi->cyclic_refresh_mode_enabled && xd->segmentation_enabled)
+                            {
+                                cpi->segmentation_map[seg_map_index+mb_col] = xd->mode_info_context->mbmi.segment_id;
+
+                                // If the block has been refreshed mark it as clean (the magnitude of the -ve influences how long it will be before we consider another refresh):
+                                // Else if it was coded (last frame 0,0) and has not already been refreshed then mark it as a candidate for cleanup next time (marked 0)
+                                // else mark it as dirty (1).
+                                if (xd->mode_info_context->mbmi.segment_id)
+                                    cpi->cyclic_refresh_map[seg_map_index+mb_col] = -1;
+                                else if ((xd->mode_info_context->mbmi.mode == ZEROMV) && (xd->mode_info_context->mbmi.ref_frame == LAST_FRAME))
+                                {
+                                    if (cpi->cyclic_refresh_map[seg_map_index+mb_col] == 1)
+                                        cpi->cyclic_refresh_map[seg_map_index+mb_col] = 0;
+                                }
+                                else
+                                    cpi->cyclic_refresh_map[seg_map_index+mb_col] = 1;
 
+                            }
+                        }
                         cpi->tplist[mb_row].stop = *tp;
 
                         x->gf_active_ptr++;      // Increment pointer into gf useage flags structure for next mb
old mode 100644 (file)
new mode 100755 (executable)
index 0ae391f..4baeefc
--- a/vpxenc.c
+++ b/vpxenc.c
@@ -347,12 +347,12 @@ unsigned int file_is_ivf(FILE *infile,
                          unsigned int *fourcc,
                          unsigned int *width,
                          unsigned int *height,
-                         char          detect[4])
+                         struct detect_buffer *detect)
 {
     char raw_hdr[IVF_FILE_HDR_SZ];
     int is_ivf = 0;
 
-    if(memcmp(detect, "DKIF", 4) != 0)
+    if(memcmp(detect->buf, "DKIF", 4) != 0)
         return 0;
 
     /* See write_ivf_file_header() for more documentation on the file header
@@ -376,6 +376,7 @@ unsigned int file_is_ivf(FILE *infile,
     {
         *width = mem_get_le16(raw_hdr + 12);
         *height = mem_get_le16(raw_hdr + 14);
+        detect->position = 4;
     }
 
     return is_ivf;
@@ -1390,7 +1391,7 @@ int main(int argc, const char **argv_)
             }
         }
         else if (detect.buf_read == 4 &&
-                 file_is_ivf(infile, &fourcc, &cfg.g_w, &cfg.g_h, detect.buf))
+                 file_is_ivf(infile, &fourcc, &cfg.g_w, &cfg.g_h, &detect))
         {
             file_type = FILE_TYPE_IVF;
             switch (fourcc)