Index: wp-includes/shortcodes.php
===================================================================
--- wp-includes/shortcodes.php	(revision 15853)
+++ wp-includes/shortcodes.php	(working copy)
@@ -259,9 +259,14 @@
  *
  * @param array $pairs Entire list of supported attributes and their defaults.
  * @param array $atts User defined attributes in shortcode tag.
+ * @param string $shortcode Optional. The name of the shortcode, provided for context to enable filtering
  * @return array Combined and filtered attribute list.
  */
-function shortcode_atts($pairs, $atts) {
+function shortcode_atts($pairs, $atts, $shortcode = '') {
+	// Shortcode handlers should provide the name of the shortcode.
+	if ( empty( $shortcode ) )
+		_deprecated_argument( __FUNCTION__, '3.1', __( 'The "$shortcode" argument should be supplied.' ) );
+
 	$atts = (array)$atts;
 	$out = array();
 	foreach($pairs as $name => $default) {
@@ -270,6 +275,12 @@
 		else
 			$out[$name] = $default;
 	}
+
+	if ( ! empty( $shortcode ) ) {
+		$out = apply_filters( 'shortcode_atts-' . $shortcode, $out, $pairs, $atts );
+		$out = apply_filters( 'shortcode_atts', $out, $pairs, $atts, $shortcode );
+	}
+
 	return $out;
 }
 
Index: wp-includes/media.php
===================================================================
--- wp-includes/media.php	(revision 15853)
+++ wp-includes/media.php	(working copy)
@@ -729,7 +729,7 @@
 		'align'	=> 'alignnone',
 		'width'	=> '',
 		'caption' => ''
-	), $attr));
+	), $attr, 'caption'));
 
 	if ( 1 > (int) $width || empty($caption) )
 		return $content;
@@ -782,7 +782,7 @@
 		'size'       => 'thumbnail',
 		'include'    => '',
 		'exclude'    => ''
-	), $attr));
+	), $attr, 'gallery'));
 
 	$id = intval($id);
 	if ( 'RAND' == $order )
