Reference-Based Image and Video Super-Resolution via C2-Matching