analysis save/load: refactor full implementation

1. Move analysis inter/intra data into encoder
2. Encoder allocates and frees memory for x265 analysis, remove api calls
3. Inter and intra data allocated based on sliceType only
4. frame record size is now variable
analysis: encodeResidue() directly write to reconPic
common: move analysis reuse structs to common.h

files in common/ shouldn't include encoder.h
encoder: add prefix to FREAD and FWRITE macros to avoid MacOSX macro conflict

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/sys/fcntl.h:111:9: note:
      previous definition is here
#define FWRITE          0x0002