[spatial svc]Implement alt reference frames
All changes are for spatial svc only.
1. Enable encoding hidden frames in each layer and use alt reference idex to reference the hidden frame in each layer
2. Use golden reference idx for spatial reference
3. For those layers that don't have hidden frames (caused by lack of frame buffers), reference a hidden frame in lower layers
4. Add "auto-alt-refs" in svc options
Change-Id: Idf27d1fd2fb5f3ffd9e86d2119235e3dad36c178
diff --git a/vpx/vpx_encoder.h b/vpx/vpx_encoder.h
index 571ad3f..7e7b774 100644
--- a/vpx/vpx_encoder.h
+++ b/vpx/vpx_encoder.h
@@ -156,6 +156,9 @@
VPX_CODEC_CX_FRAME_PKT, /**< Compressed video frame */
VPX_CODEC_STATS_PKT, /**< Two-pass statistics for this frame */
VPX_CODEC_PSNR_PKT, /**< PSNR statistics for this frame */
+#ifdef CONFIG_SPATIAL_SVC
+ VPX_CODEC_SPATIAL_SVC_LAYER_SIZES, /**< Sizes for each layer in this frame*/
+#endif
VPX_CODEC_CUSTOM_PKT = 256 /**< Algorithm extensions */
};
@@ -191,6 +194,9 @@
double psnr[4]; /**< PSNR, total/y/u/v */
} psnr; /**< data for PSNR packet */
struct vpx_fixed_buf raw; /**< data for arbitrary packets */
+#ifdef CONFIG_SPATIAL_SVC
+ size_t layer_sizes[VPX_SS_MAX_LAYERS];
+#endif
/* This packet size is fixed to allow codecs to extend this
* interface without having to manage storage for raw packets,
@@ -623,6 +629,15 @@
*/
unsigned int ss_number_layers;
+#ifdef CONFIG_SPATIAL_SVC
+ /*!\brief Enable auto alt reference flags for each spatial layer.
+ *
+ * These values specify if auto alt reference frame is enabled for each
+ * spatial layer.
+ */
+ int ss_enable_auto_alt_ref[VPX_SS_MAX_LAYERS];
+#endif
+
/*!\brief Target bitrate for each spatial layer.
*
* These values specify the target coding bitrate to be used for each