I felt curious time ago but until now never reverse engineered the tone curve applied by the camera to build the JPEG. The camera was a 350D and quite neutral parameters. This is how the RAW file and its histogram evolves at the different stages:
1. Pure RAW data
2. Linear neutral RAW development (camera WB, sRGB)
3. Same as 2 plus sRGB specific ~2.2 gamma curve (image appearance remains unaltered, histogram expands)
4. Camera JPEG (image bright and contrast are incrased)
The translation from 3 to 4 corresponds to the following tone contrast curve:
Hope you find it interesting.
Regards