frameencoder: fix --no-wpp, broken since 854f5e3072a0
replace TComPic with Frame class in common/frame.h

The new class name clashes with old variables like pic or m_pic, but I would
like to pull in TComPicYuv in the future as a Picture class, and TComYUV as
Yuv class.
api: comment nits
make cu level stats logging run time configurable

two-pass encodes will need these statistics, so they need to always be compiled
into libx265.
frameencoder: remove unread bitsOriginallyInSubstreams
frameencoder: rename m_pic to m_frame
frameencoder: simplify setup for encodeSlice()
frameencoder: use m_param->bEnableWavefront directly
frameencoder: move trace code for clarity, remove dead bWaveFrontsynchro
frameencoder: nits
frameencoder: simplify logic slightly, numSubstreams can be > 1 only with WPP
frameencoder: remove redundant widthInCU variable
frameencoder: further simplify the logic which sync's CABAC with upper-right LCU
frameencoder: simplify loop bounds
frameencoder: simplify SAO coding logic
frameencoder: further simplify SAO coding
frameencoder: simplify SAO reset when not enabled on slice
frameencoder: simplify cabac context save
frameencoder: remove more redundant checks

slice->getSaoEnabledFlag() is the same as saoParam->bSaoFlag[0]
slice->getSaoEnabledFlagChroma() is the same as saoParam->bSaoFlag[1]
TEncEntropy: nit