shithub: libvpx

Download patch

ref: 86394d2636a6f5540ad8557ec46092ac8da94a6e
parent: e27bcc2451855d08bf2b86028de9e090ee513929
author: Minghai Shang <minghai@google.com>
date: Fri Mar 28 07:42:26 EDT 2014

[svc] Fix SvcTest.SecondPassEncode failure

Root cause is the different default register length between x86
and x64 platform. Change spatial_layer_id to long long.

Change-Id: If1a5972365c7a59f7e76cb4fd714610f3d48a8ff

--- a/test/test-data.sha1
+++ b/test/test-data.sha1
@@ -1,5 +1,5 @@
 d5dfb0151c9051f8c85999255645d7a23916d3c0  hantro_collage_w352h288.yuv
-2752863aa6330a93eaeb30f883310f87aa3de87c  hantro_collage_w352h288.stat
+998cec53307c94aa5835aaf8d5731f6a3c7c2e5a  hantro_collage_w352h288.stat
 b87815bf86020c592ccc7a846ba2e28ec8043902  hantro_odd.yuv
 b1f1c3ec79114b9a0651af24ce634afb44a9a419  rush_hour_444.y4m
 5184c46ddca8b1fadd16742e8500115bc8f749da  vp80-00-comprehensive-001.ivf
--- a/vp9/encoder/vp9_firstpass.h
+++ b/vp9/encoder/vp9_firstpass.h
@@ -35,7 +35,7 @@
   double new_mv_count;
   double duration;
   double count;
-  int spatial_layer_id;
+  int64_t spatial_layer_id;
 } FIRSTPASS_STATS;
 
 struct twopass_rc {
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -1767,7 +1767,7 @@
       for (i = 0; i < oxcf->ss_number_layers; ++i) {
         FIRSTPASS_STATS *const last_packet_for_layer =
             &stats[packets - oxcf->ss_number_layers + i];
-        const int layer_id = last_packet_for_layer->spatial_layer_id;
+        const int layer_id = (int)last_packet_for_layer->spatial_layer_id;
         const int packets_in_layer = (int)last_packet_for_layer->count + 1;
         if (layer_id >= 0 && layer_id < oxcf->ss_number_layers) {
           LAYER_CONTEXT *const lc = &cpi->svc.layer_context[layer_id];
@@ -1786,7 +1786,7 @@
       }
 
       for (i = 0; i < packets; ++i) {
-        const int layer_id = stats[i].spatial_layer_id;
+        const int layer_id = (int)stats[i].spatial_layer_id;
         if (layer_id >= 0 && layer_id < oxcf->ss_number_layers
             && stats_copy[layer_id] != NULL) {
           *stats_copy[layer_id] = stats[i];
--- a/vp9/vp9_cx_iface.c
+++ b/vp9/vp9_cx_iface.c
@@ -227,7 +227,7 @@
 
       stats = cfg->rc_twopass_stats_in.buf;
       for (i = 0; i < n_packets; ++i) {
-        const int layer_id = stats[i].spatial_layer_id;
+        const int layer_id = (int)stats[i].spatial_layer_id;
         if (layer_id >= 0 && layer_id < (int)cfg->ss_number_layers) {
           ++n_packets_per_layer[layer_id];
         }
@@ -242,7 +242,7 @@
 
         stats = (const FIRSTPASS_STATS *)cfg->rc_twopass_stats_in.buf +
                 n_packets - cfg->ss_number_layers + i;
-        layer_id = stats->spatial_layer_id;
+        layer_id = (int)stats->spatial_layer_id;
 
         if (layer_id >= cfg->ss_number_layers
             ||(int)(stats->count + 0.5) != n_packets_per_layer[layer_id] - 1)