Well keep in mind that a .flv is an already edited and compressed video. So any further editing and messing with, will only degrade the quality, it will not improve it.
How to "optimize for quality" starts with how the video is shot, then how it is edited, and then how it is rendered, which would include the bitrate and codec used. Now it's done... perhaps turned into a .flv or a DVD.
So not much you do after that which will improve the quality.
So work backworks to as close to the original video, directly from the camera, as you can and then work from there.
So for example, if you are using videos from YouTube, skip that and work with the file that was uploaded to YouTube, not the recompressed version you see on YouTube.