After going back and forth, I settled with Macpro7,1 smbios. For RX 580, nothing else is needed (device properties, agpm etc.) other than WEG. imac19,1 encoding speed is slightly faster with igpu but at the cost of higher cpu freq and temp. After disabling igpu, the system is quieter compared to igpu on.
Everything works except sidecar - DRM, Appletv, hardware acceleration, safari prime etc.
Playing 4k UHD discs also uses less cpu. Another reason for moving to macpro is HDR. Though I see hdr settings in imac19,1, apple says it is not capable of handling hdr videos.
Support for high dynamic range (HDR) video, such as HDR movies and TV shows from Apple or other providers, requires the latest version of macOS, a compatible Mac model, and an HDR10-compatible display, TV, or projector.
support.apple.com
Windows automatically switches from sdr to hdr mode when hdr signal is detected but in Mac it has to be done manually.