message: codecs/gif: Add speed parameter to GifEncoder
  This is straight up forwarded to the underlying gif library, and allows
  setting the encoding quality to be able to get faster encodes.
diff: @@ -293,6 +293,7 @@ impl<'a, R: Read + 'a> AnimationDecoder<'a> for GifDecoder<R> {
  pub struct GifEncoder<W: Write> {
  w: Option<W>,
  gif_encoder: Option<gif::Encoder<W>>,
  + speed: i32,
  }
  /// GIF encoder
  @@ -309,9 +310,18 @@ pub type Encoder<W> = GifEncoder<W>;
  impl<W: Write> GifEncoder<W> {
  /// Creates a new GIF encoder.
  pub fn new(w: W) -> GifEncoder<W> {
  + Self::new_with_speed(w, 1)
  + }
  +
  + /// Create a new GIF encoder, and has the speed parameter `speed`. See
  + /// [`Frame::from_rgba_speed`](/gif/struct.Frame.html#method.from_rgb_speed)
  + /// for more information.
  + pub fn new_with_speed(w: W, speed: i32) -> GifEncoder<W> {
  + assert!(speed >= 1 && speed <= 30, "speed needs to be in the range [1, 30]");
  GifEncoder {
  w: Some(w),
  gif_encoder: None,
  + speed,
  }
  }
  @@ -379,7 +389,7 @@ impl<W: Write> GifEncoder<W> {
  rbga_frame.height())?;
  // Create the gif::Frame from the animation::Frame
  - let mut frame = Frame::from_rgba(width, height, &mut *rbga_frame);
  + let mut frame = Frame::from_rgba_speed(width, height, &mut *rbga_frame, self.speed);
  // Saturate the conversion to u16::MAX instead of returning an error as that
  // would require a new special cased variant in ParameterErrorKind which most
  // likely couldn't be reused for other cases. This isn't a bad trade-off given
  