Inital layout
Initial import as per submitted JCTVC-A124

 - trailing white space has been removed
 - line endings have been converted
   git will convert them back to CRLF if required (eg win32)
   svn will convert them back to native (CRLF on win32)
 - converted EUC-KR comments to UTF-8
 - removed visual studio files that shouldn't be version controlled:
     *.{opt,clw,ncb,aps,mak,dep,plg,suo}

Samsung contact: Woo-Jin Han <wjhan.han@samsung.com>
BBC contact: David Flynn <davidf@rd.bbc.co.uk>

From: Samsung/BBC <>
strip non-TMuC tools from JCT-A124

1. Removed tools
  1.1 MVAC (motion vector accuracy control)
      - Enables to limit the motion accuracy up to 1/2 accuracy in
        B-slices for complexity reductio
      - Not used in CfP submission
      - Command line option in A124: MVA
  1.2 SHV (simultaneous H & V motion partition)
      - Enables to use motion partition composed of quarter and
        remaining regions
      - Not used in CfP submission
      - Command line option in A124: SHV
  1.3 RNG (random noise generation)
      - Insert Gaussian noise into the reconstruction file to improve
        perceived quality in flat areas
      - Not used in CfP submission
      - Command line option in A124: RNG
  1.4 LOT (logical transform)
      - Perform 5-3 wavelet + DCT if physical transform size is smaller
        than requested transform size
      - Used in CfP submission only for 128x128 block
      - Command line option in A124: LOT
  1.5 CADR (contents-adaptive dynamic range)
      - Performance source scaling within bit-depth limit
      - Used in CfP submission
      - Command line option in A124: CAD
  1.6 LCT (low-complexity transform)
      - Low-complexity version of large integer transform
      - Not used in CfP submission
      - Command line option in A124: LCT
  1.7 EXC (extreme correction) & BDC (band correction)
      - In-loop post filters based on pixel statistics
      - Used in CfP submission
      - Command line option in A124: EXC
  1.8 PTM (pattern matching intra)
      - Pixel-based pattern matching technique for intra prediction
      - Used in CfP submission
      - Command line option in A124: TMI
  1.9 MPI (multi-parametric intra)
      - Multi-parametric post-processing of intra prediction
      - Used in CfP submission
      - Command line option in A124: MPI
  1.A CCCP (color correlation based chroma prediction)
      - Chroma intra prediction based on luma reconstruction
      - Used in CfP submission
      - Command line option in A124: CCP
  1.B ACS (adaptive coefficient scanning)
      - 3 scanning patterns are used selectively (zigzag, horiz, vert)
      - Used in CfP submission
      - Command line option in A124: ACS
  1.C HAM (high accuracy motion)
      - 1/12th accuracy motion vector for luma and chroma
      - Used in CfP submission for both luma and chroma
      - Command line option in A124: HME, HAP, HAB
  1.D HME: high accuracy motion estimation
      - HAP: HAM in P-slice
      - HAB: HAM in B-slice

2. Modified tools
  2.1 DIF (DCT-based interpolation filter)
      - A124 uses 6-tap DIF for chroma
      - Replaced with AVC bi-linear (1/8th) since it uses HAM filters
        (1/12th), which are not included in TMuC.
  2.2 GRF (generated reference frame)
      - Weighted, weight + offset, offset, affine, isotropic and
        perspective are supported
      - Not used in CfP submission
      - Command line option in A124: -v <character>
      - w: weighted, o: offset, r: refinement, a: affine, i: isotropic,
        p: perspective
      - Affine, isotropic and perspective are removed but weighted
        prediction is remained due to simulate AVC WP
      - To activate: "-v w" in command line (scale+offset) or "-v o"
        for offset-only
  2.3 AMVP (advanced motion prediction)
      - A124 software supports three AMVP modes
      - AM_NONE: use first candidate only (similar to AVC), no signaling
      - AM_EXPL: use explicit signaling (used in CfP submission)
      - AM_IMPL: use implicit signaling based on template matching
      - TMuC only has both explicit signaling mode and non-AMVP method
      - AM_IMPL is removed since it is not included in TMuC
      - AM_NONE is maintained since it can be a place-holder for
        non-AMVP method
  2.4 CIP (combined intra prediction)
      - CIPflag is now coded only for intra blocks (bug-fix)
      - A124 codes CIPflag even in inter blocks

3. Option changes
  3.1 JMQ (JM QP)
      - JMQ = 1: use JM QP assignments, JMQ = 0: use JSVM QP assignments
      - Option is removed and JMQ is always on
      - Option fix: JML (JM Lambda)
  3.2 JML = 1: use JM lambda strategy, JML = 0: use JSVM lambda strategy
      - Option is removed and JML is always on
  3.3 Option fix: ADI
      - Option is removed and ADI is always turned on
  3.4 Option fix: AMV (AMVP)
      - Option is removed and AMVP is always turned on
  3.5 Option fix: DIF
      - Option is removed and DIF is always turned on
  3.6 Option fix: AMP
      - Option is removed and AMP is always turned on
  3.7 Option fix: CIP
      - Option is removed and CIP is always turned on
  3.8 Option fix: ROT
      - Option is removed and ROT is always turned on
      - Note: set ROT_DICT = 1 to disable ROT
  3.9 Option fix: ACC
      - Try coefficient clearing in inter modes
      - Option is removed and ACC is always turned on
  3.A Profile option (-p)
      - It was used to separate A124 and A125 coding tools
      - Removed, now

4. Misc. changes
  4.1 MAX value of IBDI is fixed (IBDI_NOCLIP_RANGE MACRO)
      - Only allows possible values of bit-depth increased signal, not
        all possible values of inherent high bit-depth case
  4.2 Encoder output is fixed
      - Slice size bit (32) is now added to the encoder print-out
  4.3 Source code improvements
      - Unused functions are removed
      - Variable & function namings are changed to clarify its purpose

5. Known problems
  5.1 POC coding
      - It's not implemented well. Currently, fixed 10-bit is used for
        POC coding.
  5.2 ROT (rotational transform)
      - Inverse ROT code is not the best one on the aspects of the
        dynamic range although we already have better one.
      - It'll be replaced later with much simpler implementation.

VCS import by davidf:
  - trailing white space has been removed
  - line endings have been converted
    git will convert them back to CRLF if required (eg win32)
    svn will convert them back to native (CRLF on win32)
  - removed visual studio files that shouldn't be version controlled:
     *.{opt,clw,ncb,aps,mak,dep,plg,suo}

From: Woo-Jin Han <wjhan.han@samsung.com>
doc: Add documentation and TMuC-tools-only results

doc/README_data-structure.ppt:
  describes various data structures used

doc/README_results-a124-TMuC-tools-only.xls:
  illustrates performance after stripping non-TMuC tools from A124
  against JM and original A124.

From: Woo-Jin Han <wjhan.han@samsung.com>
build: fix UNIX builds

 - fix missing system includes
 - fix incorrectly named headers (case sensitive)

From: David Flynn <davidf@rd.bbc.co.uk>
common: fix builds on "unknown" OS

Add a fallback #define when the OS/Compiler are unknown, rather than
fail to compile.

From: David Flynn <davidf@rd.bbc.co.uk>
build: fix erroneous inclusion of malloc.h

From: David Flynn <davidf@rd.bbc.co.uk>
import Samsung release 0.1

* Modified tools
  - ADI (arbitrary directiona intra)
      - Code clean-up (lossless)
  - ROT (rotational transform)
      - Code clean-up
      - Reduce ROT matrix dynamic range to 8-bit

* Fast encoder feature
  - FEN (fast encoder) option is added (approx. 3 times speed-up to A124-stripped, now x2.7 to JM17)
      - '-1 FEN' to enable this feature
      - Following things are applied
        - Early skip decision (not very aggressive)
        - Asymmetric motion partition is tried only if horizontal or veritical split is the best
        - Large block SAD is derived by partial results
        - ASR (adaptive search range) is turned on automatically - reduces ME range in high-depth
          temporal layers
  - New configuration directory is added (approx. 5 times speed-up to A124-stripped, now x1.6 to JM17)
      - cfg/cfp_fast directory
      - No change in configuration files, only batch files is modified as
        - Class D uses up to 32x32 instead of 64x64 block size
        - Class A, B and use up to 64x64 instead of 128x128 block size
        - '-1 FEN -sr 64' is added: fast encoder option + ME range is reduced from 128 to 64

* New additions
  - Symbol mode 0 (VLC) is now working
      - '-sym 0' to use VLC instead of SBAC
      - Most parts use simple flag coding except:
      - TENTM coefficient coding is implemented (4x4, 8x8) and extended to larger size transform blocks
        (by simple interleaving)

* Known problems
  - VLC + RDOQ
      - Not supported yet (when -sym 0 is used, RDOQ is turned off automatically)

From: Woo-Jin Han <wjhan.han@samsung.com>
doc: update results data based on 0.1 release (r8)

doc/README_results-a124-TMuC-tools-only.xls:
  updated to reflect all tests

doc/README_results-a124-TMuC-tools-only-enctime.xls:
  illustrates performance with various fast encode configurations

From: Woo-Jin Han <wjhan.han@samsung.com>
HHI modifications
decoder: fix double free of TAppDecCfg::m_apcOpt

Fix (#3) double free when decoder is executed with no arguments.

With thanks to Joshua Bowman.

From: David Flynn <davidf@rd.bbc.co.uk>
encoder: fix null ptr dereference at startup with HHI_RQT

fix (#4).  TEncSearch::init() may not have been called before the
destructor.

From: David Flynn <davidf@rd.bbc.co.uk>
Fix line endings in r11

Allows setting property svn:eol-style native, for automatic line-ending
conversion on unix/windows.

This is a whitespace only change.

From: David Flynn <davidf@rd.bbc.co.uk>
set property svn:eol-style native (missed in r11)
v2v: RIM integration of user-adjustable (n CPU) loadbalancing

Adds new encoder option: "BalancedCPUs", The number of CPUs for load
balancing.  Default = 8.  value of 0 or 1 disables feature.

(includes an update to the v2v trees)

import:
 - fix whitespace conflicts
 - fix typemissmatch of

From: Gaëlle Martin-Cocher <gmartincocher@rim.com>
v2v: Store previously global stats state in a subclass of TEncBinCABAC

Also removes excessive re-computation of bestTreeThis in
TEncV2V::groupStates()

import:
 - whitespace cleanup
 - reduce over exposure of TEncBinCABAC internals

From: Gaëlle Martin-Cocher <gmartincocher@rim.com>
Initial integration of TEN TMuC features

This integration includes the following:
 - Deblocking filter
 - Angular intra prediction
 - Planar intra coding
 - Directional interpolation filter

import:
 - whitespace cleanup
 - revert removal of loopfilter offset config propagation

From: Arild Fuldseth <arild.fuldseth@tandberg.com>
fix encoder memory leak in TEncGOP::compressGOP()
revert change in trunk, should have been checked into bugfix tree
merge 0.3-qualcomm and 0.3-bugfix into trunk