The Samsung Galaxy S4 can share content with a Samsung Smart TV connected to the same Wi-Fi network, using the DLNA technology. Using this method, no complex configuration is required, you just have to connect both devices to the same Wi-Fi network.
In the absence of a Wi-Fi router, you can use Wi-Fi Direct, which allows to connect two wireless devices directly without the need of an access point. This means that you don't need to connect to a Wi-Fi network to share content between your Samsung Galaxy S4 and Samsung Smart TV.
Press the MENU button on the remote control.
Go to Network.
Activate Wi-Fi Direct.
Your TV will search for nearby Wi-Fi devices.
Go to Settings> Wi-Fi> Wi-Fi Direct.
Your phone will search for nearby Wi-Fi devices.
Select your Samsung Smart TV in the list of available devices.
A notification appears on the TV screen. Accept the connection.