def retime_by_double_reference(have, want, reference_a, reference_b)
      origins = [
        have.references[reference_a][:timecode],
        have.references[reference_b][:timecode]
      ]

      targets = [
        want.references[reference_a][:timecode],
        want.references[reference_b][:timecode]
      ]

      rescale_factor = (targets[1] - targets[0]) / (origins[1] - origins[0])
      rebase_shift = targets[0] - origins[0] * rescale_factor

      have.subtitles.each do |subtitle|
        subtitle[:start] = subtitle[:start] * rescale_factor + rebase_shift
        subtitle[:end] = subtitle[:end] * rescale_factor + rebase_shift
      end
    end
def retime_by_double_reference(have, want, reference_a, reference_b)
      origins = [
        have.references[reference_a][:timecode],
        have.references[reference_b][:timecode]
      ]

      targets = [
        want.references[reference_a][:timecode],
        want.references[reference_b][:timecode]
      ]

      rescale_factor = (targets[1] - targets[0]) / (origins[1] - origins[0])
      rebase_shift = targets[0] - origins[0] * rescale_factor

      have.subtitles.each do |subtitle|
        subtitle[:start] = subtitle[:start] * rescale_factor + rebase_shift
        subtitle[:end] = subtitle[:end] * rescale_factor + rebase_shift
      end
    end
Applies a progressive timeshift on the subtitles we {Have}
 Two points in time are known for both of which a different shift in time
 should be applied. Thus a steadily increasing or decreasing forwards or
 backwards shift will be applied to each subtitle, depending on its
 place in the time continuum

 @param have [Have] the subtitles we {Have}
 @param [Array<Float>] origins the two points in time (given in seconds)
   which shall be shifted differently
 @param [Array<Float>] targets the two amounts of time by which to shift
   either of the two points that shall be shifted