Add support for up to 139264 slices per picture.
Decoder allocates large chunks of memory for each slice and frees them only when entire picture is decoded.
It results in huge memory footprint when number of slices is 100000+.
So, it is not enough to simply increase MAX_NUM_SLICES
.
To decode pictures with 100000+ slices on typical system, memory allocation patterns need to be optimized. Such optimizations are main part of this MR.