shithub: libvpx

Download patch

ref: 01483677e567dcb58077540449de7999ec05ffcb
parent: e9b8810b4d5c1db78ef07b6061b05d2d62d55eb6
author: James Zern <jzern@google.com>
date: Thu Dec 26 08:15:56 EST 2013

add vp9_loop_filter_data_reset

Change-Id: I8a9c9019242ec10fa499a78db322221bf96a0275

--- a/vp9/common/vp9_loopfilter.c
+++ b/vp9/common/vp9_loopfilter.c
@@ -1625,6 +1625,17 @@
                        y_only);
 }
 
+void vp9_loop_filter_data_reset(
+    LFWorkerData *lf_data, YV12_BUFFER_CONFIG *frame_buffer,
+    struct VP9Common *cm, const struct macroblockd_plane planes[MAX_MB_PLANE]) {
+  lf_data->frame_buffer = frame_buffer;
+  lf_data->cm = cm;
+  lf_data->start = 0;
+  lf_data->stop = 0;
+  lf_data->y_only = 0;
+  vpx_memcpy(lf_data->planes, planes, sizeof(lf_data->planes));
+}
+
 int vp9_loop_filter_worker(LFWorkerData *const lf_data, void *unused) {
   (void)unused;
   vp9_loop_filter_rows(lf_data->frame_buffer, lf_data->cm, lf_data->planes,
--- a/vp9/common/vp9_loopfilter.h
+++ b/vp9/common/vp9_loopfilter.h
@@ -126,6 +126,10 @@
   int y_only;
 } LFWorkerData;
 
+void vp9_loop_filter_data_reset(
+    LFWorkerData *lf_data, YV12_BUFFER_CONFIG *frame_buffer,
+    struct VP9Common *cm, const struct macroblockd_plane planes[MAX_MB_PLANE]);
+
 // Operates on the rows described by 'lf_data'.
 int vp9_loop_filter_worker(LFWorkerData *const lf_data, void *unused);
 #ifdef __cplusplus
--- a/vp9/decoder/vp9_decodeframe.c
+++ b/vp9/decoder/vp9_decodeframe.c
@@ -902,11 +902,8 @@
     LFWorkerData *const lf_data = (LFWorkerData*)pbi->lf_worker.data1;
     // Be sure to sync as we might be resuming after a failed frame decode.
     winterface->sync(&pbi->lf_worker);
-    lf_data->frame_buffer = get_frame_new_buffer(cm);
-    lf_data->cm = cm;
-    vp9_copy(lf_data->planes, pbi->mb.plane);
-    lf_data->stop = 0;
-    lf_data->y_only = 0;
+    vp9_loop_filter_data_reset(lf_data, get_frame_new_buffer(cm), cm,
+                               pbi->mb.plane);
     vp9_loop_filter_frame_init(cm, cm->lf.filter_level);
   }
 
--- a/vp9/decoder/vp9_dthread.c
+++ b/vp9/decoder/vp9_dthread.c
@@ -174,9 +174,7 @@
     worker->data2 = lf_data;
 
     // Loopfilter data
-    lf_data->frame_buffer = frame;
-    lf_data->cm = cm;
-    vpx_memcpy(lf_data->planes, planes, sizeof(lf_data->planes));
+    vp9_loop_filter_data_reset(lf_data, frame, cm, planes);
     lf_data->start = i;
     lf_data->stop = sb_rows;
     lf_data->y_only = y_only;