Touchwiz and Samsung Cameras and photo quality
I believe modern Samsung Phones use a proprietary camera app called Samsung Camera which requires TouchWiz API extensions. You can see those extensions documented on Samsung's site,


  Camera SDK provides enhanced features and APIs available to users for developing enriched camera-based applications. This SDK offers additional functionalities and capabilities on top of existing Android Camera API2 capabilities. The Camera application interface utilizes the Android Camera APIs. Camera SDK also provides easy-to-use, fast performing APIs for new image processing and computational photography needs.


While it utilizes the default interface, there are SDK-specific capabilities, without which you'll be losing functionality in AOSP roms. I believe the API uses TouchWiz blobs internally.

I can not find those API extensions (proprietary and missing from AOSP)  documented anywhere, but they're explained by a commenter here.

(feel free to answer here with more information and I'll delete this answer).