shithub: libvpx

Download patch

ref: c455919f03d13703a90eb356428abd6a7f3b3ceb
parent: 49f6ff11032df0d6696da8cf544d0292e185d00c
author: Jingning Han <[email protected]>
date: Thu Aug 20 05:51:08 EDT 2015

Replace MAX_REF_LF_DELTAS with MAX_REF_FRAMES

The macro MAX_REF_LF_DELTAS is repeatedly defined. Merge its use
cases with MAX_REF_FRAMES.

Change-Id: I71c4634fb5feae78ce6f9bf99074f45ed7f68b73

--- a/vp10/common/loopfilter.h
+++ b/vp10/common/loopfilter.h
@@ -26,7 +26,6 @@
 
 #define SIMD_WIDTH 16
 
-#define MAX_REF_LF_DELTAS       4
 #define MAX_MODE_LF_DELTAS      2
 
 enum lf_path {
@@ -45,8 +44,8 @@
   uint8_t mode_ref_delta_update;
 
   // 0 = Intra, Last, GF, ARF
-  signed char ref_deltas[MAX_REF_LF_DELTAS];
-  signed char last_ref_deltas[MAX_REF_LF_DELTAS];
+  signed char ref_deltas[MAX_REF_FRAMES];
+  signed char last_ref_deltas[MAX_REF_FRAMES];
 
   // 0 = ZERO_MV, MV
   signed char mode_deltas[MAX_MODE_LF_DELTAS];
--- a/vp10/decoder/decodeframe.c
+++ b/vp10/decoder/decodeframe.c
@@ -1112,7 +1112,7 @@
     if (lf->mode_ref_delta_update) {
       int i;
 
-      for (i = 0; i < MAX_REF_LF_DELTAS; i++)
+      for (i = 0; i < MAX_REF_FRAMES; i++)
         if (vpx_rb_read_bit(rb))
           lf->ref_deltas[i] = vpx_rb_read_signed_literal(rb, 6);
 
--- a/vp10/decoder/dthread.c
+++ b/vp10/decoder/dthread.c
@@ -177,7 +177,7 @@
          (MAX_LOOP_FILTER + 1) * sizeof(loop_filter_thresh));
   dst_cm->lf.last_sharpness_level = src_cm->lf.sharpness_level;
   dst_cm->lf.filter_level = src_cm->lf.filter_level;
-  memcpy(dst_cm->lf.ref_deltas, src_cm->lf.ref_deltas, MAX_REF_LF_DELTAS);
+  memcpy(dst_cm->lf.ref_deltas, src_cm->lf.ref_deltas, MAX_REF_FRAMES);
   memcpy(dst_cm->lf.mode_deltas, src_cm->lf.mode_deltas, MAX_MODE_LF_DELTAS);
   dst_cm->seg = src_cm->seg;
   memcpy(dst_cm->frame_contexts, src_cm->frame_contexts,
--- a/vp10/encoder/bitstream.c
+++ b/vp10/encoder/bitstream.c
@@ -707,7 +707,7 @@
   if (lf->mode_ref_delta_enabled) {
     vpx_wb_write_bit(wb, lf->mode_ref_delta_update);
     if (lf->mode_ref_delta_update) {
-      for (i = 0; i < MAX_REF_LF_DELTAS; i++) {
+      for (i = 0; i < MAX_REF_FRAMES; i++) {
         const int delta = lf->ref_deltas[i];
         const int changed = delta != lf->last_ref_deltas[i];
         vpx_wb_write_bit(wb, changed);
--- a/vp10/encoder/encoder.h
+++ b/vp10/encoder/encoder.h
@@ -61,7 +61,7 @@
   unsigned char *last_frame_seg_map_copy;
 
   // 0 = Intra, Last, GF, ARF
-  signed char last_ref_lf_deltas[MAX_REF_LF_DELTAS];
+  signed char last_ref_lf_deltas[MAX_REF_FRAMES];
   // 0 = ZERO_MV, MV
   signed char last_mode_lf_deltas[MAX_MODE_LF_DELTAS];