Efficient sum-frequency generation with quasi-intracavity configuration