hevc: reorder loops

iterate over memory in a more continuous order

Signed-off-by: Anton Khirnov <anton@khirnov.net>
hevc: simplify rounding

Signed-off-by: Anton Khirnov <anton@khirnov.net>
hevc: derive partially amvp list

When the candidate has been found, no need to derive others.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
hevc: derive partial merge list

The merge list only needs to be derived up to the merge index.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
hevc: use intreadwrite

When dealing with MVs, both components may be processed at a time.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
hevc: wait proper position for tmvp

The position is either rounded or not checked, so delay the wait to
check the proper value.

Reviewed-by: Mickaël Raulet <mraulet@insa-rennes.fr>

Signed-off-by: Anton Khirnov <anton@khirnov.net>
hevc_mvs: avoid deriving tmvp in amvp

Reduces the number of calls to tmvp derivation from 933685 to 586271 on
a sequence.

Reviewed-by: Mickaël Raulet <mraulet@insa-rennes.fr>
Signed-off-by: Anton Khirnov <anton@khirnov.net>