If you have flashed a custom firmware and would like to return to stock for warranty purposes, you will have to flash the official stock firmware. Flashing it is easy. First, download it from the link given at the bottom of this post.
* Extract the firmware
* Open the included Odin
* Turn off your device
* Put your device into Download MODE (Home + Volume Down + Power)
* Click PDA and select *.tar.md5
* Then finally click start
Download the firmware from here – credit goes to Sammobile.