Unfortunately, I doubt the video can be fixed
It looks like video compression has been turned way up, nothing is going to get back data that has been compressed away.
To avoid this in the future, check the "Video Parameters" section of the CHDK menu. What appears here depends slightly a bit on the camera. I think yours will have mode options of bitrate and quality. If you set mode to bitrate and bitrate to 1x, that should use the camera default. If mode has "default" and "quality" setting it to default should use the camera defaults.
You probably want to make sure "video quality control" is unchecked too, so you don't accidentally adjust it on the fly.