+static spu_area_t spu_area_create( int x, int y, int w, int h, spu_scale_t );
+static spu_area_t spu_area_scaled( spu_area_t );
+static spu_area_t spu_area_unscaled( spu_area_t, spu_scale_t );
+static bool spu_area_overlap( spu_area_t, spu_area_t );
+
+
+/* Subpicture rendered flag
+ * FIXME ? it could be moved to private ? */
+#define SUBPICTURE_RENDERED (0x1000)
+#if SUBPICTURE_RENDERED < SUBPICTURE_ALIGN_MASK
+# error SUBPICTURE_RENDERED too low
+#endif
+
+#define SCALE_UNIT (1000)
+
+static void SubpictureUpdate( subpicture_t *,
+ const video_format_t *p_fmt_src,
+ const video_format_t *p_fmt_dst,
+ mtime_t i_ts );
+static void SubpictureChain( subpicture_t **pp_head, subpicture_t *p_subpic );
+static int SubpictureCmp( const void *s0, const void *s1 );
+
+static void SpuRenderRegion( spu_t *,
+ picture_t *p_pic_dst, spu_area_t *,
+ subpicture_t *, subpicture_region_t *,
+ const spu_scale_t scale_size,
+ const video_format_t *p_fmt,
+ const spu_area_t *p_subtitle_area, int i_subtitle_area,
+ mtime_t render_date );
+
+static void UpdateSPU ( spu_t *, vlc_object_t * );
+static int CropCallback( vlc_object_t *, char const *,
+ vlc_value_t, vlc_value_t, void * );
+static int MarginCallback( vlc_object_t *, char const *,
+ vlc_value_t, vlc_value_t, void * );
+
+/* Buffer allocation for SPU filter (blend, scale, ...) */
+static subpicture_t *spu_new_buffer( filter_t * );
+static void spu_del_buffer( filter_t *, subpicture_t * );
+static picture_t *spu_new_video_buffer( filter_t * );
+static void spu_del_video_buffer( filter_t *, picture_t * );
+
+/* Buffer aloccation fir SUB filter */
+static int SubFilterAllocationInit( filter_t *, void * );
+static void SubFilterAllocationClean( filter_t * );