bitcost: fix bitcost() function, broken 13 months ago by 07015bbe306b

when bitcost() was first introduced, we had two competing table formats for the
s_bitsizes[] array. Eventually the x264 style array won out, but this function
was not updated.

This bug was almost harmless, bitcost() could still evaluate differences in bit
costs correctly, but the upshift caused read bound exceptions when the motion
vectors became close to the HEVC max of 4k.

--HG--
branch : stable
extra : amend_source : 7b4c7a3f24d90a60081ad18319ba0725c1f71d0c
bitcost: increase size of cost arrays, for pessimal situations

MVD is MV minus MVP. MV could be BC_MAX_MV and MVP could be -BC_MAX_MV

--HG--
branch : stable
extra : rebase_source : 64e4bb5f652018675e8ccea30b491e9843437222
Merge with stable
rest: better document that -I N -i N does not disable scenecut detection
bitcost: nits
rc: instrument all error conditions in initPass2()

it's not helpful to abort the encode with no hint as to why
rc: nits

--HG--
extra : amend_source : 87c917a50712ed3b66e2905ad5187f610f40d0ef
param: log multi-pass state
refine partition size related

- reorder LumaPartitions to simplify partitionFromLog2Size()
- remove unused
qtLayer in reverse order
cli: nit
cli: call x265_param_apply_profile() after applying file-reader params

the Y4M headers could change param->internalCsp, so applying the profile before
the reader makes changes allows bugs. The CLI was allowing an encode of:

x265 foo_422.y4m o.bin --profile main

Even though --profile main was trying to enforce 4:2:0; the color space change
happened afterward the profile was enforced and thus invalidated the specified
profile. After this fix the encode properly fails with:

x265 [error]: Unsupported color space (2) on input
aborted at input frame 1, output frame 0

--HG--
extra : amend_source : ca79e395b27a8dc3163c328e0e48ddb5a884f89f
level: move all profile set/determine logic into one file, fixes for MSP
nits
encoder: fix uninitialized variable use reported by valgrind

m_conformanceWindow was not initialized at all; and this
was causing uninitialized values to be written to the SPS if padding was
necessary.

Remove unnecessary m_defaultDisplayWindow in the process
encoder: remove redundant m_pad array